• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

simple jndi question

 
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Sheriff
Posts: 3063
12
Mac IntelliJ IDE Python VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Kay Tracid
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot. You're a great help.
I found an answer for question 2 here
https://coderanch.com/t/88097/JBoss/jboss-org-jboss-logging-Logger
[ January 08, 2003: Message edited by: Kay Tracid ]
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic