2 Replies Latest reply on Jan 7, 2004 1:36 AM by stuart miller

    remote client using old JDK (hence old RMI)

    stuart miller Newbie

      I need to establish a connection to a remote session bean from within another application server (ATG Dynamo). I have tried the following ways:

      Hashtable env = new Hashtable();
      env.put("java.naming.factory.initial","com.sun.jndi.rmi.registry.RegistryContextFactory");
      env.put("java.naming.provider.url","rmi://toronto:1099");
      env.put("java.naming.factory.url.pkgs","org.jboss.naming:org.jnp.interfaces");
      ctx = new InitialContext(env);
      Object obj = ctx.lookup("test/StatelessSessionBean");


      With this way, I get:
      java.rmi.MarshalException: Transport protocol not supported by server

      When I change the env to:
      java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
      java.naming.provider.url=jnp://toronto:1099
      java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces


      First of all...a last-second dump of ctx.getEnvironment() reveals that java.naming.factory.url.pkgs has been appended with :com.sun.enterprise.naming, and I get:

      javax.naming.CommunicationException. Root exception is java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
       java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
       java.net.MalformedURLException: unknown protocol: dynamosystemresource
      java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
       java.net.MalformedURLException: unknown protocol: dynamosystemresource
      java.net.MalformedURLException: unknown protocol: dynamosystemresource
       at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:245)
       at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:220)
       at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:122)
       at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
       at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:484)
       at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:463)
       at javax.naming.InitialContext.lookup(InitialContext.java:350)
       at com.anachron.petticoat.XMLManagerProxy.doStartService(XMLManagerProxy.java:137)
       at atg.nucleus.GenericService.startService(GenericService.java:452)
       at atg.nucleus.NucleusNameResolver.startService(NucleusNameResolver.java:1085)
       at atg.nucleus.NucleusNameResolver.configureAndStartService(NucleusNameResolver.java:884)
       at atg.nucleus.NucleusNameResolver.createFromName(NucleusNameResolver.java:616)
       at atg.nucleus.NucleusNameResolver.createFromName(NucleusNameResolver.java:514)
       at atg.nucleus.NucleusNameResolver.resolveComponentName(NucleusNameResolver.java:317)
       at atg.nucleus.NucleusNameResolver.resolveName(NucleusNameResolver.java:822)
       at atg.nucleus.ConfigurationRefArray.getValue(ConfigurationRefArray.java:135)
       at atg.nucleus.SimpleComponentState.setBeanProperty(SimpleComponentState.java:345)
       at atg.nucleus.SimpleConfigurationState.saveToBean(SimpleConfigurationState.java:221)
       at atg.nucleus.SimpleConfigurationState.configureBean(SimpleConfigurationState.java:244)
       at atg.nucleus.BeanConfigurator.configureBean(BeanConfigurator.java:276)
       at atg.nucleus.PropertyConfiguration.configureService(PropertyConfiguration.java:389)
       at atg.nucleus.NucleusNameResolver.configureService(NucleusNameResolver.java:1047)
       at atg.nucleus.NucleusNameResolver.configureAndStartService(NucleusNameResolver.java:876)
       at atg.nucleus.NucleusNameResolver.createFromName(NucleusNameResolver.java:616)
       at atg.nucleus.NucleusNameResolver.createFromName(NucleusNameResolver.java:514)
       at atg.nucleus.NucleusNameResolver.resolveComponentName(NucleusNameResolver.java:317)
       at atg.nucleus.NucleusNameResolver.resolveName(NucleusNameResolver.java:822)
       at atg.nucleus.Nucleus.resolveName(Nucleus.java:1620)
       at atg.nucleus.GenericService.resolveName(GenericService.java:311)
       at atg.nucleus.GenericService.resolveName(GenericService.java:330)
       at atg.nucleus.Nucleus.<init>(Nucleus.java:480)
       at atg.nucleus.Nucleus.startNucleus(Nucleus.java:2374)
       at atg.nucleus.Nucleus.main(Nucleus.java:2313)
      


      which appears as though some Dynamo-specific things are intercepting my JNDI calls, though I explicitly have "jnp://" as the protocol.

      JBoss (3.2.2) is running on JDK1.4.2_03 and Dynamo under JDK_1.3.1_02 -- may this be the underlying cause of my troubles? Has RMI changed enough to cause problems (as I understand it, JNP is really RMI). I have verified that all JBoss-specific JARs are in fact FIRST in my classpath for the Dynamo VM... so I cannot explain this.

      Can anyone perhaps shed some light on this problem?

      Many thanks in advance,
      Stu Miller