0 Replies Latest reply: Mar 20, 2012 1:37 PM by Franklin Webber RSS

AOP for JBoss web service

Franklin Webber Newbie

I'm trying to use JBoss AOP to instrument an existing web service that runs in JBoss AS 5.1.

Unfortunately, I'm unable to get AOP to work within JBoss, despite having read a

substantial amount of documentation and done a substantial amount of fiddling around

with the "injboss" example from the AOP distribution.  (In contrast, I have been able

to get AOP to work with standalone Java programs, outside JBoss.)

 

Can anyone tell me why the following steps fail to demonstrate compile-time AOP instrumentation?

(I've also tried one of the "injboss" examples for run-time weaving, which also

does not work, but I'm guessing the compile-time example will be simpler

by not involving the Aspect Manager or a Java Agent.)

 

-- unzip jboss-5.1.0.GA-jdk6.zip

-- unzip jboss-aop-2.1.8.GA.zip

-- upgrade JBoss using the instructions in jboss-50-install/ReadMe-AS5.txt

-- modify docs/aspect-framework/examples/injboss/build-jboss5.xml ,

   setting jboss.dir , jboss.server.config , and jboss.classpath

-- run ant on build-jboss5.xml for the deploy-basic-ct-war target

-- run jboss

-- look at aopexample/index.jsp in a browser.

 

The result is ClassNotFoundException: org.jboss.injossaop.lib.SimpleInterceptor .

I note that this is similar to a problem described by poster Karen Greene

several years ago in https://community.jboss.org/message/446338#446338 .

She says she resolved the problem but does not say how.

 

I tried resolving the problem by adding aopexamplelib.jar to the JBoss AS class-path.

The result is NoClassDefFoundError:  org/jboss/aop/advice/Interceptor .

 

I then tried adding both aopexamplelib.jar and jboss-aop-single.jar from the AOP

distribution to the JBoss AS class-path.  The result is

NoSuchMethodError: org.jboss.logging.util.LoggerPluginWriter.<init> .

I do not know how to resolve this, as I see the named class in jboss-aop-single.jar .

 

Got an explanation? Useful advice? Helpful insight?