7 Replies Latest reply on Jul 5, 2002 1:26 PM by Dain Sundstrom

    Weird commit exception

    chen fang Newbie

      I am using JBoss 2.4.4 and postgresql 7.1. When I started
      Jboss, everything seems to be OK, but when I run my Test program, the client is able to find my session bean, then entity bean. But when I want to do an ejbCreate through my entity bean, it gives me the following exception:

      There are not much error message in the JBoss console, just a [ERROR,EntitySynchronizationInterceptor] followed by an javax.ejb.EJBException.

      When it breaks, it was inside of ejbStore() method. So it seems to me that it wants to commit, then somehow it blows away.

      Many thanks,

      chenfang

      ======================================================
      Exception in thread "main" java.lang.reflect.UndeclaredThrowableException: javax.transaction.RollbackException: Unable to commit, tx=XidImpl [FormatId=257, GlobalId=localhost.localdomain//1, 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.createWorkItem(Unknown Source)
      at EngineTest.testCreateWorkItem(EngineTest.java:52)
      at EngineTest.runTest(EngineTest.java:30)
      at EngineTest.main(EngineTest.java:43)

        • 1. Re: Weird commit exception
          Vincent Harcq Newbie

          Possibly you have a deadlock.
          You have only one client running ?
          Is RequiresNew used somewhere in the process ?

          • 2. Re: Weird commit exception
            chen fang Newbie

            Thanks, Vincent.

            Seems like it is something associated with postgresql about how it handles null value ( in combination with different data type) for columns. I shuffled
            aroud my code and it seems to be working. But I have another problem that I just posted.

            If someone can answer that one, I would be very appreciated.

            Thanks.



            • 3. Re: Weird commit exception
              zerosleep Newbie

              I'm having a similar error when trying to update a DATE field in PostgreSQL 7.2 via JBoss 3.0 (latest snapshot).

              I'm simply passing a java.sql.Date to a setDateAdded method on my EJB. Anyone else have this problem? I verified the date is in the proper format. I'm totally lost on this one.

              I get the following error:

              14:36:27,062 ERROR [EntityContainer] invoke returned an exception
              javax.transaction.RollbackException: Unable to commit, tx=XidImpl [FormatId=257, GlobalId=zerosleep1//38, BranchQual=] status=STATUS_ROLLEDBACK
              at org.jboss.tm.TxCapsule.commit(TxCapsule.java:362)
              at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:76)
              at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:173)
              at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:64)
              at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:127)
              at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:166)
              at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:435)
              at org.jboss.ejb.Container.invoke(Container.java:609)
              at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1555)
              at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
              at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:113)
              at org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvokerProxy.java:149)
              at org.jboss.proxy.ejb.GenericProxy.invoke(GenericProxy.java:182)
              at org.jboss.proxy.ejb.EntityProxy.invoke(EntityProxy.java:134)
              at $Proxy60.setLastLogin(Unknown Source)
              at com.zerosleep.zscaddie.servlets.PlayerManagerServlet.updateLoginDate(PlayerManagerServlet.java:142)
              at com.zerosleep.zscaddie.servlets.PlayerManagerServlet.processRequest(PlayerManagerServlet.java:45)
              at com.zerosleep.zscaddie.servlets.PlayerManagerServlet.doGet(PlayerManagerServlet.java:52)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
              at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:327)
              at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:546)
              at org.mortbay.http.HttpContext.handle(HttpContext.java:1269)
              at org.mortbay.http.HttpContext.handle(HttpContext.java:1223)
              at org.mortbay.http.HttpServer.service(HttpServer.java:725)
              at org.mortbay.http.HttpConnection.service(HttpConnection.java:748)
              at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:921)
              at org.mortbay.http.HttpConnection.handle(HttpConnection.java:763)
              at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:138)
              at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:287)
              at org.mortbay.util.ThreadPool$JobRunner.run(ThreadPool.java:715)
              at java.lang.Thread.run(Unknown Source)


              Here's my datasource service:






              ConnectionURL=jdbc : postgresql://localhost:5432/MyTable
              DriverClass=org.postgresql.Driver
              UserName=postgres
              Password=mypasswrd

              pgsql-myds
              java:/TransactionManager
              <depends optional-attribute-name="ResourceAdapterName">jboss.jca:service=RARDeployment,name=Minerva JDBC LocalTransaction ResourceAdapter
              <depends optional-attribute-name="ConnectionManagerFactoryLoaderName">jboss.jca:service=ConnectionManagerFactoryLoader,name=MinervaSharedLocalCMFactory

              BlockingTimeoutMillis=500000
              IdleTimeoutMinutes=30
              MaxSize=10
              CleanupIntervalMinutes=10
              MinSize=0
              MaxIdleTimeoutPercent=1.0


              org.jboss.resource.security.ManyToOnePrincipalMapping
              UserName=postgres



              my remote interface method

              public void setDateAdded(java.sql.Date aSQLDate) throws RemoteException;

              os: windows 2000
              jboss version: 3.0, latest snapshot
              jdk version: 1.3.1
              postgres version: 7.2 on cygwin 1.3.10

              Any help would be much appreciated.

              • 4. Re: Weird commit exception
                Kuba Nowakowski Newbie

                Hi

                Have you solved this problem???

                regards

                Kuba

                • 5. Re: Weird commit exception
                  Dain Sundstrom Master

                  Are you using the newest PostgreSQL drivers? PostgreSQL is the only other database I test against, so I am fairly confident it does work.

                  I did change many of the mappings for the date fields in jboss 3.0.1. If you have an existing table you may have to change the jdbc-type of the java.sql.Date to whatever it was in the last version you were using.

                  If this doesn't fix it, post the stacktrace for the caused by exception, which should be printed in the server.log file.

                  • 6. Re: Weird commit exception
                    Kuba Nowakowski Newbie

                    Hi

                    No
                    I'm using oracle 8.1.7
                    and jboss 3.0

                    Kuba

                    • 7. Re: Weird commit exception
                      Dain Sundstrom Master

                      Then you do not have the same problem. Please, start a new thread for your exact problem.