This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Threads and Synchronization and the fly likes A question about ClassLoader Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Threads and Synchronization
Bookmark "A question about ClassLoader" Watch "A question about ClassLoader" New topic
Author

A question about ClassLoader

kong song
Greenhorn

Joined: May 12, 2009
Posts: 13
Hi all:

The following code is extracted from org.apache.commons.chain.CatalogFactory source code.

Who can tell me under what conditions, Thread.currentThread().getContextClassLoader()==null,and fall down to execute

Why did it do this ?
Thanks for any comments !

Basell
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19656
    
  18

From the Javadoc of Thread.getContextClassLoader():
Returns:
the context ClassLoader for this Thread, or null indicating the system class loader (or, failing that, the bootstrap class loader)


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: A question about ClassLoader
 
Similar Threads
Loading POJO object without loading library first
Determining the active log4j.properties file
How to determine the current path of the classloader
Can you explain me this code ??
externalize message from ejb to a xml or text file