Community
Participate
Working Groups
AJDT compiles are hanging for me (and Mohan) on a project with a missing source folder and a missing JRE entry (reported by a user of the Glassbox Inspector project who tried to run a zip distribution). Removing the missing source folder and pointing the JRE at the system default fixes the problem. The bad distribution is available here: http://www.glassbox.com/glassbox/InspectorDownload.do?mediaItemId=77 (hopefully I can keep this available after I update to fix the problems in the built version).
Created attachment 34007 [details] Test project
I have attached a smaller test project. The problem seems to be the strange JRE entry in the .classpath file - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/sun 1.3.1_17"/> When I tried to debug this it seemed to be org.aspectj.ajdt.internal.CompilerAdapter.configureProjectOptions(..) that was hanging. Passing the bug to AspectJ.
The hang is comming from JDT code. Following this through with the debugger, it's hanging on a call to JavaModelManager.getJavaModelManager(); within org.eclipse.jdt.internal.core.JavaProject.getResolvedClasspath(..) (line 1927). However, if the same project is used for a javaproject (same classpath just without the aspectjrt) then the project doesn't compile and there's a problem in the problems view saying that "the project hasn't been built since its build path is incomplete....". Therefore, we need to do a similar thing - if the build path is incomplete then don't even try to do a build.
This is an AJDT bug. Within AspectJ, the failure is occuring within CompilerAdapter.configureProjectProperties() at the call: config.setSourcePathResources(properties.getSourcePathResources()); where properties is a ProjectPropertiesAdapter. If you compile an aj project without a jre on the classpath and without using the AJDT ProjectPropertiesAdapter then we fail with an error message "can't find type java.lang.Object.....". It is only when running through AJDT that the error occurs. In the case of AJDT, "properties" is an org.eclipse.ajdt.internal.ui.ajde.ProjectProperties. It is the implementation of getSourcePathResources() within here which is causing the hang. As a note, the implementation of getClasspath() returns all those entries which it can find, so in the case of a missing jre, it doesn't have this on the classpath (this is called at the beginning of the CompilerAdapter.configureProjectProperties() method). Also, the JavaBuilder.build(..) method catches a MissingClassFileException and it is here that the "incomplete classpath" error message in the problems view comes from.
With the latest AJDT 1.4.0 dev for Eclipse 3.2RC3, the hang now longer occurs, presumably because of JDT changes. The symptom is now that the compiler issues an appropriate error, but this is not associated with the affected resource, so it doesn't appear properly in AJDT. This is similar to issue #1 in bug 132314. Passing over to compiler.
The example in this bug is a missing jre. In this case an AbortException is thrown when we're doing AjLookupEnvironment.completeTypeBindings(..). This all happens within Compiler.compile(..) before the call to process. Consequently the before/after processing doesn't take place and the type isn't added to the list of resultsPendingWeave. Thus, when we come to notifyRequestor() after realising that there was a problem there are no resultsPendingWeave and no error is reported.