2 Replies Latest reply on May 19, 2005 1:27 PM by starksm64

    4.0.2 putting @xxxxxx in JNDI name for entity beans. 4.0.1 d

    mcdonalda

      Morning chaps,

      Having problems with JBoss 4.0.2 and JNDI names. I have a number of entity beans which successfully deployed with 4.0.1 (and prior), and their jndi names would be as I expect e.g. jndiName=local/User, service=EJB.

      With 4.0.2 an @ sign, followed by a number is added to alll entity beans, and only entity beans e.g. jndiName=local/User@3379466. This number changes everytime I restart JBoss, and it is different for each of the 40 or so entity beans I have. My session beans jndi names behave as in 4.0.1 e.g. ejb/ticket does not have this number tagged onto it.

      Needless to say the look up used in the application attempt to lookup local/User, not local/User@3379466.

      As far as I can work out all configuration files are the same between both versions of JBoss. Is there some magic switch I should set in JBoss 4.0.2 to stop this happening.

      Any guidance most appreciated.
      Angus

        • 1. Re: 4.0.2 putting @xxxxxx in JNDI name for entity beans. 4.0
          mcdonalda

          Right, after a lot more digging firstly I found a reference to adding local-jndi-name to the individual xxxx-jboss.xml descriptor files. This worked for me, but I notice from postings on the web that it doesn't work for everyone. Hmmm, I wonder if they are using a version of JBoss earlier than 4.0.2.

          I certainly didn't need this extra tag when running our app under 4.0.1.

          I also found this reference

          http://www.jboss.org/?module=bb&op=viewtopic&t=60753

          which explained the need for the local-jndi-name tag. It should have been needed for 4.0.1, but somehow out app worked without this tag.

          For expediancy I will have to add this tag to all our entity bean descriptors. Now, should I numb my mind and do it manually (there are 40 to 50 of the buggers) or should I write a Java program to step through each of the descriptors.

          Then again I can always go and get a drink from the 'coffee machine', which dispenses a warm brown liquid, almost but not quite entirely like tea.

          Angus

          • 2. Re: 4.0.2 putting @xxxxxx in JNDI name for entity beans. 4.0
            starksm64

            You should never have been looking up the local ejbs from the global jndi namespace in the first place. Its only an implementation detail of jboss that allowed you to do this. I doubt it would work an any other app server. You should be using the ejb-local-ref mechanism to access the local home in a portable way:

            http://wiki.jboss.org/wiki/Wiki.jsp?page=HowDoIAccessALocalHome