JBoss 6에서의 MariaDB XA 드라이버 설정
mariaDB jar에 다음과 같은 문제가 있습니다.
12:42:54,194 ERROR [org.jboss.jca.core.tx.jbossts.XAResourceRecoveryImpl] (Periodic Recovery) IJ000906: Error during crash recovery: java:jboss/datasources/myDS (Could not create connection): javax.resource.ResourceException: Could not create connection
at org.jboss.jca.adapters.jdbc.xa.XAManagedConnectionFactory.getXAManagedConnection(XAManagedConnectionFactory.java:525)
at org.jboss.jca.adapters.jdbc.xa.XAManagedConnectionFactory$1.run(XAManagedConnectionFactory.java:416)
at org.jboss.jca.adapters.jdbc.xa.XAManagedConnectionFactory$1.run(XAManagedConnectionFactory.java:413)
at java.security.AccessController.doPrivileged(Native Method) [rt.jar:1.8.0_45]
at javax.security.auth.Subject.doAs(Subject.java:422) [rt.jar:1.8.0_45]
at org.jboss.jca.adapters.jdbc.xa.XAManagedConnectionFactory.createManagedConnection(XAManagedConnectionFactory.java:412)
at org.jboss.jca.core.tx.jbossts.XAResourceRecoveryImpl.open(XAResourceRecoveryImpl.java:343)
at org.jboss.jca.core.tx.jbossts.XAResourceRecoveryImpl.getXAResources(XAResourceRecoveryImpl.java:170)
at com.arjuna.ats.internal.jbossatx.jta.XAResourceRecoveryHelperWrapper.getXAResources(XAResourceRecoveryHelperWrapper.java:51) [jbossjts-integration-4.17.29.Final-redhat-1.jar:4.17.29.Final-redhat-1 (revision: ede35097ddd6c0f539ba06e78df7794c0e06d68d)]
at com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule.resourceInitiatedRecoveryForRecoveryHelpers(XARecoveryModule.java:510) [jbossjts-jacorb-4.17.29.Final-redhat-1.jar:4.17.29.Final-redhat-1]
at com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule.periodicWorkFirstPass(XARecoveryModule.java:176) [jbossjts-jacorb-4.17.29.Final-redhat-1.jar:4.17.29.Final-redhat-1]
at com.arjuna.ats.internal.arjuna.recovery.PeriodicRecovery.doWorkInternal(PeriodicRecovery.java:747) [jbossjts-jacorb-4.17.29.Final-redhat-1.jar:4.17.29.Final-redhat-1]
at com.arjuna.ats.internal.arjuna.recovery.PeriodicRecovery.run(PeriodicRecovery.java:375) [jbossjts-jacorb-4.17.29.Final-redhat-1.jar:4.17.29.Final-redhat-1]
Caused by: java.lang.ClassCastException: org.mariadb.jdbc.Driver cannot be cast to javax.sql.XADataSource
at org.jboss.jca.adapters.jdbc.xa.XAManagedConnectionFactory.getXADataSource(XAManagedConnectionFactory.java:647)
at org.jboss.jca.adapters.jdbc.xa.XAManagedConnectionFactory.getXAManagedConnection(XAManagedConnectionFactory.java:508)
... 12 more
mariadb 웹사이트에서 mariadb-java-client-1.1.9를 다운로드하여 jboss_home\modules\org\mariadb\main에 있는 module.xml 파일을 만듭니다.
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.0" name="org.mariadb">
<resources>
<resource-root path="mariadb-java-client-1.1.9.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
</dependencies>
</module>
여기 standalone.xml이 있습니다.
<datasources>
<datasource jndi-name="java:jboss/datasources/rDS" pool-name="rDS" enabled="true">
<connection-url>jdbc:mariadb://localhost:3306/soccer</connection-url>
<driver>mariadb</driver>
<pool>
<min-pool-size>1</min-pool-size>
<max-pool-size>100</max-pool-size>
</pool>
<security>
<user-name>user_name</user-name>
<password>my_password</password>
</security>
<statement>
<prepared-statement-cache-size>100</prepared-statement-cache-size>
<share-prepared-statements>false</share-prepared-statements>
</statement>
</datasource>
<xa-datasource jndi-name="java:jboss/datasources/myDS" pool-name="myDS" enabled="true">
<xa-datasource-property name="ServerName">
localhost
</xa-datasource-property>
<xa-datasource-property name="PortNumber">
3306
</xa-datasource-property>
<xa-datasource-property name="DatabaseName">
soccer
</xa-datasource-property>
<driver>mariadb</driver>
<xa-pool>
<min-pool-size>1</min-pool-size>
<max-pool-size>100</max-pool-size>
</xa-pool>
<security>
<user-name>user_name</user-name>
<password>my_password</password>
</security>
<statement>
<prepared-statement-cache-size>100</prepared-statement-cache-size>
<share-prepared-statements>false</share-prepared-statements>
</statement>
</xa-datasource>
<drivers>
<driver name="mariadb" module="org.mariadb">
<xa-datasource-class>org.mariadb.jdbc.Driver</xa-datasource-class>
</driver>
</drivers>
</datasources>
감사해요.
org.mariadb.jdbc.드라이버는 javax.sql을 구현하지 않습니다.XAData 소스DS를 org.mariadb.jdbc로 변경해 주세요.MySQLData Source로 동작합니다.
언급URL : https://stackoverflow.com/questions/31144632/configuring-mariadb-xa-driver-in-jboss-6
'programing' 카테고리의 다른 글
Panda 데이터 프레임에서 행 목록을 삭제하는 방법은 무엇입니까? (0) | 2023.01.30 |
---|---|
Virtual Box Vagrant 내에서 Mysql 서버에 연결하는 방법 (0) | 2023.01.30 |
mysql 서비스가 시작되지 않거나 중단됨 - 시간 초과(Ubuntu, MariaDB) (0) | 2023.01.30 |
MySQL/MariaDB에서 LONGTEXT 필드를 JSON으로 반환하는 방법 (0) | 2023.01.30 |
HashSet/HashMap에 중복된 값을 추가하면 이전 값이 대체됩니까? (0) | 2023.01.30 |