1 Reply Latest reply on Nov 10, 2002 4:01 PM by adrian.brock

    ejb-local-ref in web.xml unable to find JNDI name

      Using the 3.03 JBoss/Jetty binary, I defined an entity bean using local interfaces. The bean is then referenced from servlet code using the local home. This works so long as the web-client.xml and jboss-web.xml files reference this bean as if it were a remote bean. Using ejb-local-ref generates this error on deployment:
      org.jboss.deployment.DeploymentException: ejb-local-ref: ejb/Program, target not found, add valid ejb-link; - nested throwable: (javax.naming.NamingException: ejb-local-ref: ejb/Program, target not found, add valid ejb-link)

      web-client.xml
      <ejb-local-ref>
      <ejb-ref-name>ejb/Program</ejb-ref-name>
      <ejb-ref-type>Entity</ejb-ref-type>
      <local-home>road.interfaces.ProgramHome</local-home>
      road.interfaces.Program
      </ejb-local-ref>
      jboss-web.xml
      <ejb-local-ref>
      <ejb-ref-name>ejb/Program</ejb-ref-name>
      <local-jndi-name>ejb/Program</local-jndi-name>
      </ejb-local-ref>
      jboss.xml

      <ejb-name>Program</ejb-name>
      <local-jndi-name>ejb/Program</local-jndi-name>


      If the web-client.xml snippet is changed to
      <ejb-ref>
      <ejb-ref-name>ejb/Program</ejb-ref-name>
      <ejb-ref-type>Entity</ejb-ref-type>
      road.interfaces.ProgramHome
      road.interfaces.Program
      </ejb-ref>
      then the war deploys without error and the beans can be referenced.

      (I have a good reason for accessing entity beans from a servlet using local interfaces. This is legal, if unusual)



        • 1. Re: ejb-local-ref in web.xml unable to find JNDI name

          jboss-web_3_0.dtd
          does not contain a <ejb-local-ref> element.

          The error message is telling you to add an <ejb-link>.

          <ejb-local-ref>
          <ejb-ref-name>ejb/Program</ejb-ref-name>
          <ejb-ref-type>Entity</ejb-ref-type>
          <local-home>road.interfaces.ProgramHome</local-home>
          road.interfaces.Program
          <ejb-link>Program</ejb-link>
          </ejb-local-ref>

          Regards,
          Adrian