Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/356.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 更改BTM tlog文件位置_Java_Jta_Bitronix - Fatal编程技术网

Java 更改BTM tlog文件位置

Java 更改BTM tlog文件位置,java,jta,bitronix,Java,Jta,Bitronix,我们正在使用org.codehaus.btm:btm:2.1.4进行测试,我们看到这些文件出现在我们的maven模块目录(即工作目录)中: btm1.tlog btm2.tlog 我希望在另一个目录中创建它们,例如在target/btmlogs/中。如何配置BTM来实现此目的?您必须配置TransactionManager 在名为src/main/resources/bitronix default config.properties的文件中执行此操作。大概是这样的: # Avoid war

我们正在使用
org.codehaus.btm:btm:2.1.4
进行测试,我们看到这些文件出现在我们的maven模块目录(即工作目录)中:

  • btm1.tlog
  • btm2.tlog

我希望在另一个目录中创建它们,例如在
target/btmlogs/
中。如何配置BTM来实现此目的?

您必须配置TransactionManager

在名为
src/main/resources/bitronix default config.properties的文件中执行此操作。大概是这样的:

# Avoid warnings in test log
bitronix.tm.serverId=foo-bar
# Disable tlog files
bitronix.tm.journal=null
# In case the journal is enabled locally, avoid that the btm1.tlog and btm2.tlog files are created in the module's directory
# causing gitignore, mvn clean and IDE indexing issues
bitronix.tm.journal.disk.logPart1Filename=target/btm/btm1.tlog
bitronix.tm.journal.disk.logPart2Filename=target/btm/btm2.tlog

您必须配置TransactionManager

在名为
src/main/resources/bitronix default config.properties的文件中执行此操作。大概是这样的:

# Avoid warnings in test log
bitronix.tm.serverId=foo-bar
# Disable tlog files
bitronix.tm.journal=null
# In case the journal is enabled locally, avoid that the btm1.tlog and btm2.tlog files are created in the module's directory
# causing gitignore, mvn clean and IDE indexing issues
bitronix.tm.journal.disk.logPart1Filename=target/btm/btm1.tlog
bitronix.tm.journal.disk.logPart2Filename=target/btm/btm2.tlog

poolgDataSource.getDriverProperties().setProperty(“bitronix.tm.journal.disk.logPart1Filename”,“target/btm/my-btm1.tlog”)导致一个
bitronix.tm.utils.PropertyException:类'bitronix.tm.resource.jdbc.lrc.LrcXADataSource'中没有可读属性'bitronix'
使用
TransactionManagerServices.getConfiguration()
而导致
非法状态异常:无法在事务管理器运行时更改配置。在静态构造函数中而不是在每个JUnit测试开始时执行这些操作会导致除第一个测试之外的所有测试都写入错误的目录(因此忽略属性)。已修复。我已经在答案中添加了添加这些道具的文件:bitronix default config.properties.
poolgdatasource.getDriverProperties().setProperty(“bitronix.tm.journal.disk.logPart1Filename”,“target/btm/my-btm1.tlog”)导致一个
bitronix.tm.utils.PropertyException:类'bitronix.tm.resource.jdbc.lrc.LrcXADataSource'中没有可读属性'bitronix'
使用
TransactionManagerServices.getConfiguration()
而导致
非法状态异常:无法在事务管理器运行时更改配置。在静态构造函数中而不是在每个JUnit测试开始时执行这些操作会导致除第一个测试之外的所有测试都写入错误的目录(因此忽略属性)。已修复。我已经在答案中添加了一个文件来添加这些道具:bitronix-default-config.properties。