Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#321 NullPointerException when beanshell is in bootclasspath

open
nobody
General (151)
5
2008-10-28
2008-10-28
Tobias Schulte
No

"new Interpreter()" fails with NullPointerException when beanshell.jar is in bootclasspath.

In ClassManagerImpl.classForName you call Interpreter.class.getClassLoader(). But Javadoc of Class.getClassLoader says: Some implementations may use null to represent the bootstrap class loader. This method will return null in such implementations if this class was loaded by the bootstrap class loader."

Exception in thread "main" java.lang.NullPointerException
at bsh.classpath.ClassManagerImpl.classForName(Unknown Source)
at bsh.NameSpace.classForName(Unknown Source)
at bsh.NameSpace.getClassImpl(Unknown Source)
at bsh.NameSpace.getClass(Unknown Source)
at bsh.Name.consumeNextObjectField(Unknown Source)
at bsh.Name.toObject(Unknown Source)
at bsh.Name.toObject(Unknown Source)
at bsh.NameSpace.get(Unknown Source)
at bsh.Interpreter.get(Unknown Source)
at bsh.Interpreter.getu(Unknown Source)
at bsh.Interpreter.<init>(Unknown Source)
at bsh.Interpreter.<init>(Unknown Source)
at bsh.Interpreter.<init>(Unknown Source)

Discussion