Discussion Locked

JMS problem in a standalone Laptop

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

We have a Java based application which has User Interface on client (using JApplets) and business logic(Servlet, JSP) and Database on the server. We tried to load both client and server code on a laptop. It worked fine so long as the laptop was connected to the intranet network. As soon as it is disconnected from the network, the same application stops working giving the following error when I start the JMS receiver program:

javax.jms.JMSException: java.net.BindException: Cannot assign requested address:set socket option failed
at allaire.ejipt._jms._Receiver._addListener(allaire/ejipt/_jms/_Receiver.java:184)
at allaire.ejipt._jms._Session._addListener(allaire/ejipt/_jms/_Session.java:512)
at allaire.ejipt._jms._Consumer.setMessageListener(allaire/ejipt/_jms/_Consumer.java:95)
at SearchAlgo.JmsDataReceiver.start(JmsDataReceiver.java:61)
at SearchAlgo.JmsDataReceiver.main(JmsDataReceiver.java:147)

This happens when I call the setMessageListener(this) passing it the reference of the current java program. This same program runs fine when the laptop is connected to the network and as soon as I remove the network cord the above mentioned error is thrown.

Any solution?

3 replies

by jay eckles

It's happening because when you remove the network card you're removing the network interface that one of the applications is using to establish the port. One of them can use the localhost interface, but the other needs a real network interface (even if it's on the same machine). The solution is to leave the network card in or create some sort of "virtual" network card that provides the interface.

by drprabhu

I was talking about removing the "cord" or the cable connecting the laptop to the intranet and not the networking "card".

We first thought that the ip address of the server machine used was the culprit and we changed it to "Localhost" but still it did not work. We changed it to the machine name and still it did not work. Even the default ip address of the PC did not work. This is just FYI.

This discussion is closed to new replies.