Issue Details (XML | Word | Printable)

Key: DBUTILS-2
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Jason Anderson
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Commons DbUtils

[dbutils] QueryLoader cannot locate properties file on weblogic

Created: 10/Sep/04 11:19 PM   Updated: 02/Jan/08 07:29 AM
Return to search
Component/s: None
Affects Version/s: 1.0
Fix Version/s: 1.1

Time Tracking:
Not Specified

Environment:
Operating System: other
Platform: Other

Bugzilla Id: 31169


 Description  « Hide
QueryLoader uses QueryLoader.class.getResourceAsStream(path) which looks for a
resource relative to the current class (QueryLoader), you can use / to indicate
classpath root but this does not work with weblogic possibly due to the way in
which weblogic manages the classpath for .war files.

If I use getClass().getClassLoader().getResourceAsStream(path) instead and dont
use leading / for the path then this works locally and for weblogic.

See method: loadQueries(String path)



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
David Graham added a comment - 03/Oct/04 11:47 PM
The problem is that current users have a leading / in the path so changing this
would be backwards incompatible. I did change
QueryLoader.class.getResourceAsStream(path) to
getClass().getResourceAsStream(path) so that if you're using a subclass of
QueryLoader you will use whatever ClassLoader loaded your subclass instead of
the one that loaded QueryLoader.

You might try writing and using an empty subclass of QueryLoader to see if this
change fixes the issue. If not, loadQueries() is now protected so you could
override loadQueries() and change how the ClassLoader is handled (COM-1607).

Also, it seems that for this problem to occur in WebLogic you must have
commons-dbutils.jar someplace other than your app's WEB-INF/lib directory. If
it's in some shared directory that WebLogic loads with a different ClassLoader
than WEB-INF/lib jars, this problem is almost certain to happen. Try placing
commons-dbutils.jar in your WEB-INF/lib directory.


Henri Yandell made changes - 16/May/06 09:45 AM
Field Original Value New Value
issue.field.bugzillaimportkey 31169 12341714
Henri Yandell made changes - 16/May/06 11:29 AM
Affects Version/s 1.0 Final [ 12311651 ]
Assignee Jakarta Commons Developers Mailing List [ commons-dev@jakarta.apache.org ]
Key COM-1562 DBUTILS-2
Project Commons [ 12310458 ] Commons DbUtils [ 12310470 ]
Component/s DbUtils [ 12311110 ]
Henri Yandell made changes - 16/May/06 12:20 PM
Affects Version/s 1.0 Final [ 12311724 ]
Henri Yandell made changes - 06/Jul/06 11:36 AM
Fix Version/s 1.1 [ 12311973 ]
Henri Yandell made changes - 02/Jan/08 07:29 AM
Status Resolved [ 5 ] Closed [ 6 ]