File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Tomcat and the fly likes ClassLoaders Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "ClassLoaders" Watch "ClassLoaders" New topic
Author

ClassLoaders

David Ulicny
Ranch Hand

Joined: Aug 04, 2004
Posts: 724
Hi,
is there any possibility to see classes within System classloader?
I mean if it is possible from code.
Thanks


SCJP<br />SCWCD <br />ICSD(286)<br />MCP 70-216
Ko Ko Naing
Ranch Hand

Joined: Jun 08, 2002
Posts: 3178
Originally posted by David Ulicny:
Hi,
is there any possibility to see classes within System classloader?
I mean if it is possible from code.
Thanks


What do u mean by "System ClassLoader"? Loading a class from an application in Tomcat or sthing? Could you elaborate more on what you mean by so-called System classloader?


Co-author of SCMAD Exam Guide, Author of JMADPlus
SCJP1.2, CCNA, SCWCD1.4, SCBCD1.3, SCMAD1.0, SCJA1.0, SCJP6.0
David Ulicny
Ranch Hand

Joined: Aug 04, 2004
Posts: 724
I mean this figure
http://jakarta.apache.org/tomcat/tomcat-5.5-doc/class-loader-howto.html
so this classloader which called there system.
Ko Ko Naing
Ranch Hand

Joined: Jun 08, 2002
Posts: 3178
System classloaders are provided to Tomcat as JAR files... You may want to unjar them to see the classes inside them... And if the source codes are not available in the JAR files, you might want to use decompiler to decompiler them into Java source files...

BTW, may I know what you want to do with the system class loaders?

No one wants to dig into Tomcat internal class loaders like this... People just use them as they are in Tomcat...
David Ulicny
Ranch Hand

Joined: Aug 04, 2004
Posts: 724
I only want to see what is loaded. Imagine that you have UnsatisfiedLinkError, so than you want to explore where are your classes loaded.
somkiat puisungnoen
Ranch Hand

Joined: Jul 04, 2003
Posts: 1312
Originally posted by David Ulicny:
I only want to see what is loaded. Imagine that you have UnsatisfiedLinkError, so than you want to explore where are your classes loaded.


This link
Class Loader How-to

will help you.


SCJA,SCJP,SCWCD,SCBCD,SCEA I
Java Developer, Thailand
David Ulicny
Ranch Hand

Joined: Aug 04, 2004
Posts: 724
I mean this Java code


will it show to me the system classloader from that picture?
Ko Ko Naing
Ranch Hand

Joined: Jun 08, 2002
Posts: 3178
Originally posted by David Ulicny:
I mean this Java code


will it show to me the system classloader from that picture?


You need to check the security manager's permission whether it is ok to access the system class loader or not... If not, the method will return null... You may want to check it out with the API to see how to achieve the things that you want from System Class Loader...

Just my 2 cents...
 
Don't get me started about those stupid light bulbs.
 
subject: ClassLoaders
 
Similar Threads
junit- why wont it run on dif. computer?
Problem using custom ClassLoader
Multiple Singleton instances.
Multiple loading of a class thru Class.forName() ??
Why does this happen?