diff --git a/spring-cloud-task-core/src/main/java/org/springframework/cloud/task/configuration/DefaultTaskConfigurer.java b/spring-cloud-task-core/src/main/java/org/springframework/cloud/task/configuration/DefaultTaskConfigurer.java index 9496eedbc..55200c5a3 100644 --- a/spring-cloud-task-core/src/main/java/org/springframework/cloud/task/configuration/DefaultTaskConfigurer.java +++ b/spring-cloud-task-core/src/main/java/org/springframework/cloud/task/configuration/DefaultTaskConfigurer.java @@ -141,7 +141,7 @@ public PlatformTransactionManager getTransactionManager() { if (this.transactionManager == null) { if (isDataSourceAvailable()) { try { - Class.forName("javax.persistence.EntityManager"); + Class.forName("jakarta.persistence.EntityManager"); if (this.context != null && this.context.getBeanNamesForType(EntityManager.class).length > 0) { logger.debug("EntityManager was found, using JpaTransactionManager"); this.transactionManager = new JpaTransactionManager(); diff --git a/spring-cloud-task-core/src/test/java/org/springframework/cloud/task/configuration/DefaultTaskConfigurerTests.java b/spring-cloud-task-core/src/test/java/org/springframework/cloud/task/configuration/DefaultTaskConfigurerTests.java index f0171449b..90ba65750 100644 --- a/spring-cloud-task-core/src/test/java/org/springframework/cloud/task/configuration/DefaultTaskConfigurerTests.java +++ b/spring-cloud-task-core/src/test/java/org/springframework/cloud/task/configuration/DefaultTaskConfigurerTests.java @@ -66,7 +66,7 @@ public void testDefaultContext() throws Exception { DefaultTaskConfigurer defaultTaskConfigurer = new DefaultTaskConfigurer(this.dataSource, TaskProperties.DEFAULT_TABLE_PREFIX, localContext); assertThat(defaultTaskConfigurer.getTransactionManager().getClass().getName()) - .isEqualTo("org.springframework.jdbc.support.JdbcTransactionManager"); + .isEqualTo("org.springframework.orm.jpa.JpaTransactionManager"); } @Test