2 Replies Latest reply on Aug 10, 2006 8:30 PM by vitalstrike82

    No ejb-link in web.xml and jndi-name in jboss-web.xml

      hi guys, i have a qns hope some of you will reply me.

      I have just deploy an ear file in jboss4.0.3 and it give these errors.

      Caused by: javax.naming.NamingException: ejb-ref: ejb/MyMusicCart, No ejb-link in web.xml and jndi-name in jboss-web.xml.

      I have check the web.xml and i do have state the ejb-ref-name of the specific bean. However i do not have the jboss-web.xml file cos i read that jboss will auto configure the jndi.

      Can anyone of you help me please? i can put up more codes if u guys request to.

      partial codes for web.xml

      <ejb-ref>
       <ejb-ref-name>ejb/EJBMusic</ejb-ref-name>
       <ejb-ref-type>Session</ejb-ref-type>
       <home>asg.MusicEJB.MusicIteratorHome</home>
       <remote>asg.MusicEJB.MusicIterator</remote>
       </ejb-ref>
       <ejb-ref>
       <ejb-ref-name>ejb/MyMusicCart</ejb-ref-name>
       <ejb-ref-type>Session</ejb-ref-type>
       <home>asg.MusicCartEJB.MusicCartHome</home>
       <remote>asg.MusicCartEJB.MusicCart</remote>
       </ejb-ref>
      </web-app>


      codes for ejb-jar for MusicCart
      display-name>MusicCartBean</display-name>
       <ejb-name>MusicCartBean</ejb-name>
       <home>asg.MusicCartEJB.MusicCartHome</home>
       <remote>asg.MusicCartEJB.MusicCart</remote>
       <ejb-class>asg.MusicCartEJB.MusicCartBean</ejb-class>
       <session-type>Stateful</session-type>
       <transaction-type>Bean</transaction-type>
       <security-identity>
       <description></description>
       <use-caller-identity></use-caller-identity>
       </security-identity>
       </session>
       </enterprise-beans>



        • 1. Re: No ejb-link in web.xml and jndi-name in jboss-web.xml
          jaikiran

          Add the ejb-link to your web.xml as follows:

          <ejb-ref>
           <ejb-ref-name>ejb/EJBMusic</ejb-ref-name>
           <ejb-ref-type>Session</ejb-ref-type>
           <home>asg.MusicEJB.MusicIteratorHome</home>
           <remote>asg.MusicEJB.MusicIterator</remote>
           <ejb-link>MusicBean</ejb-link> <!-- The name should match the ejb-name that you have specified for asg.MusicEJB.MusicIterator bean in its ejb-jar.xml file-->
           </ejb-ref>
           <ejb-ref>
           <ejb-ref-name>ejb/MyMusicCart</ejb-ref-name>
           <ejb-ref-type>Session</ejb-ref-type>
           <home>asg.MusicCartEJB.MusicCartHome</home>
           <remote>asg.MusicCartEJB.MusicCart</remote>
           <ejb-link>MusicCartBean</ejbj-link>
           </ejb-ref>
          </web-app>


          1 of 1 people found this helpful
          • 2. Re: No ejb-link in web.xml and jndi-name in jboss-web.xml

            Hi Jaikiran,
            Thanks for your advice. my program works after following your solutions.
            Thanks
            Regards
            ChongMing