Bugs item #1005271, was opened at 2004-08-07 21:41
Message generated for change (Comment added) made by ejort
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=1005271&group_id=22866

Category: JBossCX
Group: v3.2
Status: Closed
Resolution: Wont Fix
Priority: 5
Submitted By: Tim McCune (javajedi)
Assigned to: Adrian Brock (ejort)
Summary: Incorrect "Apparently wrong driver class specified" error

Initial Comment:
Environment: JBoss 3.2.3, Linux 2.4.20, JDK 1.4.2_01.

I just started working with Oracle.  I have the Oracle
JDBC drivers (version 9.2.0.3) bundled inside my ear. 
I also have my own loader-repository set up inside
jboss-app.xml.  When I deploy my ear, I get a
JBossResourceException thrown from line 287 of
LocalManagedConnectionFactory, "Apparently wrong driver
class specified for URL".  The exception shows my
Oracle driver and Oracle URL, which are both correct. 
It looks like this is some kind of class-loading bug
and the call to isDriverLoadedForURL is returning false
even though the driver is available.  I replaced line
287, which throws the exception at the end of the
method, with the line:

return driver;

and everything is working fine now.

----------------------------------------------------------------------

>Comment By: Adrian Brock (ejort)
Date: 2004-08-23 19:42

Message:
Logged In: YES 
user_id=9459

I haven't reported the java.sql.DriverManager problem to Sun.

JBoss already has a number of workarounds for the
Class.forName()
caching, but this one cannot be bypassed because the only
guaranteed way to get a jdbc driver instance is through the
java.sql.DriverManager

The actual code looks like some half-arsed attempt to fix a
security
problem in applets when using jdbc drivers, but it completely
breaks under more complicated classloading topologies.

There is one workaround that has worked for others before, 
which is to create your own loader repository to isolate
classes, 
then put the jdbc driver and a copy of jboss's local rar
inside that loader
repository, i.e. inside the ear.
But, I don't know what would happen if you try to redeploy
the ear.

You can find a previous thread on this workaround on the
jboss-user
mailing list around early 2003, with more information.

It works because the bug depends upon which classloader
loads the class that executes the DriverManager methods.

----------------------------------------------------------------------

Comment By: Tim McCune (javajedi)
Date: 2004-08-23 19:06

Message:
Logged In: YES 
user_id=62441

Then has this bug in java.sql.Driver been filed somewhere on
Sun's Bug Parade?

----------------------------------------------------------------------

Comment By: Adrian Brock (ejort)
Date: 2004-08-23 17:20

Message:
Logged In: YES 
user_id=9459

The bug is in java.sql.Driver 
(it does some horrible caching of classloaders in java 1.4).

If you change Sun's class to use
Thread.currentThread().getContextClassLoader()
instead of Class.forName() it will work.
But then you also break your license to use the jdk.

The jboss code cannot be changed, because it works around 
bugs in other jdbc drivers. 

That doesn't stop you changing it locally.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=1005271&group_id=22866


-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to