11 Replies Latest reply on Mar 9, 2012 7:04 AM by Sony Abraham

    JNDI naming issue: Migrating to AS7 using EJB 2.1



      I'm trying to migrate my ear-File from JBoss 5.1 to JBoss AS 7.01. I'm using EJB 2.1 and cannot change to 3.0 right now.

      My application deploys, but when I start the application I run into JNDI naming problems since the JNDI naming rules have changed from 2.1 to 3.0

      (javax.naming.NameNotFoundException: Name 'myapp' not found in context '')


      In the documentation( https://docs.jboss.org/author/display/AS7/Order+Application+Migration+from+EAP5.1+to+AS7 ) they solved it by changing the code to use the @EJB annotation. They write there, that this is not a required change. [ I cannot change to EJB 3.0, so I need another solution. ]


      Important: My ear-file needs to be deployable on different AS as well (IBM Websphere etc.), so I'm restricted in terms of making code changes.


      What do you recommend?



      Ideas and comments:


      - Is there a way to alias the JNDI names or to use a mapping from the new JNDI namespace to the 2.1 standard i.e from





      - In a German Java journal they write that you have to adapt the ServiceLocator. How does that work? Is this possible when I also want to use the ear-File on other ASs? [They also write that EJB 2.1 is again completely supported in AS 7.1.0, do I have to wiat?]


      - In https://docs.jboss.org/author/display/AS7/Seam+2+Booking+EAR+Migration+of+Binaries+-+Step+by+Step they resolve the JNDI naming problems using the components.xml. Can I use a similar solution? Unfortuantely the components.xml is part of Seam 2...


      I apprecite your help;)