public Object getAttribute(String
arg0)
{
Test.aspectOf().ajc$before$first_aspect_Test$5aa(ajc$tjp_0);
HTTPLogger.logUnableToDeserializeNamedAttribute(getLogContext(), arg0,
runtimeexception);
attributes.remove(arg0);
return
null;
Exception
exception;
exception;
Test.aspectOf().ajc$afterThrowing$first_aspect_Test$3d5(exception);
throw exception;
}
Please note the
calls Test.aspectOf().ajc$before$first_aspect_Test$5aa(ajc$tjp_0);
and Test.aspectOf().ajc$afterThrowing$first_aspect_Test$3d5(exception);
inserted by the ajc in the original method getAttribute(String). These methods
ajc$before$first_aspect_Test$5aa(ajc$tjp_0); &
ajc$afterThrowing$first_aspect_Test$3d5(exception); are not there in
the Test.class.
Following is the method signature map of my aspect
Test.java (generated using javap):
public class first.aspect.Test extends
java.lang.Object {
public static java.lang.String
methodName;
public static final first.aspect.Test
ajc$perSingletonInstance;
static {};
public void setMethodName(java.lang.String);
public
java.lang.String getMethodName();
public
first.aspect.Test();
public void
ajc$before$first_aspect_Test$3d5(org.aspectj.lang.JoinPoint$Stat
icPart);
public static first.aspect.Test aspectOf();
public static
boolean hasAspect();
}
My program fails with java.lang.NoSuchMethodError:
first.aspect.Test.ajc$before$first_aspect_Test$5aa(Lorg/aspectj/lang/JoinPoint$StaticPart;)V
exception when I try to execute.
Any suggestions, why this is happening? Is this a bug
or I am doing something wrong???
Following is the Test.java source:
package first.aspect;
public aspect Test {
public Test() {
System.out.println("Constructor: Test");
}
pointcut callWLServlet() : execution ( *
weblogic.servlet..*.*(..) );
pointcut callServlet() : execution ( *
javax.servlet..*.*(..) );
pointcut excludeInternal() : execution ( *
weblogic.management.internal..*.*(..) );
pointcut excludeTools() :
execution ( * weblogic.management.tools..*.*(..) );
pointcut
excludeInfo() : execution ( * weblogic.management.info..*.*(..) );
after() throwing (Exception npe)
:(
callServlet()
&&
callWLServlet()
&&
(!excludeInternal())
&&
(!excludeTools())
&&
(!excludeInfo())
)
{
System.out.println("Logging exception using Aspect:
");
System.out.println("===============================
");
System.out.println("Message: " + npe.getMessage()
);
System.out.println("=============================== ");
}
before() : ( callServlet()
&&
callWLServlet()
&&
( ! excludeInternal() )
&&
( ! excludeTools() )
&&
( ! excludeInfo()
)
)
{
if (
methodName.equals( thisJoinPoint.getSignature().getName() ) )
{
System.out.println("---------> Matched call: " + methodName
);
throw new
NullPointerException("Aspected Exception");
}
else {
//System.out.println("========> Method call: " +
thisJoinPoint.getSignature().getName() + "
<=========");
}
}
}
Thanks,
Ravi Varanasi
408 394 3273