tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: How to config the Tomcat 7.x JNDI datasource by using BoneCP ??
Date Wed, 02 May 2012 14:48:46 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Zuxiong,

On 5/2/12 3:09 AM, zuxiong lin wrote:
> In Tomcat 7 , conf/server.xml -> GlobalNamingResources <!-- BoneCP
> datasource --> <Resource acquireIncrement="2" auth="Container" 
> driverClass="com.mysql.jdbc.Driver" * 
> factory="com.jolbox.bonecp.BoneCPDataSource"*
> idleMaxAgeInMinutes="600" jdbcUrl="jdbc:mysql:// 
> 10.20.216.18:3306/SoftmgrV3?useUnicode=true&amp;characterEncoding=UTF-8"
>
> 
lazyInit="false" maxConnectionsPerPartition="100"
> minConnectionsPerPartition="3" name="jdbc/SoftmgrV3"
> partitionCount="2" password="root" releaseHelperThreads="2" 
> type="com.jolbox.bonecp.BoneCPDataSource" username="root" />

I suspect that "partitionCount" and friends might not work. You might
instead want to set those as attributes in your URL. I don't used a
partitioned MySQL, so I'm really not sure. I would double-check the
documentation for MySQL Connector/J.

> *But Excpeiotn:* exception
> 
> org.springframework.web.util.NestedServletException: Request
> processing failed; nested exception is 
> org.springframework.transaction.CannotCreateTransactionException:
> Could not open JDBC Connection for transaction; nested exception
> is org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create
> JDBC driver of class '' for connect URL 'null'

Where is your mysql-x.y.z.jar file?

Since you are using Tomcat to manage your connection pool, you'll need
to have the JAR files for MySQL Connector/J *and* BoneCP in Tomcat's
lib/ directory and *not* in your webapp's WEB-INF/lib directory.

Hope that helps,
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk+hSU4ACgkQ9CaO5/Lv0PDbbACeL1pxxn+SI/v10o6Yngxf60yy
OrUAn1DwTz6tZypOUYpUJU+Co7x5t5tU
=phDH
-----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