gpt4 book ai didi

java - 未设置属性路径 - 在类路径中查找

转载 作者:行者123 更新时间:2023-12-02 00:38:54 24 4
gpt4 key购买 nike

无论出于何种原因,我的项目决定找不到我的 transaction.properties 文件。它位于:src/main/resource

但是它看起来在 target/classes/

该文件也驻留但抛出错误(见下文)

这些似乎都源于我无法访问的代码的整体初始化,这总是很有趣。

任何人都知道如何度过整个过程:

Using init file: /target/classes/transactions.properties
com.atomikos.icatch.SysException: Error in init: Error during checkpointing
at com.atomikos.icatch.imp.TransactionServiceImp.init(TransactionServiceImp.java:728)

编辑:

错误主要指向atomikos路径。老实说,我完全不知道幕后到底发生了什么。真是有点融化了这两个文件是相同的,因此使用哪个文件并不重要,但我可以查看第一个错误行引用。

 public synchronized void init ( Properties properties ) throws SysException
{
Stack errors = new Stack ();
this.properties_ = properties;

try {
recoverymanager_.init ();
} catch ( LogException le ) {
errors.push ( le );
throw new SysException ( "Error in init: " + le.getMessage (),
errors );
}
recoverCoordinators ();

//initialized is now set in recover()
//initialized_ = true;

shuttingDown_ = false;
control_ = new LogControlImp ( this );
// call recovery already, to make sure that the
// RMI participants can start inquiring and replay

recover ();
notifyListeners ( true, false );
}

完整错误打印输出:

    Using init file: /target/classes/transactions.properties
com.atomikos.icatch.SysException: Error in init: Error during checkpointing
at com.atomikos.icatch.imp.TransactionServiceImp.init(TransactionServiceImp.java:728)
at com.atomikos.icatch.imp.BaseTransactionManager.init(BaseTransactionManager.java:217)
at com.atomikos.icatch.standalone.StandAloneTransactionManager.init(StandAloneTransactionManager.java:104)
at com.atomikos.icatch.standalone.UserTransactionServiceImp.init(UserTransactionServiceImp.java:307)
at com.atomikos.icatch.config.UserTransactionServiceImp.init(UserTransactionServiceImp.java:413)
at com.atomikos.icatch.jta.UserTransactionManager.checkSetup(UserTransactionManager.java:90)
at com.atomikos.icatch.jta.UserTransactionManager.init(UserTransactionManager.java:140)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1544)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1485)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:93)
at com.citi.eq.mo.dcc.server.Main.main(Main.java:32)
Nested exception is:
com.atomikos.persistence.LogException: Error during checkpointing
at com.atomikos.persistence.imp.FileLogStream.writeCheckpoint(FileLogStream.java:229)
at com.atomikos.persistence.imp.StreamObjectLog.init(StreamObjectLog.java:185)
at com.atomikos.persistence.imp.StateRecoveryManagerImp.init(StateRecoveryManagerImp.java:71)
at com.atomikos.icatch.imp.TransactionServiceImp.init(TransactionServiceImp.java:725)
at com.atomikos.icatch.imp.BaseTransactionManager.init(BaseTransactionManager.java:217)
at com.atomikos.icatch.standalone.StandAloneTransactionManager.init(StandAloneTransactionManager.java:104)
at com.atomikos.icatch.standalone.UserTransactionServiceImp.init(UserTransactionServiceImp.java:307)
at com.atomikos.icatch.config.UserTransactionServiceImp.init(UserTransactionServiceImp.java:413)
at com.atomikos.icatch.jta.UserTransactionManager.checkSetup(UserTransactionManager.java:90)
at com.atomikos.icatch.jta.UserTransactionManager.init(UserTransactionManager.java:140)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1544)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1485)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:93)
at com.citi.eq.mo.dcc.server.Main.main(Main.java:32)
08/05/2011 14:55:59.998 [main] [] [INFO ] [o.s.b.f.s.DefaultListableBeanFactory] Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@164dbd5: defining beans [gfiPropertyConfigurerCommon,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalPersistenceAnnotationProcessor,ZtsListenerContainer,ztsMessageListener,dccMessageHandler,dccToRioPublisher,rioJmsTemplate,dccMessageTransformer,ztsFixtoRioTransformer,dateManager,ztsDropCopyConverterContextFactory,ZtsBlockListenerContainer,ztsblockdropCopyConverterContextFactory,ZasListenerContainer,zasMessageListener,zastoRIOMessageTransformer,zasDropCopyConverterContextFactory,ztsToDccJndiTemplate,ztsQcf,ztsBlockToDccJndiTemplate,ztsBlockQcf,zasToDccJndiTemplate,zasQcf,rioJndiTemplate,rioTcf,rioDestinationResolver,URO.ZTSTRADES.1_Producer,mbeanServer,jmxExporter,rules-execution-server-engine,rio-object,trade-validator-context,trade-validator,validation-rules-helper,javaxTransactionManager,javaxUserTransaction,springPlatformTransactionManager,org.springframework.aop.config.internalAutoProxyCreator,org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0,org.springframework.transaction.interceptor.TransactionInterceptor#0,org.springframework.transaction.config.internalTransactionAdvisor,org.springframework.scheduling.annotation.internalAsyncAnnotationProcessor,org.springframework.scheduling.annotation.internalScheduledAnnotationProcessor]; root of factory hierarchy
08/05/2011 14:56:00.013 [main] [] [INFO ] [o.s.jmx.export.MBeanExporter] Unregistering JMX-exposed beans on shutdown
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'javaxTransactionManager' defined in class path resource [eq-mo-dcc-server-context.xml]: Invocation of init method failed; nested exception is com.atomikos.icatch.SysException: Error in init(): Error in init: Error during checkpointing
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:93)
at com.citi.eq.mo.dcc.server.Main.main(Main.java:32)
Caused by: com.atomikos.icatch.SysException: Error in init(): Error in init: Error during checkpointing
at com.atomikos.icatch.standalone.UserTransactionServiceImp.init(UserTransactionServiceImp.java:374)
at com.atomikos.icatch.config.UserTransactionServiceImp.init(UserTransactionServiceImp.java:413)
at com.atomikos.icatch.jta.UserTransactionManager.checkSetup(UserTransactionManager.java:90)
at com.atomikos.icatch.jta.UserTransactionManager.init(UserTransactionManager.java:140)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1544)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1485)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417)
... 12 more
Caused by: com.atomikos.icatch.SysException: Error in init: Error during checkpointing
at com.atomikos.icatch.imp.TransactionServiceImp.init(TransactionServiceImp.java:728)
at com.atomikos.icatch.imp.BaseTransactionManager.init(BaseTransactionManager.java:217)
at com.atomikos.icatch.standalone.StandAloneTransactionManager.init(StandAloneTransactionManager.java:104)
at com.atomikos.icatch.standalone.UserTransactionServiceImp.init(UserTransactionServiceImp.java:307)
... 22 more

最佳答案

你正在使用 Maven,对吧?当 Maven 打包项目时,它会将 src/main/resource 中的文件复制到 target/classes。这样资源就可以在类路径上使用。事实上,您的 transaction.properties 不存在表明您在构建或运行应用程序时遇到问题。

这是一个什么样的项目,一个网络应用程序?你是如何构建它的?

如果它是一个 Web 应用程序,您是通过 eclipse 运行它时遇到问题,还是在将 .war 部署到服务器后遇到问题?

关于java - 未设置属性路径 - 在类路径中查找,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6958184/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com