9 Replies Latest reply on Jun 22, 2012 5:32 AM by Mark Little

    How to override CheckedAction factory in JBoss 4.2.3?

    Andrew Le Newbie

      Hi, I'm new to JBoss, and I have been trying to find a way to override the CheckedAction class in Jboss 4.2.3. I found this post https://209.132.182.49/message/622627 but it's related to JBoss 5.

      Does anyone know how I can do something similar in JBoss 4.2.3?

       

      The document at http://docs.jboss.org/jbosstm/docs/4.2.3/manuals/pdf/core/ProgrammersGuide.pdf says that we JBoss JTA does support override the default behavior of CheckedAction but it does not show me how to configure it.

       

      Thanks a lot in advance.

        • 1. Re: How to override CheckedAction factory in JBoss 4.2.3?
          Tom Jenkinson Master

          Hi Andrew,

           

          Unfortuately 4.2.3 is rather old and predates my time on the team. I do have some questions though:

           

          1. To what end are you needing to overide CheckedAction?

          2. Is it possible for you to upgrade to AS7? The number of upgraded features since 4.2.3 is absolutely incredible!

           

          Tom

          • 2. Re: How to override CheckedAction factory in JBoss 4.2.3?
            Mark Little Master

            You need to get hold of the underlying BasicAction and call setCheckedAction on it. Do this before you terminate the transaction or it will be useless.

            • 3. Re: How to override CheckedAction factory in JBoss 4.2.3?
              Andrew Le Newbie

              Hi Tom,

               

              We are experiencing an issue with a third party vendor code which causes JTA transaction not being committed sucessfully. We open a support case with the vendor, but they do not seem to be able to help us identify what the issue may be.

              The error below is flooding our server.log file.

               

              I just want to be able to print out the stacktrace of the thread that causes the transaction to be aborted in the first place in order to see what code / component causes the problem.

              AS7 is out of the question for us at the moment because our corporate standard is still running on JBoss 4.2 until at least the end of the year.

               

              Caused by: org.jboss.util.NestedSQLException: Transaction is not active: tx=TransactionImple < ac, BasicAction: a894394:ecc1:4fdb77ef:a145 status: ActionStatus.ABORTED >; - nested throwable: (javax.resource.ResourceException: Transaction is not active: tx=TransactionImple < ac, BasicAction: a894394:ecc1:4fdb77ef:a145 status: ActionStatus.ABORTED >)
                      at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:96)
                      at com.eistream.sonora.util.DatabaseConnection.getEntityConnection(DatabaseConnection.java:54)
                      ... 114 more
              Caused by: javax.resource.ResourceException: Transaction is not active: tx=TransactionImple < ac, BasicAction: a894394:ecc1:4fdb77ef:a145 status: ActionStatus.ABORTED >
                      at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:319)
                      at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:403)
                      at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:850)
                      at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:90)
                      ... 115 more

              • 4. Re: How to override CheckedAction factory in JBoss 4.2.3?
                Andrew Le Newbie

                Hi Mark, thank you for the suggestion.

                 

                Is there a way to accomplish the task through configuration?

                • 5. Re: How to override CheckedAction factory in JBoss 4.2.3?
                  Michael Musgrove Master

                  The property that needs to be set in the config is: com.arjuna.ats.jts.checkedTransactions=YES

                  • 6. Re: How to override CheckedAction factory in JBoss 4.2.3?
                    Andrew Le Newbie

                    Mark, given that it is a third party vendor code for which we do not have the source code, is there a hook for me to provide my own CheckedAction class?

                    We do not have the freedom to change code in order to invoke the setCheckedAction() method from Current programmatically.

                    • 7. Re: How to override CheckedAction factory in JBoss 4.2.3?
                      Jonathan Halliday Master

                      > is there a hook for me to provide my own CheckedAction class?

                       

                      Nope, it wasn't added until later. JBTM-433

                      • 8. Re: How to override CheckedAction factory in JBoss 4.2.3?
                        Andrew Le Newbie

                        Thanks you, all. Because we do not have the source code, I decide to modify the BasicAction class and create our custom CheckedAction class directly. I then update the jbossjta.jar file with the new BasicAction class. That works fine. I find that there are contentions in an entity bean from the vendor code. Now I'm trying to resolve the contention issue but I'm also stuck there. I'll create another thread to get help from the community on the new issue.

                        • 9. Re: How to override CheckedAction factory in JBoss 4.2.3?
                          Mark Little Master

                          OK, but realise that we can't really give you much help with a modified codebase. Of course we'll try, but there's a limit.