From user-return-26090-apmail-commons-user-archive=commons.apache.org@commons.apache.org Sun May 8 18:44:35 2011 Return-Path: X-Original-To: apmail-commons-user-archive@www.apache.org Delivered-To: apmail-commons-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D624B3215 for ; Sun, 8 May 2011 18:44:35 +0000 (UTC) Received: (qmail 19501 invoked by uid 500); 8 May 2011 18:44:31 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 18962 invoked by uid 500); 8 May 2011 18:44:30 -0000 Mailing-List: contact user-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Users List" Delivered-To: mailing list user@commons.apache.org Received: (qmail 18851 invoked by uid 99); 8 May 2011 18:44:30 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 08 May 2011 18:44:30 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,NORMAL_HTTP_TO_IP,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of mickamusset@gmail.com designates 209.85.210.171 as permitted sender) Received: from [209.85.210.171] (HELO mail-iy0-f171.google.com) (209.85.210.171) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 08 May 2011 18:44:23 +0000 Received: by iyi20 with SMTP id 20so4429374iyi.30 for ; Sun, 08 May 2011 11:44:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=qSpXqBtHpNEAkEU/qloHWnBW07Qjut6PPGkg+ZXI7gw=; b=BJIan4QY02H6URMdUcCYgl8MDuJmOc341zf/b5Fl2SlpFncH+0WysRDdsX84ziITpE RfEoWMAFIXetB5m/kLhxTgCm90nOBb91ky4b9m2mIAK2B3Uoh6OyP1X1nXXVIGB+0v1s TLb9rdDuui5VAIg8bkbysgNugigDuJSGLVN3s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=SjGZjsCqSZSHFO2ufZPDlykgiKyvFLVJEoKGSJiQBZcf+WWbdRDt0QQmcFqZ1RPVnm vkw9Om+dCab0nKAfTt3ziMQi6uOlUyx8+3R5Lq3xSLQIXgDBlsN6RPMmNG6FYI3aH30x XgApk7Co5pc5oY8sNW92jhBeO/4xnKu4VJeC0= MIME-Version: 1.0 Received: by 10.42.41.129 with SMTP id p1mr5449414ice.365.1304880241528; Sun, 08 May 2011 11:44:01 -0700 (PDT) Received: by 10.231.14.70 with HTTP; Sun, 8 May 2011 11:44:01 -0700 (PDT) In-Reply-To: <4DC5680E.4080400@gmail.com> References: <001201cc0c14$39a9a480$acfced80$@com.mx> <4DC5680E.4080400@gmail.com> Date: Sun, 8 May 2011 20:44:01 +0200 Message-ID: Subject: Re: Tomcat6 From: Micka To: user@commons.apache.org, users@tomcat.apache.org Cc: phil.steitz@gmail.com, andres@digiworks.com.mx Content-Type: multipart/alternative; boundary=20cf301d3c9e454e8504a2c81beb X-Virus-Checked: Checked by ClamAV on apache.org --20cf301d3c9e454e8504a2c81beb Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Thanks for your answer, I just removed the "tomcat-dbcp.jar" that was on my web app librairies. But I still have the same problem as before ! Which is : May 8, 2011 8:39:40 PM org.apache.catalina.core.AprLifecycleListener init INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/lib/jvm/java-6-sun-1.6$ May 8, 2011 8:39:41 PM org.apache.coyote.http11.Http11Protocol init INFO: Initializing Coyote HTTP/1.1 on http-8080 May 8, 2011 8:39:41 PM org.apache.catalina.startup.Catalina load INFO: Initialization processed in 1114 ms May 8, 2011 8:39:41 PM org.apache.catalina.core.StandardService start INFO: Starting service Catalina May 8, 2011 8:39:41 PM org.apache.catalina.core.StandardEngine start INFO: Starting Servlet Engine: Apache Tomcat/6.0.24 May 8, 2011 8:39:41 PM org.apache.catalina.startup.HostConfig deployDescriptor INFO: Deploying configuration descriptor ROOT.xml May 8, 2011 8:39:41 PM org.apache.catalina.startup.HostConfig deployDescriptor INFO: Deploying configuration descriptor SERVER.xml context init 2011-05-08 20:39:41 : Servlet Context is initialized.... 2011-05-08 20:39:41 : end Servlet init..... May 8, 2011 8:39:41 PM org.apache.coyote.http11.Http11Protocol start INFO: Starting Coyote HTTP/1.1 on http-8080 May 8, 2011 8:39:41 PM org.apache.catalina.startup.Catalina start INFO: Server startup in 665 ms *Exception in thread "PROCESS 2" java.lang.NoClassDefFoundError: org/apache/tomcat/dbcp/dbcp/DelegatingConnection* at ******* *Caused by: java.lang.ClassNotFoundException: org.apache.tomcat.dbcp.dbcp.DelegatingConnection at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.ja= va:1484) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.ja= va:1329) ... 4 more* And I just checked what package i was using, and it seems that it is the right one : import org.apache.tomcat.dbcp.dbcp.*; In my code, the problem occured here : System.out.println("test 1"); *Connection dconn =3D ((DelegatingConnection) conn).getInnermostDelegate();= * *<=3D=3D HERE* System.out.println("test 2"); ((org.postgresql.PGConnection)dconn).addDataType("geometry",org.postgis.PG= geometry.class); in my web apps librairies I have : commons-logging-1.1.jar postgis-2.0.0SVN.jar postgresql-9.0-xmlfix-jdbc4.jar ws-commons-util-1.0.2.jar xmlrpc-client-3.1.3.jar xmlrpc-common-3.1.3.jar xmlrpc-server-3.1.3.jar and here is the informations about my tomcat version : mickael@toto:/usr/share/tomcat6/bin$ sh version.sh Using CATALINA_BASE: /usr/share/tomcat6 Using CATALINA_HOME: /usr/share/tomcat6 Using CATALINA_TMPDIR: /usr/share/tomcat6/temp Using JRE_HOME: /usr/lib/jvm/java-6-sun Using CLASSPATH: /usr/share/tomcat6/bin/bootstrap.jar Server version: Apache Tomcat/6.0.24 * ( My windows Tomcat version used the 6.0.28, is that important ? )* Server built: March 24 2011 1829 Server number: ...0 OS Name: Linux OS Version: 2.6.32-24-server Architecture: amd64 JVM Version: 1.6.0_24-b07 JVM Vendor: Sun Microsystems Inc. and when i'm checking the lib folder of tomcat6, i got : mickael@toto:/usr/share/tomcat6/lib$ ls -l total 0 lrwxrwxrwx 1 root root 37 2011-05-06 16:30 annotations-api.jar -> ../../java/annotations-api-6.0.24.jar lrwxrwxrwx 1 root root 34 2011-05-06 16:30 catalina-ant.jar -> ../../java/catalina-ant-6.0.24.jar lrwxrwxrwx 1 root root 33 2011-05-06 16:30 catalina-ha.jar -> ../../java/catalina-ha-6.0.24.jar lrwxrwxrwx 1 root root 30 2011-05-06 16:30 catalina.jar -> ../../java/catalina-6.0.24.jar lrwxrwxrwx 1 root root 37 2011-05-06 16:30 catalina-tribes.jar -> ../../java/catalina-tribes-6.0.24.jar *lrwxrwxrwx 1 root root 27 2011-05-06 16:30 commons-dbcp.jar -> ../../java/commons-dbcp.jar* lrwxrwxrwx 1 root root 27 2011-05-06 16:30 commons-pool.jar -> ../../java/commons-pool.jar lrwxrwxrwx 1 root root 25 2011-05-06 16:30 el-api.jar -> ../../java/el-api-2.1.jar lrwxrwxrwx 1 root root 31 2011-05-06 16:30 jasper-el.jar -> ../../java/jasper-el-6.0.24.jar lrwxrwxrwx 1 root root 28 2011-05-06 16:30 jasper.jar -> ../../java/jasper-6.0.24.jar lrwxrwxrwx 1 root root 18 2011-05-06 16:30 jasper-jdt.jar -> ../../java/ecj.jar lrwxrwxrwx 1 root root 26 2011-05-06 16:30 jsp-api.jar -> ../../java/jsp-api-2.1.jar lrwxrwxrwx 1 root root 30 2011-05-06 16:30 servlet-api.jar -> ../../java/servlet-api-2.5.jar lrwxrwxrwx 1 root root 35 2011-05-06 16:30 tomcat-coyote.jar -> ../../java/tomcat-coyote-6.0.24.jar lrwxrwxrwx 1 root root 36 2011-05-06 16:30 tomcat-i18n-es.jar -> ../../java/tomcat-i18n-es-6.0.24.jar lrwxrwxrwx 1 root root 36 2011-05-06 16:30 tomcat-i18n-fr.jar -> ../../java/tomcat-i18n-fr-6.0.24.jar lrwxrwxrwx 1 root root 36 2011-05-06 16:30 tomcat-i18n-ja.jar -> ../../java/tomcat-i18n-ja-6.0.24.jar I don't understand what is wrong ! * Thanks for your help !* On Sat, May 7, 2011 at 5:41 PM, Phil Steitz wrote: > On 5/7/11 3:33 AM, Micka wrote: > > Hi, > > > > I really don't understand why i've this error ! > > > > On my windows machine it's work well, but not on ubuntu 10.04 machine > .... > > > > here is the context : > > > > > > > auth=3D"Container" > > type=3D"javax.sql.DataSource" > > maxActive=3D"100" > > maxIdle=3D"30" > > maxWait=3D"20000" > > logAbandoned=3D"true" > > removeAbandoned=3D"true" > > removeAbandonedTimeout=3D"10" > > testOnBorrow=3D"true" > > validationQuery=3D"SELECT 1" > > validationInterval=3D"30000" > > username=3D"toto" > > password=3D"toto" > > accessToUnderlyingConnectionAllowed=3D"true" > > driverClassName=3D"org.postgresql.Driver" > > url=3D"jdbc:postgresql://172.17.100.14/D_L?autoReconnect=3Dtrue" > > /> > > > > > > > > This is really a question for the Tomcat user list, but from the > stacktrace it looks like what is going on is that you have a Commons > dbcp jar in the classpath (probably in your web app's lib) and you > don't need that jar since you are using the tomcat-bundled version > of DBCP. The Tomcat-bundled version repackages > org.apache.commons.dbcp* to org.apache.tomcat.dbcp* and provides > the required jar in the classpath. > > If you want to use the Tomcat-bundled version, you need to get rid > of the commons dbcp jar (unless it is ancient, it will be named > commons-dbcp-1.x jar for x in {2, 2.1, 2.2, 3, 4}). > > For full instructions on using JDBC DataSources with Tomcat, see the > Tomcat web pages (select the version you are using and then JDBC > DataSources from the User Guide nav). > > Phil > > > > On Sat, May 7, 2011 at 12:01 PM, Micka wrote: > > > >> thx for the answer ! > >> > >> here is what i got now : > >> > >> java.lang.ClassCastException: > >> org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper > cannot > >> be cast to org.apache.tomcat.dbcp.dbcp.DelegatingConnection > >> > >> > >> 2011/5/6 Andr=C3=A9s M. Luna > >> > >> Hi Micka, > >>> Only put jar file "tomcat-dbcp.jar" into directory $CATALINA_HOME/lib > >>> > >>> Andres. > >>> > >>> -----Original Message----- > >>> From: Micka [mailto:mickamusset@gmail.com] > >>> Sent: viernes, 06 de mayo de 2011 12:16 p.m. > >>> To: user@commons.apache.org > >>> Subject: Tomcat6 > >>> > >>> Hello everyone, i've a problem with Tomcat6 under Ubuntu 10.04. > >>> > >>> My application is developped on windows, with apache tomcat 6.0.28 > >>> > >>> The application is running very well in windows environment. > >>> > >>> But when i'm trying to install it under Ubuntu : > >>> > >>> 1) I've stopped tomcat6 > >>> 2) I put my war file under /var/lib/tomcat6/webapps > >>> 3) I start tomcat6 > >>> > >>> and here is, what I got in my log : > >>> > >>> > >>> Exception in thread java.lang.NoClassDefFoundError: > >>> org/apache/tomcat/dbcp/dbcp/DelegatingConnection > >>> at Test.DataBaseConnector.connection(DataBaseConnector.java:13= 2) > >>> at Test.DataBaseConnector.(DataBaseConnector.java:84) > >>> at Test.Guardian_Process.run(Guardian_Process.java:112) > >>> at java.lang.Thread.run(Thread.java:662) > >>> *Caused by: java.lang.ClassNotFoundException: > >>> org.apache.tomcat.dbcp.dbcp.DelegatingConnection* > >>> at > >>> > >>> > org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.= java:1484) > >>> at > >>> > >>> > org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.= java:1329) > >>> ... 4 more > >>> > >>> > >>> I don't understand ! Is it because i'm developping my application und= er > >>> windows ? > >>> > >>> > >>> Thanks, > >>> > >>> > >>> --------------------------------------------------------------------- > >>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org > >>> For additional commands, e-mail: user-help@commons.apache.org > >>> > >>> > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@commons.apache.org > For additional commands, e-mail: user-help@commons.apache.org > > --20cf301d3c9e454e8504a2c81beb--