Hello,

As the subject says, I can't actually get JBossAOP to work successfully in 
JBoss-4.0.4.CR2. I'm new with JBossAOP, and still quite new with JBoss. I have 
already looked into many resources on the internet but to no avail (or I'm not 
reading at the right place).

My JBoss configuration as follows:
- JBoss-4.0.4.CR2 downloaded using the zip archive.
- copied file from JBoss EJB3 RC6.
- used the 'all' config in JBoss.
- OS: WinXP SP2.
- run JBoss using following command line: run -c all.

Following is the file structure I deployed:

-- LearningAop.jar
  |    +-- LearningWeb.war
  |    |    +-- WEB-INF [dir]
  |    |         +-- web.xml
  |    |         +-- classes [dir]
  |    |              +-- amry [dir]
  |    |                   +-- learning [dir]
  |    |                        +-- CatchAll.class
  |    +-- myinterceptor.aop
  |         +-- amry [dir]
  |         |    +-- learning [dir]
  |         |         +-- MyTestInterceptor.class
  |         +-- META-INF [dir]
  |              +-- jboss-aop.xml

The web.xml and CatchAll.class simply contains normal configuration for a 
servlet, this is working fine.

MyTestInterceptor source as follows:
package amry.learning;
  | 
  | import org.jboss.aop.advice.Interceptor;
  | import org.jboss.aop.joinpoint.Invocation;
  | import org.jboss.logging.Logger;
  | 
  | public class MyTestInterceptor implements Interceptor {
  |     private static final Logger log = 
Logger.getLogger(MyTestInterceptor.class);
  | 
  |     public String getName() {
  |         return null;
  |     }
  | 
  |     public Object invoke(Invocation invocation) throws Throwable {
  |         log.info("MyTestInterceptor.invoke()");
  |         return invocation.invokeNext();
  |     }
  | }

jboss-aop.xml content as follows:
<?xml version="1.0" encoding="windows-1252" ?>
  | <aop>
  |     <bind pointcut="execution(* *->*(..))">
  |         <interceptor class="amry.learning.MyTestInterceptor"/>
  |     </bind>
  | </aop>

When the page is called from the browser, the output to the browser works fine. 
And output to the console by the servlet (I've used Logger in the servlet) also 
works fine. But there is no output by the interceptor I defined.

If it helps my questions, I've already created a container and client-side 
proxy interceptors which I defined inside ejb3-interceptors-aop.xml, this works 
perfectly fine.

I hope somebody could clear out for me if I'm doing something wrong. Any 
additional info needed please post to this topic. TQ in advance.

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

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


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to