com.atomikos.icatch.SysException: Error in init(): Log already in use

本文讨论了在项目中使用Atomikos时遇到的并发部署冲突问题,特别是多个项目在同一环境中部署时可能出现的com.atomikos.icatch.SysException错误。通过在每个项目中指定不同的Atomikos文件名称来解决此问题,确保各项目间文件不冲突。

在项目中使用atomikos时,如果在同一个环境中部署两个以上这种项目,则可能会报出com.atomikos.icatch.SysException: Error in init(): Log already in use异常,这个信息是因为atomikos在默认情况下是将console_file_name和log_base_name设置为默认值:tm.out和tmlog0.log,并且会将这两个文件上锁,导致其他线程无法访问,所以当多个项目都未指定这一名称时就会出现上述异常信息

解决办法:

在每一个项目中都指定atomikos的文件名称,修改jta.properties文件中的

com.atomikos.icatch.console_file_name
com.atomikos.icatch.log_base_name

两个属性的值,保证每个项目的名称都不一样

例如:

第一个项目中使用默认值,则自动生成为tm.out、tm.out.lck和tmlog0.log、tmlog.log.lck四个文件;

第二个项目中在jta.properties文件中指定属性名称:

com.atomikos.icatch.console_file_name = rm.out

com.atomikos.icatch.log_base_name = rmlog.log

启动服务时就会自动生成rm.out、rm.out.lck和rmlog0.log、rmlog.log.lck四个文件;

这时两个项目使用的文件就不会产生冲突


问题解决

18:02:39 saut ERROR c.a.persistence.imp.LogFileLock - ERROR: the specified log seems to be in use already: saut.release.log in C:\Users\迈克\AppData\Local\JetBrains\IntelliJIdea2023.3\tomcat\b0535009-facf-44e6-b0cb-ce02f38952a9/logs/\. Make sure that no other instance is running, or kill any pending process if needed. 18:02:39 saut ERROR o.s.web.context.ContextLoader - Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'objectMapperConfigurer' defined in class path resource [springfox/documentation/spring/web/SpringfoxWebMvcConfiguration.class]: BeanPostProcessor before instantiation of bean failed; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.transaction.config.internalTransactionAdvisor' defined in class path resource [org/springframework/transaction/annotation/ProxyTransactionManagementConfiguration.class]: Unsatisfied dependency expressed through method 'transactionAdvisor' parameter 1; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'transactionInterceptor' defined in class path resource [com/guoxinqitong/framework/config/TransactionManagerConfig.class]: Unsatisfied dependency expressed through method 'transactionInterceptor' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userTransaction' defined in class path resource [com/guoxinqitong/framework/config/TransactionManagerConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.transaction.UserTransaction]: Factory method 'userTransaction' threw exception; nested exception is com.atomikos.icatch.SysException: Error in init: Log already in use? saut.release.log in C:\Users\迈克\AppData\Local\JetBrains\IntelliJIdea2023.3\tomcat\b0535009-facf-44e6-b0cb-ce02f38952a9/logs/\ at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:537) at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:213) at org.springframework.c
最新发布
07-25
10:33:18.623 [main] INFO c.a.i.p.i.AssemblerImp - [logInfo,28] - Loaded jar:file:/D:/maven-res/com/atomikos/transactions/4.0.6/transactions-4.0.6.jar!/transactions-defaults.properties 10:33:18.631 [main] WARN c.a.i.p.i.AssemblerImp - [logWarning,24] - Thanks for using Atomikos! Evaluate http://www.atomikos.com/Main/ExtremeTransactions for advanced features and professional support or register at http://www.atomikos.com/Main/RegisterYourDownload to disable this message and receive FREE tips & advice Thanks for using Atomikos! Evaluate http://www.atomikos.com/Main/ExtremeTransactions for advanced features and professional support or register at http://www.atomikos.com/Main/RegisterYourDownload to disable this message and receive FREE tips & advice 10:33:18.642 [main] INFO c.a.i.p.i.AssemblerImp - [logInfo,28] - USING: com.atomikos.icatch.default_max_wait_time_on_shutdown = 9223372036854775807 10:33:18.643 [main] INFO c.a.i.p.i.AssemblerImp - [logInfo,28] - USING: com.atomikos.icatch.allow_subtransactions = true 10:33:18.643 [main] INFO c.a.i.p.i.AssemblerImp - [logInfo,28] - USING: com.atomikos.icatch.recovery_delay = 10000 10:33:18.644 [main] INFO c.a.i.p.i.AssemblerImp - [logInfo,28] - USING: com.atomikos.icatch.automatic_resource_registration = true 10:33:18.644 [main] INFO c.a.i.p.i.AssemblerImp - [logInfo,28] - USING: com.atomikos.icatch.oltp_max_retries = 5 10:33:18.645 [main] INFO c.a.i.p.i.AssemblerImp - [logInfo,28] - USING: com.atomikos.icatch.client_demarcation = false 10:33:18.646 [main] INFO c.a.i.p.i.AssemblerImp - [logInfo,28] - USING: com.atomikos.icatch.threaded_2pc = false 10:33:18.646 [main] INFO c.a.i.p.i.AssemblerImp - [logInfo,28] - USING: com.atomikos.icatch.serial_jta_transactions = true 10:33:18.647 [main] INFO c.a.i.p.i.AssemblerImp - [logInfo,28] - USING: com.atomikos.icatch.log_base_dir = D:\qz\yjs-202534-server\transaction-logs 10:33:18.647 [main] INFO c.a.i.p.i.AssemblerImp - [logInfo,28] - USING: com.atomikos.icatch.rmi_expor
03-08
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值