tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: tomcat 4.1.31 problem
Date Tue, 01 Sep 2009 15:26:31 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jamez,

On 8/31/2009 10:27 PM, jamez smith wrote:
> I have tried to type "startup.bat" in DOS under $CATALINA_HOME/bin, the
> window quickly closed itself again.

Really? When you run startup.bat from the command-line, is EXITS
CMD.EXE? That is very surprising.

> I also tried to type "catalina run",
> and saw the exception, but it does not look helpful too.

If it's this exception, then it is helpful:

> Catalina.start: LifecycleException:  Context startup failed due to previous
> errors

If there's anything before that in catalina.out, then it will be helpful
to see it. From what you posted, it looks like the error will be shown
in a different log file: one for a particular webapp.

> I am running it immediately starting up my PC.  How do we know what the
> previous error is?  I did remember I had such exception before, but I just
> can never trigger the same error again.

Try looking in the file logs/procurement_log.[datestamp].txt

> org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of
> class '' for connect URL 'null', cause:
> java.lang.NullPointerException
>  at COM.ibm.db2.jdbc.app.DB2Driver.acceptsURL(Unknown Source)
>  at java.sql.DriverManager.getDriver(DriverManager.java:232)
>  at
> org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:743)

Amusingly enough, there's a thread occurring concurrently with this one
on the list on this exact issue. Basically: check and re-check all your
<Resource> parameters, make sure your datasource name is consistent, and
only put your MySQL driver JAR file in one place: in the server's
library directory (common/lib on TC 4.1 IIRC).

> I post the datasource configuration in the server.xml again:
> 
> <Context docBase="myApp" path="/myApp"  reloadable="true" debug="1" >
>         <Logger className="org.apache.catalina.logger.FileLogger"
>               prefix="procurement_log." suffix=".txt"  timestamp="true"/>

It wouldn't hurt to turn up debug to something like "99". I've never
seen good documentation on what that attribute is supposed to do,
unfortunately.

>  <Resource name="jdbc/test_DS" auth="Container"
> type="javax.sql.DataSource"/>
>  <ResourceParams name="jdbc/test_DS">
>      <!-- Class name for JDBC driver -->
>      <parameter>
>         <name>driverClassName</name>
>        <value>COM.ibm.db2.jdbc.app.DB2Driver</value>
>      </parameter>
> 
>      <!-- The JDBC connection url for connecting to your DB -->
>      <parameter>
>        <name>url</name>
>        <value>jdbc:db2:oscahe</value>
>      </parameter>
>    </ResourceParams>


The two above parameters are the ones you ought to double- and
triple-check: does the IBM driver really start with COM all in caps? I
suspect that it should be "com.ibm.db2.jabc.app.DB2Driver" instead of
that you have. Case does matter. Also, is the URL you have above the
correct URL for DB2? Does anything need to be set up in a separate file
to resolve "oscahe" (and is that spelled right? "oscache", maybe?)? I
remember Oracle's non-type-IV JDBC drivers needed a separate file to
configure the driver.

The last thing I'd ask about your webapp is what the code looks like
that is trying to grab a connection from the connection pool. Is it your
own code? If so, post that. If you are using something like Hibernate,
an O-R mapper, or some other DB framework, post the configuration for
/that/ so we can see what the expected DataSource JNDI name is.

Finally, I wonder if upgrading to a newer level of Tomcat is an option.
I see it's a legacy application, but the servlet API hasn't changed that
dramatically over the years (other than adding features and
tightening-down the specification of older ones). You might find that
your webapp runs perfectly fine on Tomcat 6.0, and will receive better
support from just about everyone. TC 4.1 just got its last update ever,
and it's basically dead.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkqdPScACgkQ9CaO5/Lv0PDSqgCeL5A1lOEn1+MQtxwz1kXYfrzl
IfEAn2Aq9tS22XgOgvxqiwkRujlWXnn8
=X00F
-----END PGP SIGNATURE-----

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


Mime
View raw message