works in windows, linux doesn't: SpyJMSException: Cannot get
davidg Oct 12, 2001 6:02 AMhi all,
(I posted this on the new to JBoss forum but, since I had no reply, and I've read the post with the intent to kill that forum, I decided to post it on this forum, too. I apologise if this shouldn't have been done.)
I set up jboss 2.4.1 on my Debian/unstable machine. The only configuration change I did was to edit jboss.properties and change java.rmi.server.hostname to the ip of my machine.
Next, I built the jms-hello-sender and jms-hello-receiver examples and they worked fine.
Next step was to try these examples running on a remote windows 2000 machine. I edited resources/jndi.properties and changed the java.naming.provider.url to the ip of the server. This was where it started failing. I got the following error when I tried to communicate from windows to linux:
[java] An exception occured while testing HelloSender: org.jboss.mq.SpyJMSException: Cannot get a client ID: Connection refused: connect
[java] org.jboss.mq.SpyJMSException: Cannot get a client ID: Connection refused: connect
[java] at org.jboss.mq.Connection.askForAnID(Connection.java:370)
[java] at org.jboss.mq.Connection.(Connection.java:113)
[java] at org.jboss.mq.Connection.(Connection.java:135)
[java] at org.jboss.mq.SpyConnection.(SpyConnection.java:58)
[java] at org.jboss.mq.SpyConnectionFactory.createQueueConnection(SpyConnectionFactory.java:91)
[java] at org.jboss.docs.jms.client.HelloSender.(HelloSender.java:71)
[java] at org.jboss.docs.jms.client.HelloSender.main(HelloSender.java:118)
[java] linked exception is:
[java] java.net.ConnectException: Connection refused: connect
[java] at java.net.PlainSocketImpl.socketConnect(Native Method)
[java] at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:320)
[java] at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:133)
[java] at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:120)
[java] at java.net.Socket.(Socket.java:273)
[java] at java.net.Socket.(Socket.java:127)
[java] at org.jboss.mq.il.oil.OILServerIL.createConnection(OILServerIL.java:254)
[java] at org.jboss.mq.il.oil.OILServerIL.checkConnection(OILServerIL.java:248)
[java] at org.jboss.mq.il.oil.OILServerIL.getID(OILServerIL.java:95)
[java] at org.jboss.mq.Connection.askForAnID(Connection.java:367)
[java] at org.jboss.mq.Connection.(Connection.java:113)
[java] at org.jboss.mq.Connection.(Connection.java:135)
[java] at org.jboss.mq.SpyConnection.(SpyConnection.java:58)
[java] at org.jboss.mq.SpyConnectionFactory.createQueueConnection(SpyConnectionFactory.java:91)
[java] at org.jboss.docs.jms.client.HelloSender.(HelloSender.java:71)
[java] at org.jboss.docs.jms.client.HelloSender.main(HelloSender.java:118)
So I tried to do the reverse. I setup jboss on the windows machine and tried jms-hello-sender. It worked.
Then I tried jms-hello-receiver and I get this on the server:
[OILClientIL] Checking socket
[OILClientIL] ConnectionReceiverOILClient is connecting to: 127.0.0.1:33349
[OILClientIL] java.net.ConnectException: Connection refused: connect
[ClientConsumer:ID4] Could not send messages to a receiver.
java.rmi.RemoteException: Cannot connect to the ConnectionReceiver/Server
at org.jboss.mq.il.oil.OILClientIL.createConnection(OILClientIL.java:98)
at org.jboss.mq.il.oil.OILClientIL.checkSocket(OILClientIL.java:84)
at org.jboss.mq.il.oil.OILClientIL.receive(OILClientIL.java:69)
at org.jboss.mq.server.ClientConsumer.run(ClientConsumer.java:212)
at java.lang.Thread.run(Unknown Source)
[JMSServer] JMSServer->connectionFailure(dc=SpyDistributedConnection:ID4)
[JMSServer] The connection to client ID4 failed.
[JMSServer] JMSServer->connectionClosing(dc=SpyDistributedConnection:ID4)
[ClientConsumer:ID4] ClientConsumer:ID4->close()
[ClientConsumer:ID4] ClientConsumer:ID4->removeSubscription(subscriberId=-214748
3648)
[JMSServer] JMSServer->connectionClosing(dc=SpyDistributedConnection:ID4)
On the client I get nothing. The example keeps running as if it were waiting for messages.
So I decided to setup jboss on yet another windows 2000 machine. I used the first w2000 as the client. Both jms-hello-sender and jms-hello-receiver worked without problem!
Finally, I decided to setup jboss on another linux system and use the client on the first linux machine. Didn't work (same problem).
So I guess the problem is pretty much about linux here. However I don't know what to do now. I'm using sun's jdk 1.3.1_01 on all machines except one where I switched to IBM jdk 1.3.0 (to see if was a problem with vm's on linux). I also tried running everything as root (to see if it was a permissions problem) but couldn't get it working.
Anyone has a solution for this?