1 2 3 Previous Next 39 Replies Latest reply: Jan 24, 2013 9:11 AM by Haifeng Song RSS

Jboss7.1 arjuna configuration

pushpak1981 Novice

Hi,

 

where can i configure com.arjuna.ats.jta.allowMultipleLastResources property in JBoss7. We are getting warning messages :

 

[com.arjuna.ats.arjuna] (Engine Controller) ARJUNA012140: Adding multiple last resources is disallowed. Trying to add LastResourceRecord(XAOnePhaseResource(LocalXAResourceImpl@1e648bd[connectionListener=247b2e connectionManager=1b1acc3 warned=false currentXid=< formatId=131077, gtrid_length=29, bqual_length=36, tx_uid=0:ffffc0a83e4d:e827110:4f13e53a:77, node_name=1, branch_uid=0:ffffc0a83e4d:e827110:4f13e53a:24d, subordinatenodename=null, eis_name=unknown eis name >])), but already have LastResourceRecord(XAOnePhaseResource(LocalXAResourceImpl@1f50665[connectionListener=1e352cc connectionManager=fdd280 warned=false currentXid=< formatId=131077, gtrid_length=29, bqual_length=36, tx_uid=0:ffffc0a83e4d:e827110:4f13e53a:77, node_name=1, branch_uid=0:ffffc0a83e4d:e827110:4f13e53a:7b, subordinatenodename=null, eis_name=unknown eis name >]))

 

