3 Replies Latest reply on May 9, 2004 11:21 AM by Bill Burke

    Multiple metadata-aop.xml

    mriou Newbie

      Hi,

      My project is made of several modules. Each module produces its own metadata-aop.xml. All those modules are used in a web application and packaged in the web-inf/lib directory. In this context, can I make JBossAOP use several metadata-aop.xml (with different names of course) ? Could they even be loaded if I put them all in the meta-inf directory following some naming convention (I'm probably dreaming here) ?

      I wouldn't like to merge all those files manually...

      Thanks.

        • 1. Re: Multiple metadata-aop.xml
          Bill Burke Master

          I haven't done a lot of experimentation here, so please have patience. What I think you can do is put stuff in a .sar file or directory as follows:

          myapplication.sar/
           metadata1-aop.xml
           metadata2-aop.xml
           myweb.war
          


          Read these as well:

          http://jboss.org/wiki/Wiki.jsp?page=Packaging
          http://jboss.org/wiki/Wiki.jsp?page=RunningWithJBossApplicationServer

          Instead of putting stuff in the web-inf/lib directory, have this structure:

          myapplication.sar/
           mylibrary.aop/
           com/mycompany/Foo.class....
           META-INF/jboss-aop.xml
           mylibrary2.aop/
           com/mycompany/Bar.class....
           META-INF/jboss-aop.xml
           myweb.war
          


          Get back to me with problems. Hey, if you're interested, could you possibly write up some of your experiences with packaging on our WIKI? A HOWTO or something?

          With JBoss AOP beta2 release you will also be able to embed metadata as annotations within .class files. The annotations are binary compatible with JDK 1.5 annotations. JBoss AOP beta2 release will be may 4th or 5th.

          Bill


          • 2. Re: Multiple metadata-aop.xml
            mriou Newbie

            My problem is I'm using JBossAOP in a standalone mode, note with the JBoss application server. But if I can find a (not too ugly) way to package everything, I'll be happy to explain it in a 'how to'.

            But if you have any other suggestion, I'd be happy to experiment. Moving to JDK 1.5 just for annotations doesn't really seduce me.

            • 3. Re: Multiple metadata-aop.xml
              Bill Burke Master

              Ok, I will expand the jboss.aop.path System property variable to accept directories and load any XML file that has the form *-aop.xml.

              Other than that, do take a look at the packaging example in the JBoss AOP beta distribution. This solution works with standalone, but resolves XML files by classloader.getResources("META-INF/jboss-aop.xml") only.

              FYI, beta2 will have an annotation compiler for JDK 1.4 so that you can use annotations within JDK 1.4.

              Bill