RayofCommand
RayofCommand

Reputation: 4244

How to use CLASSPATH regarding to mysql drivers? "Could not find driver with class name: com.mysql.jdbc.Driver"

I am installing Atlassian Confluence on our Ubuntu 12.04 64bit Server. I downloaded a fully packed installation of Confluence and already installed it on a virtual machine for testing. Now I install it on the server and when it comes to Database configuration I choose MySQL and External DB. Then I get this error Could not find driver with class name: com.mysql.jdbc.Driver

So I downloaded the specific driver called mysql-connector-java-5.1.26 and put it in the location it should be in.

/opt/atlassian/confluence/confluence/WEB-INF/lib/mysql-connector-java-5.1.26-bin.jar

So far everything is clear, but now I have to configurate my CLASSPATH (and I don't understand what that is for now)

I went for sudo nano /etc/environment and that's what the file now looks like :

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
JAVA_HOME "/usr/lib/jvm/java-1.6.0-openjdk-amd64"
CLASSPATH="/opt/atlassian/confluence/confluence/WEB-INF/lib"

Since it is still not working (same error) , I want to know what I else have to do and maybe someone can explain me the process? Any help is upvoted!

Upvotes: 1

Views: 4920

Answers (4)

Randy B.
Randy B.

Reputation: 73

Not sure if this will help, but there is a typo in your /etc/environment file:

## You have (missing '=')...
#JAVA_HOME "/usr/lib/jvm/java-1.6.0-openjdk-amd64"
## Should be...
JAVA_HOME="/usr/lib/jvm/java-1.6.0-openjdk-amd64"

Upvotes: 0

jiang
jiang

Reputation: 170

It's been months and may be you have fixed this problem,

I would still like to leave my comment:


see https://confluence.atlassian.com/display/DOC/Database+Setup+For+MySQL notice that "Stop immediately after the installation, before opening the Confluence Setup Wizard in your browser" 。 I've got into a wrong order then, I fixed the problem by restart confluence using

service confluence restart

Upvotes: 0

user2728475
user2728475

Reputation:

This error comes when you miss a jar to provide appropriate driver class

try adding this dependency

<dependency>
    <groupId>mysql</groupId>
    <artifactId>mysql-connector-java</artifactId>
    <version>5.1.26</version>
</dependency>

or alternatively you can download jar and put it into your buildpath.

right click -> buildpath - > configure buildpath - > add external jars

Upvotes: 2

SpringLearner
SpringLearner

Reputation: 13844

You have to keep the mysql.jar in your server's lib folder

Upvotes: 1

Related Questions