1 2 Previous Next 19 Replies Latest reply on Jun 12, 2011 11:08 AM by kenfinni Go to original post
      • 15. Re: Seam Solder and native logger API not working for me...
        kenfinni

        Hanspeter,


        For Java EE 6 it is possible to deploy an EJB jar on it's own, but I believe that a CDI bean needs to be triggered by a WAR or EAR deployment.


        Please see: http://seamframework.org/Community/SeamSolderClassloadingIssueOnJBoss6

        • 16. Re: Seam Solder and native logger API not working for me...
          hpgisler

          Ken,


          Yes, for @Local beans, that certainly makes sense. But what about @Remote interfaces? They could be looked up and used via JNDI remotely, without necessitating a local caller inside WAR or EAR, couldn't they?

          • 17. Re: Seam Solder and native logger API not working for me...
            kenfinni

            Hanspeter,


            True, but for a CDI bean to be present it needs to reside within a WAR or EAR.  It can be inside a JAR, but that JAR must be deployed inside a WAR/EAR for it to work as I don't believe a JAR deployed on it's own is supported by CDI, though it is for EJBs.

            • 18. Re: Seam Solder and native logger API not working for me...
              hpgisler

              Ken,


              I've searched a bit more and found:
              CDI spec


              There it says:



              In an application deployed as an EJB jar, the container searches the EJB jar, if it is a bean archive, and every bean archive referenced by the EJB jar.

              and further up:



              Bean classes of enabled beans must be deployed in bean archives.

              and



              A directory in the JVM classpath is a bean archive if it has a file named beans.xml in the META-INF directory.

              however



              The container is not required to support application client jar bean archives.

              If I do understand this correctly, an EJB deployed jar should be able to discover beans for injection which are located outside of the EJB if they are located in a directory, however the beans are not required to be discovered (by spec) if they are packaged inside a jar which is referenced by the EJB-jar.


              Is this correct understanding or do I measread it?


              As far as I can tell (I have tried this), cdi injection works with a EJB which is is deployed as a jar (which is not further packaged inside EAR or WAR) IFF the to be injected CDI bean is also located inside this same EJB-jar. However, if the to be injected CDI bean is located outside EJB-jar, bean discovery seems not to work (as stated earlier, I belive this has to do with some classpath issues).


              What do you think?


              P.S. Please note, this is not a killer issue for me anymore, as it works when deploying inside EAR, it just bothers me, that I don't seem to be able to understand the whole mechanism correctly. In short: I don't want to steal your precious time with this topic.

              • 19. Re: Seam Solder and native logger API not working for me...
                kenfinni

                Hanspeter,


                I think it should work both when the bean being injected is in another EJB bean archive or in a directory.


                The key might be how the EJB jar is referenced to another.  Haven't deployed EJB archives so not sure what does and doesn't work, but it could be a manifest issue in the jars.


                If not, there may be a bug in the spec implementation of either Weld or the app server.

                1 2 Previous Next