• 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

JNDI Appserver problem

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic