×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Cannot create JDBC driver of class '' for connect URL 'jdbc:mysql...

Cannot create JDBC driver of class '' for connect URL 'jdbc:mysql...

Cannot create JDBC driver of class '' for connect URL 'jdbc:mysql...

(OP)
Hello
I try to get to a local MySQLDB by struts (1.2), Tomcat 5.0.16

I declare the data-source in the struts-config.xml. The DB-Driver is installed in the lib-directory of the webapps

struts-config.xml:

<data-sources>
   <data-source
         className="org.apache.struts.config.DataSourceConfig"
         type="org.apache.commons.dbcp.BasicDataSource"
         key="org.apache.struts.Globals.DATA_SOURCE_KEY"
         >
     <set-property property="autoCommit"
                      value="false"/>
     <set-property property="description"
                      value="Example Data Source Configuration"/>
     <set-property property="driverClass"
                      value="org.gjt.mm.mysql.Driver"/>
     <set-property property="maxCount"
                      value="4"/>
     <set-property property="minCount"
                      value="2"/>
     <set-property property="password"
                      value="....."/>
     <set-property property="url"
                      value="jdbc:mysql://localhost/test"/>
     <set-property property="user"
                      value="....."/>
   </data-source>
 </data-sources>


I get an Error-Message in the stdout.log:
16.01.2004 21:56:07 org.apache.struts.action.ActionServlet initModuleDataSources
SCHWERWIEGEND: Initializing application data source org.apache.struts.Globals.DATA_SOURCE_KEY
org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'jdbc:mysql://localhost/test', cause:
java.sql.SQLException: No suitable driver
    at java.sql.DriverManager.getDriver(Unknown Source)
    at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:743)
    at org.apache.commons.dbcp.BasicDataSource.setLogWriter(BasicDataSource.java:576)
    at org.apache.struts.action.ActionServlet.initModuleDataSources(ActionServlet.java:816)
    at org.apache.struts.action.ActionServlet.init(ActionServlet.java:389)
    at javax.servlet.GenericServlet.init(GenericServlet.java:256)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1044)
    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:887)
    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3948)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4271)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:866)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:850)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
    at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:316)
    at org.apache.catalina.core.StandardHost.install(StandardHost.java:859)
    at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:723)
    at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:473)
    at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1002)
    at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:393)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:166)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1133)
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:816)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1125)
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:518)
    at org.apache.catalina.core.StandardService.start(StandardService.java:519)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:2343)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:297)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:398)


Why does it not find the class? What else do I have to do to get it working?

Thanks for helping

RE: Cannot create JDBC driver of class '' for connect URL 'jdbc:mysql...

(OP)
Thanks for your reply. I found the error last night after posting my message.
I have to use the property="driverClassName" instead of property="driverClass"

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close