5 Replies Latest reply on Nov 21, 2006 2:41 AM by gquintana

    Component not found in War

    gquintana

      Hello,

      My application is structured as usual:
      MyApp.ear
      +- MyEjb.jar
      +- MyWeb.war

      When I place a component in the EJB Jar, Seam finds it perfectly. On the contrary, when I place it in the War, it doesn't see it (I looked for it in Seam traces when I deployed my app).

      My component is a simple java bean used for a presentation thing (no need for a Stateless session bean):

      @Name("myJavaBean")
      @Scope(ScopeType.STATELESS)
      public class MyJavaBean {
      (...)
      }


      This is why I would like it to be in the War. What should I do to tell Seam to look for components among the War classes as well?


        • 1. Re: Component not found in War
          pmuir

          Yu can't put seam components in the war. If you don't want them in the EJB jar you could always put them in another jar. Just don't forget seam.properties for them to loaded automatically.

          • 2. Re: Component not found in War
            gavin.king

            So you package your component class directly in WEB-INF/classes? OK, well, you would need to add a WEB-INF/classes/META-INF/seam.properties file so that Seam's scanner will scan that directory for components.

            • 3. Re: Component not found in War
              gquintana

              I tried to put an empty seam.properties file in MyApp.ear/MyWeb.war/WEB-INF/classes/META-INF (as you told me) without success. I tried to put it in MyApp.ear/MyWeb.war/WEB-INF/classes as well.

              I am using JBoss Seam 1.0.1 on JBoss AS 4.0.5.GA. Should I upgrade to JBoss Seam 1.1.Beta2?

              • 4. Re: Component not found in War
                gavin.king

                Hum, OK, then perhaps that doesn't work. I thought it would, but I guess I need to scan on a different classloader. Or perhaps it just can't work at all. Add a feature request to JIRA if this really matters to you and you want me to investigate firther.

                • 5. [Resolved] Re: Component not found in War
                  gquintana

                  I will package them separately as petemuir told me to, I tried and it works:
                  MyApp.ear
                  +- MyEjb.jar: Business beans (EJB 3)
                  +- MyWeb.jar: Presentation beans
                  +- MyWeb.war: JSP, images...

                  Nevertheless it could be a good thing to have this feature in future release. The Stripes framework automatically detects annotated action beans located in a War, so it is not impossible.

                  Thanks for your help