Reply to myself. Dam - commons-dbcp.jar does not support: getConnection(String uname, String passwd) throws SQLException.
Only. getConnection() throws SQLException I guess I need to talk to the comons-dbcp group. So why did I have to move the resources to the webApp group to make this work? P.S. - So moving the resources to the webApp context did fix my problem. Later, Robert Wynkoop -----Original Message----- From: Wynkoop, Robert M Sent: Thursday, September 11, 2003 10:53 AM To: 'Tomcat Users List' Subject: RE: Cannot load JDBC driver class 'null' - Tomcat standalone 4.1. 27 w hen trying instantiate datasource object. I moved the resources to the webApps context in server.xml. Now I'm getting this error when I try to get a connection. java.lang.UnsupportedOperationException at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.ja va:125) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:3 29) I will check my jar versions. Has anyone seen this? Later, Robert Wynkoop -----Original Message----- From: Manolo Ramirez T. [mailto:[EMAIL PROTECTED] Sent: Thursday, September 11, 2003 10:44 AM To: Tomcat Users List Subject: Re: Cannot load JDBC driver class 'null' - Tomcat standalone 4.1. 27 w hen trying instantiate datasource object. Yep, that's what I'm talking about, check the archives, some people had problems with ResourceLink's and DefaultContext. Defining your context in a myApp.xml is the best option to avoid it, you must to follow Phillip Qin advise. Happy Coding! Regards, __________________ Manolo Ramirez T. Wynkoop, Robert M wrote: > I don't know how to answer other than I have it in: > <GlobalNamingResources> > > When you say normal context, what are we talking about? :) > Are talking about something like: > > <!-- Tomcat Examples Context --> > <Context path="/examples" ........ blah, blah, blah. > <******snip********> > <Resource name="jdbc/EmployeeAppDb" auth="SERVLET" > type="javax.sql.DataSource"/> > <ResourceParams name="jdbc/EmployeeAppDb"> > <parameter><name>user</name><value>sa</value></parameter> > <parameter><name>password</name><value/></parameter> > <parameter><name>driverClassName</name> > <value>org.hsql.jdbcDriver</value></parameter> > <parameter><name>driverName</name> > <value>jdbc:HypersonicSQL:database</value></parameter> > </ResourceParams> > </Context> > Thanks, > > > Robert Wynkoop > -----Original Message----- > From: Manolo Ramirez T. [mailto:[EMAIL PROTECTED] > Sent: Thursday, September 11, 2003 9:27 AM > To: Tomcat Users List > Subject: Re: Cannot load JDBC driver class 'null' - Tomcat standalone > 4.1. 27 w hen trying instantiate datasource object. > > > Are you declaring the JNDI resource in DefaultContext or with > ResourceLink? if yes, try with a normal Context and Resource. > > Regards, > > _________________ > Manolo Ramirez T. > > Wynkoop, Robert M wrote: > >>Yeah I had already tried that. When It was not there I got this message > > on > >>Tomcat startup - java.lang.reflect.InvocationTargetException: >>java.lang.NoClassDefFoundError: javax/sql/DataSource >> >>I'm kind of stumped on this. Any other ideas? >> >>Later, >> >> >>Robert Wynkoop >> >>-----Original Message----- >>From: Phillip Qin [mailto:[EMAIL PROTECTED] >>Sent: Wednesday, September 10, 2003 5:11 PM >>To: 'Tomcat Users List' >>Subject: RE: Cannot load JDBC driver class 'null' - Tomcat standalone >>4.1. 27 w hen trying instantiate datasource object. >> >> >>If you use oracle jdbc driver, put classes12.jar in common/lib >> >>-----Original Message----- >>From: Wynkoop, Robert M [mailto:[EMAIL PROTECTED] >>Sent: September 10, 2003 6:06 PM >>To: Tomcat Mailing List (E-mail) >>Subject: Cannot load JDBC driver class 'null' - Tomcat standalone 4.1.27 w >>hen trying instantiate datasource object. >> >>The error(Wen I try to use a JNDI resource in my webapp.): >> >>C:\jdk1.3.1_08\jre\bin\java -classpath >>"C:\web\Tomcat4.1\bin\bootstrap.jar";"C:\jdk1.3.1_08\lib\tools.jar" >>-Dcatalina.home="C:\web\Tomcat4.1" -Dcatalina.base="C:\web\Tomcat4.1" >>org.apache.catalina.startup.Bootstrap "start" >>[INFO] Registry - -Loading registry information >>[INFO] Registry - -Creating new Registry instance >>[INFO] Registry - -Creating MBeanServer >>[INFO] Http11Protocol - -Initializing Coyote HTTP/1.1 on port 8080 >>Starting service Tomcat-Standalone >>Apache Tomcat/4.1.18-LE-jdk14 >>[INFO] PropertyMessageResources - -Initializing, >>config='org.apache.struts.util.LocalStrings', returnNull=true >>[INFO] PropertyMessageResources - -Initializing, >>config='org.apache.struts.action.ActionResources', returnNull=true >>[INFO] PropertyMessageResources - -Initializing, config='remic_msgcat', >>returnNull=true >>[INFO] Http11Protocol - -Starting Coyote HTTP/1.1 on port 8080 >>[INFO] ChannelSocket - -JK2: ajp13 listening on 0.0.0.0/0.0.0.0:8009 >>[INFO] JkMain - -Jk running ID=0 time=0/200 >>config=C:\web\Tomcat4.1\conf\jk2.properties >>Cannot load JDBC driver class 'null' >>java.lang.NullPointerException >> at java.lang.Class.forName0(Native Method) >> at java.lang.Class.forName(Class.java:115) >> at >> > > org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.jav > >>a:523) >> at >> > > org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:3 > >>29) >> at >> > > com.citimortgage.common.datasource.DataSourceManager.getConnection(DataSourc > >>eManager.java:80) >> >>I know I have the Oracle jar in the right place because I get this msg > > when > >>if I don't have it in <tomcatHome>/common/lib. >> >>C:\jdk1.3.1_08\jre\bin\java -classpath >>"C:\web\Tomcat4.1\bin\bootstrap.jar";"C:\jdk1.3.1_08\lib\tools.jar" >>-Dcatalina.home="C:\web\Tomcat4.1" -Dcatalina.base="C:\web\Tomcat4.1" >>org.apache.catalina.startup.Bootstrap "start" >>[INFO] Registry - -Loading registry information >>[INFO] Registry - -Creating new Registry instance >>[INFO] Registry - -Creating MBeanServer >>[INFO] Http11Protocol - -Initializing Coyote HTTP/1.1 on port 8080 >>Exception during startup processing >>java.lang.reflect.InvocationTargetException: > > java.lang.NoClassDefFoundError: > >>javax/sql/DataSource >> at java.lang.ClassLoader.defineClass0(Native Method) >> at java.lang.ClassLoader.defineClass(ClassLoader.java:488) >> at >>java.security.SecureClassLoader.defineClass(SecureClassLoader.java:106) >> >>I googled for this answer. The most common problem is not finding the >>database driver in <tomcatHome>/common/lib. >> >> >>Later, >> >> >>Robert Wynkoop >> >>--------------------------------------------------------------------- >>To unsubscribe, e-mail: [EMAIL PROTECTED] >>For additional commands, e-mail: [EMAIL PROTECTED] >> >>--------------------------------------------------------------------- >>To unsubscribe, e-mail: [EMAIL PROTECTED] >>For additional commands, e-mail: [EMAIL PROTECTED] >> >> > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]