commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Phil Steitz <phil.ste...@gmail.com>
Subject Re: Tomcat6
Date Sat, 07 May 2011 15:41:02 GMT
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
View raw message