• 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

javax.naming.CommunicationException

 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.<init>(Unknown Source)
at java.net.Socket.<init>(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
 
Sisti Dey
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Again,
I found in many of the posts that this error is due to the jar file "jbossall-client.jar "
but I have set the classpath %JBOSS_HOME%\client\jbossall-client.jar
for the client class
still getting this error

Please advice me how to to solve it..
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How did you start the server? Is the client and the server on the same machine? Is the server up when the client is running? What does the following command from the client machine return:

 
reply
    Bookmark Topic Watch Topic
  • New Topic