Cannot Create Jdbc Driver of Class ' ' for Connect Url 'Null':I Do Not Understand This Exception

Cannot create JDBC driver of class ' ' for connect URL 'null' : I do not understand this exception

I can't see anything obviously wrong, but perhaps a different approach might help you debug it?

You could try specify your datasource in the per-application-context instead of the global tomcat one.

You can do this by creating a src/main/webapp/META-INF/context.xml (I'm assuming you're using the standard maven directory structure - if not, then the META-INF folder should be a sibling of your WEB-INF directory). The contents of the META-INF/context.xml file would look something like:

<?xml version="1.0" encoding="UTF-8"?>

<Context [optional other attributes as required]>

<Resource name="jdbc/PollDatasource" auth="Container"
type="javax.sql.DataSource" driverClassName="org.apache.derby.jdbc.ClientDriver"
url="jdbc:derby://localhost:1527/poll_database;create=true"
username="suhail" password="suhail" maxActive="20" maxIdle="10" maxWait="-1"/>
</Context>

Obviously the path and docBase would need to match your application's specific details.

Using this approach, you don't have to specify the datasource details in Tomcat's context.xml file. Although, if you have multiple applications talking to the same database, then your approach makes more sense.

At any rate, give this a whirl and see if it makes any difference. It might give us a clue as to what is going wrong with your approach.

nested exception is java.sql.SQLException: Cannot create JDBC driver of class '' for connect URL 'null' - Spring MVC JNDI issue

In Server.xml place resource under <GlobalNamingResources>

<GlobalNamingResources>
<Resource auth="Container"
driverClassName="com.mysql.jdbc.Driver"
maxActive="20" maxIdle="10"
maxWait="-1"
name="jdbc/UsersDB"
type="javax.sql.DataSource"
username="root" password="root"
url="jdbc:mysql://localhost:3306/test" />
</GlobalNamingResources>

In Context.xml

<ResourceLink global="jdbc/UsersDB" name="jdbc/UsersDB" auth="Container" type="javax.sql.DataSource"/>

Cannot create JDBC driver of class '' for connect URL 'null'

In order to get all 3 webapps to use the same datasource properly, I had to move all my <Resource> entries from the META-INF/context.xml folder into the server's $CATALINA_BASE/conf/context.xml folder. Not a great solution, but it works.

Cannot create JDBC driver of class '' for connect URL 'null all the time

Ok I found solution... The thing is my META-INF with context.xml was in C:\Users\lukas\eclipse-workspace\ParkingBookSystem\src\main\resources\META-INF\context.xml when I put it into the:
C:\Users\lukas\eclipse-workspace\ParkingBookSystem\src\main\webapp
it started to work.

Cannot create JDBC driver of class for connect URL null

No suitable driver means that when you try to run, it isn't able to find the .jar file with the driver.

Before you reinstalled mac os, your driver (the jar file) was linked to your program somehow. My assumption is that this driver was deleted or moved and now your program cannot find it. How are you building your program? With Maven or another builder? A builder like Maven can handle stuff like this for you.

Regardless, in intelliJ, add your driver to your project again. Here are the screens (data sources and drivers screen) where you can configure and add your driver in intelliJ.
In this first, you can add a connection with the green plus in the top left corner or pick your DB from the list on the left and set it up. You can select the driver on the page and follow the steps to make it happen.
Data sources pic 1
In the second you can see the blue mySQL link for the driver. Make sure you have a driver here or with an already established connection you can click here to add the driver.
Data sources pic 2
Driver downloads if you are looking can easily be googled and downloaded for the different DBs if you need them.

How to resolve Cannot create JDBC driver of class 'com.mysql.jdbc.Driver' for connect URL

The JDBC URL is not correct, indeed you have a missing slash so try this:

jdbc:mysql://localhost:3306/autopark

If you check well the real error is No suitable driver which means that it cannot find any JDBC driver that supports the provided URL.

Cannot create JDBC driver of class for connect URL 'null'

You need to integrate Tomcat with iBatis using a configuration similar to the one mentioned below:

<transactionManager type="JDBC" >
<dataSource type="JNDI">
<property name="DBJndiContext" value="jdbc/nombreBD"/>
</dataSource>
</transactionManager>

Check this to learn more about it.

Tomcat 8 - java.sql.SQLException: Cannot create JDBC driver of class '' for connect URL 'jdbc:mysql://xxx/myApp'

Looks like you are doing all fine, so:

driverClassName="com.mysql.jdbc.Driver" (the capitals may matter).

You place the mysql-connector-java-5.1.34-bin.jar (it has to have jar extension to be detected in tomcat/lib (dont put it on your webapp path it should be loaded by tomcat class loader).

If it is not helping and you are starting your webapp from IDE. Try to start tomcat form console and deploy your app manually. If you have more than one tomcat installed make sure that CATALINA_HOME is set to the one you place your mysql jar.



Related Topics



Leave a reply



Submit