Thanks

  • 1. Re: Jboss7.1 arjuna configuration
    pushpak1981 Novice

    We have deployed 2 different ear. We are accessing jta resources of first ear into second ear code.

  • 2. Re: Jboss7.1 arjuna configuration
    Michael Musgrove Master

    You can configure JBossTS properties via system properties. For example, inside the server config element  add:

     

    <system-properties>

        <property name="com.arjuna.ats.arjuna.allowMultipleLastResources" value="true"/>

        com.arjuna.ats.arjuna.allowMultipleLastResources

    </system-properties>

  • 3. Re: Jboss7.1 arjuna configuration
    pushpak1981 Novice

    Thanks for the reply. We tried to set the propety. Our warning messge is gone. But when we try to add data its not getting committed into the database. Is there anything that needs to be done when we try to access first application datasource from second application ?

     

    We are using Oracle11g driver and we tried with both XA and non xa datasource but the behaviour is the same.

  • 4. Re: Jboss7.1 arjuna configuration
    Tom Jenkinson Master

    Pushpak1981, sorry for the delay in getting back to you.

     

    If this was me, I would be trying to get the following configuration to work:

     

    1. Be using XA for the oracle driver

    2. Be *not* using (excuse my poor grammar there sorry) allowMultipleLastResources as I don;t think you should need it for Oracle

    3. Be using the xa-datasource configuration in JBoss xml

     

    The datasource is configured in the standalone.xml right? Please can you provide the datasource configuration you are using?

     

    I dont think that you need multiple 1PC resources as you are using Oracle so it should be ok to just use xa-datasource.

     

    I am going to assume this is impossible for you but if you can provide:

    1. The configuration you are using

    2. A cut down example showing the error

     

    I would be very happy to get it up and running here for you/

     

    At the least, I would ensure you are only using XA and xa-datasource, disable allowMultipleLastResources as it will mask any issues with your configuration related to using xa-datasources and try again. Afterwards, if you can send some snippets of code and configuration we can take a look.

     

    Hope it helps,

    Tom

  • 5. Re: Jboss7.1 arjuna configuration
    Alexey S. Newbie

    Hello Tom.

    1. am using JBoss 7.1.1.final and got the exactly same situation.

    2.TimerEjb is connecting via Local Interface some session ejb which tries to commit JTA to MysQL DB.

    3.Same flow from outside EJB client via Remote Interface to the same Session EJB works fine

     

    error is

     

     

    19:45:03,388 WARN  [com.arjuna.ats.arjuna] (EJB default - 1) ARJUNA012140: Adding multiple last resources is disallowed. Trying to add LastResourceRecord(XAOnePhaseResource(LocalXAResourceImpl@8d3f0f[connectionListener=2e9161 connectionManager=127286f warned=false currentXid=< formatId=131077, gtrid_length=29, bqual_length=36, tx_uid=0:ffffc0a80067:335e27a:4f81bf50:23, node_name=1, branch_uid=0:ffffc0a80067:335e27a:4f81bf50:2a, subordinatenodename=null, eis_name=unknown eis name >])), but already have LastResourceRecord(XAOnePhaseResource(LocalXAResourceImpl@12130f5[connectionListener=9cc465 connectionManager=8edd02 warned=false currentXid=< formatId=131077, gtrid_length=29, bqual_length=36, tx_uid=0:ffffc0a80067:335e27a:4f81bf50:23, node_name=1, branch_uid=0:ffffc0a80067:335e27a:4f81bf50:28, subordinatenodename=null, eis_name=unknown eis name >]))

    19:45:03,402 WARN  [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (EJB default - 1) SQL Error: 0, SQLState: null

    19:45:03,404 ERROR [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (EJB default - 1) javax.resource.ResourceException: IJ000457: Unchecked throwable in managedConnectionReconnected() cl=org.jboss.jca.core.connectionmanager.listener.TxConnectionListener@2e9161[state=NORMAL managed connection=org.jboss.jca.adapters.jdbc.local.LocalManagedConnection@780239 connection handles=0 lastUse=1333903503402 trackByTx=false pool=org.jboss.jca.core.connectionmanager.pool.strategy.OnePool@d9f294 pool internal context=SemaphoreArrayListManagedConnectionPool@12fab25[pool=MyDataSource] xaResource=LocalXAResourceImpl@8d3f0f[connectionListener=2e9161 connectionManager=127286f warned=false currentXid=null] txSync=null]

    19:45:03,437 WARN  [com.arjuna.ats.arjuna] (EJB default - 1) ARJUNA012125: TwoPhaseCoordinator.beforeCompletion - failed for SynchronizationImple< 0:ffffc0a80067:335e27a:4f81bf50:29, org.hibernate.engine.transaction.synchronization.internal.RegisteredSynchronization@f99011 >: javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Could not open connection

              at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1361) [hibernate-entitymanager-4.0.1.Final.jar:4.0.1.Final]

              at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1289) [hibernate-entitymanager-4.0.1.Final.jar:4.0.1.Final]

              at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1295) [hibernate-entitymanager-4.0.1.Final.jar:4.0.1.Final]

     

    Of course , when trying to put allowmultiple transactions, error is going away but data are not commited

    It smell like a critical bug,no?

     

    Thanks in advance

    Alexey

  • 6. Re: Jboss7.1 arjuna configuration
    Tom Jenkinson Master

    Hi Alexey,

     

    Out of interest, are you actually intending there to be multiple last resources? If not, I suspect a configuration issue/JCA bug if anything. Can you paste your datasource configuration in here? Are you sure you configured the datasources for XA?

     

    Tom

  • 7. Re: Jboss7.1 arjuna configuration
    Alexey S. Newbie

    Hi Tom.

    All what I want is very simple pattern when one of my TimerEJbs calling other Session EJB via Local - and this Session EJB commit a JTA transaction.

    Here is my datasource

    <datasources>

    <datasource jndi-name="java:jboss/datasources/MyDataSource" pool-name="MyDataSource" enabled="true" use-java-context="true">

                        <connection-url>jdbc:mysql://localhost:3306/mydb</connection-url>

                        <driver>com.mysql</driver>

                        <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>

                        <pool>

                            <min-pool-size>10</min-pool-size>

                            <max-pool-size>100</max-pool-size>

                            <prefill>true</prefill>

                        </pool>

                        <security>

                            <user-name>x</user-name>

                            <password>y</password>

                        </security>

                        <statement>

                            <prepared-statement-cache-size>32</prepared-statement-cache-size>

                            <share-prepared-statements>true</share-prepared-statements>

                        </statement>

                    </datasource>

                    <drivers>

                        <driver name="h22" module="org.h2.Driver">

                            <xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>

                        </driver>

                        <driver name="h2" module="com.h2database.h2">

                            <xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>

                        </driver>

                        <driver name="com.mysql" module="com.mysql">

                            <xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class>

                        </driver>

                    </drivers>

                </datasources>

     

    Alexey

     

    P.S

    Its just amazing.

    I tried to make a simple workaround

     

    InitialContext initialContext = new InitialContext();

                  javax.sql.DataSource ds = (javax.sql.DataSource)initialContext.lookup("java:jboss/datasources/MyDataSource");

                 

      java.sql.Connection conn = ds.getConnection();

     

     

    Same crash , seems it i not connected to JTA at all.

     

    Any suggestions?

  • 8. Re: Jboss7.1 arjuna configuration
    Alexey S. Newbie

    I think this is a supercritical showstopper bug. How could I fill JIRA for that?

  • 9. Re: Jboss7.1 arjuna configuration
    Michael Musgrove Master

    Alexey S. wrote:

     

    <datasource jndi-name="java:jboss/datasources/MyDataSource" pool-name="MyDataSource" enabled="true" use-java-context="true">

     

    You need to be using an <xa-datasoure>

  • 10. Re: Jboss7.1 arjuna configuration
    Alexey S. Newbie

    but the driver is using xa-datasource- isnt it enough?

  • 11. Re: Jboss7.1 arjuna configuration
    Alexey S. Newbie

    when could I find the xa-datasource sample for AS 7?

  • 12. Re: Jboss7.1 arjuna configuration
    Tom Jenkinson Master

    Michael Musgrove wrote:

     

    Alexey S. wrote:

     

    <datasource jndi-name="java:jboss/datasources/MyDataSource" pool-name="MyDataSource" enabled="true" use-java-context="true">

     

    You need to be using an <xa-datasoure>

     

    +1

  • 13. Re: Jboss7.1 arjuna configuration
    Tom Jenkinson Master

    Hi Alexey,

     

    Take a look at: https://github.com/jbossas/quickstart/blob/master/jta-crash-rec/src/main/webapp/WEB-INF/jta-crash-rec-quickstart-ds.xml

     

    Or more generally: https://github.com/jbossas/quickstart/

    e.g. jta-crash-rec

    cmt (JTA with PostgreSQL)

    jts

    jts-distributed-crash-rec

     

    Depending upon your needs...

     

    Hope that helps!

    Tom

  • 14. Re: Jboss7.1 arjuna configuration
    Michael Musgrove Master

    If you go to the web console (http://localhost:9990), select the Profile tab (top right) and from the menu on the left choose Connector -> Datasources. Choose the XA Datasources tab. Click the Add button (top right) to create an XA Datasource ...

     

    Alternatively, you could  try deploying an xxx-ds.xml file with you app by putting the ds config in the WEB-INF folder. Eg

     

    <?xml version="1.0" encoding="UTF-8"?>

    <datasources>

        <xa-datasource jndi-name="java:jboss/datasources/MyDataSource" pool-name="MyDataSource" enabled="true" use-ccm="false">

            <xa-datasource-property name="URL">

                jdbc:mysql://localhost:3306/mydb

            </xa-datasource-property>

            <driver>com.mysq</driver>

            <xa-pool>

                <is-same-rm-override>false</is-same-rm-override>

                <interleaving>false</interleaving>

                <pad-xid>false</pad-xid>

                <wrap-xa-resource>true</wrap-xa-resource>

            </xa-pool>

            <security>

                <user-name>x</user-name>

                <password>y</password>

            </security>

            <recovery>

                <recover-credential>

                    <user-name>x</user-name>

                    <password>y</password>

                </recover-credential>

            </recovery>

        </xa-datasource>

    </datasources>

1 2 3 Previous Next