filippo balicchia created SMX4-1285:
---------------------------------------

             Summary: Activiti camel Test failed Order process lookup.
                 Key: SMX4-1285
                 URL: https://issues.apache.org/jira/browse/SMX4-1285
             Project: ServiceMix 4
          Issue Type: Bug
          Components: Examples
    Affects Versions: 4.5.0
            Reporter: filippo balicchia
            Priority: Minor


After upgrade to activiti 5.10 camelactiviti example stop to work cause fail to 
lookup "orderProcess".
the Root cause was:
Rolling back JDBC Connection.
{noformat}
09:49:00,976 | DEBUG | l Console Thread | JdbcTransaction                  | 
188 - org.mybatis.mybatis - 3.1.1 | Setting autocommit to false on JDBC 
Connection [conn3: 
url=jdbc:h2:file:/projects/servicemix/smx4/features/trunk/assemblies/apache-servicemix-full/target/apache-servicemix-4.5.0-SNAPSHOT/data/activiti/database
 user=SA]
09:49:00,977 | DEBUG | l Console Thread | selectDeploymentsByName          | 
188 - org.mybatis.mybatis - 3.1.1 | ooo Using Connection [conn3: 
url=jdbc:h2:file:/projects/servicemix/smx4/features/trunk/assemblies/apache-servicemix-full

09:49:01,059 | DEBUG | l Console Thread | JdbcTransaction                  | 
188 - org.mybatis.mybatis - 3.1.1 | Rolling back JDBC Connection [conn3: 
url=jdbc:h2:file:/projects/servicemix/smx4/features/trunk/assemblies/apache-servicemix-full/target/apache-servicemix-4.5.0-SNAPSHOT/data/activiti/database
 user=SA]
09:49:01,060 | DEBUG | l Console Thread | JdbcTransaction                  | 
188 - org.mybatis.mybatis - 3.1.1 | Resetting autocommit to true on JDBC 
Connection [conn3: 
url=jdbc:h2:file:/projects/servicemix/smx4/features/trunk/assemblies/apache-servicemix-full/target/apache-servicemix-4.5.0-SNAPSHOT/data/activiti/database
 user=SA]
{noformat}
in mybatis 3.1.1 there is a check and activiti 5.10 set by default to false:
{code}
  if (connection != null && !connection.getAutoCommit()) {
      if (log.isDebugEnabled()) {
        log.debug("Rolling back JDBC Connection [" + connection + "]");
      }
      connection.rollback();
    }
{code}

The first fix that I thought is to put this in  activiti-config.xml:
{noformat}

+    <bean id="jdbcTransactionFactory"
class="org.apache.ibatis.transaction.jdbc.JdbcTransactionFactory"/>
+
+    <bean id="transactionFactory"
factory-ref="jdbcTransactionFactory" factory-method="newTransaction">
+       <argument ref="dataSource"/>
+       <argument>
+               <null/>
+       </argument>
+       <argument value="true"/>
+    </bean>
+
     <bean id="configuration"
class="org.activiti.engine.impl.cfg.JtaProcessEngineConfiguration"
ext:field-injection="true">
         <property name="databaseType" value="h2"/>
         <property name="dataSource" ref="dataSource"/>
         <property name="transactionManager" ref="transactionManager"/>
+       <property name="transactionFactory" ref="transactionFactory"/>
         <property name="databaseSchemaUpdate" value="true"/>
     </bean>
{noformat}

But when try to start feature servicemix tell me
{noformat}

3:00:46,610 | ERROR | rint Extender: 1 | BlueprintContainerImpl| 10 -
org.apache.aries.blueprint - 0.3.2 |
Unable to start blueprint container for bundle
org.apache.servicemix.activiti.configorg.osgi.service.blueprint.container.ComponentDefinitionException:
Error setting property:
org.apache.aries.blueprint.utils.ReflectionUtils$JointPropertyDescriptor@4c8d74b

Caused by: java.lang.Exception: Unable to convert value
org.apache.ibatis.transaction.jdbc.JdbcTransaction@612bd56c to type
org.apache.ibatis.transaction.TransactionFactory
at 
org.apache.aries.blueprint.container.AggregateConverter.convert(AggregateConverter.java:172)[10:org.apache.aries.blueprint:0.3.2]
at 
org.apache.aries.blueprint.container.BlueprintRepository.convert(BlueprintRepository.java:373)[10:org.apache.aries.blueprint:0.3.2]
{noformat}


But JdbcTransactionFactory implements TransactionFactory.

I think that this problem can be amenable to
https://issues.apache.org/jira/browse/ARIES-834

At the moment IMHO the best solution I've found that works is 
WA localized in activity.







--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to