1 Reply Latest reply on Jan 29, 2002 3:52 PM by Dain Sundstrom

    Column not found exception !!!!

    Eric Chow Newbie

      Hi, When I test the CMP in JBoss3 by calling findByPrimaryKey("someKey"), it displayed the following exception:

      [2002-01-25 17:05:14,190,JDBCCommand,DEBUG] Exists command executing: SELECT COUNT(*) FROM ScheduleEJB WHERE scheduleName=?
      [2002-01-25 17:05:14,190,JDBCCommand,DEBUG] Set parameter: idx=1, jdbcType=VARCHAR, value=hello
      [2002-01-25 17:05:14,190,DefaultDS,DEBUG] Pool DefaultDS [0/0/10] destroyed object org.jboss.resource.adapter.jdbc.local.JDBCManagedConnection@1abd68.
      [2002-01-25 17:05:14,190,JDBCCommand,ERROR] Exception caught executing SQL
      java.sql.SQLException: Column not found: SCHEDULENAME in statement [SELECT COUNT(*) FROM ScheduleEJB WHERE scheduleName='hello']
      at org.hsqldb.Trace.getError(Trace.java:180)
      at org.hsqldb.Result.(Result.java:175)
      at org.hsqldb.jdbcConnection.executeHSQL(jdbcConnection.java:907)



      and my deployment descriptors:
      =================================

      ejb-jar.xml
      ===========
      <?xml version="1.0"?>

      <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN" "http://java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd">

      <ejb-jar>
      <display-name>Real-time Scheduler</display-name>
      <enterprise-beans>

      Schedule EJB -- CMP
      <ejb-name>ScheduleEJB</ejb-name>
      <local-home>ScheduleLocalHome</local-home>
      ScheduleLocal
      <ejb-class>ScheduleEJB</ejb-class>
      <persistence-type>Container</persistence-type>
      <prim-key-class>java.lang.String</prim-key-class>
      False
      <cmp-field><field-name>scheduleName</field-name></cmp-field>
      <cmp-field><field-name>executeDate</field-name></cmp-field>
      <cmp-field><field-name>startDate</field-name></cmp-field>
      <cmp-field><field-name>endDate</field-name></cmp-field>
      <cmp-field><field-name>incrementTime</field-name></cmp-field>
      <primkey-field>scheduleName</primkey-field>



      </enterprise-beans>

      <assembly-descriptor>
      <container-transaction>

      <ejb-name>ScheduleEJB</ejb-name>
      <method-intf>Local</method-intf>
      <method-name>*</method-name>

      <trans-attribute>Required</trans-attribute>
      </container-transaction>
      </assembly-descriptor>
      </ejb-jar>