users@glassfish.java.net

Re: Accessing a JMS Resource on a Remote Server

From: rdblaha1 <rd_blaha_at_hotmail.com>
Date: Mon, 14 Jan 2008 12:54:46 -0800 (PST)

Tim,

I completely messed up that previous run/stacktrace. I had GlassFish
running on my PC (which I shouldn't have for this test). I followed the
Java EE 5 Tutorial Chap 31 producer.java and synchconsumer.java which I have
working on the running on Multiple System section as required by The
Application Server Development Guide (819-3672) Chap 11 p 215 To Access a
JMS Resource From an Application Client >> 1. Create a JMS Client.
For 2. Next, configure a JMS resource on the Application Server: I
previously configured this on our network server for the Java EE 5
Tutorial to work (this was where I ran the SimpleProducer.java via GlassFish
on my PC to send messages to the queue and my SimpleSynchConsumer.java on
the network server to consume the messages there, which I did successfully).
On 3 Define the @Resource..., this I did to the best of my knowledge copying
and modifying the application-client.xml and sun-application-client.xml
files from the producer.java I had (SimpleProducer.java) to this project
(ProducerAppClient.java).
For 4. Ensure that the client JAR file includes the following files, I ran
the ant script I have been using (also copied from the SimpleProducer.java
project and modified). After running the ant script I verified the files in
the jar file to be as required in the text.
For 5. Prepare the client machine... I ran the package-appclient script and
unjarred the results in a directory on my PC C:\AppTest\appclient.
Finally on 6. Run the application client... I got this stacktrace (what I
should have given you in the first place):

C:\AppTest\appclient\bin>C:\AppTest\appclient\bin\appclient -client
C:\source\projects\JMS\ProducerApPClient\dist\ProducerAppClient.jar queue 9
Jan 14, 2008 3:15:43 PM
com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl <init>
WARNING: "IOP00410201: (COMM_FAILURE) Connection failure: socketType:
IIOP_CLEAR_TEXT; hostname: programmer1; port: 3700"
org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 201 completed: No
        at
com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2690)
        at
com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2711)
        at
com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:261)
        at
com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:274)
        at
com.sun.corba.ee.impl.transport.SocketOrChannelContactInfoImpl.createConnection(SocketOrChannelContactInfoImpl.java:130)
        at
com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.beginRequest(CorbaClientRequestDispatcherImpl.java:192)
        at
com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.request(CorbaClientDelegateImpl.java:181)
        at
com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.is_a(CorbaClientDelegateImpl.java:325)
        at org.omg.CORBA.portable.ObjectImpl._is_a(ObjectImpl.java:112)
        at
org.omg.CosNaming.NamingContextHelper.narrow(NamingContextHelper.java:69)
        at
com.sun.enterprise.naming.SerialContext.narrowProvider(SerialContext.java:127)
        at
com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.java:182)
        at
com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:339)
        at javax.naming.InitialContext.lookup(InitialContext.java:392)
        at com.sun.enterprise.util.Utility.lookupObject(Utility.java:145)
        at
com.sun.enterprise.ServerConfiguration.<init>(ServerConfiguration.java:96)
        at
com.sun.enterprise.ServerConfiguration.getConfiguration(ServerConfiguration.java:80)
        at
com.sun.enterprise.distributedtx.J2EETransactionManagerImpl.createTransactionManager(J2EETransactionManagerImpl.java:294)
        at
com.sun.enterprise.appclient.AppContainer.initializeNaming(AppContainer.java:204)
        at
com.sun.enterprise.appclient.MainWithModuleSupport.<init>(MainWithModuleSupport.java:364)
        at
com.sun.enterprise.appclient.MainWithModuleSupport.<init>(MainWithModuleSupport.java:259)
        at com.sun.enterprise.appclient.Main.main(Main.java:200)
Caused by: java.lang.RuntimeException: java.net.ConnectException: Connection
refused: connect
        at
com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:347)
        at
com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:244)
        ... 19 more
Caused by: java.net.ConnectException: Connection refused: connect
        at sun.nio.ch.Net.connect(Native Method)
        at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:507)
        at
com.sun.corba.ee.impl.orbutil.ORBUtility.openSocketChannel(ORBUtility.java:105)
        at
com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:332)
        ... 20 more
Terminate batch job (Y/N)? y

The only difference between the SimpleProducer.java file that works with the
GlassFish App Server and this file are the following:
1. Beside changing the name and project for Netbeans I added the lines:
                System.setProperty( "org.omg.CORBA.ORBInitialHost", "localhost" );
//default is localhost
                System.setProperty( "org.omg.CORBA.ORBInitialPort", "3700" ); //default
2. I ran the ant script the same as for the SimpleProducer.java.
3. I followed the Chap 11 procedures as I stated above that you said I
should follow.

The output in the stacktrace is similar to what I get with the Java EE 5
Tutorial Chap 31 when I run my SimpleProducer.java with GlassFish off.
Apparently the application-client.xml, sun-application-client.xml, and the
jar files collected using the package-appclient script was not setup
correctly or did not respond correctly to provide the pseudo-appserver (or
srtipped down appserver) as anticipated. If I better understood the
mechanics of how these files (the Application Client Container) are suppose
to be interacting to create the pseudo-appserver I may better see my setup
problem and correct it. If you can give me any insight attacking my
problem from this angle I may be better able to work with it and correct it.

Thanks. As you may have noticed I am also pursuing z's stand-alone
solution also. I am doing my best to keep the two concepts and solutions
separate.

Thank you again for your time when you can answer.

rdb

-- 
View this message in context: http://www.nabble.com/Accessing-a-JMS-Resource-on-a-Remote-Server-tp14580977p14814190.html
Sent from the java.net - glassfish users mailing list archive at Nabble.com.