What, fundamentally, am I misunderstanding about how to use 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.
GlassFish Server Open Source Edition
Application Development Guide
Release 4.0
Developing Java Clients 10-16
But there’s a gap in explaining how to do that from a host versus from directly on the ORB. Or is that not even the correct terminology? In this case there are two ORB’s? ORB to ORB over IIOP?
I’m trying to understand how to run a client hello world program with appclient, and the terminology and concepts involved. I must have a fundamental misunderstanding of the technologies, or am reading the manuals incorrectly.
The ORB, broker is on doge
@192.168.1.2, and running the JAR directly on the same machine as the ORB works fine:
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:~$
The “host” is the remote machine? The remote machine is tleilax
@192.168.1.3 and should connect to the ORB, doge
.
The fine manual:
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.
GlassFish Server Open Source Edition
Reference Manual
Release 4.0
p. 704
appclient -help says:
-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.
I don’t understand the terminology involved, apparently.
What parameters do I pass appclient, and how do I pass those parameters, for a remote application?
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}
The host, tleilax
@192.168.1.3, connects to doge
@192.168.1.2 fine:
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:~$
If I include the host when running the app from the host I get the promising output:
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
but then it hangs.
What is happening? I’m at a loss. The glassfish log shows:
[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]]
which sounds good, a ping.
How do I troubleshoot this? I could read CORBA manuals till the end of time, or every page of every Glassfish manual, but I don’t know that this would help much.
2