Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic


Sanjay Deshpande
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have following setting in struts-config.xml
description="Second Database Config"
When i start tomcat i get following error:
8000 [main] ERROR action.ActionServlet - Initializing application data source database
java.sql.SQLException: Cannot load JDBC driver class 'null'
at org.apache.commons.dbcp.BasicDataSource.createDataSource(
at org.apache.commons.dbcp.BasicDataSource.setLogWriter(
at org.apache.struts.action.ActionServlet.initModuleDataSources(
at org.apache.struts.action.ActionServlet.init(
at javax.servlet.GenericServlet.init(
at org.apache.catalina.core.StandardWrapper.loadServlet(
at org.apache.catalina.core.StandardWrapper.load(
at org.apache.catalina.core.StandardContext.loadOnStartup(
at org.apache.catalina.core.StandardContext.start(
at org.apache.catalina.core.ContainerBase.start(
at org.apache.catalina.core.StandardHost.start(
at org.apache.catalina.core.ContainerBase.start(
at org.apache.catalina.core.StandardEngine.start(
at org.apache.catalina.core.StandardService.start(
at org.apache.catalina.core.StandardServer.start(
at org.apache.catalina.startup.Catalina.start(
at org.apache.catalina.startup.Catalina.execute(
at org.apache.catalina.startup.Catalina.process(
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
at java.lang.reflect.Method.invoke(
at org.apache.catalina.startup.Bootstrap.main(
8703 [main] INFO http11.Http11Protocol - Starting Coyote HTTP/1.1 on port 8080

Any solution ?
Tiago Fernandez
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don' know why that's happening, but when I use DataSource in struts-config.xml, I do something like this:
<data-source key="MySQL-DS">
<set-property property="driverClass" value="" />
<set-property property="url" value="jdbc:mysql://localhost:3306/struts" />
<set-property property="maxCount" value="20" />
<set-property property="minCount" value="1" />
<set-property property="user" value="root" />
<set-property property="password" value="" />
Do you have the correct MySQL JAR file in your /WEB-INF/lib?
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic