[jboss-user] [JBoss AOP] - jboss-aop configuration help needed
csr1978
do-not-reply at jboss.com
Tue Dec 2 10:06:34 EST 2008
Hi,
I am new to JBoss AOP concept and need some help in configuring it. I have a web application deployed to jboss server 4.2.0. I am trying to configure logging interceptor for the web application with aop. so far i followed these steps:
package jboss.aop.interceptor; import org.jboss.aop.joinpoint.Invocation;import org.jboss.aop.joinpoint.MethodInvocation;import org.jboss.aop.advice.Interceptor; public class MethodInterceptor implements Interceptor{ public String getName() { return "MethodInterceptor"; } public Object invoke(Invocation invocation) throws Throwable { try { MethodInvocation mi = (MethodInvocation)invocation; System.out.println("<<< Entering MethodInterceptor for: " + mi.getMethod().toString()); return invocation.invokeNext(); } finally { System.out.println(">>> Leaving MethodInterceptor"); } }}
compiled this class and created a jar file with this class.
created jboss-aop.xml file as follows:
<?xml version="1.0" encoding="UTF-8"?><aop> <bind pointcut="execution(* com.tnt.thin.servlet.DDServlet->*(..))"> <interceptor class="jboss.aop.interceptor.MethodInterceptor"/> </bind></aop>
Modified jboss-service.xml file in server/default/deploy/jboss-aop-jdk50.deployer/META-INF/jboss-service.xml to:
<attribute name="EnableLoadtimeWeaving">true</attribute>
copied the jar file to server/default/lib directory
copied the jboss-aop.xml file to server/default/deploy directory.
I restarted the jboss server after doing all of the above steps and got this error:
Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException: No ClassLoaders found for: jboss.aop.interceptor.MethodInterceptor
Could anyone point me to the right direction.
Thanks,
Srikanth.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4193762#4193762
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4193762
More information about the jboss-user
mailing list