5 Replies Latest reply on Apr 13, 2007 11:57 PM by cptnkirk

    Seam and 3rd party EJB

    sradford

      Hi,

      Can't find this in the doco I'm afraid...

      Can I define a 3rd party EJB (i.e. one with no @Name) as a Seam component for injection? Or do I just have to use the @EJB injection annotation?

      Thanks,

      Sean

        • 1. Re: Seam and 3rd party EJB
          sammy8306

          I was wondering the same thing, but I think you can define them as components in components.xml, which would avoid the need for the @Name annotation. Not sure about the exact syntax...

          However, for the more general case, it would be nice for example to add Hibernate validator annotations independently to existing EJB3 beans as well. Not sure whether this can be achieved, maybe by subclassing and overriding while adding the annotations?

          • 2. Re: Seam and 3rd party EJB
            sradford

            Yes, I would have thought that you would define it in components.xml, but don't know the syntax as you need to specify an EJB (or JNDI) name rather than the class for the component

            Just looked at the components xsd and tried the following as a result:

            <component name="mySeamComponent" jndi-name="mydomain/TargetEJB/local" scope="stateless"/>

            but nothing is injected and consequently get an NPE.

            Any ideas?

            • 3. Re: Seam and 3rd party EJB
              sammy8306

              Anybody with ideas on this? I would like to use my EJB3 entities as well, without having to alter their source by adding a @Name (or other) annotation. Is this possible?

              • 4. Re: Seam and 3rd party EJB
                shane.bryzak

                I think we should support this - can you please raise it as a JIRA issue and we'll then be forced to address it one way or the other.

                • 5. Re: Seam and 3rd party EJB

                  Double check that jndi-name with the pattern in components.properties. All of my lookups are of the form #{ejbName}/local no domain.