This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

Ramon Bonet
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9610
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Postgres related stuff is fine. As for the lookup can you follow the answer given here which mentions adding something to context.xml...
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!