0 Replies Latest reply on Jul 28, 2005 6:55 AM by Mark Lybarger

    eclipse plugin - export standalone aop deployable component

    Mark Lybarger Apprentice

      i'm trying to deploy a standalone aop component into the jboss server. the aop component is to be applied to a deployed war component. i'm interested in changing the aop component, and redeploying only that, to dynamically change the behavior of the war at runtime. basically, i'd like to add and remove an "insteadof" aspect to some servlets.

      i created a .jar file with the contents of:

      jboss-aop.xml
      org/eclipse/wtp/tutorial/ServletBypassInterceptor.class
      org/eclipse/wtp/tutorial/SimpleInterceptor.class

      perhaps there's a step or something that i'm just missing. it seemed to deploy fine the first time, but when i changed the jboss-aop.xml to use the ByPassInterceptor class instead of the SimpleInterceptor, i get the following exception:

      06:47:11,906 ERROR [AspectDeployer] failed to stop
      java.lang.RuntimeException: java.lang.RuntimeException: java.lang.NullPointerException
       at org.jboss.aop.ClassAdvisor.rebuildInterceptors(ClassAdvisor.java:802)
       at org.jboss.aop.ClassAdvisor.removeAdviceBindings(ClassAdvisor.java:360)
       at org.jboss.aop.AspectManager.removeBindings(AspectManager.java:1107)
       at org.jboss.aop.AspectXmlLoader.bulkUndeploy(AspectXmlLoader.java:992)
       at org.jboss.aop.AspectXmlLoader.undeployXML(AspectXmlLoader.java:983)
       at org.jboss.aop.AspectXmlLoader.undeploy(AspectXmlLoader.java:1099)
       at org.jboss.aop.AspectXmlLoader.undeployXML(AspectXmlLoader.java:1128)
       at org.jboss.aop.deployment.AspectDeployer.stop(AspectDeployer.java:199)
       at org.jboss.deployment.MainDeployer.stop(MainDeployer.java:632)
       at org.jboss.deployment.MainDeployer.stop(MainDeployer.java:624)
       at org.jboss.deployment.MainDeployer.undeploy(MainDeployer.java:605)
       at org.jboss.deployment.MainDeployer.undeploy(MainDeployer.java:600)
       at org.jboss.deployment.MainDeployer.undeploy(MainDeployer.java:573)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
       at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:121)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
       at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:127)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
       at $Proxy8.undeploy(Unknown Source)
       at org.jboss.deployment.scanner.URLDeploymentScanner.undeploy(URLDeploymentScanner.java:355)
       at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:477)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:204)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:215)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:194)
      Caused by: java.lang.RuntimeException: java.lang.NullPointerException
       at org.jboss.aop.pointcut.Util.matchesClassExpr(Util.java:95)
       at org.jboss.aop.pointcut.MethodMatcher.matches(MethodMatcher.java:86)
       at org.jboss.aop.pointcut.MethodMatcher.visit(MethodMatcher.java:66)
       at org.jboss.aop.pointcut.ast.ASTMethod.jjtAccept(ASTMethod.java:23)
       at org.jboss.aop.pointcut.ExecutionMethodMatcher.visit(ExecutionMethodMatcher.java:43)
       at org.jboss.aop.pointcut.ast.ASTExecution.jjtAccept(ASTExecution.java:17)
       at org.jboss.aop.pointcut.MatcherHelper.visit(MatcherHelper.java:72)
       at org.jboss.aop.pointcut.MatcherHelper.matches(MatcherHelper.java:67)
       at org.jboss.aop.pointcut.PointcutExpression.matchesExecution(PointcutExpression.java:104)
       at org.jboss.aop.Advisor.resolveMethodPointcut(Advisor.java:539)
       at org.jboss.aop.ClassAdvisor.createInterceptorChains(ClassAdvisor.java:458)
       at org.jboss.aop.ClassAdvisor.rebuildInterceptors(ClassAdvisor.java:797)
       ... 31 more
      Caused by: java.lang.NullPointerException
       at org.jboss.aop.pointcut.Util.matchesTypedef(Util.java:309)
       at org.jboss.aop.pointcut.Util.matchesClassExpr(Util.java:86)
       ... 42 more
      



      here's the contents of the jboss-aop.xml within the .jar:
      <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
      <aop>
       <typedef name="TestServlets" expr="class($instanceof{javax.servlet.http.HttpServlet}) AND class(org.eclipse.wtp.tutorial.*)"/>
      
       <!--
       <bind pointcut="execution(* $typedef{TestServlets}->*(..))">
       <interceptor class="org.eclipse.wtp.tutorial.SimpleInterceptor"/>
       </bind>
       -->
      
       <bind pointcut="execution(* $typedef{TestServlets}->*(..))">
       <interceptor class="org.eclipse.wtp.tutorial.ServletBypassInterceptor"/>
       </bind>
      </aop>