This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have David & Dawn Griffiths on-line!
See this thread for details.
Win a copy of Head First Android this week in the Android forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

SQLNestedException

 
Ranch Hand
Posts: 197
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can someone help with this Exception.

I am using Tomcat 5.5 ..
here is the complete stack trace




This is CATALINA_HOME/conf/context.xml


[ June 10, 2006: Message edited by: kwame Iwegbue ]
 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
With out your code, which can be extensive, it looks like somewhere you are trying to load a class named "for connect URL 'null'"

One thing i would like to see is what your hopenet.utils.ConnectionUtil.getConnection() looks like. This appears to be where the problem actually is
 
kwame Iwegbue
Ranch Hand
Posts: 197
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
seems to work when <Resource> is placed in CATALINA_HOME/conf/server.xml under <GlobalNamingResources> and then place <ResourceLink> in the context.xml file.
 
kwame Iwegbue
Ranch Hand
Posts: 197
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have finally figured this out!!!

(This should probably be in Tomcat section, instead of here in JDBC)

From what I've seen in several other forums online regarding this problem, there might be either a bug in Tomcat v5.5, or the issue is not yet properly documented.

When trying to configure a web applications to access JDBC by using a DataSource to return a java.sql.Conncetion from Connection pool, you might encounter an
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'

This occurs when trying to run this type of code:



I believe it could be because there was a problem creating the Context. This could be fixed by using 'attributes' in <Resource> tag of <Context> element, instead of <Parameter> as in prev Tomcat versions, then by placing <Resource> in CATALINA_HOME/conf/server.xml under <GlobalNamingResources> and then place a <ResourceLink> in the context.xml file.

Problem is, when trying to perform


you might still get a
javax.naming.NameNotFoundException: Name jdbc is not bound in this Context

So next you need to place a factory attribute in <Resource>. There is a default factory provided by Tomcat v5.5, but this doesn't seen to work for Connection pooling. So you can use

factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory"

This works whether <Resource> is defined under <GlobalNamingResources> in server.xml for global access, and then <ResourceLink> is defined under <Context> for each application, or if <Resource> is placed under <Context> only. An example (saved as /META-INF/context.xml):



I hope this is helpful to someone!
[ June 15, 2006: Message edited by: kwame Iwegbue ]
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic