Details
-
Type:
Bug
-
Status:
Open
-
Priority:
2 Major
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
Severity:3 Feature failure (but usable), workaround available
-
Fix In Branch:trunk
-
Terracotta Target:Pending
Description
In certain cases (ie. auto-lock'ing a method with synchronized access) we rename existing methods (ie. from foo() --> __tc_foo()) and make the original method name a wrapper. If the original method had an annotation on it, one effect of this rename is that the annotation is no longer on the "correct" method name.
I'm not sure what kinds of things this screws up in the real world, but it does seem wrong that the annotation "moves"
Attached is a sample program to demostrate the issue.
I think DMI might have the same problematic pattern in it
I've the same issue when trying to use terracotta for clustering a jboss seam session.
Seam heavily uses annotations on its components and when an annotated methods will be rewritten by terracotta instrumentation due to auto-locking, the annotation moves to the new private method which will be than probably called by the original (and public) method.
When now seam comes to search annotated methods, it finds the new private method instead of the original public method and that obvouisly triggers errors. i.e. seam tries to get the wrong annotated method by calling class.getMethod():
java.lang.NoSuchMethodException: org.jboss.seam.security.Identity.__tc_wrapped_create()
java.lang.Class.getMethod(Class.java:1581)
org.jboss.seam.Component.callComponentMethod(Component.java:2208)
org.jboss.seam.Component.callCreateMethod(Component.java:2134)
Normally it should try to get public org.jboss.seam.security.Identity.create() which was original annotated, but because terracotta moved the annotation seam tries now to get the private __tc_wrapped_create(), which is not right and also fails due to no private methods are available by class.getMethod()
above is something written about a workaround. Where can i find that? How can I fix this issue?
Btw: Are there any experiences/project known with clustering seam sessions with terracotta?