Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: AW: AW: [aspectj-dev] Weaved code is faulty

Also check that the server code loading the classes
has aspectjrt.jar on its classpath, e.g., by putting
it in the lib/ext folder of the server jre.

Wes

Ron Bodkin wrote:

Sascha,
What happens if you compile the class without compiling in your tracing aspect? Does it work? Can you set a breakpoint on this exception in a Java debugger? Can you run the code the AspectJ compiler compiles? How are you deploying the compiled classes? Are you sure you're copying or jarring all of the right ones? Can you try compiling with ant? Ron Bodkin
Chief Technology Officer
New Aspects of Software
m: (415) 509-2895
------------Original Message------------
From: "Sascha Benkart" <Sascha.Benkart@xxxxxx>
To: <aspectj-dev@xxxxxxxxxxx>
Date: Sun, Feb-8-2004 3:05 PM
Subject: AW: AW: [aspectj-dev] Weaved code is faulty
BODY { FONT-SIZE: 10pt; MARGIN: 5px; COLOR: black; FONT-FAMILY: "Arial" } P { MARGIN: 0px } OL { MARGIN-TOP: 5px; MARGIN-BOTTOM: 5px } UL { MARGIN-TOP: 5px; MARGIN-BOTTOM: 5px } BLOCKQUOTE { MARGIN-TOP: 5px; MARGIN-BOTTOM: 5px } Here is my aspect I used to test within IS:
public aspect MethodTracing?{? pointcut tracedMethods() : execution(* *.*(..));? ? before() : tracedMethods() ? {?  System.out.println("Hello");? }? ? after() : tracedMethods()? {?  System.out.println("bye");? }? ? before() throwing(Exception e) : tracedMethods() ? {?  System.out.println("Error");? }?}
?[Sascha Benkart] -----Ursprüngliche Nachricht-----?Von: aspectj-dev-admin@xxxxxxxxxxx [mailto:aspectj-dev-admin@xxxxxxxxxxx]Im Auftrag von Sascha Benkart?Gesendet: Sonntag, 8. Februar 2004 23:51?An: aspectj-dev@xxxxxxxxxxx?Betreff: AW: AW: [aspectj-dev] Weaved code is faulty?
Hi Ron,
the error message is as following:
Could not run 'mergeDocToPipeline'.
com.wm.app.b2b.server.ServiceException: [ISS.0026.9102]
Service 'sandbox:mergeDocToPipeline' is not operational.
To run this service, first recompile the Java source.
ServiceException is a class by webMethods. I cannot get any further information, not even using Remote Debugging by Eclipse. The Exception is thrown "deep inside" the IS. I'm using AJC within Eclipse 2.1. There is no problem running the flow service woven without any aspect. bye,
Sascha
Mit freundlichen Grüßen
Sascha Benkart
Behrstr. 10, 73240 Wendlingen?fon: +49 7024.50 14 84?fax: +49 7024.50 14 85?mob: +49 171.735 09 56?mail: sascha@xxxxxxxxxxx
-----Ursprüngliche Nachricht-----?Von: aspectj-dev-admin@xxxxxxxxxxx [mailto:aspectj-dev-admin@xxxxxxxxxxx]Im Auftrag von Ron Bodkin?Gesendet: Sonntag, 8. Februar 2004 22:14?An: aspectj-dev@xxxxxxxxxxx?Betreff: Re: AW: [aspectj-dev] Weaved code is faulty?
Hi Sascha,
What exactly happens when you weave the Flow class? What error are you seeing? Are you compiling the code with ajc or with javac? Does it work if you compile with ajc but don't have any aspects involved? Ron Bodkin
Chief Technology Officer
New Aspects of Software
m: (415) 509-2895
------------Original Message------------
From: "Sascha Benkart" <Sascha.Benkart@xxxxxx>
To: <aspectj-dev@xxxxxxxxxxx>
Date: Sun, Feb-8-2004 10:55 AM
Subject: AW: [aspectj-dev] Weaved code is faulty
@font-face { font-family: Courier; } @font-face { font-family: Tahoma; } @page Section1 {size: 8.5in 11.0in; margin: 1.0in 1.25in 1.0in 1.25in; } P.MsoNormal { FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman" } LI.MsoNormal { FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman" } DIV.MsoNormal { FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman" } A:link { COLOR: blue; TEXT-DECORATION: underline } SPAN.MsoHyperlink { COLOR: blue; TEXT-DECORATION: underline } A:visited { COLOR: purple; TEXT-DECORATION: underline } SPAN.MsoHyperlinkFollowed { COLOR: purple; TEXT-DECORATION: underline } SPAN.EmailStyle18 { COLOR: navy; FONT-FAMILY: Arial } DIV.Section1 { page: Section1 } Ok, but can you tell me how to find the problem why AspectJ woven code cannot be run within Integration Server. What is modified by the Weaver?
webMethods told me, that they never tested their code with AspectJ and so it is not supported. But I really want to use AspectJ, because it makes life easier for me.
? -----Ursprüngliche Nachricht-----?Von: aspectj-dev-admin@xxxxxxxxxxx [mailto:aspectj-dev-admin@xxxxxxxxxxx]Im Auftrag von Jim Hugunin?Gesendet: Sonntag, 8. Februar 2004 18:58?An: aspectj-dev@xxxxxxxxxxx?Betreff: RE: [aspectj-dev] Weaved code is faulty?
This is almost certainly a bug in the decompiler that you’re using, not in the weaver.  Both of the “decompiled” sources that you show have a lot of bad code in them (see break MISSING_BLOCK_LABEL_NN for example).  To confirm that there’s nothing wrong with the woven code, you can use javap or another tool to inspect the bytecode directly.
This problem is not AspectJ’s, but the fault of some not very clever decompilers. Nevertheless, we do have an open enhancement request to make life easier for the decompilers and if time permits we will look into this. As with all enhancement requests, a working patch would increase the priority immensely. https://bugs.eclipse.org/bugs/show_bug.cgi?id=46298 -Jim From: aspectj-dev-admin@xxxxxxxxxxx [mailto:aspectj-dev-admin@xxxxxxxxxxx] On Behalf Of Sascha Benkart?Sent: Sunday, February 08, 2004 4:22 AM?To: aspectj-dev@xxxxxxxxxxx?Subject: [aspectj-dev] Weaved code is faulty Hi,
I'm using AspectJ 1.1.1 with webMethods Integration Server 6.0.1 (IS, eEnabling platform), running on Java 1.4.
After weaving a so called flow service (a Java class), I can't run the flow service within the IS. First I didn't know what's wrong with the code, because outside IS there is no problem to run AspectJ weaved code.
So I decompiled a class weaved by AspectJ. First lets have a look at the source before weaving:
// Source code before using AspaectJ
import com.wm.app.b2b.server.ServiceException;?import com.wm.data.*;
public final class sandbox?{ public sandbox()? {? } static sandbox _newInstance()? {? return new sandbox();? } static sandbox _cast(Object o)? {? return (sandbox)o;? } public static final void mergeDocToPipeline(IData pipeline)? throws ServiceException? {? IDataCursor pipelineCursor = pipeline.getCursor();? IData document = IDataUtil.getIData(pipelineCursor, "document");? pipelineCursor.destroy();? if(document != null)? IDataUtil.append(document, pipeline);? } static final sandbox _instance = new sandbox(); } Method _newInstance and _cast are standard methods of a IS class. Method mergeDocToPipeline defines a flow service and is not from great interest of this problem. Now, lets look at the decompiled class after WEAVING:
// Source code after using AspectJ
import com.wm.app.b2b.server.ServiceException;?import com.wm.data.*;
public final class sandbox?{ public sandbox()? {? } static sandbox _newInstance()? {? MethodTracing.aspectOf().ajc$before$MethodTracing$1b3();? new sandbox();? break MISSING_BLOCK_LABEL_25;? Throwable throwable;? throwable;? MethodTracing.aspectOf().ajc$after$MethodTracing$1fc();? throw throwable;? MethodTracing.aspectOf().ajc$after$MethodTracing$1fc();? return;? Exception exception;? exception;? MethodTracing.aspectOf().ajc$afterThrowing$MethodTracing$241(exception);? throw exception;? } static sandbox _cast(Object o)? {? MethodTracing.aspectOf().ajc$before$MethodTracing$1b3();? (sandbox)o;? break MISSING_BLOCK_LABEL_22;? Throwable throwable;? throwable;? MethodTracing.aspectOf().ajc$after$MethodTracing$1fc();? throw throwable;? MethodTracing.aspectOf().ajc$after$MethodTracing$1fc();? return;? Exception exception;? exception;? MethodTracing.aspectOf().ajc$afterThrowing$MethodTracing$241(exception);? throw exception;? } public static final void mergeDocToPipeline(IData pipeline)? throws ServiceException? {? try? {? try? {? MethodTracing.aspectOf().ajc$before$MethodTracing$1b3();? IDataCursor pipelineCursor = pipeline.getCursor();? IData document = IDataUtil.getIData(pipelineCursor, "document");? pipelineCursor.destroy();? if(document != null)? IDataUtil.append(document, pipeline);? }? catch(Throwable throwable)? {? MethodTracing.aspectOf().ajc$after$MethodTracing$1fc();? throw throwable;? }? MethodTracing.aspectOf().ajc$after$MethodTracing$1fc();? return;? }? catch(Exception exception)? {? MethodTracing.aspectOf().ajc$afterThrowing$MethodTracing$241(exception);? throw exception;? }? } static final sandbox _instance = new sandbox(); }
Looking again at methods _newInstance and _cast. Both methods return nothing (See code return;)! I'm not sure if this is a problem of the decompiler, so I decompiled the class not weaved by AspectJ and it looks like the original former class.
Is it possible that AspectJ weaves classes with methods _cast or _newInstance in a wrong way? Regards,
bux



Back to the top