2 Replies Latest reply on Nov 23, 2002 8:07 AM by tthiele

    Please help me - What's wrong in DD/ejb-ref?

    tthiele

      My won't get deployed and I'm too dump to see the reason.
      I'm using jboss-3.0.4_tomcat-4.1.12.
      The deployer always complains:

      01:46:31,055 ERROR [URLDeploymentScanner] Failed to deploy:
      org.jboss.deployment.scanner.URLDeploymentScanner$DeployedURL@a15fb685{
      url=file:/work/kulanz2/distrib/jboss-3.0.4_tomcat-4.1.12/server/default/deploy/kulanz.ear,
      deployedLastModified=0 }
      org.jboss.deployment.DeploymentException: Error during deploy; -
      nested throwable: (javax.naming.NamingException: ejb-ref: kulanz/Benutzer,
      no ejb-link match, use jndi-name in jboss-web.xml)
      at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:309)
      ...

      I tried some different combinations.
      However, these are the entries which should be appropriately (IMHO):

      this is the ejb-ref element in web.xml:

      <ejb-ref id="EJBRef_1">
      <ejb-ref-name>kulanz/Benutzer</ejb-ref-name>
      <ejb-ref-type>Entity</ejb-ref-type>
      de.ems.kulanz.benutzer.ejbcommon.BenutzerHome
      de.ems.kulanz.benutzerejbcommon.Benutzer
      </ejb-ref>

      this is the ejb-ref element in jboss-web.xml:

      <!-- EJB References -->
      <ejb-ref>
      <ejb-ref-name>kulanz/Benutzer</ejb-ref-name>
      <jndi-name>ejb/kulanz/Benutzer</jndi-name>
      </ejb-ref>

      this is the EJB-Entry in ejb-jar.xml:

      <!-- Entity Beans -->

      <![CDATA[Dies ist ein Benutzer-Bean.]]>
      <ejb-name>Benutzer</ejb-name>
      de.ems.kulanz.benutzer.ejbcommon.BenutzerHome
      de.ems.kulanz.benutzer.ejbcommon.Benutzer
      <ejb-class>de.ems.kulanz.benutzer.ejbimpl.BenutzerCMP</ejb-class>
      <persistence-type>Container</persistence-type>
      <prim-key-class>de.ems.kulanz.benutzer.ejbcommon.BenutzerPK</prim-key-class>
      ...


      this is the relevant entry in jboss.xml:


      <ejb-name>Benutzer</ejb-name>
      <jndi-name>ejb/kulanz/Benutzer</jndi-name>



      On the other hand, if I add an <ejb-link> element in web.xml like this:

      <ejb-ref id="EJBRef_1">
      <ejb-ref-name>kulanz/Benutzer</ejb-ref-name>
      <ejb-ref-type>Entity</ejb-ref-type>
      de.ems.kulanz.benutzer.ejbcommon.BenutzerHome
      de.ems.kulanz.benutzerejbcommon.Benutzer
      <ejb-link>Benutzer</ejb-link>
      </ejb-ref>

      the application gets deployed but when I try to access the bean by the ENC name
      "java:comp/env/ejb/Benutzer" the following happens:

      02:18:15,874 ERROR [STDERR] javax.naming.NameNotFoundException: ejb not bound
      02:18:15,875 ERROR [STDERR] at org.jnp.server.NamingServer.getBinding(NamingServer.java:495)