[jboss-user] [JBoss AOP] - error when calling MethodInvocation

fabiocsilva do-not-reply at jboss.com
Fri Nov 24 09:36:25 EST 2006


When the getInstance() method is called, occurs an error in the advice, but pointcut uses the clause "call". What it is made a mistake?


  | 
  |     <bind pointcut="call(* controllers.HealthWatcherFacade->getInstance())">
  |         <advice aspect="aspects.distribution.HealthWatcherClientSideAspect" name="aroundFacadeLocalCalls"/>
  |     </bind>
  | 
  | 


  | 	public Object aroundFacadeLocalCalls(MethodInvocation invocation)  {
  |                 System.out.println("aroundFacadeLocalCalls"); 
  | 
  | 		Object obj = null;
  | /*
  | 		Object[] args = invocation.getArguments();		
  | 		String methodName = invocation.getMethod().getName();	
  | 	    obj = MethodExecution.invoke(this.getRemoteFacade(), methodName, args);*/		
  | 		return obj;
  | 		
  |     }
  | 


  | error:
  | 
  | 
  | javax.servlet.ServletException: gui.servlets.ServletLogin_1_MByMInvocation
  | 	gui.servlets.ServletLogin.init(ServletLogin.java:44)
  | 	org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
  | 	org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
  | 	org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
  | 	org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
  | 	org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
  | 	org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
  | 	org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
  | 	org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
  | 	org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
  | 	java.lang.Thread.run(Thread.java:595)
  | 


  |     public void init(ServletConfig config) throws ServletException {
  | 
  |         try {
  | 
  |             healthWatcher = HealthWatcherFacade.getInstance();	    	
  | 
  | 
  |         } catch (Exception e) {
  | 
  |             throw new ServletException(e.getMessage());
  | 
  |         }
  | 
  |     }
  | 

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3988415#3988415

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3988415



More information about the jboss-user mailing list