4 Replies Latest reply on Dec 31, 2010 1:08 AM by ShuiXin Zhang

    Trouble connecting to naming server using RMI/IIOP

    Javier Peña Newbie


      I'm getting the following exception when trying to access the naming server in an application using JBoss RMI/IIOP module.

      [java] javax.naming.NameNotFoundException [Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0]
      [java] at com.sun.jndi.cosnaming.ExceptionMapper.mapException(ExceptionMapper.java:44)
      [java] at com.sun.jndi.cosnaming.CNCtx.callResolve(CNCtx.java:453)
      [java] at com.sun.jndi.cosnaming.CNCtx.lookup(CNCtx.java:492)
      [java] at com.sun.jndi.cosnaming.CNCtx.lookup(CNCtx.java:470)
      [java] at javax.naming.InitialContext.lookup(InitialContext.java:347)
      [java] at org.jboss.naming.client.java.javaURLContextFactory$EncContextProxy.invoke(javaURLContextFactory.java:114)
      [java] at $Proxy0.lookup(Unknown Source)
      [java] at javax.naming.InitialContext.lookup(InitialContext.java:347)
      [java] at com.sun.ebank.util.EJBGetter.getCustomerControllerHome(EJBGetter.java:69)
      [java] at com.sun.ebank.appclient.DataModel.(DataModel.java:126)
      [java] at com.sun.ebank.appclient.EventHandle.(EventHandle.java:52)
      [java] at com.sun.ebank.appclient.BankAdmin.main(BankAdmin.java:593)
      [java] Caused by: org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0
      [java] at org.omg.CosNaming.NamingContextPackage.NotFoundHelper.read(NotFoundHelper.java:72)
      [java] at org.omg.CosNaming._NamingContextStub.resolve(_NamingContextStub.java:251)
      [java] at com.sun.jndi.cosnaming.CNCtx.callResolve(CNCtx.java:440)
      [java] ... 10 more

      looks like some other people in this forum also got this same exception before but I couldn't find a posted solution. I modified the JBossDukesBank example that comes with the J2EE tutorial to support RMI/IIOP clients. The example works fine when not using IIOP. I did everything that is mentioned in the http://www.jboss.org/developers/projects/jboss/IIOP document as far as modifing the jboss.xml file in the dd/ejb directory and changing the jndi.properties file in the dd/client directory. I tried several things for the java.naming.provider.url property in the jndi.properties. I tried using the corbaloc address with localhost,, with no luck. I even tried without a corbaloc address and just the IOR string with the bunch of hex digits that JBoss server shows in the console and still didn't work. I'm using JBoss 4.0.2 and Java 1.4.2 on MacOS X Tiger for the client and the server. I'm running the JBoss server with "-c all" arguments and I can see that the IOR for the CustomerController are created succesfully. I'm actually running the java client on the same machine as the server. I'm pretty much a newbie in JBoss.

      Here's my jndi.properties file

      # For IIOP client communication

      # Uncomment this out if no IIOP comunication is needed

      # this was commented out before


      I also added the java arguments mentioned by Francisco Reverbel in a post I found in the design forum. So the jboss-build.xml file looks like the following for running the client.

      <!-- Run the standalone client -->


      <!-- The following vm args are needed for connecting the client via IIOP -->

      <!-- this was the one added for the bank example -->

      when I run the java client (ant -f jboss-build.xml run-client) I get the javax.naming.NameNotFoundException exception

      I'm stuck with this problem for more than a week and I just ran out of options. Hopefully I'm missing something simple and easy to resolve. Any help would be really appreciate it.

      Could this exception caused by some security enforced in the bank example?

      thanks in advance