• 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

Struts 1.3, Tomcat 5.5.12, MySQL 5.0.37 issue

 
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I get the following error "javax.naming.NamingException: Cannot create resource instance" at the line "DataSource ds = (DataSource)envContext.lookup("jdbc/mydb");" in my action class.

I am trying to connect to MySQL database using JNDI. the document that I am referring to resolve the issue is: http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html

the configuration of the system is: Tomcat 5.5.12 Struts 1.3 MySQL Server version: 5.0.37-community-nt MySQL Community Edition (GPL) MYSQL connector to connect frm java code mysql-connector-java-5.0.8-bin.jar (I have downloaded the connector from http://dev.mysql.com/downloads/connector/j/5.0.html ) The code to connect in the action class is



The complete error stack is


This is my server.xml




This is the web.xml




Kindly let me know what is going wrong. Thanks a million in advance.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic