Ubuntu Tomcat7 java.lang.ClassNotFoundException: org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory -



Ubuntu Tomcat7 java.lang.ClassNotFoundException: org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory -

i'm trying set jdbc datasource in tomcat 7 under ubuntu 12.x, added next context.xml file:

<resource name="jdbc/myds" auth="container" type="javax.sql.datasource" maxactive="5" maxidle="2" maxwait="5000" driverclassname="org.postgresql.driver" username="usr" password="***" url="jdbc:postgresql://localhost:5432/db" />

obviously, using right , tested database user id , password. when restart tomcat, error:

feb 05, 2013 1:10:01 pm org.apache.catalina.core.namingcontextlistener addresource warning: failed register in jmx: javax.naming.namingexception: not create resource mill instance [root exception java.lang.classnotfoundexception: org.apache.tomcat.dbcp.dbcp.basicdatasourcefactory]

i googled, , found out jdbc driver has copied $catalina_home/lib folder, copied postgresql-9.2-1000.jdbc4.jar /usr/share/tomcat7/lib, didn't help. tried copying file other locations, same results.

another effort alter tomcat-dbcp.jar symlink in /usr/share/tomcat7/lib ../../java/tomcat-dbcp-7.0.30.jar ../../java/tomcat-dbcp.jar. alter got 1 warning instead of four, datasource doesn't work either.

java version:

jdoe@sever:~$ java -version java version "1.7.0_09" openjdk runtime environment (icedtea7 2.3.4) (7u9-2.3.4-0ubuntu1.12.10.1) openjdk 64-bit server vm (build 23.2-b09, mixed mode)

any hint, welcomed.

cheers.

the library tomcat-dbcp-7.0.30.jar repositories corrupted.

replace with:

sudo wget -o /usr/share/java/tomcat-dbcp-7.0.30.jar http://search.maven.org/remotecontent?filepath=org/apache/tomcat/tomcat-dbcp/7.0.30/tomcat-dbcp-7.0.30.jar

tomcat ubuntu jdbc datasource tomcat7

Comments

Popular posts from this blog

javascript - mongodb won't find my schema method in nested container -

Hibernate criteria by a list of natural ids -

ios - Lagging ScrollView with UIWebview inside -