[Logo] Terracotta Discussion Forums (LEGACY READ-ONLY ARCHIVE)
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
[Expert]
Strange error with Terracotta + Spring + AspectJ  XML
Forum Index -> Terracotta for Spring
Author Message
kennyw

neo

Joined: 06/20/2007 08:27:07
Messages: 3
Offline

I have an annotated class (ConnectorServiceInterceptor) containing some AspectJ around advices.
e.g.:
@Around("execution(void Service.removeConnector(long))")
public void removeConnector(ProceedingJoinPoint pjp) throws Throwable {
// do stuff
}

I have a Spring configured bean exposing some methods which are configured in Terracotta to be distributed. This works ;)
Executing the method on application 1 also executes the method on application 2.

The problem is that when starting my application, I get the following exception:
Code:
 com.tc.aspectwerkz.exception.DefinitionException: Could not register parameter named args from register 2 for removeConnector_aroundBody3$advice.(LDefaultConnectorService;JLorg/aspectj/lang/JoinPoint;LConnectorServiceInterceptor;Lorg/aspectj/lang/ProceedingJoinPoint;)V
 	at com.tc.aspectwerkz.reflect.impl.asm.AsmMethodInfo.pushParameterNameFromRegister(AsmMethodInfo.java:246)
 	at com.tc.aspectwerkz.reflect.impl.asm.AsmClassInfo$MethodParameterNamesCodeAdapter.visitLocalVariable(AsmClassInfo.java:971)
 	at com.tc.asm.ClassReader.accept(ClassReader.java:1121)
 	at com.tc.asm.ClassReader.accept(ClassReader.java:300)
 	at com.tc.aspectwerkz.reflect.impl.asm.AsmClassInfo.<init>(AsmClassInfo.java:184)
 	at com.tc.aspectwerkz.reflect.impl.asm.AsmClassInfo.getClassInfo(AsmClassInfo.java:301)
 ...
 

When I launch the application without Terracotta I don't receive any exceptions.

Someone knows why I am receiving this exception?

Thanks.
teck

seraphim
[Avatar]
Joined: 05/24/2006 15:03:25
Messages: 1128
Offline

I haven't seen that before, but it sure looks more like a bug than a feature :-)

Is it possible to get the bytecode for the class containing that weaved in aspect? I'm not super familiar with how aspectJ weaving works. I'd be looking for the bytes to whatever class the method "removeConnector_aroundBody3$advice" is introduced into.

Alternatively, if you package up a little bit of a complete example that fails with terracotta, it would help us debug it.


Tim Eck (terracotta engineer)
kennyw

neo

Joined: 06/20/2007 08:27:07
Messages: 3
Offline

Thank you for your prompt reply. I was afraid not being able to reproduce this problem with an easy sample, but I managed ;)
Attached file throws the exception mentioned in my first post in the console. It is working though so I'm not quite sure what is going on.
 Filename Test.zip [Disk] Download
 Description
 Filesize 45 Kbytes
 Downloaded:  321 time(s)

teck

seraphim
[Avatar]
Joined: 05/24/2006 15:03:25
Messages: 1128
Offline

I don't have a answer yet, but I do have the code running and producing the same exception locally (which is at least half of the battle). Many thanks for creating the test case!!

Tim Eck (terracotta engineer)
teck

seraphim
[Avatar]
Joined: 05/24/2006 15:03:25
Messages: 1128
Offline

Little closer -- looks like this has something do with Terracotta's instrumentation around array access. Commenting out array operations in the removeConnetor advice avoids the exception

Code:
     @Around("execution(void test.ConnectorService.removeConnector(long))")
     public void removeConnector(ProceedingJoinPoint pjp) throws Throwable {
         System.out.println("i Remove");
         // Object[] args = pjp.getArgs();
         // long id = (Long) args[0];
         pjp.proceed(pjp.getArgs());
         // System.out.println(id);
     }
 


Still digging on the underlying issue. Just keeping everyone posted

Tim Eck (terracotta engineer)
teck

seraphim
[Avatar]
Joined: 05/24/2006 15:03:25
Messages: 1128
Offline

I spoke too soon...commenting out the array operations in that advice has the side effect of eliminating all local variables (the real source of the issue). More details to come


Tim Eck (terracotta engineer)
teck

seraphim
[Avatar]
Joined: 05/24/2006 15:03:25
Messages: 1128
Offline

This issue will tracked in this JIRA item moving forward: https://jira.terracotta.org/jira/browse/CDV-310

It seems that the AspectJ compiler is failing to update the local variable information correctly. We will be reporting the problem to the AJ developers shortly.

Although it is ugly and annoying to see that exception being printed, it should not be causing any issues to your application or the function of Terracotta.

Tim Eck (terracotta engineer)
kennyw

neo

Joined: 06/20/2007 08:27:07
Messages: 3
Offline

Thank you for the update.
Indeed, it is an ugly exception but the application works fine.
 
Forum Index -> Terracotta for Spring
Go to:   
Powered by JForum 2.1.7 © JForum Team