Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » AspectJ » J2ME
J2ME [message #62477] Sat, 04 March 2006 02:09 Go to next message
Eclipse UserFriend
Originally posted by: hunt2.cs.clemson.edu

I am having difficulty getting aspectj to work with a J2ME project. I
have tried a number of ways. The way that came the closest was:
Start with a working J2ME project
Right click on project and select convert to aspectj project

The result seems to build correctly.
If I run the J2ME code without making changes it comes up correctly in the
emulator.
If a create a sample aspectj app in the same project as the J2ME code, it
builds and runs correctly.

BUT, when I add an aspect to my J2ME code it:
Builds although it does indicate a problem with the project by showing a
red X on the project folder, but does not flag any of the files making up
the project with an X.
It runs the app in the emulator.
It recognizes a match specified by the pointcut.
When it attempts to execute the advice associated with the pointcut it
gives a runtime error:
java.lang.NoClassDefFoundError: org/aspectj/lang/NoAspectBoundException

Interestingly if I leave the pointcut but comment out the advice the
application runs fine in the emulator.

This is creating a major crimp in progress on my dissertation. Would
greatly appreciate advice on how to get J2ME and AspectJ to work together
in Eclipse.
BTW: I updated all the Eclipse packages in my enviroment yesterday. So I
believe I am latest and greatest for my Eclipse environment
Re: J2ME [message #62542 is a reply to message #62477] Sat, 04 March 2006 09:29 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: clemas.uk.ibm.com

Hello John,

Code built with the AspectJ compiler has a dependency on the
aspectjrt.jar file. This contains some classes that support the runtime
operation of the aspect - for example the NoAspectBoundException you are
seeing. You must ensure this runtime jar is available in the
environment where you execute the application.

Now ... we know there are certain issues with the current aspectjrt.jar
classes where they use some types not available in certain J2ME
environments (for example, cflow support may need ThreadLocal). Please
see https://bugs.eclipse.org/bugs/show_bug.cgi?id=92933 for more
discussion on it.

Also... the latest aspectjrt.jar shipped with Java5 is quite large - we
are looking to ship multiple variants depending on the target
environment as much of the contents probably supports features you
aren't using (eg. reflection support for AspectJ code). We just haven't
done it yet.

Andy.

John Hunt wrote:
> I am having difficulty getting aspectj to work with a J2ME project. I
> have tried a number of ways. The way that came the closest was: Start
> with a working J2ME project
> Right click on project and select convert to aspectj project
>
> The result seems to build correctly.
> If I run the J2ME code without making changes it comes up correctly in
> the emulator.
> If a create a sample aspectj app in the same project as the J2ME code,
> it builds and runs correctly.
>
> BUT, when I add an aspect to my J2ME code it:
> Builds although it does indicate a problem with the project by showing a
> red X on the project folder, but does not flag any of the files making
> up the project with an X.
> It runs the app in the emulator.
> It recognizes a match specified by the pointcut.
> When it attempts to execute the advice associated with the pointcut it
> gives a runtime error: java.lang.NoClassDefFoundError:
> org/aspectj/lang/NoAspectBoundException
>
> Interestingly if I leave the pointcut but comment out the advice the
> application runs fine in the emulator.
>
> This is creating a major crimp in progress on my dissertation. Would
> greatly appreciate advice on how to get J2ME and AspectJ to work
> together in Eclipse.
> BTW: I updated all the Eclipse packages in my enviroment yesterday. So
> I believe I am latest and greatest for my Eclipse environment
>
Re: J2ME [message #62566 is a reply to message #62542] Sat, 04 March 2006 22:17 Go to previous message
Eclipse UserFriend
Originally posted by: hunt2.cs.clemson.edu

Thanks so much Andy. You are quite right. So it is, basically, a
classpath problem. I have it a bit easier than most in that I can live
with it working in emulation, and don't care much about memory (its a long
story). So my ultimate fix is to change the run configuration on the
emulation tab to add an extra emulator parameter of "-classpath
c:\aspectj1.5\lib\aspectjrt.jar"
I don't think I would have gotten this with out help.
So thanks again.
John
Re: J2ME [message #592463 is a reply to message #62477] Sat, 04 March 2006 09:29 Go to previous message
Andrew Clement is currently offline Andrew ClementFriend
Messages: 162
Registered: July 2009
Senior Member
Hello John,

Code built with the AspectJ compiler has a dependency on the
aspectjrt.jar file. This contains some classes that support the runtime
operation of the aspect - for example the NoAspectBoundException you are
seeing. You must ensure this runtime jar is available in the
environment where you execute the application.

Now ... we know there are certain issues with the current aspectjrt.jar
classes where they use some types not available in certain J2ME
environments (for example, cflow support may need ThreadLocal). Please
see https://bugs.eclipse.org/bugs/show_bug.cgi?id=92933 for more
discussion on it.

Also... the latest aspectjrt.jar shipped with Java5 is quite large - we
are looking to ship multiple variants depending on the target
environment as much of the contents probably supports features you
aren't using (eg. reflection support for AspectJ code). We just haven't
done it yet.

Andy.

John Hunt wrote:
> I am having difficulty getting aspectj to work with a J2ME project. I
> have tried a number of ways. The way that came the closest was: Start
> with a working J2ME project
> Right click on project and select convert to aspectj project
>
> The result seems to build correctly.
> If I run the J2ME code without making changes it comes up correctly in
> the emulator.
> If a create a sample aspectj app in the same project as the J2ME code,
> it builds and runs correctly.
>
> BUT, when I add an aspect to my J2ME code it:
> Builds although it does indicate a problem with the project by showing a
> red X on the project folder, but does not flag any of the files making
> up the project with an X.
> It runs the app in the emulator.
> It recognizes a match specified by the pointcut.
> When it attempts to execute the advice associated with the pointcut it
> gives a runtime error: java.lang.NoClassDefFoundError:
> org/aspectj/lang/NoAspectBoundException
>
> Interestingly if I leave the pointcut but comment out the advice the
> application runs fine in the emulator.
>
> This is creating a major crimp in progress on my dissertation. Would
> greatly appreciate advice on how to get J2ME and AspectJ to work
> together in Eclipse.
> BTW: I updated all the Eclipse packages in my enviroment yesterday. So
> I believe I am latest and greatest for my Eclipse environment
>
Re: J2ME [message #592474 is a reply to message #62542] Sat, 04 March 2006 22:17 Go to previous message
John Hunt is currently offline John HuntFriend
Messages: 2
Registered: July 2009
Junior Member
Thanks so much Andy. You are quite right. So it is, basically, a
classpath problem. I have it a bit easier than most in that I can live
with it working in emulation, and don't care much about memory (its a long
story). So my ultimate fix is to change the run configuration on the
emulation tab to add an extra emulator parameter of "-classpath
c:\aspectj1.5\lib\aspectjrt.jar"
I don't think I would have gotten this with out help.
So thanks again.
John
Previous Topic:Using weaved plugin in eclipse
Next Topic:Using weaved plugin in eclipse
Goto Forum:
  


Current Time: Thu Apr 25 06:54:48 GMT 2024

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

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

Back to the top