1 Reply Latest reply on Oct 13, 2004 3:01 AM by sfrind

    JNDI, J2ME, J9 and jboss

    piwo Newbie

      Hi,

      I want develop a small jboss test-client for J2ME. Specially for IBMs J9 running on Pocket PCs. J use IBMs Device Developer with the J2ME Profile jclRMIP to develop the following small client:
      (…)
      try {

      InitialContext ic = new InitialContext();
      TestEntityHome testEntityHome =
      (TestEntityHome) ic.lookup("ejb/mvc/TestEntity");


      TestEntityPK pk;

      for (int num = 2; num <=10; num++) {
      pk = new TestEntityPK(num);
      TestEntity entity = testEntityHome.findByPrimaryKey(pk);
      System.out.println(entity.getValueObject().toString());
      }

      (…)
      The first stumbling block J have to sail around to make this code running is the JNDI lookup to get the Home-Object. I use the jndi.jar from Sun and get the following stack trace if I run the code under W2K with J9:

      java/lang/Throwable.()V
      java/lang/Throwable.(Ljava/lang/String;)V
      java/lang/NullPointerException.(Ljava/lang/String;)V
      com/ibm/oti/rmi/wire/StreamProtocolClient.startClient(Lcom/ibm/oti/rmi/EndpointID;Ljava/rmi/server/RMIClientSocketFactory;)V
      com/ibm/oti/rmi/wire/StreamProtocolClient.(Lcom/ibm/oti/rmi/EndpointID;Ljava/rmi/server/RMIClientSocketFactory;)V
      com/ibm/oti/rmi/wire/ProtocolClient.newClient(Lcom/ibm/oti/rmi/EndpointID;ILjava/rmi/server/RMIClientSocketFactory;)Lcom/ibm/oti/rmi/wire/ProtocolClient;
      com/ibm/oti/rmi/wire/ProtocolClient.clientFor(Lcom/ibm/oti/rmi/EndpointID;BLjava/rmi/server/RMIClientSocketFactory;)Lcom/ibm/oti/rmi/wire/ProtocolClient;
      com/ibm/oti/rmi/UnicastRef.invoke(Ljava/rmi/Remote;Ljava/lang/reflect/Method;[Ljava/lang/Object;J)Ljava/lang/Object;
      org/jnp/server/NamingServer_Stub.lookup(Ljavax/naming/Name;)Ljava/lang/Object;
      org/jnp/interfaces/NamingContext.lookup(Ljavax/naming/Name;)Ljava/lang/Object;
      org/jnp/interfaces/NamingContext.lookup(Ljava/lang/String;)Ljava/lang/Object;
      javax/naming/InitialContext.lookup(Ljava/lang/String;)Ljava/lang/Object;
      TestClient.()V
      TestClient.main([Ljava/lang/String;)V


      Is the JNDI or/and IBMs RMI implementation the problem? Have anybody make experience with J9/J2ME and JNDI? Finally, is a J2ME/Jboos-Client possible to develop or I’m to naïve?
      I’m glad about any comment

      Thanks
      Peter

        • 1. Re: JNDI, J2ME, J9 and jboss
          sfrind Newbie

          Have you solved this issue?
          I experience the same problem with J9 as client JVM and jdk1.4 as server JVM. The causing exception (NP) occurs on server.
          UnicastServerRef.dispatch(Remote, RemoteCall) line: 231
          Transport$1.run() line: 148

          With partly decompiling UnicastServerRef class from SUN it shows this line:
          231: method = (Method)methodTable.get(new Long(l));

          Does anybody have the sources of the SUN RMI classes of jdk1.4? So I could try to debug?
          Can anybody explain what is going on and how to circumvent this problem?

          It should be noted that plain RMI works with J9 as client and jdk1.4 as server, e.g. the issue has something to do with jboss.

          Regards,
          Stephan