| Summary: | NullPointerException after building the project | ||
|---|---|---|---|
| Product: | [Tools] AJDT | Reporter: | stefano.dacchille |
| Component: | Core | Assignee: | AJDT-inbox <AJDT-inbox> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | major | ||
| Priority: | P3 | CC: | aclement, andrew.eisenberg, yuriy.eclipsebugs |
| Version: | 2.1.1 | ||
| Target Milestone: | 2.2.0 | ||
| Hardware: | Macintosh | ||
| OS: | Mac OS X - Carbon (unsup.) | ||
| Whiteboard: | |||
|
Description
stefano.dacchille
any more information about the NPE in your error log? (Window>Show View>Error Log) Yes, here it is: Error Wed Jun 22 10:10:18 CEST 2011 Errors running builder 'AspectJ Builder' on project 'project-name'. java.lang.NullPointerException at org.eclipse.ajdt.core.builder.AJBuilder.postBuild(AJBuilder.java:341) at org.eclipse.ajdt.core.builder.AJBuilder.build(AJBuilder.java:270) at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:629) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:172) at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:203) at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:255) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:258) at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:311) at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:343) at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:144) at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:242) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) Is your project using annotation processors? I can easily add a null check here, but I'd rather figure out why there is a null value being found where we are not expecting. Yes, it is. Please tell me if you need some more info. Consider for the 2.2.0 release. I am getting the same exception - same stack trace with only slightly different line numbers in BuildManager. I am not sure though what you mean by using "annotation processors" ? google did not come up with anything to enlighten, could you elaborate please? I am not using annotations in/for aspects but I do have some annotations defined for home-grown serialization they are all @Retention(RetentionPolicy.RUNTIME) and various : @Target(ElementType.TYPE) or METHOD OR FIELD One difference from the original report - I have it happening every single time - I have just imported a whole source tree into a blank project and was unable to have it built even once. If this was patched I would gladly run a dev build (in fact i just installed it to see if it would make any difference - it didn't). One more thing - after spending some more time with it - it is clear that exception happens when the regardless of ajdt project does not compile i.e. - I have not added all the required jars to the project. And as I add them one at the time - the progress % goes further before the NPE. So maybe the "result" is null because the "java" build failed. It would not be all that bad if only the "Problems" view showed the errors - as it is - I have to guess. I is also a guess but I expect the NPE to not happen once the build or at may be the buildpath is complete. Small update my intuition betrayed my optimism - after fixing all the dependencies the NPE still happens However, here is one more bit of info: I've added -debug to eclipse command line and that produced lots of these errors in the error log: <quote> eclipse.buildId=I20110613-1736 java.version=1.6.0_26 java.vendor=Sun Microsystems Inc. BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US Command-line arguments: -os linux -ws gtk -arch x86_64 -debug -clean Error Sun Aug 14 22:40:49 PDT 2011 File outside of project is being compiled: FileName.java </quote> This is the complete "Error Details" content. There are lots of these errors each time build happens, listing many files that are in reality safely asleep very much inside project source directories. having done some searching - this does not seem to be reported, I have submitted a new bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=354713 I committed a workaround so that the NPE is avoided, but this will mean that any annotation processors for your project will not be invoked. Since you say that you are not aware of using an annotation processor, this may not be an issue. The change will be available in the next dev build on the 3.7 stream. I will let you know when it is available. And if you can try it out, can you let me know if this fixes your problem? I will definitely get the updated build and post the result here. The new AJDT build for 3.7 is available. This will bypass the NPE that you were experiencing earlier. Assuming fixed. |