3 Replies Latest reply on Mar 30, 2002 2:01 PM by Dennis Muhlestein

    BMPPersistenceManager Tries to deploy CMP Bean??

    Dennis Muhlestein Newbie

      I'm trying to deploy a very simple CMP 2.0 bean.

      I have this in my ejb-jar.xml:


      <ejb-name>EJBTestEJB</ejb-name>
      EJBTestHome
      EJBTest
      <ejb-class>EJBTestBean</ejb-class>
      <persistence-type>Container</persistence-type>
      <prim-key-class>java.lang.String</prim-key-class>
      False
      <cmp-version>2.x</cmp-version>
      <abstract-schema-name>Account</abstract-schema-name>
      <cmp-field>
      <field-name>username</field-name>
      </cmp-field>
      <primkey-field>username</primkey-field>
      <resource-ref>
      <res-ref-name>jdbc/msSQL</res-ref-name>
      <res-type>javax.sql.DataSource</res-type>
      <res-auth>Container</res-auth>
      <res-sharing-scope>Shareable</res-sharing-scope>
      </resource-ref>



      I have this in jbosscmp-jdbc.xml:


      <jbosscmp-jdbc>

      java:/msSQL
      <datasource-mapping>MS SQLSERVER</datasource-mapping>
      <create-table>false</create-table>
      true

      <enterprise-beans>

      <class-name>EJBTestEJB</class-name>
      <table-name>Account</table-name>
      <cmp-field>
      <field-name>username</field-name> <column-name>username</column-name>
      </cmp-field>

      </enterprise-beans>
      </jbosscmp-jdbc>


      I've tried by the JBossCMP Workbook to deploy this been and I get the following errors:

      16:43:15,793 INFO [EJBDeployer]
      Bean : EJBTestEJB
      Section: 9.4.7.1
      Warning: The primkey-field element must name a public field in the bean implementation class.

      16:43:15,815 INFO [EJBDeployer]
      Bean : EJBTestEJB
      Section: 9.2.2
      Warning: The entity bean class must not be defined as abstract.

      .............
      .............
      16:43:16,592 ERROR [BMPPersistenceManager] Home Method public abstract EJBTest EJBTestHome.findByPrimaryKey(java.lang.String) throws java.rmi.RemoteException,javax.ejb.FinderException not implemented in bean class
      16:43:16,598 ERROR [EntityContainer] Exception in service lifecyle operation: create
      java.lang.NoSuchMethodException
      at java.lang.Class.getMethod0(Native Method)
      at java.lang.Class.getMethod(Class.java:888)
      at org.jboss.ejb.plugins.BMPPersistenceManager.createMethodCache(BMPPersistenceManager.java:178)
      at org.jboss.ejb.plugins.BMPPersistenceManager.create(BMPPersistenceManager.java:114


      etc.....


      It looks to me like the Container is trying to load this bean as BMP??

      Am I missing the Boat? Any suggestions?

      Any help would be appreciated much appreciated.