You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Kevin Passey <kp...@kdpsoftware.co.uk> on 2003/09/11 15:55:04 UTC

RE: Cannot load JDBC driver class 'null' and org.apache.jasper.Ja sperException: Exception retrieving attribute 'driverClassName'

No the xml file should be called myapp.xml in webapps along with your war
file

Did you note my other comment about myDS and fsaDS that looks like it's more
your problem.

Leave it how you had it and just change that - stop and start tomcat and see
if that flies.

Regards

Kevin

-----Original Message-----
From: Wynkoop, Robert M [mailto:robert.m.wynkoop@citigroup.com]
Sent: 11 September 2003 14:54
To: 'Tomcat Users List'
Subject: RE: Cannot load JDBC driver class 'null' and
org.apache.jasper.Ja sperException: Exception retrieving attribute
'driverClassName'


I thought about this and then went into the 
Tomcat admin. Under service/localhost/context<myapp> When 
I click Datasource(under my apps context) I get the error:

org.apache.jasper.JasperException: Exception retrieving attribute
'driverClassName'
	at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:2
54)

in my browser window.

My app is at p:.../somename/web/WEB-INF/.  
So are you telling me I need to create a file 
called web.xml.  Can't do that.  
I already have my real web.xml there.  
Where can I find more information on this config file in the tomcat docs?


Later,


Robert Wynkoop
-----Original Message-----
From: Kevin Passey [mailto:kpassey@kdpsoftware.co.uk]
Sent: Thursday, September 11, 2003 8:26 AM
To: 'Tomcat Users List'
Subject: RE: Cannot load JDBC driver class 'null'


Rather than changing your server XML create an xml file in your webapps
directory with the same name as your app directory.

Here is an example:- 

- <Context className="org.apache.catalina.core.StandardContext"
crossContext="false" reloadable="false"
mapperClass="org.apache.catalina.core.StandardContextMapper"
useNaming="true" debug="0" swallowOutput="false" privileged="false"
displayName="Shilton"
wrapperClass="org.apache.catalina.core.StandardWrapper"
docBase="C:/Tomcat4.1/webapps/shilton" cookies="true" path="/shilton"
cachingAllowed="true"
charsetMapperClass="org.apache.catalina.util.CharsetMapper">
  <Resource name="mail/Session" scope="Shareable" type="javax.mail.Session"
auth="Container" description="Resource reference to a factory for
javax.mail.Session instances that may be used for sending electronic mail
messages, preconfigured to connect to the appropriate SMTP server." /> 
  <Resource name="jdbc/shiltonDB" auth="Container"
type="javax.sql.DataSource" /> 
- <ResourceParams name="jdbc/shiltonDB">
- <parameter>
  <name>factory</name> 
  <value>org.apache.commons.dbcp.BasicDataSourceFactory</value> 
  </parameter>
- <parameter>
  <name>maxActive</name> 
  <value>100</value> 
  </parameter>
- <parameter>
  <name>maxIdle</name> 
  <value>5</value> 
  </parameter>
- <parameter>
  <name>maxWait</name> 
  <value>100</value> 
  </parameter>
- <parameter>
  <name>username</name> 
  <value>INTERNET</value> 
  </parameter>
- <parameter>
  <name>password</name> 
  <value>**********</value> 
  </parameter>
- <parameter>
  <name>driverClassName</name> 
  <value>com.ibm.as400.access.AS400JDBCDriver</value> 
  </parameter>
- <parameter>
  <name>url</name> 
  <value>jdbc:as400://REX</value> 
  </parameter>
  </ResourceParams>
  </Context>

Stop and re-start Tomcat and hey presto!! OK I mine is for DB2 on an iSeries
- by hey it works !!

Anyway shouldn't your Web XML file have myDS not fsaDS.

Good luck 

Kevin


-----Original Message-----
From: Ben Anderson [mailto:stuts_andersonbd1@hotmail.com]
Sent: 11 September 2003 13:17
To: tomcat-user@jakarta.apache.org
Subject: Cannot load JDBC driver class 'null'


Ok, I know this topic has been posted many times, but I can't find anything 
to help.

I have OracleDriver in [$CATALINA_HOME]/common/lib
here's my server.xml
<GlobalNamingResources>
......................
<Resource name="myDS" scope="Shareable" type="javax.sql.DataSource" 
auth="Container"/>
    <ResourceParams name="myDS">
      <parameter>
        <name>validationQuery</name>
        <value>select user from dual;</value>
      </parameter>
      <parameter>
        <name>url</name>
        <value>jdbc:oracle:thin:myMachine:1521:myDBName</value>
      </parameter>
      <parameter>
        <name>username</name>
        <value>hris</value>
      </parameter>
      <parameter>
        <name>password</name>
        <value>****</value>
      </parameter>
      <parameter>
        <name>maxActive</name>
        <value>4</value>
      </parameter>
      <parameter>
        <name>maxWait</name>
        <value>5000</value>
      </parameter>
      <parameter>
        <name>driverClassName</name>
        <value>oracle.jdbc.driver.OracleDriver</value>
      </parameter>
      <parameter>
        <name>maxIdle</name>
        <value>2</value>
      </parameter>
    </ResourceParams>
  </GlobalNamingResources>

and my web.xml:

    <resource-ref>
        <res-ref-name>jdbc/fsaDS</res-ref-name>
        <res-type>javax.sql.DataSource</res-type>
        <res-auth>Container</res-auth>
        <res-sharing-scope>Shareable</res-sharing-scope>
    </resource-ref>

in the administrative tool:
the top level Resources->DataSources looks ok as MyDS is listed there
but the /my_context->Resources->Datasources gives:
org.apache.jasper.JasperException: Exception retrieving attribute 
'driverClassName'

and the localhost_log.xxx.txt (when it tries to use myDS):
java.sql.SQLException: Cannot load JDBC driver class 'null

Any help would be great - I've been trying everything - reloading with 
different configurations about 50 times - looking through books, mailing 
lists/archives.
Thanks,
Ben

_________________________________________________________________
Get 10MB of e-mail storage! Sign up for Hotmail Extra Storage.  
http://join.msn.com/?PAGE=features/es


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org