This is a reposting since I haven't got any answer yet.
It is about the NullPointerException in class Connection
of MySQL Connector/J 2.0.14.
I just changed the driver to MySQL Connector/J 2.0.14.
But I'm still getting this NullPointerException once in
a while. The new StackTrace is:
java.lang.NullPointerException
at com.mysql.jdbc.Connection.execSQL(Unknown Source)
at com.mysql.jdbc.Connection.execSQL(Unknown Source)
at com.mysql.jdbc.Connection.setAutoCommit(Unknown Source)
at
org.apache.commons.dbcp.DelegatingConnection.setAutoCommit(DelegatingConnect
ion.java:237)
at
org.apache.commons.dbcp.PoolableConnectionFactory.activateObject(PoolableCon
nectionFactory.java:273)
at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(Unknown
Source)
at
org.apache.commons.dbcp.AbandonedObjectPool.borrowObject(AbandonedObjectPool
.java:117)
at
org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.ja
va:110)
at
org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:3
12)
at
org.apache.struts.util.GenericDataSource.getConnection(GenericDataSource.jav
a:276)
at de.mytest.fe.BaseAction.getConnection(BaseAction.java:36)
The application works for a long time and the exception occurs just
once in a while. I still don't know where to look for the cause.
The application gets its connections through a DataSource defined in
Struts' config file (struts-config.xml), which in turn uses Jakarta's
DBCP 1.0 (Database Connection Pool). I'm using Struts 1.1b2.
The parameters for the DataSource are as follows:
<data-source>
<set-property property="autoCommit"
value="true"/>
<set-property property="description"
value="Data Source for MySQL"/>
<set-property property="driverClass"
value="org.gjt.mm.mysql.Driver"/>
<set-property property="maxCount"
value="10"/>
<set-property property="minCount"
value="2"/>
<set-property property="password"
value="*******"/>
<set-property property="url"
value="jdbc:mysql://localhost:3306/somedb?autoReconnect=true"/>
<set-property property="user"
value="******"/>
<set-property property="autoReconnect"
value="true"/>
</data-source>
(The double "autoReconnect" was used to make sure, DBCP auto reconnects.
Since we have no access to the Servers, we couldn't figure out, which one
does the job -- the one in the url, or the extra paramter. However, this
is not the problem. AutoReconnect works).
Help greatly appreciated!
Thanks in advance,
Holger
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Holger Wiechert wrote:
> Hi,
>
> I'm having a quite serious problem. I wrote a web application that uses
> MySQL via ConnectorJ V2.0.6 in combination with Apache's DBCP 1.0
> (Jakarta Commons Database Connection Pool).
> The web application is installed on a server, I don't have access to.
> The same for the MySQL server.
> Once in a while, I get a NullPointerException and have no clue about
> the reason: DBCP, the JDBC driver, or MySQL.
> Once the exception occurred, it comes up with every new connection
> retrieval.
> I really wonder about the NullPointerexception, which seems to me like
> a ConnectorJ-Bug, but I'm not sure at all.
>
> java.lang.NullPointerException
> at org.gjt.mm.mysql.Connection.execSQL(Connection.java:863)
> at org.gjt.mm.mysql.Connection.execSQL(Connection.java:857)
> at org.gjt.mm.mysql.Connection.setAutoCommit(Connection.java:474)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Connector/J Package Names start with com.mysql.jdbc
This is not MySQL Connector/J, it is MM.MySQL, which is what MySQL
Connector/J used to be called (and a rather old version at that).
Please try upgrading to MySQL Connector/J 2.0.14 or 3.0.5 from
http://www.mysql.com/products/connector-j/ and see if your problem goes
away.
-Mark
____________
Virus checked by G DATA AntiVirusKit
Virus news: www.antiviruslab.com
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php