7 Replies Latest reply on Jun 14, 2013 12:47 PM by Thiago Nascimento

    CorbaNamingService for EJB3 in AS trunk

    Jonathan Halliday Master

      So I'm trying to write a RMI/IIOP client for an EJB that's deployed in JBossAS. I'm using META-INF/jboss.xml to enable the iiop invoker and that bit works seems to work fine.


      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE jboss PUBLIC
       "-//JBoss//DTD JBOSS 4.0//EN" "http://www.jboss.org/j2ee/dtd/jboss_4_0.dtd">
      
      <jboss>
       <enterprise-beans>
       <session>
       <ejb-name>StatelessBean</ejb-name>
       <jndi-name>StatelessBean</jndi-name>
       <configuration-name>Standard Stateless SessionBean</configuration-name>
       <invoker-bindings>
       <invoker>
       <invoker-proxy-binding-name>iiop</invoker-proxy-binding-name>
       </invoker>
       </invoker-bindings>
       </session>
       </enterprise-beans>
       <resource-managers />
      </jboss>
      


      Then in the client I try to get a CORBA stub thusly:

      Properties p = new Properties();
      p.put(InitialContext.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.cosnaming.CNCtxFactory");
      p.put(InitialContext.PROVIDER_URL, "corbaloc::172.16.130.100:3528/JBoss/Naming/root");
      
      InitialContext ctx = new InitialContext(p);
      MyRemote bean = (MyRemote) ctx.lookup("StatelessBean");
      


      which blows up:


      [java] javax.naming.NameNotFoundException [Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0]
      


      so I use the JMX to do a list() on the jboss:service=CorbaNaming, which I'm assuming should dump out the contents of the name space. It's empty.

      So, question: how do I get the bean into the name server? I'm pretty sure it 'just worked' under 4.2. Is this broken in 5.0 or did I miss a step?

      Thanks