This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Spring and the fly likes [Error]NameNotFoundException: jndi-lookup name is not associated with this context Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "[Error]NameNotFoundException: jndi-lookup name is not associated with this context" Watch "[Error]NameNotFoundException: jndi-lookup name is not associated with this context" New topic
Author

[Error]NameNotFoundException: jndi-lookup name is not associated with this context

Ramon Bonet
Greenhorn

Joined: Jun 02, 2013
Posts: 8
Hi all,

Trying to run the application into browser, the following error appears:


javax.naming.NameNotFoundException: name hibernate/TFCappDS is not associated with this context


I connect to data Source with JNDI lookup, my app server is VMware vFabric tc Server, and I'm using Hibernate as the ORM framwork.

The fact is, I really don't know what name should I put as a jndi name.

Furthermore, I read in some places that is necessary to define JNDI lookup name as a <resource> in server.xml file from Server directory, and then to reference JNDI from Server's web, in context.xml from the same directory. But I have no idea about how to create this server resource, or what values should I write considering my server and ORM cases (VMware vFabric tc Server, Hibernate)

All my current code about JNDI and dataSource bean is this, at Spring xml file:



And I added the following resource, inside server.xml VMware tc Server file:



But It still does not recognize jndi name as a part of this context.

About this, I have two questions:

Can someone tell me if I have the correct values of 'url' and 'driverClassName' parameters, considering postgres??

Does Anyone know if there's something more to do, after editing servlet-context.xml and server.xml like this, to get JNDI-lookup name finally recognized? Or am I just simply wrong from de begining?


Very grateful to everyone
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9291
    
  17

The Postgres related stuff is fine. As for the lookup can you follow the answer given here which mentions adding something to context.xml...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
 
jQuery in Action, 2nd edition
 
subject: [Error]NameNotFoundException: jndi-lookup name is not associated with this context
 
Similar Threads
Error creating bean 'org.spring....PersistenceExceptionTranslationPostProcessor#0'
javax.servlet.ServletException: No adapter for handler
org.springframework.beans.factory.BeanCreationException
Cannot get Spring database connection work
Error: No setter found for property 'packagesToScan'. At servlet-context.xml