Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ClassLoaders

 
David Ulicny
Ranch Hand
Posts: 724
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
is there any possibility to see classes within System classloader?
I mean if it is possible from code.
Thanks
 
Ko Ko Naing
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
David Ulicny
Ranch Hand
Posts: 724
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 724
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1312
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
David Ulicny
Ranch Hand
Posts: 724
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I mean this Java code


will it show to me the system classloader from that picture?
 
Ko Ko Naing
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic