org.springframework.transaction.CannotCreateTransactionException: Could not open JPA EntityManager for transaction; nested exception is java.lang.IllegalStateException: EntityManagerFactory is closed at org.springframework.orm.jpa.JpaTransactionManager.doBegin(JpaTransactionManager.java:431) at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:373) at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130) at org.flowable.common.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:56) at org.flowable.common.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:30) at org.flowable.common.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:56) at org.flowable.common.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:51) at org.flowable.common.engine.impl.query.AbstractQuery.list(AbstractQuery.java:117) at org.flowable.eventregistry.impl.management.DefaultEventRegistryChangeDetectionManager.detectChanges(DefaultEventRegistryChangeDetectionManager.java:50) at org.flowable.eventregistry.impl.management.EventRegistryChangeDetectionRunnable.run(EventRegistryChangeDetectionRunnable.java:35) at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.runAndReset$$$capture(FutureTask.java:308) at java.util.concurrent.FutureTask.runAndReset(FutureTask.java) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748)
时间: 2024-04-25 21:26:40 浏览: 350
org.springframework.transaction-3.1.2.release.jar
这个异常是由于在执行事务期间无法打开JPA EntityManager引起的。其中嵌套的异常是“EntityManagerFactory is closed”。这可能是由于以下原因之一:
1. 在entityManagerFactory关闭之后,尝试使用它。
2. entityManagerFactory尚未成功初始化。
3. 数据库连接池中没有足够的连接可供使用。
您可以尝试重新启动应用程序或检查数据库连接是否正确。您还可以尝试增加数据库连接池的大小,以确保有足够的连接可用。如果这些步骤无法解决问题,请提供更多上下文和详细信息,以便我可以提供更准确的答案。
阅读全文