Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

EJB3.0 Communication Exception

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
best scout
Posts: 1294
Scala IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 1294
Scala IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Heroic work plunger man. Please allow me to introduce you to this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic