Oct 14, 2008 9:16:16 PM org.apache.catalina.core.NamingContextListener addResource WARNING: Failed to register in JMX: javax.naming.NamingException: Could not load resource factory class [Root exception is java.lang.ClassNotFoundException: org.apache.commons.dbcp.BasicDataSourceFactory] Oct 14, 2008 9:16:16 PM org.apache.catalina.core.NamingContextListener addResource WARNING: Failed to register in JMX: javax.naming.NamingException: Could not load resource factory class [Root exception is java.lang.ClassNotFoundException: org.apache.commons.dbcp.BasicDataSourceFactory] Oct 14, 2008 9:16:16 PM org.apache.coyote.http11.Http11AprProtocol start INFO: Starting Coyote HTTP/1.1 on http-8080
what this error is about,
i added all required jar files still error is there..
I'm new to Java Web Development and had a very similar error, but for the life of me could not figure it out.
My setup was: Tomcat 6.0.14 MySQL Connector/J 5.1.6
I managed to get a test application working with the following settings in my application's META-INF/context.xml:
But could not get it working for my main application. I then decided to look and see if the context for my main application was being set anywhere else (such as in the Tomcat conf directory) and sure enough, there it was in the following directory:
using the attribute factory="org.apache.commons.dbcp.BasicDataSourceFactory" in the <Resource> element. This setting was part of a previous attempt of mine that failed since Tomcat 6 uses the factory org.apache.tomcat.dbcp.BasicDataSourceFactory. According to the Tomcat 6 documentation, Tomcat will load the XML file in $CATALINA_BASE/conf/[enginename]/[hostname]/ before it moves on the the application's META-INF directory if it doesn't find it. For some reason Tomcat was copying my application's META-INF/context.xml to that directory (strangely enough not my test application's though) and NOT refreshing every time I made changes in my application directory. Once I removed the mentioned xml and restarted the server, everything worked perfectly. But again, Tomcat has copied my (working) context.xml file to that directory, ready to give me another headache the next time I try to change my Resource settings... (any thoughts on how to stop this would be GREATLY appreaciated)