NPE on redeploy (inside aspect library code)
squeak Nov 4, 2004 12:41 PMI have a simple webapp that makes use of only the TX Apsect libraries for demarcation.
I am using both the Annotation compiler and the AOPC compilier, packaging up the results in a WAR, and deploying to a JBoss 4.0 server. I have upgraded to FINAL code.
My issues is that on startup, or first deployment of my WAR file, my code, and the TX interceptors work great. However, once I redploy my WAR file, I get a NullPointerException in my original method signature (which is now the new interceptor method).
So, if I have a method called saveOrganization() that has been intercepted, after a redployment, I will get the following stacktrace:
2:34:39,168 ERROR [org.osn.jext.framework.util.RequestInterceptor:124] java.lang.NullPointerException at org.osn.homefront.app.service.HomefrontService.saveOrganization(HomefrontService.java) at org.osn.homefront.app.OrgSignUp2.submit(OrgSignUp2.java:559) at org.osn.homefront.app.OrgSignUp2.pageMain(OrgSignUp2.java:63) at org.osn.jext.framework.JSPPageContent.runPageMain(JSPPageContent.java:45)
As you can see, the line number is missing for where the NPE happens at, since it is the new instumented code.
For shits & giggles, I decompiled that method and here is the code:
public void saveOrganization(Organization organization) throws PersistenceException, BusinessValidationException { if(((Advisor) (aop$classAdvisor$aop)).doesHaveAspects || _instanceAdvisor != null && _instanceAdvisor.hasInstanceAspects) { org.jboss.aop.advice.Interceptor ainterceptor[] = aop$MethodInfo_saveOrganization5875559486684723374.interceptors; if(_instanceAdvisor != null) ainterceptor = _instanceAdvisor.getInterceptors(aop$MethodInfo_saveOrganization5875559486684723374.interceptors); HomefrontService_saveOrganization_5875559486684723374_OptimizedMethodInvocation homefrontservice_saveorganization_5875559486684723374_optimizedmethodinvocation = new HomefrontService_saveOrganization_5875559486684723374_OptimizedMethodInvocation(aop$MethodInfo_saveOrganization5875559486684723374, ainterceptor); homefrontservice_saveorganization_5875559486684723374_optimizedmethodinvocation.arg0 = organization; homefrontservice_saveorganization_5875559486684723374_optimizedmethodinvocation.setTargetObject(this); homefrontservice_saveorganization_5875559486684723374_optimizedmethodinvocation.typedTargetObject = this; homefrontservice_saveorganization_5875559486684723374_optimizedmethodinvocation.setAdvisor(aop$classAdvisor$aop); homefrontservice_saveorganization_5875559486684723374_optimizedmethodinvocation.invokeNext(); } else { org$osn$homefront$app$service$HomefrontService$saveOrganization$aop(organization); } }
Now, looking at that, I am not sure exactly where the NPE would be happening at, but the first suspect to me is the aop$classAdvisor$aop variable, since it is static. I wonder if it is getting blown away on the redploy and not set back up properly, since the static constructor might not get ran again?
Thoughts?