0 Replies Latest reply on Oct 6, 2003 2:15 AM by tibo

    ejb-ref problem

    tibo Newbie

      Hi,

      I got a error when I deploy my ear application into Jboss 4.0. The EAR contains an EJB module and a WAR module. The EJB Module contains 2 Session EJB: BankService and AccountService.

      Any help should be appreciated!
      Tks,

      Here is the error I got:
      ------------------------------
      09:32:36,468 WARN [ServiceController] Problem starting service jboss.deployment
      :name=file%3a/C%3a/Softs/JBoss/server/btc/deploy/samples.ear/samples-web.war/,se
      rvice=DeploymentInfo
      org.jboss.deployment.DeploymentException: Error during deploy; - nested throwabl
      e: (javax.naming.NamingException: ejb-ref: ejb/BankService, no ejb-link match, u
      se jndi-name in jboss-web.xml)



      Here is the EJB module DD (in META-INF):
      ejb-jar.xml
      --------------
      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN" "http://java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd">
      <ejb-jar>
      <display-name>BTF Framework samples EJB services</display-name>
      <enterprise-beans>

      <ejb-name>BankService</ejb-name>
      com.btc.framework.samples.service.BankServiceHome
      com.btc.framework.samples.service.BankService
      <ejb-class>com.btc.framework.samples.service.impl.BankServiceBean</ejb-class>
      <session-type>Stateless</session-type>
      <transaction-type>Container</transaction-type>
      <!--
      <resource-ref>
      DS
      <res-ref-name>jdbc/SAMPLESDB</res-ref-name>
      <res-type>javax.sql.DataSource</res-type>
      <res-auth>Container</res-auth>
      </resource-ref>
      -->



      <ejb-name>AccountService</ejb-name>
      com.btc.framework.samples.service.AccountServiceHome
      com.btc.framework.samples.service.AccountService
      <ejb-class>com.btc.framework.samples.service.impl.AccountServiceBean</ejb-class>
      <session-type>Stateless</session-type>
      <transaction-type>Container</transaction-type>
      <!--
      <resource-ref>
      DS
      <res-ref-name>jdbc/SAMPLESDB</res-ref-name>
      <res-type>javax.sql.DataSource</res-type>
      <res-auth>Container</res-auth>
      </resource-ref>
      -->

      </enterprise-beans>
      </ejb-jar>

      jboss.xml
      ------------
      <?xml version="1.0" encoding="UTF-8"?>


      <enterprise-beans>

      <ejb-name>BankService</ejb-name>
      <jndi-name>ejb/BankService</jndi-name>


      <ejb-name>BankService</ejb-name>
      <jndi-name>ejb/AccountService</jndi-name>

      </enterprise-beans>




      Here is the WAR module DD:

      web.xml
      -----------
      <?xml version="1.0" encoding="ISO-8859-1"?>
      <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">

      <web-app>
      <display-name>BTF Framework samples web client</display-name>
      <welcome-file-list>
      <welcome-file>index.jsp</welcome-file>
      <welcome-file>index.html</welcome-file>
      </welcome-file-list>

      <ejb-ref>
      <ejb-ref-name>ejb/BankService</ejb-ref-name>
      <ejb-ref-type>Session</ejb-ref-type>
      com.btc.framework.samples.service.BankServiceHome
      com.btc.framework.samples.service.BankService
      </ejb-ref>

      <ejb-ref>
      <ejb-ref-name>ejb/AccountService</ejb-ref-name>
      <ejb-ref-type>Session</ejb-ref-type>
      com.btc.framework.samples.service.AccountServiceHome
      com.btc.framework.samples.service.AccountService
      </ejb-ref>

      </web-app>




      jboss-web.xml
      -------------------
      <?xml version="1.0" encoding="UTF-8"?>
      <web-app>
      <ejb-ref>
      <ejb-ref-name>ejb/BankService</ejb-ref-name>
      <ejb-ref-type>Session</ejb-ref-type>
      com.btc.framework.samples.service.BankServiceHome
      com.btc.framework.samples.service.BankServiceHome
      <ejb-link>BankService</ejb-link>
      </ejb-ref>

      <ejb-ref>
      <ejb-ref-name>ejb/AccountService</ejb-ref-name>
      <ejb-ref-type>Session</ejb-ref-type>
      com.btc.framework.samples.service.AccountServiceHome
      com.btc.framework.samples.service.AccountServiceHome
      <ejb-link>AccountService</ejb-link>
      </ejb-ref>
      </web-app>