tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Scott Mueller" <sc...@acceleratebiz.com>
Subject problem accessing datasource in 5.5.4 application
Date Tue, 16 Nov 2004 07:54:23 GMT
Someone please help me.  The same code that was working fine in tomcat
5.0.19 does not work anymore in 5.5.4 for accessing the database.  I have
the correct postgresql (jdk1.5 compatible) driver in the common/lib
directory.  In server.xml, I have the following resource as a child of the
GlobalNamingResources element:

<Resource name="data/ispmanagerpg" auth="Container"

        type="javax.sql.DataSource" driverClassName="org.postgresql.Driver"

        url="jdbc:postgresql://manager.acceleratebiz.com/xxxxxxx"

        username="xxxxxxx" password="xxxxxxx" maxActive="20" maxIdle="10"
maxWait="-1"/>

 

That seems to work fine, because in my
webapps/ispmanager/META-INF/context.xml file, I have the following Realm:

<Context docBase="ispmanager" path="">

  <Realm className="org.apache.catalina.realm.DataSourceRealm"
dataSourceName="data/ispmanagerpg" debug="99" roleNameCol="Rolename"
userCredCol="Password" userNameCol="Username" userRoleTable="Account_Roles"
userTable="Account"/>

</Context>

 

This works perfectly.  I can login with the correct username/password in my
postgresql database and it works as expected.  The problem is when actually
logged in and referencing a servlet that accesses the database through the
data/ispmanagerpg datasource.  It gives the error below.  This was working
fine in 5.0.19 as I explained above.  Not sure what's different or what I
may have inadvertently changed. I have the correct resource-ref element in
my WEB-INF/web.xml file.

 

2004-11-16 03:41:48,354 ERROR [http-69.60.97.166-443-Processor25]
servlet.CustomXmlProducer (CustomXmlProducer.java:60) - unable to get result
set for this entity

org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of
class '' for connect URL 'null'

        at
org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource
.java:780)

        at
org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.ja
va:540)

        at
com.acceleratebiz.manager.util.Database.getConnection(Database.java:31)

        at
com.acceleratebiz.manager.servlet.CustomXmlProducer.getCustomerId(CustomXmlP
roducer.java:54)

        at
com.acceleratebiz.manager.servlet.CustomXmlProducer.initialize(CustomXmlProd
ucer.java:41)

        at
com.acceleratebiz.manager.controlpanel.Traffic.produceXml(Traffic.java:30)

        at org.mis.xsltfront.servlet.XmlSource.produceXml(XmlSource.java:33)

        at org.mis.xsltfront.servlet.XsltServlet.doGet(XsltServlet.java:56)

        at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)

        at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:237)

        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:157)

        at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:214)

        at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:178)

        at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase
.java:482)

        at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126
)

        at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105
)

        at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:107)

        at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)

        at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:825)

        at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne
ction(Http11Protocol.java:731)

        at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.jav
a:526)

        at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWo
rkerThread.java:80)

        at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
a:684)

        at java.lang.Thread.run(Thread.java:595)

Caused by: java.lang.NullPointerException

        at java.util.StringTokenizer.<init>(StringTokenizer.java:182)

        at org.postgresql.Driver.parseURL(Driver.java:251)

        at org.postgresql.Driver.acceptsURL(Driver.java:159)

        at java.sql.DriverManager.getDriver(DriverManager.java:232)

        at
org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource
.java:773)

        ... 24 more

 

 

The last 7 lines of my web.xml file if it helps anyone:

        <resource-ref>

                <description>ispmanager database</description>

                <res-ref-name>data/ispmanagerpg</res-ref-name>

                <res-type>javax.sql.DataSource</res-type>

                <res-auth>Container</res-auth>

        </resource-ref>

</web-app>

 

Scott Mueller

AccelerateBiz Managed Hosting

http://www.acceleratebiz.com <http://www.acceleratebiz.com/> 

Phone: (800) 360-7360

Fax: (270) 778-3081 

 


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