Bug 395771 - FileNotFoundException when compiling a project with aspects
Summary: FileNotFoundException when compiling a project with aspects
Status: NEW
Alias: None
Product: AspectJ
Classification: Tools
Component: Build (show other bugs)
Version: unspecified   Edit
Hardware: Macintosh Mac OS X
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-04 19:10 EST by Leo Dos Santos CLA
Modified: 2012-12-05 16:31 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 Leo Dos Santos CLA 2012-12-04 19:10:00 EST
java.io.FileNotFoundException
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:194)
at java.io.FileOutputStream.<init>(FileOutputStream.java:145)
at org.aspectj.util.FileUtil.makeOutputStream(FileUtil.java:1303)
at org.aspectj.ajdt.internal.core.builder.AjBuildManager.writeOutxmlFile(AjBuildManager.java:674)
at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performBuild(AjBuildMa ... orker.run(Worker.java:53)

Compile error: FileNotFoundException thrown: /STS-2539/target/test-classes/META-INF/aop-ajc.xml (No such file or directory)

---

This can be reliably reproduced in Spring Tool Suite with the Spring Roo integration:

* Create a new Spring Roo project in Spring Tool Suite
* type 'jpa setup --database HYPERSONIC_IN_MEMORY --provider HIBERNATE ' into the Roo Shell
* type 'entity jpa --class MyEntity'

This should create a class MyEntity.java along with a few .aj files. The project will rebuild and should throw up a dialog with the given stack trace.
Comment 1 Andrew Eisenberg CLA 2012-12-04 19:41:51 EST
Thanks for the bug report.  What's happening here is that AJDT is confusing a workspace path with a filesystem path.  Before the build, AJDT needs to map all source folders with output folders.  It needs to use filesystem paths, not workspace paths, so it must convert.

The heuristic that AJDT has been using is that it first tries to convert the output folder to a workspace path.  If that exists, AJDT uses it, otherwise AJDT assumes that the path is a filesystem path.

In this case, the output folder does not exist and so the wrong choice is being made.  

Looks like we need a different heuristic for determining the true output folder.
Comment 2 Andrew Eisenberg CLA 2012-12-04 19:51:07 EST
Pushed a fix.  The AJDT snapshot with this fix in it will be out tomorrow.  Please try it out to confirm that it is fixed.

Update site is here:

http://download.eclipse.org/tools/ajdt/42/dev/update/
Comment 3 Leo Dos Santos CLA 2012-12-04 19:57:47 EST
Thanks Andrew. I'll try the snapshot when its available.
Comment 4 Leo Dos Santos CLA 2012-12-05 16:31:03 EST
Verified with AJDT 2.2.2.e42x-20121204-1900