Mon application fonctionne correctement avec la datasource mysql suivante sous JBoss 4.0.0 mais génère l'erreur suivante sous JBoss 4.2.0GA :
<<
Caused by: org.jboss.util.NestedSQLException: Could not enlist in transaction on
entering meta-aware object!; - nested throwable: (javax.transaction.SystemExcep
tion: java.lang.Throwable: Unabled to enlist resource, see the previous warnings
. tx=TransactionImple < ac, BasicAction: ae10719:12c2:4666ed28:4b status: Action
Status.ABORT_ONLY >); - nested throwable: (org.jboss.resource.JBossResourceExcep
tion: Could not enlist in transaction on entering meta-aware object!; - nested t
hrowable: (javax.transaction.SystemException: java.lang.Throwable: Unabled to en
list resource, see the previous warnings. tx=TransactionImple < ac, BasicAction:
ae10719:12c2:4666ed28:4b status: ActionStatus.ABORT_ONLY >))
at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(Wrapp
erDataSource.java:94)
at org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadRelationCommand.execute(JDBCLo
adRelationCommand.java:96)
... 194 more
Caused by: org.jboss.resource.JBossResourceException: Could not enlist in transa
ction on entering meta-aware object!; - nested throwable: (javax.transaction.Sys
temException: java.lang.Throwable: Unabled to enlist resource, see the previous
warnings. tx=TransactionImple < ac, BasicAction: ae10719:12c2:4666ed28:4b status
: ActionStatus.ABORT_ONLY >)
at org.jboss.resource.connectionmanager.TxConnectionManager.managedConne
>>
Ceci se produit lors de l'accès à via EJB Entité à la DB MySQL.
myapp-ds.xml
---
<?xml version="1.0" encoding="UTF-8"?>
<!-- ==================================================================== -->
<!-- Datasource config for MyApp -->
<!-- ==================================================================== -->
<datasources>
<local-tx-datasource>
<jndi-name>MyApp_RW_DS</jndi-name>
<connection-url>jdbc:mysql://localhost/myApp</connection-url>
<driver-class>org.gjt.mm.mysql.Driver</driver-class>
<transaction-isolation>TRANSACTION_REPEATABLE_READ</transaction-isolation>
<user-name>root</user-name>
<password></password>
<min-pool-size>20</min-pool-size>
<max-pool-size>500</max-pool-size>
</local-tx-datasource>
<local-tx-datasource>
<jndi-name>MyApp_RO_DS</jndi-name>
<connection-url>jdbc:mysql://localhost/myApp</connection-url>
<driver-class>org.gjt.mm.mysql.Driver</driver-class>
<transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
<user-name>root</user-name>
<password></password>
<min-pool-size>20</min-pool-size>
<max-pool-size>500</max-pool-size>
</local-tx-datasource>
</datasources>
---
Ajout effectué dans standardjboss.xml du répertoire conf de jboss :
<<
<!-- begin myapp-j2ee specific -->
<container-configuration>
<container-name>MyApp CMP 2.x READ-ONLY ETB</container-name>
<call-logging>false</call-logging>
<invoker-proxy-binding-name>entity-rmi-invoker</invoker-proxy-binding-name>
<sync-on-commit-only>false</sync-on-commit-only>
<container-interceptors>
<interceptor>org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor</interceptor>
<interceptor>org.jboss.ejb.plugins.LogInterceptor</interceptor>
<interceptor>org.jboss.ejb.plugins.SecurityInterceptor</interceptor>
<interceptor>org.jboss.ejb.plugins.TxInterceptorCMT</interceptor>
<interceptor metricsEnabled="true">org.jboss.ejb.plugins.MetricsInterceptor</interceptor>
<interceptor>org.jboss.ejb.plugins.EntityLockInterceptor</interceptor>
<interceptor>org.jboss.ejb.plugins.EntityInstanceInterceptor</interceptor>
<interceptor>org.jboss.ejb.plugins.EntityReentranceInterceptor</interceptor>
<interceptor>org.jboss.resource.connectionmanager.CachedConnectionInterceptor</interceptor>
<interceptor>org.jboss.ejb.plugins.EntitySynchronizationInterceptor</interceptor>
<interceptor>org.jboss.ejb.plugins.cmp.jdbc.JDBCRelationInterceptor</interceptor>
</container-interceptors>
<instance-pool>org.jboss.ejb.plugins.EntityInstancePool</instance-pool>
<instance-cache>org.jboss.ejb.plugins.InvalidableEntityInstanceCache</instance-cache>
<persistence-manager>org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager</persistence-manager>
<locking-policy>org.jboss.ejb.plugins.lock.QueuedPessimisticEJBLock</locking-policy>
<container-cache-conf>
<cache-policy>org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy</cache-policy>
<cache-policy-conf>
<min-capacity>100</min-capacity>
<max-capacity>1000000</max-capacity>
<overager-period>300</overager-period>
<max-bean-age>600</max-bean-age>
<resizer-period>400</resizer-period>
<max-cache-miss-period>60</max-cache-miss-period>
<min-cache-miss-period>1</min-cache-miss-period>
<cache-load-factor>0.75</cache-load-factor>
</cache-policy-conf>
</container-cache-conf>
<container-pool-conf>
<MaximumSize>100</MaximumSize>
</container-pool-conf>
<commit-option>A</commit-option>
</container-configuration>
<container-configuration>
<container-name>MyApp CMP 2.x EntityBean with cache invalidation and IPT</container-name>
<call-logging>false</call-logging>
<invoker-proxy-binding-name>entity-rmi-invoker</invoker-proxy-binding-name>
<container-interceptors>
<interceptor>org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor</interceptor>
<interceptor>org.jboss.ejb.plugins.LogInterceptor</interceptor>
<interceptor>org.jboss.ejb.plugins.SecurityInterceptor</interceptor>
<interceptor>org.jboss.ejb.plugins.TxInterceptorCMT</interceptor>
<interceptor metricsEnabled="true">org.jboss.ejb.plugins.MetricsInterceptor</interceptor>
<interceptor>org.jboss.ejb.plugins.EntityCreationInterceptor</interceptor>
<interceptor>org.jboss.ejb.plugins.EntityLockInterceptor</interceptor>
<interceptor>org.jboss.ejb.plugins.EntityInstanceInterceptor</interceptor>
<interceptor>org.jboss.ejb.plugins.EntityReentranceInterceptor</interceptor>
<interceptor>org.jboss.resource.connectionmanager.CachedConnectionInterceptor</interceptor>
<interceptor>org.jboss.ejb.plugins.EntitySynchronizationInterceptor</interceptor>
<!--interceptor>org.jboss.ejb.plugins.EntityMultiInstanceSynchronizationInterceptor</interceptor-->
<interceptor>org.jboss.cache.invalidation.triggers.EntityBeanCacheBatchInvalidatorInterceptor</interceptor>
<interceptor>org.jboss.ejb.plugins.cmp.jdbc.JDBCRelationInterceptor</interceptor>
</container-interceptors>
<instance-pool>org.jboss.ejb.plugins.EntityInstancePool</instance-pool>
<instance-cache>org.jboss.ejb.plugins.PerTxEntityInstanceCache</instance-cache>
<persistence-manager>org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager</persistence-manager>
<!--locking-policy>org.jboss.ejb.plugins.lock.QueuedPessimisticEJBLock</locking-policy-->
<locking-policy>org.jboss.ejb.plugins.lock.NoLock</locking-policy>
<container-cache-conf/>
<container-pool-conf>
<MaximumSize>100</MaximumSize>
</container-pool-conf>
<commit-option>C</commit-option>
</container-configuration>
<!-- end myapp-j2ee specific -->
>>
La base de donnée étant du MySQL 4 et celle-ci ne fonctionnant pas à priori en mode XA, y a t il un moyen de contournement ?
Partager