0 Replies Latest reply on Oct 24, 2002 12:26 PM by janist

    Remove method fails with composite PK

    janist

      Hi,

      I'm working with JBoss 2.4.9/Tomcat 4.0.4 and Oracle8i database.
      I created CMP bean with composite PK, that contains two arguments - String and Long. All methods works fine, except remove method. The same application works fine on JBoss 2.4.4.

      Here is my code:
      Collection subs = subscriptionHome.findByEmail(email);
      Iterator it = oldSubscription.iterator();
      while (it.hasNext()) {
      ((Subscription)it.next()).remove();
      }

      Here is the stack trace:
      javax.transaction.TransactionRolledbackException: Load failed; nested exception is:
      java.lang.IllegalArgumentException: object is not an instance of declaring class; nested exception is:
      java.rmi.ServerException: Load failed; nested exception is:
      java.lang.IllegalArgumentException: object is not an instance of declaring class
      java.rmi.ServerException: Load failed; nested exception is:
      java.lang.IllegalArgumentException: object is not an instance of declaring class
      java.lang.IllegalArgumentException: object is not an instance of declaring class
      at java.lang.reflect.Field.get(Native Method)
      at org.jboss.ejb.plugins.jaws.jdbc.JDBCCommand.getPkFieldValue(JDBCCommand.java:659)
      at org.jboss.ejb.plugins.jaws.jdbc.JDBCCommand.setPrimaryKeyParameters(JDBCCommand.java:360)
      at org.jboss.ejb.plugins.jaws.jdbc.JDBCLoadEntityCommand.setParameters(JDBCLoadEntityCommand.java:160)
      at org.jboss.ejb.plugins.jaws.jdbc.JDBCCommand.jdbcExecute(JDBCCommand.java:155)
      at org.jboss.ejb.plugins.jaws.jdbc.JDBCLoadEntityCommand.execute(JDBCLoadEntityCommand.java:144)
      at org.jboss.ejb.plugins.jaws.JAWSPersistenceManager.loadEntity(JAWSPersistenceManager.java:157)
      at org.jboss.ejb.plugins.CMPPersistenceManager.loadEntity(CMPPersistenceManager.java:372)
      at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invoke(EntitySynchronizationInterceptor.java:295)
      at org.jboss.ejb.plugins.EntityInstanceInterceptor.invoke(EntityInstanceInterceptor.java:203)
      at org.jboss.ejb.plugins.EntityLockInterceptor.invoke(EntityLockInterceptor.java:125)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invokeNext(TxInterceptorCMT.java:138)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:347)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:100)
      at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:127)
      at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:170)
      at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:436)
      at org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invoke(JRMPContainerInvoker.java:506)
      at org.jboss.ejb.plugins.jrmp.interfaces.GenericProxy.invokeContainer(GenericProxy.java:335)
      at org.jboss.ejb.plugins.jrmp.interfaces.HomeProxy.invoke(HomeProxy.java:177)
      at $Proxy19.remove(Unknown Source)
      at euso.saeima.web.jsp.DivisionRequestBean.processRequest(DivisionRequestBean.java:157)
      at org.apache.jsp.pierakstities$jsp._jspService(pierakstities$jsp.java:132)
      at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:201)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

      What is the problem?

      Regards,
      Janis