Only 48 hours left in the trailboss' kickstarter!

New rewards and stretch goals. CLICK HERE!



  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JNDI Appserver problem  RSS feed

 
frank vallee
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I try to reach a bean deployed on Sun Appserver 1.4 but I end up with a NameNotFoundException during the context lookup. I set the INITIAL_CONTEXT_FACTORY to "com.sun.jndi.fscontext.RefFSContextFactory".
Is it the good factory object ?
Do I need to include information about the server in the context environment ?
Frank.
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could you post the stack trace of the NameNotFoundException? It usually contains some information about which part of the JNDI name could not be solved.
 
frank vallee
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is the stacktrace :
E:\project\ejb\projects\advice>java -cp D:\Sun\AppServer\jndi\lib\providerutil.j
ar;D:\Sun\AppServer\jndi\lib\fscontext.jar;D:\Sun\AppServer\lib\j2ee.jar;.;Advic
eAppClient.jar AdviceClient
javax.naming.NameNotFoundException: Advisor
at com.sun.jndi.fscontext.RefFSContext.getObjectFromBindings(RefFSContex
t.java:419)
at com.sun.jndi.fscontext.RefFSContext.lookupObject(RefFSContext.java:34
7)
at com.sun.jndi.fscontext.RefFSContext.lookup(RefFSContext.java:183)
at com.sun.jndi.fscontext.FSContext.lookup(FSContext.java:165)
at javax.naming.InitialContext.lookup(InitialContext.java:347)
at AdviceClient.go(AdviceClient.java:41)
at AdviceClient.main(AdviceClient.java:15)
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, is "Advisor" what you've specified as the JNDI name in your deployment descriptors? Does the appserver's log tell you that the "Advisor" bean has been deployed properly?
 
frank vallee
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes I used the deployment tool and the JNDI name for the bean on the server is "Advisor". I think that I just don't get a good context on the server. I read that with Sun Appserver, you're not supposed to use any environment settings but when I do that, I get a NoInitialContextException. So I use the following code :

I tried sevral context factories (rmi, corba, dns) each of them thrown exceptions (corba result example : javax.naming.CommunicationException: Cannot connect to ORB.)
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Perhaps you should specify the JNDI server's URL along with the factory class? (just guessing because I've never really used the RI server)
 
frank vallee
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I finally solved the problem. I used the following code :

I already tried to put the PROVIDER_URL before posting this topic but with the http port value (8080). A closer look at the admin console gave me the good value for iiop port.
Thanks for the hint Lasse.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!