Home » Language IDEs » AspectJ » strange bug with .aj files in jar-packager
strange bug with .aj files in jar-packager [message #57050] |
Thu, 29 September 2005 10:32  |
Eclipse User |
|
|
|
I have a strange bug here with AspectJ files (I am using the .aj
extension) and eclipse's .jar packager:
When marking an entire directory that contains aspects as to be included
in the .jar I was getting warings re. duplicate entries. Investigating
further I found, that when I select a directory that contains aspects in
the Jar packager, each .aj file is listed TWICE in the right hand side
file list, once with a J-(Java-)icon, and once with an
AJ-(AspectJ-)icon.
In the resource view (and in reality), each file exists of course only
once!
Are others able to reproduce this?
This is on Eclipse 3.1 and AJDT 1.3.0.20050923165804
Michael
|
|
|
Re: strange bug with .aj files in jar-packager [message #57076 is a reply to message #57050] |
Thu, 29 September 2005 17:42   |
Eclipse User |
|
|
|
Intriguing! These duplicate entries *do* actually exist in the package
explorer, even for .java files. One entry is the .java file resource, the
other is the compilation unit created for that .java file. The package
explorer filters out the file version (and of course the navigator view
doesn't show compilation units). The same happens for .aj files, and
because the package explorer doesn't know about .aj files, we add a filter
to remove the file versions, leaving the compilation unit versions.
The export JAR wizard is therefore using the same content provider, but
not the same filters. We can't change the regular export wizard, but we
contribute the "export JAR with AspectJ support" wizard (which is
presumably the one you're using already), so we can hopefully add the
necessary filtering there - please could you raise a bug for this.
Regards,
Matt.
Michael Moser wrote:
> I have a strange bug here with AspectJ files (I am using the .aj
> extension) and eclipse's .jar packager:
> When marking an entire directory that contains aspects as to be included
> in the .jar I was getting warings re. duplicate entries. Investigating
> further I found, that when I select a directory that contains aspects in
> the Jar packager, each .aj file is listed TWICE in the right hand side
> file list, once with a J-(Java-)icon, and once with an
> AJ-(AspectJ-)icon.
> In the resource view (and in reality), each file exists of course only
> once!
> Are others able to reproduce this?
> This is on Eclipse 3.1 and AJDT 1.3.0.20050923165804
> Michael
|
|
| |
Re: strange bug with .aj files in jar-packager [message #57341 is a reply to message #57076] |
Thu, 06 October 2005 11:27  |
Eclipse User |
|
|
|
Maybe along a similar line:
I ran into problems with an eclipse plugin that at run time generates
new files and compiles them, thereby - so to speak - extending the
original plugin (in spirit somewhat similar to JSPs). For these
compilation to work, the plugin's own .jar file has to be on the
compilers classpath, so that it can find all super-classes, interfaces,
etc. to properly compile those files.
Now, I am advising some classes, that are base-classes of those that are
later compiled at runtime and now suddenly got ClassNotFoundExceptions.
Investigating closer I found out, that those class files that stem from
compiling the AspectJ files were not included in the .jar file, even
though in eclipse's JarPackager I marked the .aj files a part of the
application (in JarPackager one has to mark the *source* of those
artifacts whose compiled *derivatives* should later be included in the
..jar file, i.e. one has to mark the .java-files and not the
..class-files.
To overcome these ClassNotFoundErrors I had to manually and explicitly
include the .class files that stem from aspects (fortunately there were
only five...) in the JarPackager. So I guess there is some dependency or
ant rule missing for AspectJ files. Or something along these lines (I am
not exactly and expert for build processes nor an ant guru...).
This is on Eclipse 3.1.1 and AJDT 1..3.0.20051003160848, i.e. on the
bleeding edge - as always... :-)
Michael
|
|
|
Re: strange bug with .aj files in jar-packager [message #590229 is a reply to message #57050] |
Thu, 29 September 2005 17:42  |
Eclipse User |
|
|
|
Intriguing! These duplicate entries *do* actually exist in the package
explorer, even for .java files. One entry is the .java file resource, the
other is the compilation unit created for that .java file. The package
explorer filters out the file version (and of course the navigator view
doesn't show compilation units). The same happens for .aj files, and
because the package explorer doesn't know about .aj files, we add a filter
to remove the file versions, leaving the compilation unit versions.
The export JAR wizard is therefore using the same content provider, but
not the same filters. We can't change the regular export wizard, but we
contribute the "export JAR with AspectJ support" wizard (which is
presumably the one you're using already), so we can hopefully add the
necessary filtering there - please could you raise a bug for this.
Regards,
Matt.
Michael Moser wrote:
> I have a strange bug here with AspectJ files (I am using the .aj
> extension) and eclipse's .jar packager:
> When marking an entire directory that contains aspects as to be included
> in the .jar I was getting warings re. duplicate entries. Investigating
> further I found, that when I select a directory that contains aspects in
> the Jar packager, each .aj file is listed TWICE in the right hand side
> file list, once with a J-(Java-)icon, and once with an
> AJ-(AspectJ-)icon.
> In the resource view (and in reality), each file exists of course only
> once!
> Are others able to reproduce this?
> This is on Eclipse 3.1 and AJDT 1.3.0.20050923165804
> Michael
|
|
| |
Re: strange bug with .aj files in jar-packager [message #590354 is a reply to message #57076] |
Thu, 06 October 2005 11:27  |
Eclipse User |
|
|
|
Maybe along a similar line:
I ran into problems with an eclipse plugin that at run time generates
new files and compiles them, thereby - so to speak - extending the
original plugin (in spirit somewhat similar to JSPs). For these
compilation to work, the plugin's own .jar file has to be on the
compilers classpath, so that it can find all super-classes, interfaces,
etc. to properly compile those files.
Now, I am advising some classes, that are base-classes of those that are
later compiled at runtime and now suddenly got ClassNotFoundExceptions.
Investigating closer I found out, that those class files that stem from
compiling the AspectJ files were not included in the .jar file, even
though in eclipse's JarPackager I marked the .aj files a part of the
application (in JarPackager one has to mark the *source* of those
artifacts whose compiled *derivatives* should later be included in the
..jar file, i.e. one has to mark the .java-files and not the
..class-files.
To overcome these ClassNotFoundErrors I had to manually and explicitly
include the .class files that stem from aspects (fortunately there were
only five...) in the JarPackager. So I guess there is some dependency or
ant rule missing for AspectJ files. Or something along these lines (I am
not exactly and expert for build processes nor an ant guru...).
This is on Eclipse 3.1.1 and AJDT 1..3.0.20051003160848, i.e. on the
bleeding edge - as always... :-)
Michael
|
|
|
Goto Forum:
Current Time: Thu May 08 20:53:58 EDT 2025
Powered by FUDForum. Page generated in 0.03890 seconds
|