Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » AJDT » strange bug with .aj files in jar-packager
strange bug with .aj files in jar-packager [message #57050] Thu, 29 September 2005 14:32 Go to next message
Michael Moser is currently offline Michael MoserFriend
Messages: 914
Registered: July 2009
Senior Member
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 21:42 Go to previous messageGo to next message
Matt Chapman is currently offline Matt ChapmanFriend
Messages: 429
Registered: July 2009
Senior Member
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 #57131 is a reply to message #57076] Mon, 03 October 2005 12:57 Go to previous messageGo to next message
Michael Moser is currently offline Michael MoserFriend
Messages: 914
Registered: July 2009
Senior Member
Done: https://bugs.eclipse.org/bugs/show_bug.cgi?id=111329

"Matt Chapman" <mpchapman@gmail.com> wrote in message
news:d0690143007b93aba3cf76ca68e456ee$1@www.eclipse.org...
> ...
> ... please could you raise a bug for this.
> ...
Re: strange bug with .aj files in jar-packager [message #57341 is a reply to message #57076] Thu, 06 October 2005 15:27 Go to previous message
Michael Moser is currently offline Michael MoserFriend
Messages: 914
Registered: July 2009
Senior Member
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 21:42 Go to previous message
Matt Chapman is currently offline Matt ChapmanFriend
Messages: 429
Registered: July 2009
Senior Member
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 #590247 is a reply to message #57076] Mon, 03 October 2005 12:57 Go to previous message
Michael Moser is currently offline Michael MoserFriend
Messages: 914
Registered: July 2009
Senior Member
Done: https://bugs.eclipse.org/bugs/show_bug.cgi?id=111329

"Matt Chapman" <mpchapman@gmail.com> wrote in message
news:d0690143007b93aba3cf76ca68e456ee$1@www.eclipse.org...
> ...
> ... please could you raise a bug for this.
> ...
Re: strange bug with .aj files in jar-packager [message #590354 is a reply to message #57076] Thu, 06 October 2005 15:27 Go to previous message
Michael Moser is currently offline Michael MoserFriend
Messages: 914
Registered: July 2009
Senior Member
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
Previous Topic:Changing the class hierarchy
Next Topic:AspectJ 5 M4
Goto Forum:
  


Current Time: Sun Dec 21 19:31:23 GMT 2014

Powered by FUDForum. Page generated in 0.01754 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software