commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Micka <mickamus...@gmail.com>
Subject Re: Tomcat6
Date Sun, 08 May 2011 18:44:01 GMT
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.java:1484)
        at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java: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 = ((DelegatingConnection) conn).getInnermostDelegate();*
*<== HERE*
System.out.println("test 2");
 ((org.postgresql.PGConnection)dconn).addDataType("geometry",org.postgis.PGgeometry.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 <phil.steitz@gmail.com> 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 :
> >
> > <Context reloadable="false">
> >   <Resource name="jdbc/Pool"
> >     auth="Container"
> >     type="javax.sql.DataSource"
> >     maxActive="100"
> >     maxIdle="30"
> >     maxWait="20000"
> >     logAbandoned="true"
> >     removeAbandoned="true"
> >     removeAbandonedTimeout="10"
> >     testOnBorrow="true"
> >     validationQuery="SELECT 1"
> >     validationInterval="30000"
> >     username="toto"
> >     password="toto"
> >     accessToUnderlyingConnectionAllowed="true"
> >     driverClassName="org.postgresql.Driver"
> >     url="jdbc:postgresql://172.17.100.14/D_L?autoReconnect=true"
> >   />
> >
> > </Context>
> >
>
> 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 <mickamusset@gmail.com> 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és M. Luna <andres@digiworks.com.mx>
> >>
> >> 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:132)
> >>>        at Test.DataBaseConnector.<init>(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 under
> >>> 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
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message