0 Replies Latest reply on Aug 26, 2003 10:10 AM by mkroom

    Mysql + CMP problem - NoSuchEntityException

    mkroom Newbie

      I'm using | jboss 3.2.1 | mysql-4.0.14b | win2k

      I have a entity bean with a composite key (varchar | Date).

      The EJBQL is:

      <query-method>
      <method-name>findSlsBySlsCdAndDate</method-name>
      <method-params>
      <method-param>java.lang.String</method-param>
      <method-param>long</method-param>
      <method-param>long</method-param>
      </method-params>
      </query-method>
      <result-type-mapping>Local</result-type-mapping>
      <ejb-ql><![CDATA[select OBJECT(s) from Sls s where s.slsCd=?1 and s.dtMillisecond between ?2 and ?3]]></ejb-ql>


      The jboss/mysql datasource:


      <local-tx-datasource>
      <jndi-name>jdbc/test</jndi-name>
      <connection-url>jdbc:mysql://localhost/test?autoReconnect=true</connection-url>
      <driver-class>com.mysql.jdbc.Driver</driver-class>
      <user-name>xxx</user-name>

      </local-tx-datasource>




      ===> My client execute the finder method and I can see that it returns data :

      Sls collection size=31
      2003-08-26 10:31:26,251 [Thread-7] INFO - [ejb/Sls:[.02.Sat Aug 01 00:00:00 CDT 3903.], ejb/Sls:[.02.Sun Aug 02 00:00:00 CDT 3903.], .......]

      The problem is that after I cast the obj in the collection into the SlsLocal and call any method on the local obj, the error below is thrown....

      I tested the same code but with a oracle db and it seem to work fine.. Can't seem to figure it out, help!
      thanks in advance...


      ---------------------------------------------------------------------
      2003-08-26 10:31:26,311 [Thread-7] ERROR - NoSuchEntityException:
      javax.ejb.NoSuchEntityException: Entity not found: primaryKey=[.02.Sat Aug 01 00:00:00 CDT 3903.]
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.execute(JDBCLoadEntityCommand.java:215)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.execute(JDBCLoadEntityCommand.java:83)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.loadEntity(JDBCStoreManager.java:632)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.loadEntity(JDBCStoreManager.java:614)
      at org.jboss.ejb.plugins.CMPPersistenceManager.loadEntity(CMPPersistenceManager.java:386)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.loadEntity(CachedConnectionInterceptor.java:353)
      at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invoke(EntitySynchronizationInterceptor.java:232)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186)



      .........



      2003-08-26 10:31:26,391 [Thread-7] WARN - Unhandled Exception thrown: class javax.ejb.NoSuchObjectLocalException
      2003-08-26 10:31:26,391 [Thread-7] ERROR - StandardWrapperValve[action]: Servlet.service() for servlet action threw exception
      javax.servlet.ServletException: Entity not found: primaryKey=[.02.Sat Aug 01 00:00:00 CDT 3903.]
      at org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:545)
      at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:486)
      at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
      at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
      at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)


      .......


      2003-08-26 10:31:26,391 [Thread-7] ERROR - ----- Root Cause -----
      javax.ejb.NoSuchObjectLocalException: Entity not found: primaryKey=[.02.Sat Aug 01 00:00:00 CDT 3903.]
      at org.jboss.ejb.plugins.LogInterceptor.handleException(LogInterceptor.java:314)
      at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:195)
      at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
      at org.jboss.ejb.EntityContainer.internalInvoke(EntityContainer.java:483)
      at org.jboss.ejb.Container.invoke(Container.java:674)
      at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:353)
      at org.jboss.ejb.plugins.local.EntityProxy.invoke(EntityProxy.java:38)
      at $Proxy35.getSlsValue(Unknown Source)
      at com.room.SlsAction.findSlsBySlsCdAndDate(SlsAction.java:62)
      ---------------------------------------------------------------------