It means the driver-class/url are incompatible.
I've also seen this problem when there is an internal problem within the driver,
e.g. classes missing or other bizarre internal error.
Put the proper driver jar file in server/default/lib folder of JBoss installation folder.
Even I face the same problem
I am also getting the same problem, however , be it the first or the second Time I keep on getting The above error(Apparent wrong driver)
In my case if I connect Directly using DriverManager.getConnection() , then I am able to connect to the DataBase, but when i try using Connection Pooling i.e ds.xml and then Look up, I get this error.
I use following url in ds.xml,
Plese let me know if this is correct or not. I use following jars
My Problem is finally resolved. I switched over to jtds drivers (freeware) . I wasted 3 days trying with Microsoft Drivers and it Took only 5 mins for Connection Pooling using jtds drivers.
I was having the same problem and also switched to jtds, but the problem remains.
My connection is failing randomly with "Apparently wrong driver class specified for URL" error.
The connection will fail this way over and over again, then will randomly begin to work. It's maddening! Is anyone else experiencing this?
I am running JBoss on Java 1.506, conncting to MSSQL with jtds 1.2 with the folloding datasource specifier:
sql to call on an existing pooled connection when it is obtained from pool
How are you deploying your datasource? Are any of the JDBC jars contained in the lib directory or your WAR? Do any of the JDBC jar files reside in an EAR?
Typically we see this error when a user tries to deploy the jars inside of an application archive and not in the server/server-config/lib directory.
Wow, that was a swift response! Turnaround time of 4 minutes - ought to be in an ad for JBoss....
Indeed, the jar file was being deployed in the WAR module. I removed it from the WAR and put in in the config/lib directory as specified, and it now seems to be working reliably.
Thank you very much for your help.
Not a problem :-)
Note, this is a bug in the DriverManager. Basically what is going on is some heinous cacheing of classes that prevents the class from being loaded. Supposedly this is addressed in JDBC 4.0. Also, the Class.forName("classname") mess goes away. The DriverManager will be able to load the classes automatically without the registration process.
I am getting this same error. My ear does'nt contain any jdbc.jar files.
Configuration is:jdk1.6.0_03, jboss-4.2.2.GA, MySQL version 5.0.45, MySQL driver
Though I am seeing C:\jboss-4.2.2.GA\server\default\tmp\deploy\tmp29174jboss-local-jdbc.rar-contents\jboss-local-jdbc.jar
file in tmp folder. Probably it is used by jboss. I am deploying ear in default server config.
04:23:10,942 INFO [InjectedDataSourceConnectionProvider] Using provided datasource
04:23:10,957 WARN [JBossManagedConnectionPool] Throwable while attempting to get a new connection: null
org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (org.jboss.resource.JBossResourceException: Apparently wrong driver class specified for URL: class: com.mysql.jdbc.Driver, url: jdbc:mysql//127.0.0.1:3306/Testworld)
Explain all the steps you have been doing , open a new thread I will address it there .
Your post does not clearly indicate how you are deploying the datasource , explain things in DETAIL and *NEVER* bloat the existing forum thread as it becomes difficult for people to indentify the current issue .
Sorry My Bad.
I was not giving correct jdbc url. IO missed : after mysql in url
In case anyone can get anything useful, I have an ear file that works well and very reliably (over 6 months) on my Linux server running JB 4.2.1.
This ear uses MS sql drivers and connects to MS SQL on mt 2003 SBS server.
When I move THE SAME distros of Java, JBoss, MS SQL drivers ear etc to the 2003 server running as localhost ... or to a DNS name or IP number on the WIn server , I get this message.
Theenvironments couldnt be more similar other than the one is Unix, the other WIn2003.
I'm about to check for copies of the drivers in the ear - they will, of course, be from the SAME DOWNLOAD from MS.
I've been having the same problem.
bhavinpmehta's advice solved the problem - so there must definitely be something wrong with some of Microsoft's JDBC drivers somewhere as I'm sure all the connection strings and things were right... *shrug*
This was with version 2.0.1008.2 of the Microsoft SQL Server 2005 driver.