Version 2

    Why does CosNaming create a new ORB?

     

    Question

    When I use Sun's CosNaming to do JNDI it creates a new ORB, why doesn't it use the ORB configured in deploy/iiop-service.xml?

     

    Answer

    Because Sun's CosNaming uses the ORB configured in the Naming environment. The default JBoss initial context factory

    org.jnp.interfaces.NamingContextFactory

    does not set the ORB, you need to use a context factory that does set the ORB to JBoss's ORB.

     

    Change conf/jndi.properties

    # DO NOT EDIT THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING
    #
    java.naming.factory.initial=org.jboss.iiop.naming.ORBInitialContextFactory
    java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
    

     

    Application client

     

    The

    org.jboss.iiop.naming.ORBInitialContextFactory

    is also required

    if you are using CosNaming in an application client.