0 Replies Latest reply on Jul 26, 2009 10:50 PM by sisti

    javax.naming.CommunicationException

      Hi,

      Can anybody help me to solve this error:-

      While trying to do this sample example with jboss 4.2 , ejb 3 ,jdk1.5 that
      I found at site
      :- http://javahowto.blogspot.com/2007/11/simple-ejb-3-on-jboss-application.html

      I am getting the following error when I run the client class
      ---------------------------------------------------------------------------------------------------

      Exception in thread "main" javax.naming.CommunicationException: Could not obtain
      connection to any of these urls: localhost:1099 and discovery failed with error
      : javax.naming.CommunicationException: Receive timed out [Root exception is java
      .net.SocketTimeoutException: Receive timed out] [Root exception is javax.naming.
      CommunicationException: Failed to connect to server localhost:1099 [Root excepti
      on is javax.naming.ServiceUnavailableException: Failed to connect to server loca
      lhost:1099 [Root exception is java.net.ConnectException: Connection refused: con
      nect]]]
      at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1562)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:634)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627)
      at javax.naming.InitialContext.lookup(Unknown Source)
      at foo.Client.main(Client.java:16)
      Caused by: javax.naming.CommunicationException: Failed to connect to server loca
      lhost:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed t
      o connect to server localhost:1099 [Root exception is java.net.ConnectException:
      Connection refused: connect]]
      at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:274)
      at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1533)
      ... 4 more
      Caused by: javax.naming.ServiceUnavailableException: Failed to connect to server
      localhost:1099 [Root exception is java.net.ConnectException: Connection refused
      : connect]
      at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:248)
      ... 5 more
      Caused by: java.net.ConnectException: Connection refused: connect
      at java.net.PlainSocketImpl.socketConnect(Native Method)
      at java.net.PlainSocketImpl.doConnect(Unknown Source)
      at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
      at java.net.PlainSocketImpl.connect(Unknown Source)
      at java.net.SocksSocketImpl.connect(Unknown Source)
      at java.net.Socket.connect(Unknown Source)
      at java.net.Socket.connect(Unknown Source)
      at java.net.Socket.(Unknown Source)
      at java.net.Socket.(Unknown Source)
      at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory
      .java:84)
      at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory
      .java:77)
      at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:244)
      ... 5 more
      -----------------------------------------------------------------------------------------------------------------------
      When I tried to do the first example of ejb3 in action with Myeclipse,jboss 4.2, ejb 3, jdk1.5
      I am getting this same error.

      I am not understanding What I am missing.
      I will be very thankful if anybody can help me to solve this error...

      Thanks in advance.
      sisti