Hi,

I finally solved my problems now...Thank you, Kabir, for your help. It was 
somewhat tricky, although everything was available in tutorials, but some of 
them were contradictory etc.

So for those of you, who are beginners of implementing aop, here is what I did 
for implementing my first aspect:

1. Install JBoss-4.0.0 (download the zip-file from jboss.org) and JDK1.5

2. delete the jboss-aop.deployer-file from server/all/deploy

Note: I had to use the jboss-all-configuration, aop did not work with the 
default-configuration on my system.


3. Download jboss-aop_1.0.0-FINAL.zip from jboss.org and unzip it. Copy the 
whole jboss-aop-jdk50.deployer directory into your server/all/deploy directory. 
(If you are using jdk1.4 you have to copy the jboss-aop.deployer-directory)

4. Now, modify the jboss-service.xml-file in the 
jboss-aop-jdk50.deployer/META-INF directory. The only thing you have to do is 
to set the "EnableTransformer"-Attribute to TRUE. This will cause jboss to take 
a longer time when starting up.

Note: On my system it was not enough to simply set the same attribute to TRUE 
on the jmx-console. 

5. Start the all-configuration by the command
        run -c all
on your console.

6. The packaging looks like this:

HelloWorld.ear contains:

-HelloWorld.jar // here are simple EnterpriseBeans that say "HelloWorld"
-Aspect.aop // this is a jar-file ending with the suffix .aop, which contains 
the aspect code
-Maybe you also add .war-files if you are implementing a servlet
-finally a META-INF/application.xml-file

My application.xml-file looks like this:

<?xml version='1.0'  encoding='UTF-8'?>
  | <!DOCTYPE application PUBLIC '-//Sun Microsystems, Inc.//DTD J2EE 
Application 1.2//EN'
  |                              
'http://java.sun.com/j2ee/dtds/application_1_2.dtd'>
  | 
  | <application>
  |     <display-name>AOP in JBoss example</display-name>
  |     <module>
  |         <ejb>HelloWorld.jar</ejb>
  |     </module>
  |     <module>
  |         <java>Aspect.aop</java>
  |     </module>
  | </application>
  | 

Just for completeness, the HelloWorld.jar contains:
- HelloWorld.class  //Remote Interface
- HelloWorldBean.class // Your enterprise bean
- HelloWorldHome.class // Home-Interface
- META-INF/ejb-jar.xml  // deployment-descriptor for the beans

and my Aspect.aop-file contains:
- aspect.class // Aspect code as described in the tutorials
- META-INF/jboss-aop.xml  // AOP-Deployment-descriptor

Note:
Make sure that, when trying to set an aspect on a bean-class or just one method 
of a bean-class for example, the -tag - or other tags in your 
jboss-aop.xml-file - must describe the whole package-structure of your code, to 
find the correct class.

7. Copy this .ear-file to the server/all/deploy-directory to deploy it on the 
server

8. Run your client

Of course, there are different methods to make it work, but this on fit for me.
I hope it might help you...

OLLI



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

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


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to