1 Reply Latest reply on Oct 16, 2012 8:21 AM by jaikiran pai

    EJB2 JNDI Mapping

    Chandra Shekhar Newbie

      I wrote simple CMP2.0 bean and deployed in JBoss AS7. It was deployed sucessfully that I can see in server console but I can't see JNDI binding so when I call cmp bean I am getting "No EJB receiver available for handling".

       

       

      Server console

      -------------------------

      16:32:30,106 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015876: Starting deployment of "TestEJB.jar"

      16:32:37,231 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS018559: Deployed "TestEJB.jar"

       

       

      ejb-jar.xml

      ---------------------------------

      <ejb-jar>

      <enterprise-beans>

        <entity>

         <ejb-name>ExampleTable</ejb-name>

         <home>com.migration.entity.ExampleTableHome</home>

         <remote>com.migration.entity.ExampleTable</remote>

         <ejb-class>com.migration.entity.ExampleTableEJB</ejb-class>

         <persistence-type>Container</persistence-type>

         <prim-key-class>java.lang.Integer</prim-key-class>

         <reentrant>False</reentrant>

         <cmp-version>2.x</cmp-version>

         <abstract-schema-name>ExampleTableEJB</abstract-schema-name>

         <cmp-field><field-name>implEmpName</field-name></cmp-field>

         <cmp-field><field-name>implEmptype</field-name></cmp-field>

         <primkey-field>implEmptype</primkey-field>

         <resource-ref>

          <res-ref-name>jdbc/database</res-ref-name>

          <res-type>javax.sql.DataSource</res-type>

          <res-auth>Container</res-auth>

         </resource-ref>

        </entity>

      </enterprise-beans>

      </ejb-jar>

      -------------------------------------

      jbosscmp-jdbc.xml

      ------------------------------------

      <jbosscmp-jdbc>

      <enterprise-beans>

        <entity>

         <ejb-name>ExampleTable</ejb-name>

         <row-locking>false</row-locking>

         <table-name>keyword</table-name>

         <cmp-field>

          <field-name>implEmpName</field-name>

          <column-name>EMPNAME</column-name>

         </cmp-field>

         <cmp-field>

          <field-name>implEmptype</field-name>

          <column-name>EMPTYPE</column-name>

         </cmp-field>

        </entity>

      </enterprise-beans>

      </jbosscmp-jdbc>

       

      ---------------------

      jboss-ejb3.xml

      ---------------------

      <enterprise-beans>

        <entity>

         <ejb-name>ExampleTable</ejb-name>

         <resource-ref>

          <res-ref-name>jdbc/database</res-ref-name>

          <jndi-name>java:jboss/datasources/MigDS</jndi-name>

         </resource-ref>

        </entity>

      </enterprise-beans>

      </jboss:ejb-jar>