diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/transaction/jta/BitronixJtaConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/transaction/jta/BitronixJtaConfiguration.java index 1edf664e77..8ddf9e5cae 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/transaction/jta/BitronixJtaConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/transaction/jta/BitronixJtaConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -51,7 +51,9 @@ import org.springframework.util.StringUtils; * @author Phillip Webb * @author Andy Wilkinson * @author Kazuki Shimizu + * @deprecated since 2.3.0 as the Bitronix project is no longer being maintained */ +@Deprecated @Configuration(proxyBeanMethods = false) @EnableConfigurationProperties(JtaProperties.class) @ConditionalOnClass({ JtaTransactionManager.class, BitronixContext.class }) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/transaction/jta/JtaAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/transaction/jta/JtaAutoConfiguration.java index 2fb24cec7c..2b8d8cfefb 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/transaction/jta/JtaAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/transaction/jta/JtaAutoConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,6 +35,7 @@ import org.springframework.context.annotation.Import; * @author Nishant Raut * @since 1.2.0 */ +@SuppressWarnings("deprecation") @Configuration(proxyBeanMethods = false) @ConditionalOnClass(javax.transaction.Transaction.class) @ConditionalOnProperty(prefix = "spring.jta", value = "enabled", matchIfMissing = true) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/transaction/jta/JtaAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/transaction/jta/JtaAutoConfigurationTests.java index 06573d1407..1170e0b71f 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/transaction/jta/JtaAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/transaction/jta/JtaAutoConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -71,6 +71,7 @@ import static org.mockito.Mockito.mock; * @author Kazuki Shimizu * @author Nishant Raut */ +@SuppressWarnings("deprecation") class JtaAutoConfigurationTests { private AnnotationConfigApplicationContext context; @@ -115,6 +116,7 @@ class JtaAutoConfigurationTests { } @Test + @Deprecated void bitronixSanityCheck() { this.context = new AnnotationConfigApplicationContext(JtaProperties.class, BitronixJtaConfiguration.class); this.context.getBean(bitronix.tm.Configuration.class); @@ -126,6 +128,7 @@ class JtaAutoConfigurationTests { } @Test + @Deprecated void defaultBitronixServerId() throws UnknownHostException { this.context = new AnnotationConfigApplicationContext(BitronixJtaConfiguration.class); String serverId = this.context.getBean(bitronix.tm.Configuration.class).getServerId(); @@ -133,6 +136,7 @@ class JtaAutoConfigurationTests { } @Test + @Deprecated void customBitronixServerId() { this.context = new AnnotationConfigApplicationContext(); TestPropertyValues.of("spring.jta.transactionManagerId:custom").applyTo(this.context); @@ -167,6 +171,7 @@ class JtaAutoConfigurationTests { } @Test + @Deprecated void bitronixConnectionFactoryPoolConfiguration() { this.context = new AnnotationConfigApplicationContext(); TestPropertyValues.of("spring.jta.bitronix.connectionfactory.minPoolSize:5", @@ -192,6 +197,7 @@ class JtaAutoConfigurationTests { } @Test + @Deprecated void bitronixDataSourcePoolConfiguration() { this.context = new AnnotationConfigApplicationContext(); TestPropertyValues @@ -218,6 +224,7 @@ class JtaAutoConfigurationTests { } @Test + @Deprecated void bitronixCustomizeJtaTransactionManagerUsingProperties() { this.context = new AnnotationConfigApplicationContext(); TestPropertyValues diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/spring-boot-features.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/spring-boot-features.adoc index 24f138f721..169cca114b 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/spring-boot-features.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/spring-boot-features.adoc @@ -5889,7 +5889,8 @@ When a `jndi-name` is set, it takes precedence over all other Session-related se [[boot-features-jta]] == Distributed Transactions with JTA -Spring Boot supports distributed JTA transactions across multiple XA resources by using either an https://www.atomikos.com/[Atomikos] or https://github.com/bitronix/btm[Bitronix] embedded transaction manager. +Spring Boot supports distributed JTA transactions across multiple XA resources by using an https://www.atomikos.com/[Atomikos] embedded transaction manager. +Deprecated support for using a https://github.com/bitronix/btm[Bitronix] embedded transaction manager is also provided but it will be removed in a future release. JTA transactions are also supported when deploying to a suitable Java EE Application Server. When a JTA environment is detected, Spring's `JtaTransactionManager` is used to manage transactions. @@ -5918,7 +5919,8 @@ To ensure uniqueness in production, you should configure the configprop:spring.j [[boot-features-jta-bitronix]] === Using a Bitronix Transaction Manager -https://github.com/bitronix/btm[Bitronix] is a popular open-source JTA transaction manager implementation. +NOTE: As of Spring Boot 2.3, support for Bitronix has been deprecated and will be removed in a future release. + You can use the `spring-boot-starter-jta-bitronix` starter to add the appropriate Bitronix dependencies to your project. As with Atomikos, Spring Boot automatically configures Bitronix and post-processes your beans to ensure that startup and shutdown ordering is correct. @@ -5978,7 +5980,7 @@ The {spring-boot-module-code}/jms/XAConnectionFactoryWrapper.java[`XAConnectionF The interfaces are responsible for wrapping `XAConnectionFactory` and `XADataSource` beans and exposing them as regular `ConnectionFactory` and `DataSource` beans, which transparently enroll in the distributed transaction. DataSource and JMS auto-configuration use JTA variants, provided you have a `JtaTransactionManager` bean and appropriate XA wrapper beans registered within your `ApplicationContext`. -The {spring-boot-module-code}/jta/bitronix/BitronixXAConnectionFactoryWrapper.java[BitronixXAConnectionFactoryWrapper] and {spring-boot-module-code}/jta/bitronix/BitronixXADataSourceWrapper.java[BitronixXADataSourceWrapper] provide good examples of how to write XA wrappers. +The {spring-boot-module-code}/jta/atomikos/AtomikosXAConnectionFactoryWrapper.java[AtomikosXAConnectionFactoryWrapper] and {spring-boot-module-code}/jta/atomikos/AtomikosXADataSourceWrapper.java[AtomikosXADataSourceWrapper] provide good examples of how to write XA wrappers. diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-jta-bitronix/build.gradle b/spring-boot-project/spring-boot-starters/spring-boot-starter-jta-bitronix/build.gradle index 019fb12558..ee541b4a07 100644 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-jta-bitronix/build.gradle +++ b/spring-boot-project/spring-boot-starters/spring-boot-starter-jta-bitronix/build.gradle @@ -2,7 +2,7 @@ plugins { id "org.springframework.boot.starter" } -description = "Starter for JTA transactions using Bitronix" +description = "Starter for JTA transactions using Bitronix. Deprecated since 2.3.0" dependencies { api(platform(project(":spring-boot-project:spring-boot-dependencies"))) diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jta/bitronix/BitronixDependentBeanFactoryPostProcessor.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jta/bitronix/BitronixDependentBeanFactoryPostProcessor.java index 8591985086..3cebd875ac 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jta/bitronix/BitronixDependentBeanFactoryPostProcessor.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jta/bitronix/BitronixDependentBeanFactoryPostProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,7 +32,9 @@ import org.springframework.core.Ordered; * * @author Phillip Webb * @since 1.2.0 + * @deprecated since 2.3.0 as the Bitronix project is no longer being maintained */ +@Deprecated public class BitronixDependentBeanFactoryPostProcessor implements BeanFactoryPostProcessor, Ordered { private static final String[] NO_BEANS = {}; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jta/bitronix/BitronixXAConnectionFactoryWrapper.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jta/bitronix/BitronixXAConnectionFactoryWrapper.java index 4a3749073a..fc1b0d7eab 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jta/bitronix/BitronixXAConnectionFactoryWrapper.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jta/bitronix/BitronixXAConnectionFactoryWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,7 +27,9 @@ import org.springframework.boot.jms.XAConnectionFactoryWrapper; * * @author Phillip Webb * @since 1.2.0 + * @deprecated since 2.3.0 as the Bitronix project is no longer being maintained */ +@Deprecated public class BitronixXAConnectionFactoryWrapper implements XAConnectionFactoryWrapper { @Override diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jta/bitronix/BitronixXADataSourceWrapper.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jta/bitronix/BitronixXADataSourceWrapper.java index c443f97004..c766a82dab 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jta/bitronix/BitronixXADataSourceWrapper.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jta/bitronix/BitronixXADataSourceWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,7 +26,9 @@ import org.springframework.boot.jdbc.XADataSourceWrapper; * * @author Phillip Webb * @since 1.2.0 + * @deprecated since 2.3.0 as the Bitronix project is no longer being maintained */ +@Deprecated public class BitronixXADataSourceWrapper implements XADataSourceWrapper { @Override diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jta/bitronix/PoolingConnectionFactoryBean.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jta/bitronix/PoolingConnectionFactoryBean.java index 0de3e82c67..484c4c26be 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jta/bitronix/PoolingConnectionFactoryBean.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jta/bitronix/PoolingConnectionFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,7 +41,9 @@ import org.springframework.util.StringUtils; * @author Josh Long * @author Andy Wilkinson * @since 1.2.0 + * @deprecated since 2.3.0 as the Bitronix project is no longer being maintained */ +@Deprecated @SuppressWarnings("serial") @ConfigurationProperties(prefix = "spring.jta.bitronix.connectionfactory") public class PoolingConnectionFactoryBean extends PoolingConnectionFactory diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jta/bitronix/PoolingDataSourceBean.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jta/bitronix/PoolingDataSourceBean.java index af1b9c9aa3..21a80bb935 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jta/bitronix/PoolingDataSourceBean.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jta/bitronix/PoolingDataSourceBean.java @@ -42,7 +42,9 @@ import org.springframework.util.StringUtils; * @author Josh Long * @author Andy Wilkinson * @since 1.2.0 + * @deprecated since 2.3.0 as the Bitronix project is no longer being maintained */ +@Deprecated @SuppressWarnings("serial") @ConfigurationProperties(prefix = "spring.jta.bitronix.datasource") public class PoolingDataSourceBean extends PoolingDataSource implements BeanNameAware, InitializingBean { diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jta/bitronix/package-info.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jta/bitronix/package-info.java index e91d18370a..71a5709d26 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jta/bitronix/package-info.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jta/bitronix/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,5 +16,6 @@ /** * Support classes for Bitronix JTA. + * @deprecated since 2.3.0 as the Bitronix project is no longer being maintained */ package org.springframework.boot.jta.bitronix; diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/jta/bitronix/BitronixDependentBeanFactoryPostProcessorTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/jta/bitronix/BitronixDependentBeanFactoryPostProcessorTests.java index 0154e8153c..ab8f474f95 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/jta/bitronix/BitronixDependentBeanFactoryPostProcessorTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/jta/bitronix/BitronixDependentBeanFactoryPostProcessorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,6 +36,7 @@ import static org.mockito.Mockito.verify; * * @author Phillip Webb */ +@Deprecated class BitronixDependentBeanFactoryPostProcessorTests { private AnnotationConfigApplicationContext context; diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/jta/bitronix/BitronixXAConnectionFactoryWrapperTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/jta/bitronix/BitronixXAConnectionFactoryWrapperTests.java index 21da1d5267..6369668111 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/jta/bitronix/BitronixXAConnectionFactoryWrapperTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/jta/bitronix/BitronixXAConnectionFactoryWrapperTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ import static org.mockito.Mockito.mock; * * @author Phillip Webb */ +@Deprecated class BitronixXAConnectionFactoryWrapperTests { @Test diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/jta/bitronix/BitronixXADataSourceWrapperTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/jta/bitronix/BitronixXADataSourceWrapperTests.java index b7eb2e6011..f47bf4c45c 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/jta/bitronix/BitronixXADataSourceWrapperTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/jta/bitronix/BitronixXADataSourceWrapperTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ import static org.mockito.Mockito.mock; * * @author Phillip Webb */ +@Deprecated class BitronixXADataSourceWrapperTests { @Test diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/jta/bitronix/PoolingConnectionFactoryBeanTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/jta/bitronix/PoolingConnectionFactoryBeanTests.java index cd3a9f1911..9655b5fb0e 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/jta/bitronix/PoolingConnectionFactoryBeanTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/jta/bitronix/PoolingConnectionFactoryBeanTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ import static org.mockito.Mockito.verify; * * @author Phillip Webb */ +@Deprecated class PoolingConnectionFactoryBeanTests { @SuppressWarnings("serial") diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/jta/bitronix/PoolingDataSourceBeanTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/jta/bitronix/PoolingDataSourceBeanTests.java index 057da9d6da..a45ad23070 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/jta/bitronix/PoolingDataSourceBeanTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/jta/bitronix/PoolingDataSourceBeanTests.java @@ -36,6 +36,7 @@ import static org.mockito.Mockito.verify; * * @author Phillip Webb */ +@Deprecated class PoolingDataSourceBeanTests { private PoolingDataSourceBean bean = new PoolingDataSourceBean();