Bug 96942 - JavaCore / AspectJCore create throws Exception
Summary: JavaCore / AspectJCore create throws Exception
Status: NEW
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: 1.2.1   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-27 06:28 EDT by Juergen Graf CLA
Modified: 2007-02-14 06:00 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Juergen Graf CLA 2005-05-27 06:28:47 EDT
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
  IJavaModel javaModel = AspectJCore.create(root);

throws the following Exception:

Error May 27, 2005 11:59:43.381 An internal error occurred during: "Launching".
java.lang.ExceptionInInitializerError
	at org.aspectj.org.eclipse.jdt.core.JavaCore.create(JavaCore.java:1188)
	at
org.eclipse.chianti.launch.aj.AjChiantiLaunchUtil.getJavaModel(AjChiantiLaunchUtil.java:67)
	at
org.eclipse.chianti.launch.aj.AjChiantiParRunner.<init>(AjChiantiParRunner.java:63)
	at
org.eclipse.chianti.launch.ChiantiLaunchConfiguration.launch(ChiantiLaunchConfiguration.java:65)
	at
org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:569)
	at
org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:788)
	at org.eclipse.debug.internal.ui.DebugUIPlugin$6.run(DebugUIPlugin.java:955)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:66)
Caused by: java.lang.NullPointerException
	at
org.aspectj.org.eclipse.jdt.internal.core.search.indexing.IndexManager.getJavaPluginWorkingLocation(IndexManager.java:279)
	at
org.aspectj.org.eclipse.jdt.internal.core.search.indexing.IndexManager.<init>(IndexManager.java:49)
	at
org.aspectj.org.eclipse.jdt.internal.core.JavaModelManager.<init>(JavaModelManager.java:521)
	at
org.aspectj.org.eclipse.jdt.internal.core.JavaModelManager.<clinit>(JavaModelManager.java:499)
	... 8 more
Comment 1 Mik Kersten CLA 2005-05-27 11:20:07 EDT
Matt, I'm assuming that AspectJCore related stuff should go to AJDT.
Comment 2 Andrew Clement CLA 2005-05-27 11:32:01 EDT
I'm not sure it goes in AJDT - given that AspectJCore is a part of the JDT
compiler code that we provide from the AJ project.  I think Adrian also did a
little bit of work on this a while ago...
Comment 3 Matt Chapman CLA 2005-05-27 11:43:11 EDT
I think the confusion is that there are two AspectJCores:
org.eclipse.ajdt.core.AspectJCore (AJDT)
and
org.aspectj.ajdt.core.AspectJCore (AspectJ)

Both implement create() but the AJDT one only implements create(String) to
convert a handle identifier into an IJavaElement. So we must be talking about
the AspectJ one, which inherits create(IWorkspaceRoot) from JavaCore
(org.aspectj.org.eclipse.jdt.core.JavaCore that is, not
org.eclipse.jdt.core.JavaCore - confused yet, I know I am!).
Comment 4 Juergen Graf CLA 2005-05-30 11:54:13 EDT
Calling

org.aspectj.org.eclipse.jdt.internal.core.JavaModelManager.getJavaModelManager();

results in the same exception.