10 Replies Latest reply on Feb 9, 2006 1:25 PM by Gavin King

    Beta 2: Names vs JNDI, jndiPattern, etc

    ryan dewell Novice

      I don't know if it was a change in the ejb spec, Seam, or both, but my Seam code has just become a whole lot more complicated and error prone with this new release -- all with regard to the new JNDI naming requirements.

      For example, my *.ejb contains code for multiple web applications. They both have a Login local and LoginImpl SFSB, in different packages of course.

      Previously I could just give them different Seam names:

      @Name("CommerceLogin");
      @Name("ManagementLogin");

      And we were good to go. In Beta 2, though, these two beans are going to share the exact same JNDI name / location, since they're both Login+LoginImpl. Is this a change in the EJB spec? -- why didn't this conflict exist previously?

      So, to be absolutely safe and free of conflicts between the code of both web applications, I'm going to do this on every single bean:

      @Name("CommerceLogin");
      @Stateful(name="CommerceLogin");

      and

      @Name("ManagementLogin");
      @Stateful(name="ManagementLogin");

      What a weird change and a waste of typing. The alternative is to try and make sure that both packages never reuse the same class name which again is odd.

      If this new behavior isn't going away, can Seam at least allow:

      @Name()

      and then derive the name from

      @Stateful(name="**");

      ?

      Also, I'd suggest that Seam issue some kind of WARNING if it detects to Components with the same JNDI name which is what happens in the above example.

      I really like the old way of doing the JNDI lookup by fully qualified class name...

      Best regards,

      Ryan