In che modo ORB è distinto da un endpoint?

1

Che cosa, in fondo, sto fraintendendo su come usare appclient ?

The Application Client Container (ACC) includes a set of Java classes, libraries, and other files that are required for and distributed with Java client programs that execute in their own Java Virtual Machine (JVM). The ACC manages the execution of Java EE application client components (application clients), which are used to access a variety of Java EE services (such as JMS resources, EJB components, web services, security, and so on.) from a JVM outside the Oracle GlassFish Server. The ACC communicates with the GlassFish Server using RMI-IIOP protocol and manages the details of RMI-IIOP communication using the client ORB that is bundled with it. Compared to other Java EE containers, the ACC is lightweight.

Edizione Open Source Server GlassFish Guida allo sviluppo dell'applicazione Release 4.0 Sviluppo di client Java 10-16

Tuttavia, c'è una lacuna nello spiegare come farlo da un host rispetto direttamente da ORB . O non è nemmeno la terminologia corretta? In questo caso ci sono due ORB? ORB a ORB su IIOP?

Sto cercando di capire come eseguire un programma client hello world con appclient e la terminologia e i concetti coinvolti. Devo avere un fondamentale fraintendimento delle tecnologie, o sto leggendo i manuali in modo errato.

L'ORB, broker è su doge @192.168.1.2, ed esegue il JAR direttamente sulla stessa macchina di cui l'ORB funziona bene:

thufir@doge:~$ 
thufir@doge:~$ appclient -client  NetBeansProjects/corba/GreeterCorbaClient/dist/GreeterCorbaClient.jar 
{org.omg.CORBA.ORBInitialPort=3700, java.naming.factory.initial=com.sun.enterprise.naming.impl.SerialInitContextFactory, Context.SECURITY_CREDENTIALS=pass123, org.omg.CORBA.ORBInitialHost=192.168.1.2, java.naming.factory.url.pkgs=com.sun.enterprise.naming, java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl, Context.SECURITY_PRINCIPAL=user1}
[fred, flinstone, barney, rubble, wilma]
thufir@doge:~$ 

L'host è la macchina remota? La macchina remota è tleilax @192.168.1.3 e dovrebbe connettersi all'ORB, doge .

Il bel manuale:

Example 1 Using the appclient command

appclient -xml sun-acc.xml -jar myclientapp.jar scott sample

Where: sun-acc.xml is the name of the client configuration XML file, myclientapp.jar is the client application .jar file, and scott and sample are arguments to pass to the application. If sun-acc.xml and myclientapp.jar are not in the current directory, you must give the absolute path locations; otherwise the relative paths are used. The relative path is relative to the directory where the command is being executed.

Edizione Open Source Server GlassFish Manuale di riferimento Release 4.0 p. 704

appclient -help dice:

   -targetserver
       optional; a comma-separated list of one or more server
       specifications for ORB endpoints. Each server specification must
       include at least the host. Optionally, a server specification can
       include the port as well. If the port is omitted from a server
       specification, the default value, 3700, is used for that host.

Non capisco la terminologia in questione, a quanto pare.

Quali parametri faccio passare appclient e in che modo faccio passare quei parametri, per un'applicazione remota ?

thufir@tleilax:~$ 
thufir@tleilax:~$ appclient -targetserver 192.168.1.2:3700  -jar GreeterCorbaClient.jar 
{org.omg.CORBA.ORBInitialPort=3700, java.naming.factory.initial=com.sun.enterprise.naming.impl.SerialInitContextFactory, Context.SECURITY_CREDENTIALS=pass123, org.omg.CORBA.ORBInitialHost=192.168.1.2, java.naming.factory.url.pkgs=com.sun.enterprise.naming, java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl, Context.SECURITY_PRINCIPAL=user1}

L'host, tleilax @192.168.1.3, si connette a doge @192.168.1.2 bene:

thufir@tleilax:~$ 
thufir@tleilax:~$ telnet 192.168.1.2 3700
Trying 192.168.1.2...
Connected to 192.168.1.2.
Escape character is '^]'.
^]
^C
^CConnection closed by foreign host.
thufir@tleilax:~$ 

Se I includi l'host durante l'esecuzione dell'app dall'host ottengo l'output promettente:

thufir@tleilax:~$ 
thufir@tleilax:~$ appclient -targetserver 192.168.1.3,192.168.1.2:3700  -jar GreeterCorbaClient.jar 
Mar 13, 2015 5:50:33 AM org.glassfish.enterprise.iiop.impl.GlassFishORBManager getCorbalocURL
INFO: list[i] ==> 192.168.1.3:3700
Mar 13, 2015 5:50:33 AM org.glassfish.enterprise.iiop.impl.GlassFishORBManager getCorbalocURL
INFO: list[i] ==> 192.168.1.2:3700
Mar 13, 2015 5:50:33 AM org.glassfish.enterprise.iiop.impl.GlassFishORBManager getCorbalocURL
INFO: corbaloc url ==> iiop:[email protected]:3700,iiop:[email protected]:3700

ma poi si blocca.

Cosa sta succedendo? Sono in perdita. Il registro glassfish mostra:

[2015-03-13T04:30:00.695-0700] [glassfish 4.1] [INFO] [] [javax.enterprise.system.core] [tid: _ThreadID=42 _ThreadName=admin-listener(1)] [timeMillis: 1426246200695] [levelValue: 800] [[
  SimpleGreeterEAR was successfully deployed in 4,470 milliseconds.]]

[2015-03-13T04:31:38.082-0700] [glassfish 4.1] [INFO] [] [] [tid: _ThreadID=74 _ThreadName=PingService] [timeMillis: 1426246298082] [levelValue: 800] [[
  Domain Pinged: release.glassfish.org]]

che suona bene, un ping.

Come posso risolvere questo? Potrei leggere i manuali CORBA fino alla fine dei tempi, o ogni pagina di ogni manuale di Glassfish, ma non so che questo sarebbe di aiuto molto .

    
posta Thufir 13.03.2015 - 14:05
fonte

0 risposte