• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EJB3.0 Communication Exception

 
Kranthi Gajula
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1294
IntelliJ IDE Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1294
IntelliJ IDE Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic