contextclassloader

Thread.getContextClassLoader() == null ?

Can Thread.getContextClassLoader() be null ? The javadoc is not really clear. Should a library take this case into account ? Update: the reason I asked is that beansbinding.dev.java.net dus not work in this case (and my code does setContextClassLoader(null) ...

How can I safely solve this Java context classloader problem?

One and only one of my hundreds of users has trouble starting my Java desktop app. It only starts for him about one-third of the time. The other two-thirds of the time a NullPointerException is thrown at startup: Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at java.util.Hashtable.put(Hashtable.java:394) ...

Why can't java use thread context classloader when a method is literally called?

I've written a custom classloader 'JarClassLoader', which itself works ok, since the following test case is green: public void testJarClassLoader() throws Exception { JarClassLoader cl = new JarClassLoader(); cl.addURLsByClassPath("lib/a-lot-of-jars.jar|lib/more-jars.jar", "\\|"); Class c = cl.loadClass("com.packagepath.cla...

Crazy ClassLoader question

The classes: public interface Inter { ...some methods... } public class Impl implements Inter { ...some implementations... } The issue is that for some freaky reason, I have to load the interface Inter with child ClassLoader and the implementation class Impl with parent ClassLoader. In this case I will get NoClassDefError, becau...