J2EE JMS problem

F

Farshad

I am trying to connect to a Sun App Server from the JMS client
application: SimpleProducer from chapter 33 of
http://java.sun.com/j2ee/1.4/docs/tutorial/doc/index.html

It works fine when run on the same machine where the server is running.
But when I try it from a remote machine, I get an infinite chain of
error messages beginning with:

---
Destination name is jms/Queue
May 15, 2003 6:42:02 PM com.sun.corba.ee.spi.logging.LogWrapperBase
doLog
INFO: "IOP00710299: (INTERNAL) Successfully created IIOP listener on
the specified host/port: all interfaces/34705"
May 15, 2003 6:42:03 PM
com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl <init>
WARNING: "IOP00410201: (COMM_FAILURE) Connection failure: socketType:
IIOP_CLEAR_TEXT; hostname: 127.0.0.1; 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:2257)
....
---

When the server is local I run this command from the simple/build
directory:
#java SimpleProducer jms/Queue
and it works successfully.
From a remote machine I run the below command from the simple/build
directory:
#java -Dorg.omg.CORBA.ORBInitialHost=myservername SimpleProducer
jms/Queue


Sounds that at some point the application is trying to connect to the
localhost. Specifying a properties file as below does not help either.

--- jndi.properties ---
java.naming.factory.initial=com.sun.enterprise.naming.SerialInitContextFactory
java.naming.provider.url=iiop://myservername:3700
java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl
---

Running those applications to access a local server works fine on both
machines. I want to have a client accessing the server remotely. Do I
need to edit/compile source code of those applications in some other
way? Isn't specifying a remote server from command line enough?
I have tried any suggestions found on the Internet or anything coming
to my mind but no success so far. I appreciate any clues.
thanks,
Farshad
 
F

Farshad

Apparently, the system tries to connect to the localhost at some point!
I changed the jndi.properties to:
---
java.naming.factory.initial=com.sun.enterprise.naming.SerialInitContextFactory
org.omg.CORBA.ORBInitialHost=myservername
org.omg.CORBA.ORBInitialPort=3700
java.naming.provider.url=iiop://myservername:3700
---
Now, executing
#java -Djms.properties=jndi.properties SimpleProducer jms/Queue
gives the below message while if I change "myservername" to "localhost"
and run an App Server locally it works quite fine. What am I missing?!
Isn't it enough to have a remote server name in that jndi.properties to
make the same application work with a remote server? I appreciate any
help.

- Farshad

ERROR MESSAGE:
---
Destination name is jms/Queue
May 15, 2003 7:56:10 PM
com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl <init>
WARNING: "IOP00410201: (COMM_FAILURE) Connection failure: socketType:
IIOP_CLEAR_TEXT; hostname: localhost; port: 3700"
org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 201 completed: No
at
com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSyst
emException.java:2257)
at
com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSyst
emException.java:2278)
at
com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(Sock
etOrChannelConnectionImpl.java:208)
at
com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(Sock
etOrChannelConnectionImpl.java:221)
at
com.sun.corba.ee.impl.transport.SocketOrChannelContactInfoImpl.createConnection
(SocketOrChannelContactInfoImpl.java:104)
at
com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.beginRequest(Co
rbaClientRequestDispatcherImpl.java:153)
at
com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.request(CorbaClientDeleg
ateImpl.java:127)
at
com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.is_a(CorbaClientDelegate
Impl.java:244)
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:89)
at
com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.java:128)
at
com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:290)
at javax.naming.InitialContext.lookup(InitialContext.java:347)
at SimpleProducer.main(Unknown Source)
Caused by: java.lang.RuntimeException: java.net.ConnectException:
Connection refused
at
com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.
java:336)
at
com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(Sock
etOrChannelConnectionImpl.java:191)
.... 12 more
Caused by: java.net.ConnectException: Connection refused
at sun.nio.ch.Net.connect(Native Method)
at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:460)
at java.nio.channels.SocketChannel.open(SocketChannel.java:146)
at
com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.
java:320)
.... 13 more
JNDI API lookup failed: javax.naming.CommunicationException: Can't find
SerialContextProvider [Root exception is org.omg.CORBA.COMM_FAILURE:
vmcid: SUN minor code: 201 completed: No]
javax.naming.CommunicationException: Can't find SerialContextProvider
[Root exception is org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code:
201 completed: No] at
com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.java:133)
at
com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:290)
at javax.naming.InitialContext.lookup(InitialContext.java:347)
at SimpleProducer.main(Unknown Source)
Caused by: org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 201
completed: No
at
com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSyst
emException.java:2257)
at
com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSyst
emException.java:2278)
at
com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(Sock
etOrChannelConnectionImpl.java:208)
at
com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(Sock
etOrChannelConnectionImpl.java:221)
at
com.sun.corba.ee.impl.transport.SocketOrChannelContactInfoImpl.createConnection
(SocketOrChannelContactInfoImpl.java:104)
at
com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.beginRequest(Co
rbaClientRequestDispatcherImpl.java:153)
at
com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.request(CorbaClientDeleg
ateImpl.java:127)
at
com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.is_a(CorbaClientDelegate
Impl.java:244)
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:89)
at
com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.java:128)
.... 3 more
Caused by: java.lang.RuntimeException: java.net.ConnectException:
Connection refused
at
com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.
java:336)
at
com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(Sock
etOrChannelConnectionImpl.java:191)
.... 12 more
Caused by: java.net.ConnectException: Connection refused
at sun.nio.ch.Net.connect(Native Method)
at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:460)
at java.nio.channels.SocketChannel.open(SocketChannel.java:146)
at
com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.
java:320)
.... 13 more
---
 
F

Farshad

Okay, I got the problem solved although I'm not sure what was going
wrong. I tried using the IP address of my server rather than it's
name both in the properties file and the command line and it worked
successfully. Now it even works fine when giving the server name (while
it used to fail in this situation before)!! My server is not using DHCP
which has problem with JMS on Application Server 8.1 according to the
latest Sun documentation.
- Farshad
 
F

Farshad

Farshad said:
Apparently, the system tries to connect to the localhost at some point!
I changed the jndi.properties to:
---
java.naming.factory.initial=com.sun.enterprise.naming.SerialInitContextFactory
org.omg.CORBA.ORBInitialHost=myservername
org.omg.CORBA.ORBInitialPort=3700
java.naming.provider.url=iiop://myservername:3700
---
Now, executing
#java -Djms.properties=jndi.properties SimpleProducer jms/Queue
gives the below message while if I change "myservername" to "localhost"
and run an App Server locally it works quite fine. What am I missing?!
Isn't it enough to have a remote server name in that jndi.properties to
make the same application work with a remote server? I appreciate any
help.

- Farshad

ERROR MESSAGE:
---
Destination name is jms/Queue
May 15, 2003 7:56:10 PM
com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl <init>
WARNING: "IOP00410201: (COMM_FAILURE) Connection failure: socketType:
IIOP_CLEAR_TEXT; hostname: localhost; port: 3700"
org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 201 completed: No
at
com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSyst
com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSyst


com.sun.corba.ee.impl.transport.SocketOrChannelContactInfoImpl.createConnection
com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.beginRequest(Co
com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.request(CorbaClientDeleg
com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.is_a(CorbaClientDelegate
Impl.java:244)
at org.omg.CORBA.portable.ObjectImpl._is_a(ObjectImpl.java:112)
at
org.omg.CosNaming.NamingContextHelper.narrow(NamingContextHelper.java:69)
com.sun.enterprise.naming.SerialContext.narrowProvider(SerialContext.java:89)
com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.java:128)
com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:290)
at javax.naming.InitialContext.lookup(InitialContext.java:347)
at SimpleProducer.main(Unknown Source)
Caused by: java.lang.RuntimeException: java.net.ConnectException:
Connection refused
at
com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.
java:336)
at
com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl. said:
etOrChannelConnectionImpl.java:191)
... 12 more
Caused by: java.net.ConnectException: Connection refused
at sun.nio.ch.Net.connect(Native Method)
at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:460)
at java.nio.channels.SocketChannel.open(SocketChannel.java:146)
at
com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.
java:320)
... 13 more
JNDI API lookup failed: javax.naming.CommunicationException: Can't find
SerialContextProvider [Root exception is org.omg.CORBA.COMM_FAILURE:
vmcid: SUN minor code: 201 completed: No]
javax.naming.CommunicationException: Can't find SerialContextProvider
[Root exception is org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code:
201 completed: No] at
com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.java:133)
com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:290)
at javax.naming.InitialContext.lookup(InitialContext.java:347)
at SimpleProducer.main(Unknown Source)
Caused by: org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 201
completed: No
at
com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSyst
emException.java:2257)
at
com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSyst
emException.java:2278)
at
com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl. said:
etOrChannelConnectionImpl.java:208)
at
com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl. said:
etOrChannelConnectionImpl.java:221)
at
com.sun.corba.ee.impl.transport.SocketOrChannelContactInfoImpl.createConnection
(SocketOrChannelContactInfoImpl.java:104)
at
com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.beginRequest(Co
rbaClientRequestDispatcherImpl.java:153)
at
com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.request(CorbaClientDeleg
ateImpl.java:127)
at
com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.is_a(CorbaClientDelegate
Impl.java:244)
at org.omg.CORBA.portable.ObjectImpl._is_a(ObjectImpl.java:112)
at
org.omg.CosNaming.NamingContextHelper.narrow(NamingContextHelper.java:69)
com.sun.enterprise.naming.SerialContext.narrowProvider(SerialContext.java:89)
com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.java:128)
... 3 more
Caused by: java.lang.RuntimeException: java.net.ConnectException:
Connection refused
at
com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.
java:336)
at
 
F

Farshad

Okay, I got the problem solved although I'm not sure what was going
wrong. I tried using the IP address of my server rather than it's
name both in the properties file and the command line and it worked
successfully. Now it even works fine when giving the server name (while
it used to fail in this situation before)!! My server is not using DHCP
which has problem with JMS on Application Server 8.1 according to the
latest Sun documentation.
- Farshad
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top