Meaningless Drivel is fun!*
The moose likes EJB and other Java EE Technologies and the fly likes EJB3.0 Communication Exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "EJB3.0 Communication Exception" Watch "EJB3.0 Communication Exception" New topic
Author

EJB3.0 Communication Exception

Kranthi Gajula
Greenhorn

Joined: Mar 30, 2008
Posts: 2
Hi,
I am using Jboss4.2.2 App server.I have built a simple hello world EJB and successfully deployed in the server.Also I have created a standalone client with netbeans 6.0. When I run the client I get the following exception...
(Ofcourse the server is running)

javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out]
at org.jnp.interfaces.NamingContext.discoverServer(NamingContext.java:1465)
at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1594)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:634)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at ejb30statefulclient.CountClient.main(CountClient.java:32)
Caused by: java.net.SocketTimeoutException: Receive timed out
at java.net.PlainDatagramSocketImpl.receive0(Native Method)
at java.net.PlainDatagramSocketImpl.receive(PlainDatagramSocketImpl.java:136)
at java.net.DatagramSocket.receive(DatagramSocket.java:712)
at org.jnp.interfaces.NamingContext.discoverServer(NamingContext.java:1435)
... 5 more

Any clue as to why it is throwing the exception.
Marco Ehrentreich
best scout
Bartender

Joined: Mar 07, 2007
Posts: 1280

Hi!

Do you have the properties for JBoss JNDI lookup correctly set? For testing purposes you can simply put this into your client source code instead of a properties file:

Perhaps you have configured a different naming provider or port which eventually times out. The settings above are the default settings for JBoss.

Marco
[ March 30, 2008: Message edited by: Marco Ehrentreich ]
Kranthi Gajula
Greenhorn

Joined: Mar 30, 2008
Posts: 2
Hi,

I havent changed(touched) any JNDI settings. I have couple of jars and the "C:\Program Files\jboss-4.2.2.GA\server\default\conf" folder as well in the class path, thats all.

Another thing is, there seems to be no problem when I run the client when I am using glassfish v2.
Marco Ehrentreich
best scout
Bartender

Joined: Mar 07, 2007
Posts: 1280

I don't really know what your client application does or should do but by all means from the stack trace of the exception it seems to be primarily a problem with JNDI. I guess you are trying to get a remote interface of a session bean aren't you?

Have you tried the code snippet I posted with JBoss? You should insert this into the client code before you create your InitialContext. But the exact settings are dependent on your application server so I'm quite sure it won't work with exactly the same options for Glassfish.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: EJB3.0 Communication Exception