[jboss-user] [JBoss AOP] - JBoss AS 5.1 Remote EJB calls not being intercepted

Robert Goodwin do-not-reply at jboss.com
Thu Jun 9 12:08:04 EDT 2011


Robert Goodwin [http://community.jboss.org/people/robert.m.goodwin] created the discussion

"JBoss AS 5.1 Remote EJB calls not being intercepted"

To view the discussion, visit: http://community.jboss.org/message/609466#609466

--------------------------------------------------------------
I have a Stateless EJB/ WebService that I have added a  Aspect and a corresponding jboss-aop.xml to so I can get information about calls made to the public interface of the service.  It appears though that remote calls to the service are not being intercepted ( atleast the log messages that I have are not being printed).  In the public interface I do have methods that call other methods on the public interface, those methods do get intercepted.  It appears that only local calls are working.  This is simular to the problem dicussed here ( https://issues.jboss.org/browse/JBAS-7172 https://issues.jboss.org/browse/JBAS-7172)

My jboss-aop.xml file

{code}
<?xml version=+"1.0"+ encoding=+"UTF-8"+?>
<aop xmlns=+"urn:jboss:aop-beans:1.0"+> 
   <aspect class=+"mc2sa.mdr.SoiServiceAspect"+/>
   <bind pointcut=+"execution(public * mc2sa.mdr.MetadataRegistryService->*(..))"+>
      <around aspect=+"mc2sa.mdr.SoiServiceAspect"+ name=+"invoke"+/>
   </bind>
</aop>
{code}

Aspect code

{code}
*import* org.jboss.aop.advice.Interceptor;
*import* org.jboss.aop.joinpoint.Invocation;
*import* org.jboss.aop.joinpoint.MethodInvocation;
*import* org.jboss.logging.Logger;


*public* *class* SoiServiceAspect *implements* Interceptor
{
*private* *static* *final* Logger +log+ = Logger.+getLogger+(SoiServiceAspect.*class*);

*public* String getName()
 {
*return* "SoiServiceAspect";
 }

*public* Object invoke(Invocation invocation) *throws* Throwable
 {
      MethodInvocation mi = (MethodInvocation) invocation;
      String methodName = mi.getMethod().toString();

*try* {
+log+.info("Entering: " + methodName);
*return* invocation.invokeNext();
      } *finally* {
+log+.info("Leaving: " + methodName);
      }
   }

}
{code}

The jboss-aop.xml file is in the root of the jar that provides the service. and the aspect is in the same package as the service.  Is this a bug, or more likely, am I missing something in the configuration that would allow my aspect to be called when being invoked remotely?

Thanks,
Rob
--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/609466#609466]

Start a new discussion in JBoss AOP at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2027]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20110609/c8541f64/attachment.html 


More information about the jboss-user mailing list