tomcat7 connection pool error -
when start tomcat7.0_26 on ubuntu 12/jdk7 (running on vm/virtual box), keep getting following error datasourcefactory in catalina.out file in logs directory. ideas how can resolved? have copied relevant server.xml , context.xml portions below well. able connect postgres db supplied username/pwd combination.
server.xml:
<resource type="javax.sql.datasource" name="jdbc/db" factory="org.apache.tomcat.jdbc.pool.datasourcefactory" driverclassname="org.postgresql.driver" url="jdbc:postgresql://localhost:5432/dbname" username="database-user" password="database-user-pwd" testwhileidle="true" testonborrow="true" testonreturn="false" validationquery="select 1" validationinterval="30000" timebetweenevictionrunsmillis="30000" maxactive="100" minidle="10" maxwait="10000" initialsize="10" removeabandonedtimeout="60" removeabandoned="true" logabandoned="true" minevictableidletimemillis="30000" jmxenabled="true"
context.xml
<context> <!-- default set of monitored resources --> <watchedresource>web-inf/web.xml</watchedresource> <!-- uncomment disable session persistence across tomcat restarts --> <!-- <manager pathname="" /> --> <!-- uncomment enable comet connection tacking (provides events on session expiration webapp lifecycle) --> <!-- <valve classname="org.apache.catalina.valves.cometconnectionmanagervalve" /> --> <resourcelink type="javax.sql.datasource" name="jdbc/db" global="jdbc/db"/> </context>
catalina.out:
aug 15, 2013 3:39:22 pm org.apache.catalina.startup.catalina load info: initialization processed in 1052 ms aug 15, 2013 3:39:22 pm org.apache.catalina.core.namingcontextlistener addresource warning: failed register in jmx: javax.naming.namingexception: not load resource factory class [root exception java.lang.classnotfoundexception: org.apache.tomcat.jdbc.pool.datasourcefactory] aug 15, 2013 3:39:22 pm org.apache.catalina.mbeans.globalresourceslifecyclelistener creatembeans severe: exception processing global jndi resources javax.naming.namingexception: not load resource factory class [root exception java.lang.classnotfoundexception: org.apache.tomcat.jdbc.pool.datasourcefactory] @ org.apache.naming.factory.resourcefactory.getobjectinstance(resourcefactory.java:84) @ javax.naming.spi.namingmanager.getobjectinstance(namingmanager.java:321) @ org.apache.naming.namingcontext.lookup(namingcontext.java:843) @ org.apache.naming.namingcontext.lookup(namingcontext.java:154) @ org.apache.naming.namingcontextbindingsenumeration.nextelementinternal(namingcontextbindingsenumeration.java:119) @ org.apache.naming.namingcontextbindingsenumeration.next(namingcontextbindingsenumeration.java:73) @ org.apache.naming.namingcontextbindingsenumeration.next(namingcontextbindingsenumeration.java:36) @ org.apache.catalina.mbeans.globalresourceslifecyclelistener.creatembeans(globalresourceslifecyclelistener.java:140) @ org.apache.catalina.mbeans.globalresourceslifecyclelistener.creatembeans(globalresourceslifecyclelistener.java:147) @ org.apache.catalina.mbeans.globalresourceslifecyclelistener.creatembeans(globalresourceslifecyclelistener.java:112) @ org.apache.catalina.mbeans.globalresourceslifecyclelistener.lifecycleevent(globalresourceslifecyclelistener.java:84) @ org.apache.catalina.util.lifecyclesupport.firelifecycleevent(lifecyclesupport.java:119) @ org.apache.catalina.util.lifecyclebase.firelifecycleevent(lifecyclebase.java:90) @ org.apache.catalina.util.lifecyclebase.setstateinternal(lifecyclebase.java:401) @ org.apache.catalina.util.lifecyclebase.setstate(lifecyclebase.java:346) @ org.apache.catalina.core.standardserver.startinternal(standardserver.java:725) @ org.apache.catalina.util.lifecyclebase.start(lifecyclebase.java:150) @ org.apache.catalina.startup.catalina.start(catalina.java:645) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:57) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:43) @ java.lang.reflect.method.invoke(method.java:616) @ org.apache.catalina.startup.bootstrap.start(bootstrap.java:322) @ org.apache.catalina.startup.bootstrap.main(bootstrap.java:450) caused by: java.lang.classnotfoundexception: org.apache.tomcat.jdbc.pool.datasourcefactory @ java.net.urlclassloader$1.run(urlclassloader.java:217) @ java.security.accesscontroller.doprivileged(native method) @ java.net.urlclassloader.findclass(urlclassloader.java:205) @ java.lang.classloader.loadclass(classloader.java:321) @ java.lang.classloader.loadclass(classloader.java:266) @ org.apache.naming.factory.resourcefactory.getobjectinstance(resourcefactory.java:82) ... 23 more
you seem missing jar file tomcat-jdbc.jar
. not included default in standard debian/ubuntu package. can download maven central.
Comments
Post a Comment