1 Reply Latest reply on Oct 28, 2003 12:06 AM by kuato

    ejb cmp20 deployment under JBOSS

    scambam Newbie

      Hi Guys,

      While deploying my EJB's under the JBOSS framework, I get
      these errors.

      I really dont know what is wrong.

      Any help would be appreciated.

      Thanks,
      Shekhar!

      19:18:36,281 INFO [MainDeployer] Starting deployment of package: file:/usr/loca
      l/jboss-3.2.1/server/default/deploy/testcmp20.jar
      19:18:37,832 WARN [verifier] EJB spec violation:
      Bean : Address
      Method : public Integer ejbCreate() throws CreateException
      Section: 10.6.4
      Warning: The return type of an ejbCreate(...) method must be the entity bean's p
      rimary key type.

      19:18:37,906 WARN [verifier] EJB spec violation:
      Bean : User
      Method : public String ejbCreate(String) throws CreateException
      Section: 10.6.4
      Warning: The return type of an ejbCreate(...) method must be the entity bean's p
      rimary key type.

      19:18:38,009 ERROR [MainDeployer] could not create deployment: file:/usr/local/j
      boss-3.2.1/server/default/deploy/testcmp20.jar
      org.jboss.deployment.DeploymentException: Verification of Enterprise Beans faile
      d, see above for error messages.

      I am also attaching AddressBean.java and UserBean.java files
      for a check up.

      AddressBean.java -->

      package model.user;

      import javax.ejb.*;
      import java.util.GregorianCalendar;

      /**
      * @ejb.bean
      * name="Address"
      * type="CMP"
      * local-jndi-name="AddressLocalHome"
      * jndi-name="AddressBean"
      * primkey-field="id"
      * cmp-version="2.x"
      * view-type="local"
      *
      * @ejb:pk class="Integer" package="java.lang" generate="false"
      * @ejb:transaction type="Supports"
      *
      * @ejb:home local-extends="javax.ejb.EJBLocalHome"
      * @ejb:data-object extends="java.lang.Object"
      *
      * @ejb:finder signature="java.util.Collection findAll()"
      * query=""
      * @ejb.persistence table-name="ITM_USER_ADDRESS"
      * @jboss:create-table "${jboss.create.table}"
      * @jboss:remove-table "${jboss.remove.table}"
      */
      public abstract class AddressBean implements EntityBean
      {

      // used in hack to generate "unique" ID
      private static final long MY_EPOCH =
      new GregorianCalendar(2002, 11, 1).getTimeInMillis();

      /**
      * @ejb.create-method
      */
      public Integer ejbCreate() throws javax.ejb.CreateException
      {
      setId(generateUniqueId());
      return null;
      }

      public void ejbPostCreate() { }

      /**
      * @ejb.pk-field
      * @ejb.persistent-field
      * @ejb.persistence column-name="ID"
      * @ejb.interface-method view-type="local"
      * @jboss:column-name="ID"
      */
      public abstract Integer getId();

      public abstract void setId(Integer id);

      /**
      * @ejb.persistent-field
      * @ejb.persistence column-name="STREET"
      * @ejb.interface-method view-type="local"
      * @jboss:column-name="STREET"
      */
      public abstract String getStreet();

      /**
      * @ejb.interface-method view-type="local"
      */
      public abstract void setStreet(String street);

      /**
      * @ejb.persistent-field
      * @ejb.persistence column-name="CITY"
      * @ejb.interface-method view-type="local"
      * @jboss:column-name="CITY"
      */
      public abstract String getCity();


      UserBean.java --->

      import javax.ejb.*;

      /**
      * @ejb.bean
      * name="User"
      * type="CMP"
      * local-jndi-name="UserLocalHome"
      * jndi-name="UserBean"
      * primkey-field="username"
      * cmp-version="2.x"
      * view-type="local"
      *
      * @ejb:pk class="String" package="java.lang" generate="false"
      * @ejb:transaction type="Supports"
      *
      * @ejb:home local-extends="javax.ejb.EJBLocalHome"
      * @ejb:data-object extends="java.lang.Object"
      *
      * @ejb:finder signature="java.util.Collection findAll()"
      * query=""
      * @ejb.persistence table-name="ITM_USER"
      * @jboss:create-table "${jboss.create.table}"
      * @jboss:remove-table "${jboss.remove.table}"
      */
      public abstract class UserBean implements EntityBean
      {

      /**
      * @ejb.create-method
      */
      public String ejbCreate(String username) throws javax.ejb.CreateException
      {
      setUsername(username);
      return null;
      }

      public void ejbPostCreate(String username) { }

      /**
      * @ejb.pk-field
      * @ejb.persistent-field
      * @ejb.persistence column-name="USERNAME"
      * @ejb.interface-method view-type="local"
      * @jboss:column-name="USERNAME"
      */
      public abstract String getUsername();

      public abstract void setUsername(String username);

      /**
      * @ejb.persistent-field
      * @ejb.persistence column-name="PASSWORD"
      * @ejb.interface-method view-type="local"
      * @jboss:column-name="PASSWORD"
      */
      public abstract String getPassword();

      /**
      * @ejb.interface-method view-type="local"
      */
      public abstract void setPassword(String password);