Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Tomcat JDBC Error??

  • 26-11-2009 7:43pm
    #1
    Registered Users, Registered Users 2 Posts: 1,987 ✭✭✭


    Any ideas with the below error is occuring, can't figure it out at all?
    org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'
    at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1150)
    at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)


Comments

  • Registered Users, Registered Users 2 Posts: 3,766 ✭✭✭Reku


    Ziycon wrote: »
    Any ideas with the below error is occuring, can't figure it out at all?

    If I understand the first line correctly you're trying to establish a null connection, not a connection to a database, are your connect command inputs correct?
    The 2 other lines should point you towards problem points in your code where the issue has cropped up, it may be that one of them is the source of the exception.


  • Registered Users, Registered Users 2 Posts: 1,987 ✭✭✭Ziycon


    This is the connection string being used:
    jdbc:mysql://127.0.0.1/db1?jdbcCompliantTruncation=false&zeroDateTimeBehavior=convertToNull&characterEncoding=utf-8&mysqlEncoding=utf8
    


  • Registered Users, Registered Users 2 Posts: 3,766 ✭✭✭Reku


    I assume you have the database 'db1' and your mysql program active/running on the machine?
    Probably a stupid question but I'm afraid I'm not familiar with JDBC so my usefulness to you is rather limited.


  • Registered Users, Registered Users 2 Posts: 1,987 ✭✭✭Ziycon


    Yup database exists and mysql is running fine. Thanks anyway for your help.


  • Registered Users, Registered Users 2 Posts: 1,987 ✭✭✭Ziycon


    Ah, found the full stacktrace:
    [HTML]org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'
    at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1150)
    at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173)
    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993)
    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4149)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4458)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:722)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
    at org.apache.catalina.core.StandardService.start(StandardService.java:516)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:583)
    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:288)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
    Caused by: java.lang.NullPointerException
    at sun.jdbc.odbc.JdbcOdbcDriver.getProtocol(Unknown Source)
    at sun.jdbc.odbc.JdbcOdbcDriver.knownURL(Unknown Source)
    at sun.jdbc.odbc.JdbcOdbcDriver.acceptsURL(Unknown Source)
    at java.sql.DriverManager.getDriver(Unknown Source)
    at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1143)
    ... 21 more[/HTML]


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 2,013 ✭✭✭lynchie


    I assume you have your mysql java connector on the class path, i.e. in common\lib?


  • Registered Users, Registered Users 2 Posts: 1,987 ✭✭✭Ziycon


    I haven't added anything to the CLASSPATH, i have the mySQL connector jar in the Tomcat\lib\ directory??


  • Registered Users, Registered Users 2 Posts: 1,916 ✭✭✭ronivek


    The main issue appears to be that Tomcat doesn't know which JDBC Driver to use.

    This might be of some use.


Advertisement