hi, i'm new to this topic. i try to write a client application for jboss, an easy helloWorld.
my directory strukture:
question 1: do i have to put the interfaces into a HelloWorldClient.jar to run the client? i thought i dont have to, because of jndi. Must I always import the interfaces? or is there a other better way? question 2: my client doesn't work, what means the exception: java.lang.NoClassDefFoundError: org/jboss/logging/Logger at org.jnp.interfaces.NamingContext.<clinit>(NamingContext.java:92) at org.jnp.interfaces.NamingContextFactory.getInitialContext(NamingContextFactory.java:42) at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:662) at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243) at javax.naming.InitialContext.init(InitialContext.java:219) at javax.naming.InitialContext.<init>(InitialContext.java:195) at HelloWorldClient.main(HelloWorldClient.java:16) Exception in thread "main" Process terminated with exit code 1 question 3: Context.lookup must have the name of the jar-file as param? please help, thanks a lot
regards kay [ January 08, 2003: Message edited by: Kay Tracid ]
Question 1: Yes, your client needs to have the interfaces, both HelloWorldHome and HelloWorldRemote, to work. In fact, you won't even be able to compile the client without access to those interfaces. Because of the underlying RMI mechanism, you don't need the stub classes that implement those interfaces. Those will be delivered to your client at runtime, but you do need the interfaces. Question 2: No idea. It looks to be JBoss specific. I would check to make sure JBoss's logger is in the classpath of the server. I don't think you will need it for the client, but I don't know for sure. Question 3: Context.lookup doesn't need the name of the Jar file as a parameter. It needs the JNDI name of the bound object, which is an object that implements HelloWorldHome. The class of this object is automatically generated during the EJB compile (ejbc). You specify the JNDI name in your deployment descriptor. It may be the same name as the Jar file, but then again, it may not.