Can I load classes from a specific jar file at runtime?
Henry Leung
Greenhorn
Joined: Oct 26, 2003
Posts: 24
posted
0
I have a web-app running on an app-server. The app-server has by default loaded an XML parser, but that's too old for my app. I want to use my own version of xerces.jar but I don't want to modify any server setting. So I wonder if it is possible to specify a file path for the targeted xerces.jar at runtime, let my web-app use that jar file's classes, and overrides the loaded ones by the app-server? Any such tricks can be done in the ClassLoader?
OK, it seems I misunderstood your question. Your app has its own version of xerces.jar, but you would like to override this at runtime with your own version of xerces.jar When you say 'the app server has its own version', you should be able to put your xerces.jsr in the web-inf/lib directory and have it loaded in preference to the one in the application server. (If you are refering to the deprecated files you may be a able to find a compatibility jar to bridge the gap) I'm not sure where these jar files are configured, but I hope this helps. Dave
Henry Leung
Greenhorn
Joined: Oct 26, 2003
Posts: 24
posted
0
Originally posted by David O'Meara: OK, it seems I misunderstood your question. Your app has its own version of xerces.jar, but you would like to override this at runtime with your own version of xerces.jar When you say 'the app server has its own version', you should be able to put your xerces.jsr in the web-inf/lib directory and have it loaded in preference to the one in the application server. (If you are refering to the deprecated files you may be a able to find a compatibility jar to bridge the gap) I'm not sure where these jar files are configured, but I hope this helps. Dave
The appserver I am using is JRun 3.0, and I found that the one in the application server is loaded in preference to the one in web-inf/lib....
subject: Can I load classes from a specific jar file at runtime?