Bug 37779 - ExceptionInInitializerError when using JDTCompilerAdapter
Summary: ExceptionInInitializerError when using JDTCompilerAdapter
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.0 M1   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-05-16 14:20 EDT by Charlie Gracie CLA
Modified: 2006-01-23 09:30 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Charlie Gracie CLA 2003-05-16 14:20:56 EDT
I am using the  JDT Compiler Adapter outside of eclipse and if I do not 
provide a bootclasspath in my build.xml it throws an 
ExceptionInInitializerError.  Here is the stack trace:

java.lang.ExceptionInInitializerError
        at java.lang.Throwable.<init>(Throwable.java:61)
        at java.lang.ExceptionInInitializerError.<init>
(ExceptionInInitializerError.java:72)
        at java.lang.Class.initialize(Class.java)
        at org.eclipse.jdt.core.JavaCore.getClasspathVariable
(JavaCore.java:1025)
        at org.eclipse.jdt.core.JDTCompilerAdapter.setupJavacCommand
(JDTCompilerAdapter.java:91)
        at org.eclipse.jdt.core.JDTCompilerAdapter.execute
(JDTCompilerAdapter.java:52)
        at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:842)
        at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:682)
        at org.apache.tools.ant.Task.perform(Task.java:341)
        at org.apache.tools.ant.Target.execute(Target.java:309)
        at org.apache.tools.ant.Target.performTasks(Target.java:336)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1339)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1255)
        at org.apache.tools.ant.Main.runBuild(Main.java:609)
        at org.apache.tools.ant.Main.start(Main.java:196)
        at org.apache.tools.ant.Main.main(Main.java:235)
Caused by: java.lang.NullPointerException
        at java.lang.Throwable.<init>(Throwable.java:61)
        at java.lang.Throwable.<init>(Throwable.java:75)
        at java.lang.NullPointerException.<init>(NullPointerException.java:59)
        at 
org.eclipse.jdt.internal.core.search.indexing.IndexManager.getJavaPluginWorking
Location(IndexManager.java:213)
        at org.eclipse.jdt.internal.core.search.indexing.IndexManager.<init>
(IndexManager.java:64)
        at org.eclipse.jdt.internal.core.DeltaProcessor.<init>
(DeltaProcessor.java:185)
        at org.eclipse.jdt.internal.core.JavaModelManager.<init>
(JavaModelManager.java:465)
        at org.eclipse.jdt.internal.core.JavaModelManager.<clinit>
(JavaModelManager.java:450)
        at java.lang.Class.initializeImpl(Native Method)
        at java.lang.Class.initialize(Class.java)
        at org.eclipse.jdt.core.JavaCore.getClasspathVariable
(JavaCore.java:1025)
        at org.eclipse.jdt.core.JDTCompilerAdapter.setupJavacCommand
(JDTCompilerAdapter.java:91)
        at org.eclipse.jdt.core.JDTCompilerAdapter.execute
(JDTCompilerAdapter.java:52)
        at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:842)
        at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:682)
        at org.apache.tools.ant.Task.perform(Task.java:341)
        at org.apache.tools.ant.Target.execute(Target.java:309)
        at org.apache.tools.ant.Target.performTasks(Target.java:336)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1339)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1255)
        at org.apache.tools.ant.Main.runBuild(Main.java:609)
        at org.apache.tools.ant.Main.start(Main.java:196)
        at org.apache.tools.ant.Main.main(Main.java:235)
Comment 1 Olivier Thomann CLA 2003-05-16 14:31:08 EDT
The problem comes from the fact that the code is not checking is eclipse is
running prior to try to get the value of a classpath variable. I would fix it by
using the java.home instead of the JRE_LIB as long as we don't have a good story
for running an ant task in a different VM than the one on which Eclipse is
running. We might end up with the same problem.
Comment 2 Philipe Mulet CLA 2003-05-17 04:46:08 EDT
Agreed
Comment 3 Olivier Thomann CLA 2003-05-21 16:06:13 EDT
Fixed and released in HEAD stream.
Comment 4 Olivier Thomann CLA 2003-05-21 16:11:45 EDT
Change target milestone.
Comment 5 David Audel CLA 2003-06-06 11:18:18 EDT
Verified.
Comment 6 raveesh CLA 2006-01-23 04:01:24 EST
       [javac] BUILD FAILED: file:C:/Nokia/Documents/PhoneShop/PhoneShop/PhoneShop/PhoneShop/build.xml:92: Compiler Adapter 'org.eclipse.jdt.core.JDTCompilerAdapter' can't be found.
Comment 7 Olivier Thomann CLA 2006-01-23 09:30:07 EST
and?
Could you please explain how you got this?
This has nothing to do with the original problem. It looks like the ant adapter is not on the ant classpath.
Open a new bug report against Platform/Ant.