Ich verwende Atomicos essentials in meinem Projekt für die Verwaltung von Transaktionen. Ich erhalte die folgende Ausnahme nach der Bereitstellung meines Projekts. Ich steckte darin fest und konnte es nicht lösen. Kann mir jemand bei der Lösung helfen?AbstractMethodError in AtomikosDataSourceBean.getMaxLifetime()
Exception in thread "Atomikos:0" java.lang.AbstractMethodError: com.atomikos.jdbc.AtomikosDataSourceBean.getMaxLifetime()I at com.atomikos.datasource.pool.ConnectionPool.removeConnectionsThatExceededMaxLifetime(ConnectionPool.java:286) at com.atomikos.datasource.pool.ConnectionPool.access$000(ConnectionPool.java:47) at com.atomikos.datasource.pool.ConnectionPool$1.alarm(ConnectionPool.java:92) at com.atomikos.timing.PooledAlarmTimer.notifyListeners(PooledAlarmTimer.java:112) at com.atomikos.timing.PooledAlarmTimer.run(PooledAlarmTimer.java:99) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)
Hier ist meine atomikos Konfiguration
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:util="http://www.springframework.org/schema/util"
xmlns:jee="http://www.springframework.org/schema/jee"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
http://www.springframework.org/schema/jee
http://www.springframework.org/schema/jee/spring-jee-3.0.xsd">
<!-- Optional: add a log administrator - To view Active Transaction-->
<!-- <bean id="localLogAdministrator"
class="com.atomikos.icatch.admin.imp.LocalLogAdministrator"/> -->
<bean id="userTransactionService"
class="com.atomikos.icatch.config.UserTransactionServiceImp"
init-method="init" destroy-method="shutdownForce">
<constructor-arg>
<!-- IMPORTANT: specify all Atomikos properties here -->
<props>
<prop key="com.atomikos.icatch.service">
com.atomikos.icatch.standalone.UserTransactionServiceFactory
</prop>
</props>
</constructor-arg>
<!-- Uncomment to see the java Applet Program to view the active transaction -->
<!-- <property name="initialLogAdministrators">
<list>
<ref bean="localLogAdministrator"/>
</list>
</property> -->
</bean>
<!--
Construct Atomikos UserTransactionManager to manage XA datasources
-->
<bean id="AtomikosTransactionManager"
class="com.atomikos.icatch.jta.UserTransactionManager"
init-method="init" destroy-method="close"
depends-on="userTransactionService">
<!-- IMPORTANT: disable startup because the userTransactionService above does this -->
<property name="startupTransactionService" value="false"/>
<!--
Decide when close is called,
should we force transactions to terminate or not?
-->
<property name="forceShutdown" value="false" />
</bean>
<!--
Atomikos User transaction to set transactionTimeout
-->
<bean id="AtomikosUserTransaction"
class="com.atomikos.icatch.jta.UserTransactionImp"
depends-on="userTransactionService">
<property name="transactionTimeout" value="1000" />
</bean>
<!-- To fetch datasource properties from JNDI -->
<bean id="xadatasourceprops" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="properties">
<bean class="java.util.Properties">
<constructor-arg>
<map>
<entry key="xaDataSourceClassName">
<jee:jndi-lookup jndi-name="java:comp/env/xaDataSourceClassName"/>
</entry>
<entry key="user">
<jee:jndi-lookup jndi-name="java:comp/env/user"/>
</entry>
<entry key="password">
<jee:jndi-lookup jndi-name="java:comp/env/password"/>
</entry>
<entry key="url">
<jee:jndi-lookup jndi-name="java:comp/env/url"/>
</entry>
<entry key="poolsize">
<jee:jndi-lookup jndi-name="java:comp/env/poolsize"/>
</entry>
</map>
</constructor-arg>
</bean>
</property>
</bean>
<!-- Configuring Atomikos DataSource Bean for Database-->
<bean id="atomikosDataSourceBean" class="com.atomikos.jdbc.AtomikosDataSourceBean" init-method="init" destroy-method="close">
<!-- set an arbitrary but unique name for the datasource -->
<property name="uniqueResourceName"><value>XADBResource</value></property>
<!-- set the underlying driver class to use -->
<property name="xaDataSourceClassName">
<value>${xaDataSourceClassName}</value>
</property>
<property name="xaProperties">
<!-- set the driver-specific XADataSource properties -->
<props>
<prop key="user">${user}</prop>
<prop key="password">${password}</prop>
<prop key="URL">${url}</prop>
</props>
</property>
<!-- how many connections in the pool? -->
<property name="poolSize" value="${poolsize}"/>
</bean>
<!-- Configuring Atomikos Connection Factory for JMS - ActiveMQ -->
<bean id="connectionFactory"
class="org.apache.activemq.spring.ActiveMQXAConnectionFactory">
<property name="brokerURL" value="tcp://localhost:61616" />
<property name="objectMessageSerializationDefered">
<value>true</value>
</property>
</bean>
<bean id="jmsListenerContainerFactory"
class="org.springframework.jms.config.DefaultJmsListenerContainerFactory">
<property name="connectionFactory" ref="connectionFactory" />
</bean>
<!--
Configure the JMS connector;
call init to register for recovery!
-->
<bean id="atomikosConnectionFactoryBean"
class="com.atomikos.jms.AtomikosConnectionFactoryBean"
init-method="init" destroy-method="close">
<property name="uniqueResourceName" value="amq_jms" />
<property name="xaConnectionFactory" ref="connectionFactory" />
<property name="poolSize" value="5" />
</bean>
<bean id="listenerContainerFactory"
class="org.springframework.jms.config.DefaultJmsListenerContainerFactory">
<property name="connectionFactory" ref="connectionFactory" />
</bean>
</beans>
Ich glaube nicht, dass es genug Informationen gibt, um das Problem für Sie zu lösen. Können Sie einige Ihrer Konfigurationen bereitstellen, um zu zeigen, wie Sie Atomikos in Ihrer Anwendung konfiguriert haben? – pczeus
@pczeus: Ich habe meine Atomikos-Konfiguration hinzugefügt .. Bitte überprüfen Sie .. – user3615185
Welche Version von Atomikos verwenden Sie? – pczeus