0 Replies Latest reply on Jan 20, 2003 6:38 PM by Craig Hamilton

    problem with cmp finder select

    Craig Hamilton Newbie

      Hi,

      I am using 3.2rc1, with sqlserver2000 dataservice

      When I try and load an entity utilizing CMP i get the following error. It is not filling in the appropriate parameters into the sql statement.

      any help would be appreciated.

      craig


      run.client:
      [java] Looking up activity
      [java] javax.ejb.FinderException: Find failed: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLSer
      ver]Incorrect syntax near the keyword 'FROM'.
      [java] at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:245)
      [java] at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:220)
      [java] at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:122)
      [java] at org.jboss.invocation.jrmp.server.JRMPInvoker_Stub.invoke(Unknown Source)
      [java] at org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvokerProxy.java:138)
      [java] at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:92)
      [java] at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:77)
      [java] at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:80)
      [java] at org.jboss.proxy.ejb.HomeInterceptor.invoke(HomeInterceptor.java:175)
      [java] at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:82)
      [java] at $Proxy0.findByPrimaryKey(Unknown Source)
      [java] at test.ActivityClient.main(ActivityClient.java:22)

      Here are the traces from server.log
      2003-01-20 15:34:53,808 DEBUG [org.jboss.system.Registry] lookup -1157687082=jboss.j2ee:jndiName=ActivityBean,service=EJB
      2003-01-20 15:34:53,892 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCFindByPrimaryKeyQuery.ActivityBean.findByPrimaryKey] Executing SQL: SELECT FROM kcactivity WHERE
      2003-01-20 15:34:55,376 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCFindByPrimaryKeyQuery.ActivityBean.findByPrimaryKey] Find failed
      java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Incorrect syntax near the keyword 'FROM'.
      at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
      at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
      at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processErrorToken(Unknown Source)
      at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReplyToken(Unknown Source)


      The ejb-jar.xml file


      <![CDATA[This is the Activity entity bean.]]>

      <ejb-name>ActivityBean</ejb-name>

      test.ActivityBeanHome
      test.ActivityRemote
      <local-home>test.ActivityBeanLocalHome</local-home>
      test.ActivityLocal

      <ejb-class>test.ActivityBeanCMP</ejb-class>
      <persistence-type>Container</persistence-type>
      <prim-key-class>java.lang.Integer</prim-key-class>
      False
      <cmp-version>2.x</cmp-version>
      <abstract-schema-name>ActivityBean</abstract-schema-name>
      <cmp-field >
      <![CDATA[Returns the ActivityID]]>
      <field-name>activityID</field-name>
      </cmp-field>
      <cmp-field >
      <![CDATA[Returns the Year]]>
      <field-name>year</field-name>
      </cmp-field>
      <cmp-field >
      <![CDATA[Returns the ID]]>
      <field-name>recordID</field-name>
      </cmp-field>
      <cmp-field >
      <![CDATA[Returns the Activity Description]]>
      <field-name>description</field-name>
      </cmp-field>
      <cmp-field >
      <![CDATA[Returns the Work Comments]]>
      <field-name>workComments</field-name>
      </cmp-field>
      <cmp-field >
      <![CDATA[Returns the Accomplishments in terms of number of accomplishments of the specified unit of measure]]>
      <field-name>accomplishments</field-name>
      </cmp-field>
      <cmp-field >
      <![CDATA[Returns the Unit of Measure]]>
      <field-name>unitOfMeasure</field-name>
      </cmp-field>

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