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 81ED79661 for ; Thu, 8 Mar 2012 15:12:44 +0000 (UTC) Received: (qmail 26573 invoked by uid 500); 8 Mar 2012 15:12:40 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 26505 invoked by uid 500); 8 Mar 2012 15:12:40 -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 26494 invoked by uid 99); 8 Mar 2012 15:12:40 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Mar 2012 15:12:40 +0000 X-ASF-Spam-Status: No, hits=0.7 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [76.96.59.243] (HELO qmta13.westchester.pa.mail.comcast.net) (76.96.59.243) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Mar 2012 15:12:34 +0000 Received: from omta02.westchester.pa.mail.comcast.net ([76.96.62.19]) by qmta13.westchester.pa.mail.comcast.net with comcast id j2xu1i0090QuhwU5D3CEzG; Thu, 08 Mar 2012 15:12:14 +0000 Received: from Christophers-MacBook-Pro.local ([69.143.109.145]) by omta02.westchester.pa.mail.comcast.net with comcast id j3CD1i01i38FjT13N3CEnD; Thu, 08 Mar 2012 15:12:14 +0000 Message-ID: <4F58CC4E.3030602@christopherschultz.net> Date: Thu, 08 Mar 2012 10:12:14 -0500 From: Christopher Schultz User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 MIME-Version: 1.0 To: Tomcat Users List Subject: Re: What is the best way to view Tomcat JDBC pool properties in Tomcat 6? References: <1331173542254-4557182.post@n6.nabble.com> <-997437064820984158@unknownmsgid> <1331206180031-4558028.post@n6.nabble.com> <4F58C7ED.9040700@christopherschultz.net> In-Reply-To: <4F58C7ED.9040700@christopherschultz.net> X-Enigmail-Version: 1.3.5 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Jonathan, So, ConnectionPool.getProxyConstructor definitely makes a decision about what interfaces to expose when generating a proxy for a PooledConnection (sorry for the word-wrapping): public Constructor getProxyConstructor(boolean xa) throws NoSuchMethodException { //cache the constructor if (proxyClassConstructor == null ) { Class proxyClass = xa ? Proxy.getProxyClass(ConnectionPool.class.getClassLoader(), new Class[] {java.sql.Connection.class,javax.sql.PooledConnection.class, javax.sql.XAConnection.class}) : Proxy.getProxyClass(ConnectionPool.class.getClassLoader(), new Class[] {java.sql.Connection.class,javax.sql.PooledConnection.class}); proxyClassConstructor = proxyClass.getConstructor(new Class[] { InvocationHandler.class }); } return proxyClassConstructor; } This error: On 3/8/12 9:53 AM, Christopher Schultz wrote: > >> Caused by: java.lang.ClassCastException: $Proxy5 cannot be cast >> to org.apache.tomcat.jdbc.pool.PooledConnection at >> org.apache.tomcat.jdbc.pool.DataSourceProxy.getPooledConnection(DataSourceProxy.java:156) >> >> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at ... looks like it's probably a bug somewhere. I checked the code in trunk, and nowhere does DataSourceProxy cast anything to org.apache.tomcat.jdbc.pool.PooledConnection. What version of Tomcat 7 are you using? It looks like the DataSource must be configured with XA connections enabled, so this error: >> Caused by: java.sql.SQLException: Connection from pool does not >> implement javax.sql.XAConnection at >> org.apache.tomcat.jdbc.pool.DataSourceProxy.getXAConnection(DataSourceProxy.java:134) ...is >> probably due to a misconfiguration. Please double-check that you have XA enabled in your DataSource. - -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/ iEYEARECAAYFAk9YzE4ACgkQ9CaO5/Lv0PDpIwCeOtDG372WawwiuXRT7HF8c1bT O7oAoIzfybIR2wiomopF/bTm8fVY7T3y =oDvs -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org