To elaborate on Adrian's point in response to your query, you can use the
normal tools you'd use with any Java bytecode to compare Java-compiled code and
AspectJ-woven code, i.e., a disassembler like javap or a decompiler like jad.
Jad, like most decompilers, is getting a bit long in the tooth and doesn't do a
very good job with several language constructs (for both Java programs and
AspectJ programs).
However, looking at the generated bytecode should be the last resort when
working through a problem - it's MUCH better to work through the semantics of
the aspects (i.e., what advice is firing and when). Especially in a case
like this where it's almost certainly an aspect that's failing.
Ron Bodkin
Chief Technology Officer
New Aspects of Software
o: (415) 824-4690
m: (415) 509-2895
------------Original Message------------
From: Adrian Colyer <adrian_colyer@xxxxxxxxxx>
To: aspectj-users@xxxxxxxxxxx
Date: Fri, Aug-6-2004 7:51 AM
Subject: RE: [aspectj-users] [AspectJ] Why do I need aspectjrt.jar
There is nothing special about the bytecodes produced by the AspectJ
compiler - they are fully compliant with the JVM specification (and if they
aren't in any case, that would be a serious bug). The requirement for
aspectjrt.jar to be on the classpath is no different to the requirement for
say log4j.jar to be on the classpath if you used Log4j.
If the server is using 100% CPU resources, is it possible you've got some
advice that is advising itself? I know self-advice is cheaper than going to an
outside consultant, but it generally ends up using a lot of CPU and dying with
a StackOverflowError ;).
-- Adrian.
adrian_colyer@xxxxxxxxxx
06 August 2004 15:06 To: <aspectj-users@xxxxxxxxxxx> cc:
From: "Sascha Benkart" <Sascha.Benkart@xxxxxx> Subject: RE:
[aspectj-users] [AspectJ] Why do I need aspectjrt.jar
Hi
Russ,
thanks for your answer. I used AspectJ in former
projects (without the Integration Server) and I really love
it.
Thus
I want to use it in my Integration Server package. But unfortunately the
server doesn't come up, using 100% of system resources. Is AspectJ really code
compatible to "normal" Java. Do you have any idea why it is not possible to
use it? Only standard lib jce.jar is replaced by iac.jar, another security
component. Is there a tool to compare Java code with and without AspectJ
weaving.
Regards,
Sascha
Hi Sascha,
You need aspectjrt.jar to support the objects
that AspectJ compilation has added into your application to facilitate your
aspects.
During the compilation process the ajc command line tool
weaves in certain constructs to make your aspects work. This weaving, whilst
totally compatible with regular object-oriented Java, requires some
additional support features that are available in the aspectjrt.jar and so,
just like in any other application where you are using extra facilities
beyond the standard libraries, you need to have those constructs available
at runtime as well as compile time.
Hope this makes sense
:-)
Russ
On 5 Aug 2004, at 21:36, Sascha Benkart
wrote:
Hi,/smaller>/fontfamily> I
want to use AspectJ 1.2 for a webMethods Integration Server (Java
1.4, but without jce.jar) project. Unfortunately the server is not running
if I add a package (a Java unit) compiled with AspectJ (using 100% of
system resource)./smaller>/fontfamily> AspectJ
weaves the aspect code into the existing classes. Why do I need to add the
aspectjrt.jar to my project on runtime? At compile time it is clear why I
need the jar file./smaller>/fontfamily> Cheers!/smaller>/fontfamily> Sascha/smaller>/fontfamily>
|