0 Replies Latest reply on Apr 27, 2002 2:50 AM by Daysen

    EJB not bound error

    Daysen Newbie

      Hello

      I have a problem with JBoss 2.4.
      My same code runs perfectly on BEA weblogic.
      When I run the code:

      Context ic = new InitialContext();
      circonscriptionHome = (CirconscriptionHome)ic.lookup("CirconscriptionEJB/CirconscriptionHome");

      I get the error: "CirconscriptionEJB not bound"

      I've gone through my ejb-jar.xml and jboss.xml many times, but i can't find the error.
      I've included the two files below.

      If someone could point out the error and let me know, I would greatly appreciate it.

      Thanks
      Daysen

      ***************************************************************************************************

      <?xml version="1.0"?>

      <!DOCTYPE ejb-jar PUBLIC
      '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN'
      'http://java.sun.com/dtd/ejb-jar_2_0.dtd'>

      <ejb-jar>
      <enterprise-beans>



      <ejb-name>CandidateEJB</ejb-name>
      <local-home>election.CandidateHome</local-home>
      election.Candidate
      <ejb-class>election.CandidateBean</ejb-class>
      <persistence-type>Bean</persistence-type>
      <prim-key-class>election.CandidatePK</prim-key-class>
      False
      <resource-ref>

      <res-ref-name>jdbc/ElectionDS</res-ref-name>
      <res-type>javax.sql.DataSource</res-type>
      <res-auth>Container</res-auth>
      </resource-ref>





      <ejb-name>CirconscriptionEJB</ejb-name>
      <local-home>election.CirconscriptionHome</local-home>
      election.Circonscription
      <ejb-class>election.CirconscriptionBean</ejb-class>
      <persistence-type>Bean</persistence-type>
      <prim-key-class>java.lang.Integer</prim-key-class>
      False
      <resource-ref>

      <res-ref-name>jdbc/ElectionDS</res-ref-name>
      <res-type>javax.sql.DataSource</res-type>
      <res-auth>Container</res-auth>
      </resource-ref>




      <ejb-name>CountingCentreEJB</ejb-name>
      <local-home>election.CountingCentreHome</local-home>
      election.CountingCentre
      <ejb-class>election.CountingCentreBean</ejb-class>
      <persistence-type>Bean</persistence-type>
      <prim-key-class>java.lang.Integer</prim-key-class>
      False
      <resource-ref>

      <res-ref-name>jdbc/ElectionDS</res-ref-name>
      <res-type>javax.sql.DataSource</res-type>
      <res-auth>Container</res-auth>
      </resource-ref>




      <ejb-name>VoteTranEJB</ejb-name>
      <local-home>election.VoteTranHome</local-home>
      election.VoteTran
      <ejb-class>election.VoteTranBean</ejb-class>
      <persistence-type>Bean</persistence-type>
      <prim-key-class>election.VoteTranPK</prim-key-class>
      False
      <resource-ref>

      <res-ref-name>jdbc/ElectionDS</res-ref-name>
      <res-type>javax.sql.DataSource</res-type>
      <res-auth>Container</res-auth>
      </resource-ref>




      <ejb-name>VotingCentreEJB</ejb-name>
      <local-home>election.VotingCentreHome</local-home>
      election.VotingCentre
      <ejb-class>election.VotingCentreBean</ejb-class>
      <persistence-type>Bean</persistence-type>
      <prim-key-class>election.VotingCentrePK</prim-key-class>
      False
      <resource-ref>

      <res-ref-name>jdbc/ElectionDS</res-ref-name>
      <res-type>javax.sql.DataSource</res-type>
      <res-auth>Container</res-auth>
      </resource-ref>




      <ejb-name>ElectionManagerEJB</ejb-name>
      election.ElectionManagerHome
      election.ElectionManager
      <ejb-class>election.ElectionManagerBean</ejb-class>
      <session-type>Stateless</session-type>
      <transaction-type>Container</transaction-type>
      <resource-ref>

      <res-ref-name>jdbc/ElectionDS</res-ref-name>
      <res-type>javax.sql.DataSource</res-type>
      <res-auth>Container</res-auth>
      </resource-ref>

      <ejb-ref>
      <ejb-ref-name>ejb/CirconscriptionEJB</ejb-ref-name>
      <ejb-ref-type>Entity</ejb-ref-type>
      election.CirconscriptionHome
      election.Circonscription
      <ejb-link>CirconscriptionEJB</ejb-link>
      </ejb-ref>

      <ejb-ref>
      <ejb-ref-name>ejb/CandidateEJB</ejb-ref-name>
      <ejb-ref-type>Entity</ejb-ref-type>
      election.CandidateHome
      election.Candidate
      <ejb-link>CandidateEJB</ejb-link>
      </ejb-ref>

      <ejb-ref>
      <ejb-ref-name>ejb/CountingCentreEJB</ejb-ref-name>
      <ejb-ref-type>Entity</ejb-ref-type>
      election.CountingCentreHome
      election.CountingCentre
      <ejb-link>CountingCentreEJB</ejb-link>
      </ejb-ref>

      <ejb-ref>
      <ejb-ref-name>ejb/VoteTranEJB</ejb-ref-name>
      <ejb-ref-type>Entity</ejb-ref-type>
      election.VoteTranHome
      election.VoteTran
      <ejb-link>VoteTranEJB</ejb-link>
      </ejb-ref>

      <ejb-ref>
      <ejb-ref-name>ejb/VotingCentreEJB</ejb-ref-name>
      <ejb-ref-type>Entity</ejb-ref-type>
      election.VotingCentreHome
      election.VotingCentre
      <ejb-link>VotingCentreEJB</ejb-link>
      </ejb-ref>



      </enterprise-beans>


      <assembly-descriptor>
      <container-transaction>

      <ejb-name>ElectionManagerEJB</ejb-name>
      <method-name>*</method-name>

      <trans-attribute>Required</trans-attribute>
      </container-transaction>


      <container-transaction>

      <ejb-name>CandidateEJB</ejb-name>
      <method-name>*</method-name>

      <trans-attribute>Required</trans-attribute>
      </container-transaction>


      <container-transaction>

      <ejb-name>CirconscriptionEJB</ejb-name>
      <method-name>*</method-name>

      <trans-attribute>Required</trans-attribute>
      </container-transaction>


      <container-transaction>

      <ejb-name>CountingCentreEJB</ejb-name>
      <method-name>*</method-name>

      <trans-attribute>Required</trans-attribute>
      </container-transaction>


      <container-transaction>

      <ejb-name>VoteTranEJB</ejb-name>
      <method-name>*</method-name>

      <trans-attribute>Required</trans-attribute>
      </container-transaction>


      <container-transaction>

      <ejb-name>VotingCentreEJB</ejb-name>
      <method-name>*</method-name>

      <trans-attribute>Required</trans-attribute>
      </container-transaction>

      </assembly-descriptor>
      </ejb-jar>

      ************************************************************************************************


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


      <enterprise-beans>

      <ejb-name>ElectionManagerEJB</ejb-name>
      <jndi-name>ElectionManagerEJB/ElectionManagerHome</jndi-name>
      <resource-ref>
      <res-ref-name>jdbc/ElectionDS</res-ref-name>
      <jndi-name>java:/ElectionDS</jndi-name>
      </resource-ref>

      <ejb-ref>
      <ejb-ref-name>ejb/CirconscriptionEJB</ejb-ref-name>
      <jndi-name>CirconscriptionEJB/CirconscriptionHome</jndi-name>
      </ejb-ref>

      <ejb-ref>
      <ejb-ref-name>ejb/CandidateEJB</ejb-ref-name>
      <jndi-name>CandidateEJB/CandidateHome</jndi-name>
      </ejb-ref>

      <ejb-ref>
      <ejb-ref-name>ejb/CountingCentreEJB</ejb-ref-name>
      <jndi-name>CountingCentreEJB/CountingCentreHome</jndi-name>
      </ejb-ref>

      <ejb-ref>
      <ejb-ref-name>ejb/VoteTranEJB</ejb-ref-name>
      <jndi-name>VoteTranEJB/VoteTranHome</jndi-name>
      </ejb-ref>

      <ejb-ref>
      <ejb-ref-name>ejb/VotingCentreEJB</ejb-ref-name>
      <jndi-name>VoteTranEJB/VoteTranHome</jndi-name>
      </ejb-ref>





      <ejb-name>CandidateEJB</ejb-name>
      <jndi-name>CandidateEJB/CandidateHome</jndi-name>
      <resource-ref>
      <res-ref-name>jdbc/ElectionDS</res-ref-name>
      <jndi-name>java:/ElectionDS</jndi-name>
      </resource-ref>




      <ejb-name>CirconscriptionEJB</ejb-name>
      <jndi-name>CirconscriptionEJB/CirconscriptionHome</jndi-name>
      <resource-ref>
      <res-ref-name>jdbc/ElectionDS</res-ref-name>
      <jndi-name>java:/ElectionDS</jndi-name>
      </resource-ref>




      <ejb-name>CountingCentreEJB</ejb-name>
      <jndi-name>CountingCentreEJB/CountingCentreHome</jndi-name>
      <resource-ref>
      <res-ref-name>jdbc/ElectionDS</res-ref-name>
      <jndi-name>java:/ElectionDS</jndi-name>
      </resource-ref>




      <ejb-name>VoteTranEJB</ejb-name>
      <jndi-name>VoteTranEJB/VoteTranHome</jndi-name>
      <resource-ref>
      <res-ref-name>jdbc/ElectionDS</res-ref-name>
      <jndi-name>java:/ElectionDS</jndi-name>
      </resource-ref>



      <ejb-name>VotingCentreEJB</ejb-name>
      <jndi-name>VotingCentreEJB/VotingCentreHome</jndi-name>
      <resource-ref>
      <res-ref-name>jdbc/ElectionDS</res-ref-name>
      <jndi-name>java:/ElectionDS</jndi-name>
      </resource-ref>


      </enterprise-beans>

      <resource-managers>
      <resource-manager
      res-class="org.jboss.ejb.deployment.JDBCResource">
      <res-name>jdbc/ElectionDS</res-name>
      <res-jndi-name>java:/ElectionDS</res-jndi-name>
      </resource-manager>
      </resource-managers>