Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

A question about ClassLoader

 
kong song
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 20606
60
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic