about semantic web, software architecture and life in general

Post details: Java Class Loaders

2005-04-26

Permalink 22:50:57, Categories: Software Development   English (EU)

Java Class Loaders

Here are some tricks you can perform with your own class loaders:

- search a database instead of a filesystem for classes
- load different classes with the same fully-qualified name
- swap your classes with new versions at runtime
- load classes before you need them

JDK 1.4 + Tomcat Normal Edition + your own XML parser

... your web applications will not be using JDK 1.4 XML parser, but Tomcat's Xerces parser instead.

If you want to use your own XML parser shared across multiple web applications, you could place it in the shared class loader path, but because the common class loader is higher in the delegation chain, Tomcat's parser will be used first.

To solve this problem you could either use ... or move xerces.jar from the common class loader path to the system class loader path, which would make it available to Tomcat but invisible to your application.

More reading:

- ClassLoader JavaDoc
- JavaGeeks papers section - has a few white papers related to class loaders.

From Professional Apache Tomcat book.

Comments, Pingbacks:

Comment from: Joseph [Visitor]
I would like to congratulate you by this wonderful article! The world needs people like you, with front-end ideas. I work with hospedagem gratis, hospedagem php, hospedagem jsp, hospedagem java and hospedagem de sites in Brazil. Peace in your heart. Joseph.
PermalinkPermalink 2006-06-16 @ 01:52
Comment from: Cristian [Visitor] · http://www.gaming-pc.net
Java has unsolved issues and many programmers just use php instead because the efficiency is higher and of course your problems can be solved much faster with php.
PermalinkPermalink 2008-07-03 @ 10:38
Comment from: Reese [Visitor] Email · http://piercing.optdvd.com
I have analyzed your article, thanks for these recommendations. I have read your links too. This information will be useful for my job. I have used your detailed tricks. Thanks.
PermalinkPermalink 2008-08-29 @ 22:04

This post has 4 feedbacks awaiting moderation...

Leave a comment:

Your email address will not be displayed on this site.
Your URL will be displayed.

Allowed XHTML tags: <p, a, ul, ol, li, dl, dt, dd, address, blockquote, ins, del, span, bdo, br, em, strong, dfn, code, samp, kdb, var, cite, abbr, acronym, q, sub, sup, tt, i, b, big, small>
(Line breaks become <br />)
(Set cookies for name, email and url)
(Allow users to contact you through a message form (your email will NOT be displayed.))

captsolo weblog

See also:

May 2012
Mon Tue Wed Thu Fri Sat Sun
 << <   > >>
  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      
Last comments

Search

Gallery

www.flickr.com
captsolo's items Go to captsolo's photostream

Misc

Syndicate this blog XML

powered by
b2evolution
Page served in 0.443 seconds

Valid XHTML 1.0! Valid CSS! Valid RSS! Valid Atom!