4 Replies Latest reply on Mar 5, 2009 8:56 AM by thomasgo

    Embed ejb3-interceptors-aop.xml or equivalent into EAR

    thomasgo

      Hi,

      We need to introduce serveral interceptors into our application. So far I added one interceptor to a jar which is contained in our EAR and registered the interceptor as well as the pointcut in the ejb3-interceptors-aop.xml.

      However, we'd prefer to embed that information into our EAR so that we only have to deploy that file and can have the interceptors added to our service calls.

      Is that even possible? If so, how?

      Thanks in advance for your help.

      Thomas

        • 1. Re: Embed ejb3-interceptors-aop.xml or equivalent into EAR
          kabirkhan

          Look at the injboss example that comes with the download

          • 2. Re: Embed ejb3-interceptors-aop.xml or equivalent into EAR
            thomasgo

            Thanks for your reply. I had a look at the injboss example and already tried some of the things mentioned in there before, but to no avail.

            If I understand the examples correctly, I have to set this: false to true in order to enable general aop without precompilation. However, if I do this I get exceptions since the transformator is missing. OK, I could install it, but that would require to deliver it to every jboss installation our software runs in.

            So I tried various approaches without loadtime weaving explicitly enabled: annotated interceptors, stand-alone jboss-aop.xml, embedded jboss-aop.xml
            None worked, which would not surprise me in terms of standard aop (since I'm neither weaving at compile time nor explicitly at load time).

            However, since interceptors work without any additional aop preparations (neither aopc nor loadtime weaving) if they are listed in ejb3-interceptors-aop.xml, there must be some way to achieve the same with embedding a corresponding file into our EAR.

            So far, I came up with a solution that we might stick with: we deploy another xml file called lisa-interceptors-aop.xml (our application is called lisa :) ) which redefines and extends domain "Stateless Beans" (). This approach works, but requires us to deploy 2 additional files (the xml and the jar with the interceptors, which we don't want to include into the EAR).

            As I said we might stick with that for now.
            But I'd really appreciate some enlightenment how that whole thing should work with everything embedded into the EAR and without any explicit weaving (just standard jboss ejb3 mechanisms). Maybe I missed something in the documentation that you could point me to :)

            Thanks in advance.

            Thomas

            • 3. Re: Embed ejb3-interceptors-aop.xml or equivalent into EAR
              kabirkhan

              I'm not sure I understand what you mentioned at the end? You should be able to include the lisa-interceptors-aop.xml and jar containing the interceptors into your ear?

              • 4. Re: Embed ejb3-interceptors-aop.xml or equivalent into EAR
                thomasgo

                Well, I didn't try to embed lisa-interceptors-aop.xml into the EAR but I tried with ejb3-interceptors-aop.xml. This didn't work, but maybe it's just because the original file still resided in the deploy directory, was loaded before and the embedded file was rejected.

                I'll try it with both embedded when I have some more time play around with it.

                Thanks for your help. :)