It seems that my Tomcat 6.0.28 has run into some problems. I was running an Servlet/JSP project in Eclipse today. And I found that its throwing some errors. I have made a post in the JDBC section as well.
http://www.coderanch.com/t/476480/JDBC/java/Unable-Load-Driver At first i thought that i must coded something wrong but it seems that all third party classes which need JARS to be added in the Classpath are causing the same problem!!! Now even the POI API is causing issues. although i have all the JARS added in the Classpath of the project.
Such libraries should be added to the WEB-INF/lib folder of the web app that uses them, not to Tomcat's lib folder.
well ulf.but most of the time[i experienced] it is not loaded by container. what could be the problem?.[example, i was tried this by jdbc-connector.jar]
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35237
7
posted
0
So, *is* the library in the WEB-INF/lib folder, and did you restart the web app after placing it there? Earlier you were talking about "classpath of the project" which sounds like an Eclipse thing that is irrelevant to Tomcat.
JDBC jars SHOULD usually be placed in TOMCAT_HOME/lib. Application-specific resources such as Apache POI SHOULD usually be placed in the WAR's WEB-INF/lib folder, since they're not intended to be server-shared resources nor to be accessible from subsystems outside the webapp (like JDBC connection pools).
Customer surveys are for companies who didn't pay proper attention to begin with.
Well that was the problem! Some idiot had deleted the lib folder from the WEB-INF over the weekend! I had placed all the jars there knew that they were there.
Somnath Mallick wrote:Some idiot had deleted the lib folder from the WEB-INF over the weekend!
Anyway thanks for that Idiot. because i get more clarification from this topic .
Theen-Theen Tan
Greenhorn
Joined: May 18, 2011
Posts: 1
posted
0
Caused by: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot load JDBC driver class 'oracle.jdbc.xa.client.OracleXADataSource'
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1136)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
at org.springframework.scheduling.quartz.LocalDataSourceJobStore$2.getConnection(LocalDataSourceJobStore.java:129)
at org.quartz.utils.DBConnectionManager.getConnection(DBConnectionManager.java:112)
at org.quartz.impl.jdbcjobstore.JobStoreCMT.getNonManagedTXConnection(JobStoreCMT.java:164)
... 71 more
Caused by: java.lang.ClassNotFoundException: oracle.jdbc.xa.client.OracleXADataSource
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1130)
My data sources and transactionmanager are declared in context.xml, and the beans that are failing to create is part of a Spring context of the application.
I am seeing the error above will all the transaction and oracle driver located in by WEB-INF/lib We do not want to have anything in tomcat/lib
Is it possible?
Thanks!
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.