1 Reply Latest reply on Jul 31, 2003 1:07 PM by Rajeev Chitamoor

    CMP newbie question

    Rajeev Chitamoor Newbie

      I am trying to get a basic CMP bean to work.
      When I try to lookit up using the findByPrimaryKey(), I get a

      FinderException: No Such Entity!.

      error message

      I am sure I am doing something stupid, or completely forgot something.

      I am using JBoss 3.2.1 with Oracle as the datastore. I turned on the tracing (in log4J),
      and the SQL select statement generated by the finder method seems okay.
      Not sure where else to look.

      Any suggestions would be aprreciated.


      <![CDATA[ThemeBean is a CMP Entity Bean.]]>



      <cmp-field >
      <![CDATA[Primary key of this Theme.]]>
      <cmp-field >
      <![CDATA[Parent Theme of this Theme.]]>
      <cmp-field >
      <![CDATA[Name of this Theme.]]>
      <cmp-field >
      <![CDATA[Description of this Theme.]]>

      <ejb-ql><![CDATA[select object(t) from Themes t where t.name = ?1]]></ejb-ql>

      <!-- Write a file named ejb-finders-ThemeBean.xml if you want to define extra finders. -->

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE jbosscmp-jdbc PUBLIC "-//JBoss//DTD JBOSSCMP-JDBC 3.0//EN" "http://www.jboss.org/j2ee/dtd/jbosscmp-jdbc_3_0.dtd">



      To add beans that you have deployment descriptor info for, add
      a file to your XDoclet merge directory called jbosscmp-jdbc-beans.xml
      that contains the markup for those beans.









      public abstract class ThemeBean implements EntityBean {

      private EntityContext entityContext = null;

      public Long ejbCreate(ThemeModel themeModel) throws CreateException {

      public void ejbPostCreate() throws CreateException {


      public abstract Long getThemeId();

      public abstract Long getParentId();

      public abstract String getName();

      public abstract String getDescription();

      public abstract void setThemeId(Long themeId);

      public abstract void setParentId(Long parentThemeId);

      public abstract void setName(String themeName);

      public abstract void setDescription(String themeDescription);

      public void ejbRemove() throws RemoveException {}

      public void ejbLoad() {}

      public void ejbStore() {}

      public void ejbActivate() {}

      public void ejbPassivate() {}

      public void unsetEntityContext() {}

      public void setEntityContext(EntityContext entityContext) {}


      public interface ThemeLocalHome
      extends javax.ejb.EJBLocalHome

      public com.portblue.model.creation.resource.ThemeLocal create(com.portblue.model.creation.resource.ThemeModel themeModel)
      throws javax.ejb.CreateException;

      public com.portblue.model.creation.resource.ThemeLocal findByName(java.lang.String name)
      throws javax.ejb.FinderException;

      public com.portblue.model.creation.resource.ThemeLocal findByPrimaryKey(java.lang.Long pk)
      throws javax.ejb.FinderException;