Jonas N
Jonas N

Reputation: 1777

MySQL on JBoss7: DriverManager says caller does not have permission to load driver

got some problems deploying a java web application on jboss 7.1...

Stepped through the code and it seems that classloading is involved; causing the scan to simply skip driver/s:

// java.sql.DriverManager
for (int i = 0; i < drivers.size(); i++) {
    DriverInfo di = (DriverInfo)drivers.elementAt(i);

    // If the caller does not have permission to load the driver then 
    // skip it.
    if ( getCallerClass(callerCL, di.driverClassName ) != di.driverClass ) {
    println("    skipping: " + di);
    continue;
    }
    [...]
}

The drivers are, on first round "org.h2.Driver" (built-in to jboss, right?), and on second round it's "com.mysql.jdbc.Driver". Both get skipped, resulting in "No suitable driver found". So, the question is: what's going on here? It's a war project, built with Maven. All libraries end up in META-INF/lib, including 'mysql-connector-java-5.1.6.jar'. Is it specific to JBoss7?

Thanks for any help, j

Upvotes: 2

Views: 401

Answers (1)

kraftan
kraftan

Reputation: 6312

I suggest, you install the MySQL driver as a JBoss module and add the datasource to your JBoss configuration. For that, I used the reference manual.

Upvotes: 3

Related Questions