wood burning stoves 2.0*
The moose likes JBoss/WildFly and the fly likes JBoss error: Could not obtain connection... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "JBoss error: Could not obtain connection..." Watch "JBoss error: Could not obtain connection..." New topic

JBoss error: Could not obtain connection...

Lu Jin

Joined: Feb 22, 2003
Posts: 17
I am using JBoss-4.0.4RC1, when I do the jndi lookup for remote interface, I get the error:

01:14:53,156 ERROR [STDERR] javax.naming.CommunicationException: Could not obtain connection to any of these urls: localhost:1099 and discovery failed with error: javax.naming.CommunicationException: Failed to connect to server [Root exception is java.lang.ClassCastException: $Proxy353] [Root exception is javax.naming.CommunicationException: Failed to connect to server localhost
:1099 [Root exception is java.lang.ClassCastException: org.jnp.server.NamingServer_Stub]]
01:14:53,156 ERROR [STDERR] at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1414
01:14:53,156 ERROR [STDERR] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:594)
01:14:53,156 ERROR [STDERR] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
01:14:53,156 ERROR [STDERR] at javax.naming.InitialContext.lookup(InitialContext.java:351)

Context.URL_PKG_PREFIXES=org.jboss.naming rg.jnp.interfaces

are there any errors with my configuration?

Sanju Thomas
Ranch Hand

Joined: Dec 29, 2004
Posts: 243
Looks like you are using different version client.jar in the Client end. take the jboss-client jar from the JBOSS_HOME/client/ and put it in your client's class path.
Craig Caulfield

Joined: Dec 12, 2005
Posts: 3
I've just overcome a similar problem. All I did was replace jboss-client.jar with jbossall-client.jar in my classpath.

See if it works for you.
Chen ZhiJiang
Ranch Hand

Joined: May 18, 2002
Posts: 72
I facing same problem ,it been solved by replace jbossall-client.jar from jboss server.

Thanks very much.

It is sorta covered in the JavaRanch Style Guide.
subject: JBoss error: Could not obtain connection...
Similar Threads
Trouble in getting started with EJB3
Help required for JMS on Jboss server
please help ..... error while running program using eclipse
SocketTimeoutException when doing JNDI lookup