0 Replies Latest reply on Sep 20, 2002 7:48 PM by Richard T. Feak

    Problems with RMI/IIOP

    Richard T. Feak Newbie

      I am using JBoss 3.0.2. I am having trouble talking to a simple stateless session bean in an IIOP container via RMI/IIOP. Any help with this problem would be greatly appreciated. A bunch of information follows.

      Also, if there are any tutorials or documentation for using RMI/IIOP with JBoss that would help a bunch.

      Thanks in advance for any help,
      RTF


      I am receiving the following exception:
      javax.naming.CommunicationException: Cannot connect to ORB. Root exception is org.omg.CORBA.COMM_FAILURE: minor code: 1398079490 completed: No
      at com.sun.corba.se.internal.iiop.IIOPConnection.writeLock(IIOPConnection.java:914)
      at com.sun.corba.se.internal.iiop.IIOPConnection.send(IIOPConnection.java:975)
      at com.sun.corba.se.internal.iiop.IIOPOutputStream.invoke(IIOPOutputStream.java:71)
      at com.sun.corba.se.internal.iiop.ClientRequestImpl.invoke(ClientRequestImpl.java:82)
      at com.sun.corba.se.internal.corba.ClientDelegate.invoke(ClientDelegate.java:153)
      at com.sun.corba.se.internal.corba.ClientDelegate.is_a(ClientDelegate.java:509)
      at org.omg.CORBA.portable.ObjectImpl._is_a(ObjectImpl.java:109)
      at org.omg.CosNaming.NamingContextHelper.narrow(NamingContextHelper.java:47)
      at com.sun.jndi.cosnaming.CNCtx.setOrbAndRootContext(CNCtx.java:278)
      at com.sun.jndi.cosnaming.CNCtx.initOrbAndRootContext(CNCtx.java:213)
      at com.sun.jndi.cosnaming.CNCtx.(CNCtx.java:68)
      at com.sun.jndi.cosnaming.CNCtxFactory.getInitialContext(CNCtxFactory.java:30)
      at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:660)
      at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:241)
      at javax.naming.InitialContext.init(InitialContext.java:217)
      at javax.naming.InitialContext.(InitialContext.java:193)
      at com.accelrys.HelloWorldTest.main(HelloWorldTest.java:15)

      I ran the server using:
      run.bat -c all
      which should include IIOP support. I also verified that the CORBA Orb did start up by looking at the jmx-console.
      I used the following main() to generate the error:
      public static void main(String[] args) {
      try{
      Properties properties = new Properties();
      properties.load(new FileInputStream(new File("jndi.properties")));
      InitialContext initialContext = new InitialContext(properties);
      Object objRef = initialContext.lookup(com.accelrys.HelloWorldHome.JNDI_NAME);
      HelloWorldHome home = (HelloWorldHome)PortableRemoteObject.narrow(objRef, HelloWorldHome.class);
      HelloWorld bean = home.create();
      String helloString = bean.sayHello();
      System.out.println(helloString);
      }catch(Exception e){
      e.printStackTrace();
      }
      }

      I used the following for jndi.properties:
      java.naming.factory.initial=com.sun.jndi.cosnaming.CNCtxFactory
      java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
      java.naming.provider.url=IOR:.(inserted hex from log here)

      I also made sure to deploy to an IIOP Stateless SessionBean container in the jboss.xml . When I run this exact same example in a Standard Stateless SessionBean container and change the jndi.properties accordingly, everything works fine.