I'm trying to use AOP to intercept all MuleEvent calls to my services to track the state of messages in the system and I'm cross-cutting a service with an aspect seems is causing the resolution of the service endpoint to fail. Has anyone been able to do this successfully?
This is my Spring config:
<spring:bean id="serviceEventTrackingAspect"
class="billg.aop.MuleServiceEventTrackingAspect"/>
<aop:config>
<aop:aspect ref="serviceEventTrackingAspect">
<aop:around method="doRecordEvent"
pointcut="execution(* org.mule.api.service.Service.dispatchEvent(..))"/>
<aop:around method="doRecordEvent"
pointcut="execution(* org.mule.api.service.Service.sendEvent(..))"/>
</aop:aspect>
</aop:config>
When I then try to make a call to one of my services via the servlet inbound relay, I get an exception like this in the logs:
[2008-07-30 17:54:10.883] [17:54:10.879] ERROR AbstractReceiverServlet.java:168 message: Endpoint "No receiver found for endpointUri: publishBlogEntryAsync" not found
[2008-07-30 17:54:10.883] org.mule.api.transport.NoReceiverForEndpointException: Endpoint "No receiver found for endpointUri: publishBlogEntryAsync" not found
[2008-07-30 17:54:10.883] at org.mule.transport.servlet.MuleReceiverServlet.getReceiverForURI(MuleReceiverServlet.java:312)
[2008-07-30 17:54:10.883] at org.mule.transport.servlet.MuleRESTReceiverServlet.doPost(MuleRESTReceiverServlet.java:100)
[2008-07-30 17:54:10.883] at javax.servlet.http.HttpServlet.service(HttpServlet.java:154)
[2008-07-30 17:54:10.883] at javax.servlet.http.HttpServlet.service(HttpServlet.java:92)
[2008-07-30 17:54:10.883] at com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:106)
[2008-07-30 17:54:10.883] at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:173)
[2008-07-30 17:54:10.883] at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:229)
[2008-07-30 17:54:10.883] at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:274)
[2008-07-30 17:54:10.883] at com.caucho.server.port.TcpConnection.run(TcpConnection.java:511)
[2008-07-30 17:54:10.883] at com.caucho.util.ThreadPool.runTasks(ThreadPool.java:520)
[2008-07-30 17:54:10.883] at com.caucho.util.ThreadPool.run(ThreadPool.java:442)
[2008-07-30 17:54:10.883] at java.lang.Thread.run(Thread.java:595)
If I comment out the aop:around configs, or I set a pointcut to a method that doesn't exist on Service, my service works fine.
My aspect does nothing at the moment:
public Object doRecordEvent(ProceedingJoinPoint pjp) throws Throwable {
return pjp.proceed();
}
thanks,
Bill
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email