[jboss-user] [JNDI and Naming] New message: "jndi.properties vs bindings-jboss-beans.xml"

jsingh jsingh do-not-reply at jboss.com
Wed Feb 24 17:52:45 EST 2010


User development,

A new message was posted in the thread "jndi.properties vs bindings-jboss-beans.xml":

http://community.jboss.org/message/528333#528333

Author  : jsingh jsingh
Profile : http://community.jboss.org/people/jagdeep

Message:
--------------------------------------------------------------
Hi All,
 
I am porting an application which uses RMI into JBoss 5.1.0.
 
I have code in the application which uses the "org.jnp.interfaces.NamingContextFactory"  implementation of the Context for RMI connection.
Since I am using a port different than :1099, I edit the "bindings-jboss-beans.xml" file's Naming Service port to my custom port, and the communication works fine.
 
I was wondering if it's possible to *not* edit the bindings-jboss-beans.xml but edit the jndi.properties file as follows (assuming localhost as my url for now):
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory 
java.naming.provider.url=jnp://localhost:<my port number> 
java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
 
When I try this, JBoss throws the following exception (below).
 
My questions were:
1) Am I doing something wrong in the jndi.props file? Do I need to make it part of the class path?
2) Does JBoss look at bindings-jboss-beans.xml before it looks at jndi.properties?
 
I have made sure :<my port number>  is not in use.
 
2010-02-24 17:18:23,228 WARN  [org.jnp.server.NamingBeanImpl] (main) Context.PROVIDER_URL in server jndi.properties, url=localhost:<my port number>
.......
2010-02-24 17:19:09,400 ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] (main) Error installing to Start: name=jboss.jmx:alias=jmx/rmi/RMIAdaptor state=Create mode=Manual requiredState=Installed
javax.naming.CommunicationException: Could not obtain connection to any of these urls: localhost:<my port number> 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/127.0.0.1:<my port number> [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server localhost/127.0.0.1:<my port number> [Root exception is java.net.ConnectException: Connection refused: connect]]]
 at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1763)
 at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:693)
 at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686)
 at javax.naming.InitialContext.lookup(InitialContext.java:392)
 at org.jboss.util.naming.Util.createLinkRef(Util.java:275)
 at org.jboss.util.naming.Util.createLinkRef(Util.java:253)
 at org.jboss.naming.NamingAlias.createLinkRef(NamingAlias.java:133)
 at org.jboss.naming.NamingAlias.startService(NamingAlias.java:122)
 at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:376)
 at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:322)
 at sun.reflect.GeneratedMethodAccessor80.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

--------------------------------------------------------------

To reply to this message visit the message page: http://community.jboss.org/message/528333#528333




More information about the jboss-user mailing list