I'm trying to deploy a simple Spring Boot application. application.properties
contains the following:
spring.datasource.name=MyDS
spring.datasource.username=user
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.xa.data-source-class-name=com.mysql.jdbc.jdbc2.optional.MysqlXADataSource
spring.datasource.password=passwd
spring.jpa.database=mysql
spring.jpa.database-platform=org.hibernate.dialect.HSQLDialect
spring.datasource.url=jdbc\:mysql\://host\:3306/mydb
hibernate.dialect: org.hibernate.dialect.MySQL5Dialect
entitymanager.packagesToScan: /
Upon deploying I get the following:
java.lang.IllegalStateException: Unable to create XADataSource instance from 'com.mysql.jdbc.jdbc2.optional.MysqlXADataSource'
at org.springframework.boot.autoconfigure.jdbc.XADataSourceAutoConfiguration.createXaDataSourceInstance(XADataSourceAutoConfiguration.java:107)
at org.springframework.boot.autoconfigure.jdbc.XADataSourceAutoConfiguration.createXaDataSource(XADataSourceAutoConfiguration.java:94)
at org.springframework.boot.autoconfigure.jdbc.XADataSourceAutoConfiguration.dataSource(XADataSourceAutoConfiguration.java:76)
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:498)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162)
... 47 more
I've only encountered this kind of exception when the XA DataSource was set to org.mysql.jdbc.MySQLDataSource
. In that case setting it to com.mysql.jdbc.jdbc2.optional.MysqlXADataSource
is supposed to do the trick. Any suggestions are welcome.
UPDATE: after bringing in the older versions of Atomikos in pom.xml
I can choose between atomikos-util 3.8.0
in which case the spring-boot:run
fails with java.lang.ClassNotFoundException: com.atomikos.util.Assert
. If however I change the version to atomikos-util 4.0.0
or higher I get com.atomikos.diagnostics.Console
.