1 2 Previous Next 28 Replies Latest reply on Dec 13, 2012 3:06 PM by tomjenkinson Go to original post
      • 15. Re: XA Datasource Recovery in JBoss 5.1.0.
        tomjenkinson

        Sorry, I see in your original message you confirmed where you are editing the file, still the question about JTS usage remains

        • 16. Re: XA Datasource Recovery in JBoss 5.1.0.
          tomjenkinson

          Can you provide your xa-datasource configuration, please?

          • 17. Re: XA Datasource Recovery in JBoss 5.1.0.
            tomjenkinson

            Also, assuming you are wanting to use JTS, did you also make the changes to jacorb.properties transaction-jboss-beans.xml and iiop-service.xml

            • 18. Re: XA Datasource Recovery in JBoss 5.1.0.
              tomjenkinson

              Hi Amod,

               

              Prepare yourself to "Correct Answer" this message...

               

              You have <property name="com.arjuna.ats.jta.recovery.XAResourceRecovery1" value= "com.arjuna.ats.internal.jbossatx.jta.AppServerJDBCXARecovery;XAOracleDS"/> in the wrong section (same for messaging).

               

              It should be in "jta", you have it in "recoverymanager".

               

              Tom

              • 19. Re: XA Datasource Recovery in JBoss 5.1.0.
                amodrm

                Hi Tom,

                 

                Thanks a lot for all your inputs.

                 

                1. Yes,I was using the jbossts-properties.xml in ./server/all/conf/jbossts-properties.xml.

                  

                  Currently I am trying out sample application on single server only with server configuration "all" . So may be I don't need to use JTS as per JBoss docs.
                   So I reverted all my changes in jbossts-properties.xml & only added following property
                  <property name="com.arjuna.ats.arjuna.recovery.recoveryExtension5" value="com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule"/>

                 

                I still get errors "No XAResource to recover" &  "Could not find new XAResource to use for recovering non-serializable XAResource"

                 

                2. Our actual deployments uses cluster wherein transactions in our application might involve multiple servers.  I referred docs\examples\transactions\README.txt

                    I have followed all steps mentioned in the doc.  As you have mentioned, I have done changes in jacorb.properties transaction-jboss-beans.xml and iiop-service.xml.

                    I am in the process of testing with those changes now. I will get back to you.

                 

                3. By that time, as you have mentioned, please find my xa-datasource file.

                 

                Thanks again.

                • 21. Re: XA Datasource Recovery in JBoss 5.1.0.
                  tomjenkinson

                  I would definitely recommend just using JTA if you are not propagated the transaction between AS instances

                  • 22. Re: XA Datasource Recovery in JBoss 5.1.0.
                    amodrm

                    Hi Tom,

                     

                    Thanks a lot for all your inputs. Now XA recovery is working for for JTA. To just summarize, updated jta" property section with:

                    <property name="com.arjuna.ats.jta.xaRecoveryNode" value="1"/>
                    <property name="com.arjuna.ats.jta.recovery.XAResourceRecovery1" value= "com.arjuna.ats.internal.jbossatx.jta.AppServerJDBCXARecovery;MyXADatasourceS"/>
                    <property name="com.arjuna.ats.jta.recovery.XAResourceRecovery.JBMESSAGING1" value="org.jboss.jms.server.recovery.MessagingXAResourceRecovery;java:/DefaultJMSProvider"/>

                     

                    For getting XA recovery for JTS, I followed steps mentioned in examples\transactions\README.txt, but XA recovery is not happening.

                    In short steps were:
                    1. Use jbossts-properties.xml from examples\transactions directory & remove the  recovery extension property containing the value "com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule" from jbossts-properties.xml file:

                    2. update the TransactionManager class and dependencies in transaction-jboss-beans.xml.

                    3. jacorb.properies: change the jacorb.poa.thread_pool_max property to 32.

                    4. Modify PortableInterceptorInitializers attribute in Update iiop-service.xml.

                     

                    5. In addition to these steps (as mentioned in README.txt), I also updated value for "com.arjuna.ats.jta.jtaTMImplementation"/"com.arjuna.ats.jta.jtaUTImplementation" property keys as mentioned in https://community.jboss.org/wiki/JBossTSRecoveryInAS

                     

                    Is there any more steps needed for use of JTS in JBoss 5.1.0? e.g. specify AppServerJDBCXARecovery as we did for JTA?

                     

                    Thanks.

                     

                    • 23. Re: XA Datasource Recovery in JBoss 5.1.0.
                      tomjenkinson

                      Hi Amod,

                       

                      I will have to take a look in the morning but I would definitely say that it will need something similar if not the same as:

                      <property name="com.arjuna.ats.jta.recovery.XAResourceRecovery1" value= "com.arjuna.ats.internal.jbossatx.jta.AppServerJDBCXARecovery;MyXADatasourceS"/>

                      <property name="com.arjuna.ats.jta.recovery.XAResourceRecovery.JBMESSAGING1" value="org.jboss.jms.server.recovery.MessagingXAResourceRecovery;java:/DefaultJMSProvider"/>

                       

                      It will probably be added to the "jta" section the same, did you try that yet? Also, you will need the following in "common" I think it is the default anyway:

                      <property name="com.arjuna.ats.arjuna.xa.nodeIdentifier" value="1"/>

                       

                      You also need the following in the "recovery" section:

                      <property name="com.arjuna.ats.jta.xaRecoveryNode" value="1"/> 

                       

                      Can you attach your config file and I will take a look again?

                       

                      As I think I mentioned but maybe not strongly enough, if you only require a single server I would discourage you from using JTS as you will be paying a performance penalty for the remoting capability provided by JTS even if you don't actually use it.

                       

                      Tom

                      • 24. Re: XA Datasource Recovery in JBoss 5.1.0.
                        tomjenkinson

                        Also, there is a script to enable JTS, here is the output from me running it on a fresh install:

                         

                         

                        [tom@localhost transactions]$ pwd

                        /home/tom/jboss-5.1.0.GA/docs/examples/transactions

                        [tom@localhost transactions]$ ant jts -v

                        Apache Ant(TM) version 1.8.2 compiled on July 6 2011

                        Trying the default build file: build.xml

                        Buildfile: /home/tom/jboss-5.1.0.GA/docs/examples/transactions/build.xml

                        Detected Java version: 1.7 in: /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.9.x86_64/jre

                        Detected OS: Linux

                        parsing buildfile /home/tom/jboss-5.1.0.GA/docs/examples/transactions/build.xml with URI = file:/home/tom/jboss-5.1.0.GA/docs/examples/transactions/build.xml

                        Project base dir set to: /home/tom/jboss-5.1.0.GA/docs/examples/transactions

                        parsing buildfile jar:file:/usr/share/java/ant.jar!/org/apache/tools/ant/antlib.xml with URI = jar:file:/usr/share/java/ant.jar!/org/apache/tools/ant/antlib.xml from a zip file

                        Build sequence for target(s) `jts' is [jts]

                        Complete build sequence is [jts, usage, modify-jts-config-files, tools, xts, ]

                         

                        jts:

                             [move] Moving 1 file to /home/tom/jboss-5.1.0.GA/server/all/conf

                             [move] Attempting to rename: /home/tom/jboss-5.1.0.GA/server/all/conf/jbossts-properties.xml to /home/tom/jboss-5.1.0.GA/server/all/conf/jbossts-properties-old-for-jta.xml

                             [copy] Copying 1 file to /home/tom/jboss-5.1.0.GA/server/all/conf

                             [copy] Copying /home/tom/jboss-5.1.0.GA/docs/examples/transactions/jbossts-properties.xml to /home/tom/jboss-5.1.0.GA/server/all/conf/jbossts-properties.xml

                             [echo] Transaction service configuration file installed.

                        Project base dir set to: /home/tom/jboss-5.1.0.GA/docs/examples/transactions

                          [antcall] calling target(s) [modify-jts-config-files] in build file /home/tom/jboss-5.1.0.GA/docs/examples/transactions/build.xml

                        parsing buildfile /home/tom/jboss-5.1.0.GA/docs/examples/transactions/build.xml with URI = file:/home/tom/jboss-5.1.0.GA/docs/examples/transactions/build.xml

                        Project base dir set to: /home/tom/jboss-5.1.0.GA/docs/examples/transactions

                        Override ignored for property "target.server.dir"

                        Build sequence for target(s) `modify-jts-config-files' is [modify-jts-config-files]

                        Complete build sequence is [modify-jts-config-files, jts, usage, tools, xts, ]

                          [antcall] Entering /home/tom/jboss-5.1.0.GA/docs/examples/transactions/build.xml...

                        Build sequence for target(s) `modify-jts-config-files' is [modify-jts-config-files]

                        Complete build sequence is [modify-jts-config-files, jts, usage, tools, xts, ]

                         

                        modify-jts-config-files:

                        [replaceregexp] Replacing pattern '<property\s+name=.com\.arjuna\.ats\.arjuna\.recovery\.recoveryExtension\d+.\s*value=.com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule.\s*/>' with '' in '/home/tom/jboss-5.1.0.GA/server/all/conf/jbossts-properties.xml'.

                        [replaceregexp] File has changed; saving the updated file

                        [replaceregexp] Replacing pattern 'com.arjuna.ats.jbossatx.jta.TransactionManagerService' with 'com.arjuna.ats.jbossatx.jts.TransactionManagerService' in '/home/tom/jboss-5.1.0.GA/server/all/deploy/transaction-jboss-beans.xml' by line.

                        [replaceregexp] File has changed; saving the updated file

                        [replaceregexp] Replacing pattern '</bean>' with '    <start><parameter><inject bean="jboss:service=CorbaORB" property="ORB"/></parameter></start>

                        [replaceregexp]

                        [replaceregexp]     </bean>' in '/home/tom/jboss-5.1.0.GA/server/all/deploy/transaction-jboss-beans.xml'.

                        [replaceregexp] File has changed; saving the updated file

                        [replaceregexp] Replacing pattern 'jacorb.poa.thread_pool_max\s*=\s*\d+' with 'jacorb.poa.thread_pool_max=32' in '/home/tom/jboss-5.1.0.GA/server/all/conf/jacorb.properties'.

                        [replaceregexp] File has changed; saving the updated file

                        [replaceregexp] Replacing pattern 'org.jboss.tm.iiop.TxServerClientInterceptorInitializer' with 'com.arjuna.ats.jts.orbspecific.jacorb.interceptors.interposition.InterpositionORBInitializerImpl' in '/home/tom/jboss-5.1.0.GA/server/all/deploy/iiop-service.xml'.

                        [replaceregexp] File has changed; saving the updated file

                        [replaceregexp] Replacing pattern 'org.jboss.tm.iiop.TxServerInterceptorInitializer' with 'com.arjuna.ats.jbossatx.jts.InboundTransactionCurrentInitializer' in '/home/tom/jboss-5.1.0.GA/server/all/deploy/iiop-service.xml'.

                        [replaceregexp] File has changed; saving the updated file

                          [antcall] Exiting /home/tom/jboss-5.1.0.GA/docs/examples/transactions/build.xml.

                             [echo] JBossAS config files updated to run JTS in config ../../../server/all

                         

                        BUILD SUCCESSFUL

                        Total time: 0 seconds

                         

                        Once you have done that, then open /home/tom/jboss-5.1.0.GA/server/all/conf/jbossts-properties.xml

                        1. Make sure com.arjuna.ats.arjuna.xa.nodeIdentifier is set to a value you are happy with (it should be set to "1" by default), each server must have a unique id though. It must be in the **"arjuna"** section

                        2. Add the following in the **"recoverymanager"** section:

                        <property name="com.arjuna.ats.jta.xaRecoveryNode" value="1"/>

                        3. Add the following in the **"jta"** section:

                        <property name="com.arjuna.ats.jta.recovery.XAResourceRecovery1" value= "com.arjuna.ats.internal.jbossatx.jta.AppServerJDBCXARecovery;MyXADatasourceS"/>

                        <property name="com.arjuna.ats.jta.recovery.XAResourceRecovery.JBMESSAGING1" value="org.jboss.jms.server.recovery.MessagingXAResourceRecovery;java:/DefaultJMSProvider"/>

                         

                        I have ran this succesfully here.

                         

                        Hope that clears it up for JTS too!

                        Tom

                         

                        PS my jbossts-properties.xml is attached, the other files were all generated using the script so I didn't attach them

                        1 of 1 people found this helpful
                        • 25. Re: XA Datasource Recovery in JBoss 5.1.0.
                          amodrm

                          Hi Tom,

                           

                          Thanks a lot for. I followed steps mentioned n your last comment. Now XA recovery happens correctly in database..

                          But XA recovery is still not happening for JMS messages.

                          To just recap,
                          In my ejb transactional method, I do:
                          a. database insert
                          b. Send JMS message

                          After successful prepare() call, just berfore BasicAction.phase2Commit(), I shutdown JBoss server.


                          Now after server restart, recovery happens for db insert operation. i.e. XA recovery leads to database tables getting updated. But message is not delievered to MDB.

                           

                          After shutdown of server after successful prepare() call, I could see logs (for JMS XA resource) at data\tx-object-store\ShadowNoFileLockStore\defaultStore\CosTransactions\XAResourceRecord\96d6987:de0c:50b5d777

                          but I didn't find any data in JBM_MSG table. Does it signal any missing steps?

                           

                          Here is analysis of logs:

                          1.  After restart, I can see logs as : XARecoveryModule.xaRecovery()--MessagingXAResourceWrapper.getConnectionFactory(). By that time, jms resources are not set. Hence logs were: MessagingXAResourceWrapper]..Failed to connect to server 

                                javax.naming.NameNotFoundException: XAConnectionFactory not bound

                          2.  Then I can see in the log that Messaging Server is started.
                          3.  But then, I don't see MessagingXAResourceWrapper getting invoked.

                          4.  I can see logs such as

                                a. Transaction 96d6987:de0c:50b5d777:13a still in ActionStore
                                b. Transaction 96d6987:de0c:50b5d777:13a assumed complete - will not poll any more

                           

                          Here is the logs in brief:

                           

                          ERROR [com.arjuna.ats.internal.jbossatx.jta.AppServerJDBCXARecovery] (Thread-28) AppServerJDBCXARecovery.createDataSource got exception javax.management.InstanceNotFoundException: jboss.jca:name=XAOracleDS,service=ManagedConnectionFactory is not registered.

                          ERROR [org.jboss.jms.server.recovery.MessagingXAResourceWrapper] (Thread-28) ********************************Failed to connect to server
                          javax.naming.NameNotFoundException: XAConnectionFactory not bound
                          at org.jnp.server.NamingServer.getBinding(NamingServer.java:771)
                          at org.jnp.server.NamingServer.getBinding(NamingServer.java:779)
                          at org.jnp.server.NamingServer.getObject(NamingServer.java:785)
                          at org.jnp.server.NamingServer.lookup(NamingServer.java:443)
                          at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:726)
                          at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686)
                          at javax.naming.InitialContext.lookup(InitialContext.java:436)
                          at org.jboss.util.naming.Util.lookup(Util.java:222)
                          at org.jboss.jms.server.recovery.MessagingXAResourceWrapper.getConnectionFactory(MessagingXAResourceWrapper.java:354)
                          at org.jboss.jms.server.recovery.MessagingXAResourceWrapper.connect(MessagingXAResourceWrapper.java:300)
                          at org.jboss.jms.server.recovery.MessagingXAResourceWrapper.getDelegate(MessagingXAResourceWrapper.java:259)
                          at org.jboss.jms.server.recovery.MessagingXAResourceWrapper.recover(MessagingXAResourceWrapper.java:107)
                          at com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule.xaRecovery(XARecoveryModule.java:771)
                          at com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule.resourceInitiatedRecovery(XARecoveryModule.java:665)
                          at com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule.periodicWorkSecondPass(XARecoveryModule.java:200)
                          at com.arjuna.ats.internal.arjuna.recovery.PeriodicRecovery.doWorkInternal(PeriodicRecovery.java:799)
                          at com.arjuna.ats.internal.arjuna.recovery.PeriodicRecovery.run(PeriodicRecovery.java:412)

                          2012-11-28 12:54:29,864 INFO  [org.jboss.jms.server.ServerPeer] (main) JBoss Messaging 1.4.3.GA server [0] started


                          2012-11-28 15:11:40,092 INFO  [com.arjuna.ats.jts.logging.loggerI18N] (Thread-28) [com.arjuna.ats.internal.jts.recovery.transactions.TransactionRecoveryModule_6] [com.arjuna.ats.internal.jts.recovery.transactions.TransactionRecoveryModule_6] - Transaction 96d6987:de0c:50b5d777:13a still in ActionStore
                          2012-11-28 15:11:40,092 INFO  [com.arjuna.ats.jts.logging.loggerI18N] (Thread-28) [com.arjuna.ats.internal.jts.recovery.transactions.TransactionRecoveryModule_6] [com.arjuna.ats.internal.jts.recovery.transactions.TransactionRecoveryModule_6] - Transaction 96d6987:de0c:50b5d777:13a still in ActionStore
                          2012-11-28 15:11:40,996 INFO  [com.arjuna.ats.jts.logging.loggerI18N] (Thread-28) [com.arjuna.ats.internal.jts.recovery.transactions.TransactionCache_4] [com.arjuna.ats.internal.jts.recovery.transactions.TransactionCache_4] - Transaction 96d6987:de0c:50b5d777:13a assumed complete - will not poll any more

                           

                          Thanks & Regards,

                          • 26. Re: XA Datasource Recovery in JBoss 5.1.0.
                            tomjenkinson

                            Hi Amod,

                             

                            I think this must be a JBoss Messaging configuration issue, might I suggest posting a question over on their forums and linking to your final comment. As you say, it looks like JBoss Messaging needs to be loaded before JBoss Transactions, though I would assume the JBM guys have seen that before.

                             

                            Tom

                            • 27. Re: XA Datasource Recovery in JBoss 5.1.0.
                              amodrm

                              Hi Tom,

                              Ok. I will post about correct jms xa configuration in jms forum.

                               

                              Thanks a lot for all your suggestions/replies.

                               

                              Regards,

                              Amod

                              • 28. Re: XA Datasource Recovery in JBoss 5.1.0.
                                tomjenkinson

                                No worries, if they redirect you back here I will try to dig deeper but it seems like it should be a known configuration setting that they have.

                                 

                                Thanks for using JBoss Transactions!

                                1 2 Previous Next