Return-Path: X-Original-To: apmail-tomcat-users-archive@www.apache.org Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E3419C1C9 for ; Thu, 3 May 2012 01:13:52 +0000 (UTC) Received: (qmail 5949 invoked by uid 500); 3 May 2012 01:13:49 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 5788 invoked by uid 500); 3 May 2012 01:13:49 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 5779 invoked by uid 99); 3 May 2012 01:13:49 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 May 2012 01:13:49 +0000 X-ASF-Spam-Status: No, hits=1.8 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,HTML_MESSAGE,NORMAL_HTTP_TO_IP,RCVD_IN_DNSWL_LOW,SPF_PASS,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of linzuxiong1988@gmail.com designates 209.85.216.41 as permitted sender) Received: from [209.85.216.41] (HELO mail-qa0-f41.google.com) (209.85.216.41) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 May 2012 01:13:43 +0000 Received: by qabg27 with SMTP id g27so3690332qab.0 for ; Wed, 02 May 2012 18:13:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=Vq3Y0WFggahQ6fVOCE3xS6XuNZ6EhPbAasi0xFkDOS0=; b=IvEMWuf2iCRwyIOd+jzVE8V9tf15p5gXbNoRIevhTmBbqE2z7TVX/73IdU3PmSHFDI SHyG9oaX43JWcMXtMpirEiw3jzgsFbPjRsbcOylXsf6/MG4yECfZjdzHNlqdHXXjAH55 J0Pw+zScVs0A2qQgxhS+yz8nrJl1dKMDVMPn57SBYcbokzG8yximEVUBeLxcuYcvjBCk wUiiWyFjcDtzW/7+asJoTaoB3+onb73AJDCteXKYS9RA5nIIIRxVk9ThEPrbN9xkUwAG xfl0fmzeJ5AEj6H/DRCXqWyZkHLG3svsxGv/7ODrasGJ24UIwjXplaNilRVsaTnXQhqw GS3A== MIME-Version: 1.0 Received: by 10.229.105.224 with SMTP id u32mr116951qco.41.1336007602487; Wed, 02 May 2012 18:13:22 -0700 (PDT) Received: by 10.229.12.145 with HTTP; Wed, 2 May 2012 18:13:22 -0700 (PDT) In-Reply-To: <4FA1494E.3040504@christopherschultz.net> References: <4FA1494E.3040504@christopherschultz.net> Date: Thu, 3 May 2012 09:13:22 +0800 Message-ID: Subject: Re: How to config the Tomcat 7.x JNDI datasource by using BoneCP ?? From: zuxiong lin To: Tomcat Users List Content-Type: multipart/alternative; boundary=00235429cd4090436804bf17829f --00235429cd4090436804bf17829f Content-Type: text/plain; charset=ISO-8859-1 When I use BoneCP in per-web-app, it is OK with partitionCount . "partitionCount " is a property of BoneCP. MySQL Connector/J 5.1.19, I put it into both Tomcat's lib/ directory and my webapp's WEB-INF/lib directory . (I can have a try. I think it doesnot work : > 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. ) On Wed, May 2, 2012 at 10:48 PM, Christopher Schultz < chris@christopherschultz.net> wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Zuxiong, > > On 5/2/12 3:09 AM, zuxiong lin wrote: > > In Tomcat 7 , conf/server.xml -> GlobalNamingResources > driverClass="com.mysql.jdbc.Driver" * > > factory="com.jolbox.bonecp.BoneCPDataSource"* > > idleMaxAgeInMinutes="600" jdbcUrl="jdbc:mysql:// > > 10.20.216.18:3306/SoftmgrV3?useUnicode=true&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 > > --00235429cd4090436804bf17829f--