-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: JNDI lookup problem
PostPosted: Tue Jun 08, 2004 3:50 am 
Beginner
Beginner

Joined: Tue Mar 23, 2004 4:18 pm
Posts: 45
Hi!

this is how I initialize my context:

put( InitialContext.INITIAL_CONTEXT_FACTORY, Configuration.JNDI.INITIAL_CONTEXT_FACTORY );
put( InitialContext.PROVIDER_URL, Configuration.JNDI.PROVIDER_URL );
put( "hibernate.session_factory_name", "java:comp/env/hibernate/SessionFactory" );


But on lookup is thrown an naming exception:

SessionFactory sf = (SessionFactory)context.lookup( "java:comp/env/hibernate/SessionFactory" );

What am I doing wrong?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 08, 2004 6:36 am 
Senior
Senior

Joined: Fri Nov 21, 2003 5:55 am
Posts: 155
What kind of server are you using?
What is the trace of your exception?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 09, 2004 3:27 am 
Beginner
Beginner

Joined: Tue Mar 23, 2004 4:18 pm
Posts: 45
subich wrote:
What kind of server are you using?
What is the trace of your exception?


Jetty5

[java] javax.naming.NameNotFoundException
[java] at org.mortbay.jndi.NamingContext.lookup(NamingContext.java:600)
[java] at org.mortbay.jndi.NamingContext.lookup(NamingContext.java:628)
[java] at org.mortbay.jndi.NamingContext.lookup(NamingContext.java:628)
[java] at org.mortbay.jndi.NamingContext.lookup(NamingContext.java:643)
[java] at org.mortbay.jndi.java.javaRootURLContext.lookup(javaRootURLContext.java:115)
[java] at javax.naming.InitialContext.lookup(InitialContext.java:351)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.