JNDI, J2ME, J9 and jboss
piwo Mar 3, 2003 10:49 AMHi,
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