I am trying to add the removeAbandoned attribute to a resource in an environment running Tomcat 5.5. Before adding this attribute, the servlet running in this environment works fine. As soon as I add the attribute an exception is thrown as follows:
EXCEPTION javax.naming.NamingException: No set method found for property: removeAbandoned.
I do not understand why this is happenning. As soon as I remove the attribute, the servlet works again.
Below is the entire Context tag as it appears in my environment:
<Context path="/emscribe" docBase="emscribe" debug="0" reloadable="true"
crossContext="true">
<Logger className="org.apache.catalina.logger.FileLogger" prefix="emscribe_log."
suffix=".txt" timestamp="true"/>
<Resource name="jdbc/emscribe" auth="Container"
type="com.mchange.v2.c3p0.ComboPooledDataSource" driverClass="com.mysql.jdbc.Driver"
maxPoolSize="100" minPoolSize="5"
acquireIncrement="5" removeAbandoned="true"
user="aUserID"
password="aPassword"
factory="org.apache.naming.factory.BeanFactory"
jdbcUrl="jdbc:mysql://127.000.71.101/emscribedx?autoReconnect=true"
/>
Your exception:
states that it can’t find a method
getRemoveAbandoned()andsetRemoveAbandoned(boolean removeAbandoned)from the type specified in your resource.The
removeAdandonedproperty can only be used with Apache DBCP BasicDataSource.So, your resource
jdbc/emscribetype must not becom.mchange.v2.c3p0.ComboPooledDataSourcebut ratherorg.apache.commons.dbcp.BasicDataSource.Hope this helps.