bpurcell.org - Debugging Tip: Identifying Which Jar file a class was loaded from in ColdFusion MX
Calendar
SunMonTueWedThuFriSat
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31  

Subject Archives
Amazon EC2 (15)
ColdFusionMX (155)
Corvette (3)
Flash Lite (4)
Flash Media Server (5)
Flash Player (3)
Flex (39)
General Web Dev (14)
HDTV (3)
Jboss (1)
Jquery (2)
JRun (59)
Max 2003 (3)
Other (33)
PC Hardware (16)
Software (17)
SpatialKey (7)
Wireless (8)
Working Out (1)

RSS Feed
Feed Listing

Site Contents
Home
My Blog
ColdFusion
JRun
Flex
Wireless & Networking
Hardware & Gadgets
HDTV
Software Picks
Pictures
Contact Me
Search


My Articles & Papers
Flex Performance
Server/Client
mm.com Under the Hood
Multiple Instances of CFMX
Multiple Instance Config
NLB with ColdFusion
Clustering CFMX for J2EE
Multi-Tier Hardware LB w CFMX
Cisco CSS & Coldfusion MX
JRun 4 Jini based Clustering
WiFi Growth

2ID Tacweb

Other Hobbys
Body-For-Life Challenge

Personal Projects
Family Pool
Deck Gate

username:
password:
 

 
Viewing Individual Entry / Main
December 3, 2003

I ran into a case where a developer was having issues with the Oracle driver packaged with CF.  This is a known issue and the workaround is to move back to the U3+ drivers.  After following replacing the macromedia_drivers.jar in JRun4\lib the problem still exhibited itself so the thought was that the drivers did not fix the problem.  My thought was that the problematic drivers were still being loaded from some other location.  There is an easy way to determine this in ColdFusion using the Java API.  Here is the code:

<cfoutput>
<cfset resource="macromedia/jdbc/oracle/OracleDriver.class">
#resource#: [#resolveResource(resource)#]<br>
</cfoutput>

<cffunction name="resolveResource" returnType="string">
<cfset var resourceURL = getClass().getClassLoader().getResource(resource)>
<cfif isDefined("resourceURL")>
<cfreturn resourceURL>
</cfif>
<cfreturn "could not resolve resource">
</cffunction>

This code will return the location of the Jar file that is loading the class, and it output the following on my machine:

 macromedia/jdbc/oracle/OracleDriver.class: [ jar:file:/C:/JRun4/servers/latestcfbuild/cfusion/WEB-INF/cfusion/lib/macromedia_drivers.jar!/macromedia/jdbc/oracle/OracleDriver.class]

This told me that the drivers were being loaded from another location and they needed to update that Jar instead. 

Comments

test comment


 
Page Render Time:203