0 Replies Latest reply on Jan 22, 2003 1:13 PM by apinto

    JBoss and JacORB

    apinto

      Hi there,

      I'm trying to use the JacORB version distributed with JBoss 3.0.4, because I find it unnecessary to use two differente ORBs. In the server application, I do the following:

      --------------------------------------------------------------------------------
      orb=org.omg.CORBA.ORB.init(args, null);
      (...)
      org.omg.PortableServer.POA poa=org.omg.PortableServer.POAHelper.narrow(orb.resolve_initial_references("RootPOA"));
      poa.the_POAManager().activate();
      org.omg.CORBA.Object o=poa.servant_to_reference(this);

      NamingContextExt context=NamingContextExtHelper.narrow(orb.resolve_initial_references("NameService"));
      context.rebind(context.to_name(SERVICE_NAME), o);

      orb.run();
      --------------------------------------------------------------------------------

      I have both jndi.properties and jacorb.properties in the classpath. I used the jacorb.properties found in JBoss distribution. jndi.properties has the following:

      --------------------------------------------------------------------------------
      java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
      java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
      java.naming.provider.url=IOR:000000000000002B49444C3A6F6D672E6F72672F436F734E616D696E672F4E616D696E67436F6E746578744578743A312E300000000000020000000000000068000102000000000D31302E3131322E37322E353000000DC8000000114A426F73732F4E616D696E672F726F6F74000000000000020000000000000008000000004A414300000000010000001C00000000000100010000000105010001000101090000000105010001000000010000002C0000000000000001000000010000001C00000000000100010000000105010001000101090000000105010001
      --------------------------------------------------------------------------------

      I copied the java.naming.provider.url from JBoss log file. To start the server, I do:

      %JAVA_HOME%\bin\java.exe -classpath %ALTAIA_CLASSPATH% -Dorg.omg.CORBA.ORBClass=org.jacorb.orb.ORB -Dorg.omg.CORBA.ORBSingletonClass=org.jacorb.orb.ORBSingleton pt.ptinovacao.altaia.manager.server.Main

      This dumps the following exception:

      --------------------------------------------------------------------------------
      java.lang.NullPointerException
      at java.util.Hashtable.put(Hashtable.java:389)
      at org.jacorb.poa.POA.getReference(POA.java:1004)
      at org.jacorb.poa.POA.servant_to_reference(POA.java:1517)
      at pt.ptinovacao.altaia.manager.server.control.ControlServer.run(ControlServer.java:74)
      at pt.ptinovacao.altaia.manager.server.Main.(Main.java:69)
      at pt.ptinovacao.altaia.manager.server.Main.main(Main.java:57)
      --------------------------------------------------------------------------------

      Can anyone help me please? Thanks in advance. Best regards,

      Arménio Pinto