Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

tomcat and jndi resource

 
shankar vembu
Ranch Hand
Posts: 309
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
everything was fine until i moved my jndi resource settings from my appl. context to the global jndi naming resources as I have more than one appl. to share this resoruce. Now i get the exception that the jdbc driver could not be loaded 'null'. Whats the problem now. I had a tough time long back when I was trying to set up this jndi stuff and now stuck again
i am using tomcat 5 and mysql database.
regards.
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you move your jdbc driver jar file up to CATALINA_HOME/common/lib ?
 
shankar vembu
Ranch Hand
Posts: 309
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Mike Curwen:
Did you move your jdbc driver jar file up to CATALINA_HOME/common/lib ?

yes, it's in that location.
The problem occured when I moved my JNDI resource setting in server.xml from the web app context to global jndi naming resources tag. The lookup is fine cos I get a valid datasource after the jndi lookup in my code. But when I try to get the connection, it throws the exception. So the code where I getConnection() is unable to locate the driver..... But i dont find any reason why it isn't... This is strange. A dirty workaround is to have all the web app contexts have this resource entry. This works but lot of redundancy.....
Regards.
 
shankar vembu
Ranch Hand
Posts: 309
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
same kinda problem
The follow ups say "More specifically, in 4.1.27 you can't define your JDBC resources in either
the DefaultContext or the GlobalResources. You need to explicitly define a
Context for your webapp, and insert the resources into that context."
Well, I use tomcat 5.....
regards
[ November 28, 2003: Message edited by: shankar vembu ]
 
shankar vembu
Ranch Hand
Posts: 309
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
any pointers??
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic