Uploaded image for project: 'Red Hat Fuse'
  1. Red Hat Fuse
  2. ENTESB-5370

Aries transaction manager fails with background connection validation

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: jboss-fuse-6.2.1
    • Component/s: Aries
    • Labels:
      None
    • Environment:

      JBoss Fuse 6.2.1

    • Sprint:
      Sprint 5 - towards ER2

      Description

      An application defines an XA-aware connection pool as follows:

      <bean id="ariesTransactionManager" class="org.apache.aries.transaction.internal.AriesTransactionManagerImpl">
              ...    
      </bean>
       <bean id="internalXaDataSource" class="org.h2.jdbcx.JdbcDataSource">
              <property name="URL" value="..."/>
              <property name="description" value="..."/>
          </bean>
          <bean id="dataSource" class="org.apache.aries.transaction.jdbc.RecoverableDataSource" init-method="start">
              <property name="transactionManager" ref="ariesTransactionManager"/>
              <property name="dataSource" ref="internalXaDataSource"/>
              <property name="backgroundValidation" value="true"/>
              <property name="transaction" value="xa"/>
              ...    
      </bean>
      

      So long as backgroundValidation==true, the application fails at runtime with the following exception:

      Caused by: java.lang.RuntimeException: java.lang.NoSuchFieldException: pool
      	at org.apache.aries.transaction.jdbc.internal.Reflections.get(Reflections.java:56)
      	at org.apache.aries.transaction.jdbc.internal.ValidatingGenericConnectionManager.<init>(ValidatingGenericConnectionManager.java:89)
      	at org.apache.aries.transaction.jdbc.internal.ConnectionManagerFactory.init(ConnectionManagerFactory.java:152)
      	at org.apache.aries.transaction.jdbc.RecoverableDataSource.start(RecoverableDataSource.java:235)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:497)
      

      This seems to be a defect in org.apache.aries.transaction.jdbc.internal.ValidatingGenericConnectionManager:

        if (current instanceof AbstractSinglePoolConnectionInterceptor) {
                  foundPool = Reflections.get(stack, "pool"); //----- PROBLEM!
              } else if (current instanceof MultiPoolConnectionInterceptor) {
                  log.warn("validation on stack {} not supported", stack);
              }
      

      Intuitively we thing that Reflections.get() should be called on "current" not on "stack"; current is an instance of AbstractSinglePoolConnectionInterceptor, and thus has a "pool" property; "stack" is an instance of ConnectionInterceptor, that does not.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                jpoth John Poth
                Reporter:
                kboone Kevin Boone
                Tester:
                Tomáš Turek
              • Votes:
                0 Vote for this issue
                Watchers:
                10 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: