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
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.