2 Replies Latest reply on Sep 14, 2001 8:15 AM by banigreyling

    java.rmi.ServerException: Store failed

    reini_r

      hello world,


      following strange problem.
      i hava a CMP and a stateless session bean.

      i call the cmp methods within stateless. these manipulations are working as long as i deploy the stateless for a second time.
      from then on i only get on server:
      [DoTransfer] java.rmi.ServerException: Store failed; nested exception is:
      [DoTransfer] java.lang.ClassCastException: java.sql.Timestamp
      [DoTransfer] java.lang.ClassCastException: java.sql.Timestamp
      [DoTransfer] at oracle.jdbc.driver.OraclePreparedStatement.setObject(OraclePreparedStatement.java:2001)
      [DoTransfer] at oracle.jdbc.driver.OraclePreparedStatement.setObject(OraclePreparedStatement.java:2052)

      on client:

      Exception in thread "main" java.lang.reflect.UndeclaredThrowableException: javax.transaction.RollbackException: Unable to commit, tx=XidImpl [FormatId=257, GlobalId=spunk//65, BranchQual=] status=STATUS_ROLLEDBACK
      at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:245)
      at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:220)
      at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:122)
      at org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker_Stub.invoke(Unknown Source)
      at org.jboss.ejb.plugins.jrmp.interfaces.GenericProxy.invokeContainer(GenericProxy.java:357)
      at org.jboss.ejb.plugins.jrmp.interfaces.StatelessSessionProxy.invoke(StatelessSessionProxy.java:123)
      at $Proxy1.transfer(Unknown Source)


      why ???


      the only solution afterwads is to delete all entries from database and then it works again.

      sw:
      jboss 2.4.0
      oracle 8.1
      sun - jdk 1.3.2
      linux 2.2.4



        • 1. Re: java.rmi.ServerException: Store failed
          reini_r

          As i figured out this only happens if i use a DATE type in database.

          is there any hint of how to use DATE - types within jboss and CMP ???

          • 2. Re: java.rmi.ServerException: Store failed
            banigreyling

            Hi

            I wrote a generic static method to convert between java.util.Date and java.sql.Timestamp. The fields in my CMP Bean is Timestamp, but all my method signatures use java.util.Date. You are safe with this way provided you take nano seconds into account while converting, and that your stored date resolution in the DB is not higher than milliseconds,i.e. if you don't use getdate(), sysdate or the like or always use JBoss to write/update your DB, you'r fine .

            Anyone have a more elegant solution?