tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ashish shrivastava" <ashish.ind...@gmail.com>
Subject Re: JDBC driver of class '' for connect URL 'null' in Tomcat 5.5.12
Date Thu, 16 Aug 2007 13:00:49 GMT
check this

http://evolutionnext.com/blog/2005/10/13/1129259088959.html



On 8/16/07, Matthew Kerle <matthew.kerle@sra.com.au> wrote:
>
> hmm, you have an interesting problem!
>
> first thing I'd say is use this opportunity to upgrade to the
> ojdbc14.jar, which is the latest oracle jdbc driver and allows lots of
> nice enhancements.
>
> second, I'm assuming that since the error is a servlet exception, that
> there's some servlet code manually handling a database connection (no
> comment *cough* *cough*) that it gets from a JNDI lookup?
>
> third, try changing the <ResourceParams> tag to a plain <Resource> tag,
> this is the Resource tag that I use in my app (and it works). caveat: I
> declare this in /META-INF/context.xml inside the <context> tag.
>
>    <Resource name="jdbc/my_USERDS" auth="Container"
>              type="javax.sql.DataSource"
>              maxActive="0"
>              maxIdle="10"
>              maxWait="500"
>              username="db_user"
>              password="db_pass"
>              driverClassName="oracle.jdbc.OracleDriver"
>              url="jdbc:oracle:thin:@server:1521:ORA_SID"/>
>
> can you try this and let us know how it goes?
>
> cheers!
>
> ian.blenk@dsl.pipex.com wrote:
> > I'm upgrading from tomcat 4.1.24 to tomcat 5.5.12 on WinXP. I have three
> applications that are deployed from this
> > server, two of which work fine with tomcat 5.5.12, however the third
> which uses an oracle 9i database gives me the
> > following error "javax.servlet.ServletException: Cannot create JDBC
> driver of class '' for connect URL 'null' ".
> > Basically I've included the same details form the Tomcat4 server.xmlfile into the
tomcat
> 5.5 server.xml, rediting
> > where necessary.
> >
> > Things I have tried..
> >
> > Placing the context into fragment files located either inside the
> applications META-INF folder or under
> > tomcat\conf\Catalina\localhost. Neither of these seemd to work for me as
> Tomcat could not find the apps, so I've
> > left the context back in server.xml.
> > Rewriting the Resource params <parameter> as elements i.e.factory="
> com.ora.jsp.sql.DataSourceFactory"
> > Checked changed location of the JDBC jar file. classes12.jarcatalina_home\common\lib\
AND
> > catalina_home\webapps\[appname]\WEB-INF\lib
> > Checked changed the server.xml service-name and engine name to match
> previous TC4 server.xml version.
> > Added a Resourcelink element to the context - this is not present on the
> TC4 version
> > Checked Tomcat logs.
> >
> > I think that Tomcat is not able to read the <ResourceParams> element,
> which is why the URL and driverClass are
> > NULL.
> >
> > Which When I checked the Tomcat log files shows ...
> >
> > 16-Aug-2007 09:25:46 org.apache.catalina.core.ApplicationContext log
> > SEVERE: action: Cannot create JDBC driver of class '' for connect URL
> 'null'
> >
> > Background info
> > Using Apache 2.0 with mod_JK to serve pages on port 80
> > Java version 1.5
> >
> > **** server.xml ****
> >
> > <!-- Tomcat 5.5 Example Server Configuration File -->
> >
> > <Server port="8005" shutdown="SHUTDOWN" debug="0">
> >
> >   <Listener className="
> org.apache.catalina.mbeans.ServerLifecycleListener" debug="0"/>
> >   <Listener className="
> org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" debug="0"/>
> >
> >   <!-- Global JNDI resources -->
> >   <GlobalNamingResources>
> >
> >     <!-- Test entry for demonstration purposes -->
> >     <Environment name="simpleValue" type="java.lang.Integer"
> value="30"/>
> >
> >
> >     <Resource name="UserDatabase" auth="Container"
> >               type="org.apache.catalina.UserDatabase"
> >        description="User database that can be updated and saved"
> >            factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
> >           pathname="conf/tomcat-users.xml" ></Resource>
> >
> >
> >   </GlobalNamingResources>
> >
> >
> >   <Service name="Catalina">
> >
> >     <Connector port="8009"
> >                enableLookups="true" redirectPort="8443"
> protocol="AJP/1.3" />
> >
> >     <Engine name="Catalina" defaultHost="opp-online" debug="0">
> >
> >
> >       <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
> >              resourceName="UserDatabase"/>
> >
> >
> >       <Host name="opportunities-online" debug="0" appBase="webapps" >
> >
> >
> >         <Context path="/staff" docBase="oponline/staff" cookies="true"
> reloadable="true">
> >           <Valve className="org.apache.catalina.valves.AccessLogValve"
> >                  directory="logs"  prefix="staff_access_log."
> suffix=".txt"
> >                  pattern="combined" resolveHosts="false"/>
> >
> >           <Logger className="org.apache.catalina.logger.FileLogger"
> prefix="oponline_log." suffix=".txt"
> > timestamp="true"/>
> >
> >            <ResourceParams name="jdbc/oponline"
> >                      factory="com.ora.jsp.sql.DataSourceFactory"
> >                          user="myuser"
> >                          password="mypassword"
> >                          dataSourceClassName="
> oracle.jdbc.pool.OracleConnectionCacheImpl"
> >                          URL="
> jdbc:oracle:thin:@sas-test.myserver.ac.uk:1521:MYTE"
> >                          maxLimit="5" />
> >
> >              <!-- global resource for application's context. -->
> >              <!-- <ResourceLink name="/jdbc/oponline"
> global="/jdbc/oponline"
> >                         type="org.apache.catalina.UserDatabase"/> -->
> >
> >         </Context>
> >
> >       </Host>
> >
> >     </Engine>
> >
> >   </Service>
> >
> > </Server>
> >
> > *** end server.xml ***
> >
> >
> > *** App web.xml except ***
> >
> >  <resource-ref>
> >     <description>
> >       JNDI DataSource for [appname] database.
> >       (From Oreilly "JavaServer Pages", Bergsten, 2nd Ed., page 485)
> >     </description>
> >     <res-ref-name>jdbc/oponline</res-ref-name>
> >     <res-type>javax.sql.DataSource</res-type>
> >     <res-auth>Container</res-auth>
> >   </resource-ref>
> >
> > *** end web.xml ***
> >
> >
> > Thanks
> >
> > Ian
> >
> >
>
> --
> Matthew Kerle
> IT Consultant
> Canberra, Australia
>
> Mobile: +61404 096 863
> Email : mattkerle@gmail.com
> Web : http://threebrightlights.blogspot.com/
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message