В настоящее время я столкнулся с проблемой в проекте Spring 1.4.2.
Когда я запускаю свой проект в IntelliJ, все работает нормально (с использованием java --classpath com.my.project .Launcher).
Однако, когда я создаю jar-файл и запускаю его вручную, я получаю следующую трассировку стека.
2024-10-02 16:50:24 [background-preinit] INFO [org.hibernate.validator.internal.util.Version] Version.:30 - HV000001: Hibernate Validator 5.2.4.Final
2024-10-02 16:50:24 [main] INFO [com.my.project.Launcher] StartupInfoLogger.logStarting:48 - Starting Launcher v3.1-SNAPSHOT on localhost.localdomain with PID 12995 (/home/user/workspace/my.project/target/my.project.jar started by user in /home/user/workspace/my.project)
2024-10-02 16:50:24 [main] INFO [com.my.project.batch.my.project.Launcher] SpringApplication.logStartupProfileInfo:661 - No active profile set, falling back to default profiles: default
2024-10-02 16:50:24 [main] INFO [org.springframework.context.annotation.AnnotationConfigApplicationContext] AbstractApplicationContext.prepareRefresh:582 - Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@244038d0: startup date [Wed Oct 02 16:50:24 CEST 2024]; root of context hierarchy
2024-10-02 16:50:25 [main] INFO [org.springframework.beans.factory.support.DefaultListableBeanFactory] DefaultListableBeanFactory.registerBeanDefinition:821 - Overriding bean definition for bean 'transactionManager' with a different definition: replacing [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=myprojectTransactionManagerConfiguration; factoryMethodName=transactionManager; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [com/my/project/batch/my.project/configuration/MyProjectTransactionManagerConfiguration.class]] with [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.batch.core.configuration.annotation.SimpleBatchConfiguration; factoryMethodName=transactionManager; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/batch/core/configuration/annotation/SimpleBatchConfiguration.class]]
2024-10-02 16:50:25 [main] WARN [org.springframework.context.annotation.ConfigurationClassEnhancer] ConfigurationClassEnhancer$BeanMethodInterceptor.intercept:348 - @Bean method ScopeConfiguration.stepScope is non-static and returns an object assignable to Spring's BeanFactoryPostProcessor interface. This will result in a failure to process annotations such as @Autowired, @Resource and @PostConstruct within the method's declaring @Configuration class. Add the 'static' modifier to this method to avoid these container lifecycle issues; see @Bean javadoc for complete details.
2024-10-02 16:50:25 [main] WARN [org.springframework.context.annotation.ConfigurationClassEnhancer] ConfigurationClassEnhancer$BeanMethodInterceptor.intercept:348 - @Bean method ScopeConfiguration.jobScope is non-static and returns an object assignable to Spring's BeanFactoryPostProcessor interface. This will result in a failure to process annotations such as @Autowired, @Resource and @PostConstruct within the method's declaring @Configuration class. Add the 'static' modifier to this method to avoid these container lifecycle issues; see @Bean javadoc for complete details.
2024-10-02 16:50:25 [main] WARN [com.atomikos.jdbc.AbstractDataSourceBean] Slf4jLogger.logWarning:12 - AtomikosDataSoureBean 'data1Ds': poolSize equals default - this may cause performance problems!
2024-10-02 16:50:26 [main] WARN [com.atomikos.jdbc.AbstractDataSourceBean] Slf4jLogger.logWarning:12 - AtomikosDataSoureBean 'data2Ds': poolSize equals default - this may cause performance problems!
2024-10-02 16:50:26 [main] WARN [com.atomikos.icatch.config.UserTransactionServiceImp] Slf4jLogger.logWarning:12 - No properties path set - looking for transactions.properties in classpath...
2024-10-02 16:50:26 [main] WARN [com.atomikos.icatch.config.UserTransactionServiceImp] Slf4jLogger.logWarning:12 - transactions.properties not found - looking for jta.properties in classpath...
2024-10-02 16:50:26 [main] WARN [com.atomikos.icatch.config.UserTransactionServiceImp] Slf4jLogger.logWarning:12 - Failed to open transactions properties file - using default values
2024-10-02 16:50:26 [main] WARN [com.atomikos.icatch.config.imp.AbstractUserTransactionService] Slf4jLogger.logWarning:12 - /logqm0/myproject could not be created - using default
2024-10-02 16:50:26 [main] WARN [com.atomikos.persistence.Utils] Slf4jLogger.logWarning:12 - /logqm0/myproject could not be created - using default
2024-10-02 16:50:27 [main] INFO [org.springframework.batch.core.repository.support.JobRepositoryFactoryBean] JobRepositoryFactoryBean.afterPropertiesSet:183 - No database type set, using meta data indicating: ORACLE
2024-10-02 16:50:27 [main] INFO [org.springframework.batch.core.launch.support.SimpleJobLauncher] SimpleJobLauncher.afterPropertiesSet:195 - No TaskExecutor has been set, defaulting to synchronous executor.
2024-10-02 16:50:27 [main] INFO [org.apache.commons.vfs2.impl.StandardFileSystemManager] VfsLog.info:136 - Using "/tmp/vfs_cache" as temporary files store.
2024-10-02 16:50:27 [main] INFO [org.springframework.jmx.export.annotation.AnnotationMBeanExporter] MBeanExporter.afterSingletonsInstantiated:431 - Registering beans for JMX exposure on startup
2024-10-02 16:50:27 [main] INFO [org.springframework.boot.autoconfigure.batch.JobLauncherCommandLineRunner] JobLauncherCommandLineRunner.run:118 - Running default command line with: [--logging.level.root=TRACE]
2024-10-02 16:50:27 [main] ERROR [org.springframework.boot.SpringApplication] SpringApplication.reportFailure:839 - Application startup failed
java.lang.StackOverflowError: null
at java.lang.reflect.InvocationTargetException.(InvocationTargetException.java:72)
at sun.reflect.GeneratedMethodAccessor25.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at org.springframework.batch.core.configuration.annotation.SimpleBatchConfiguration$PassthruAdvice.invoke(SimpleBatchConfiguration.java:127)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)
at com.sun.proxy.$Proxy60.getTransaction(Unknown Source)
at sun.reflect.GeneratedMethodAccessor25.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at org.springframework.batch.core.configuration.annotation.SimpleBatchConfiguration$PassthruAdvice.invoke(SimpleBatchConfiguration.java:127)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)
at com.sun.proxy.$Proxy60.getTransaction(Unknown Source)
at sun.reflect.GeneratedMethodAccessor25.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at org.springframework.batch.core.configuration.annotation.SimpleBatchConfiguration$PassthruAdvice.invoke(SimpleBatchConfiguration.java:127)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)
at com.sun.proxy.$Proxy60.getTransaction(Unknown Source)
В настоящее время я столкнулся с проблемой в проекте Spring 1.4.2. Когда я запускаю свой проект в IntelliJ, все работает нормально (с использованием java --classpath com.my.project .Launcher). Однако, когда я создаю jar-файл и запускаю его вручную, я получаю следующую трассировку стека. [code]2024-10-02 16:50:24 [background-preinit] INFO [org.hibernate.validator.internal.util.Version] Version.:30 - HV000001: Hibernate Validator 5.2.4.Final 2024-10-02 16:50:24 [main] INFO [com.my.project.Launcher] StartupInfoLogger.logStarting:48 - Starting Launcher v3.1-SNAPSHOT on localhost.localdomain with PID 12995 (/home/user/workspace/my.project/target/my.project.jar started by user in /home/user/workspace/my.project) 2024-10-02 16:50:24 [main] INFO [com.my.project.batch.my.project.Launcher] SpringApplication.logStartupProfileInfo:661 - No active profile set, falling back to default profiles: default 2024-10-02 16:50:24 [main] INFO [org.springframework.context.annotation.AnnotationConfigApplicationContext] AbstractApplicationContext.prepareRefresh:582 - Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@244038d0: startup date [Wed Oct 02 16:50:24 CEST 2024]; root of context hierarchy 2024-10-02 16:50:25 [main] INFO [org.springframework.beans.factory.support.DefaultListableBeanFactory] DefaultListableBeanFactory.registerBeanDefinition:821 - Overriding bean definition for bean 'transactionManager' with a different definition: replacing [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=myprojectTransactionManagerConfiguration; factoryMethodName=transactionManager; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [com/my/project/batch/my.project/configuration/MyProjectTransactionManagerConfiguration.class]] with [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.batch.core.configuration.annotation.SimpleBatchConfiguration; factoryMethodName=transactionManager; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/batch/core/configuration/annotation/SimpleBatchConfiguration.class]] 2024-10-02 16:50:25 [main] WARN [org.springframework.context.annotation.ConfigurationClassEnhancer] ConfigurationClassEnhancer$BeanMethodInterceptor.intercept:348 - @Bean method ScopeConfiguration.stepScope is non-static and returns an object assignable to Spring's BeanFactoryPostProcessor interface. This will result in a failure to process annotations such as @Autowired, @Resource and @PostConstruct within the method's declaring @Configuration class. Add the 'static' modifier to this method to avoid these container lifecycle issues; see @Bean javadoc for complete details. 2024-10-02 16:50:25 [main] WARN [org.springframework.context.annotation.ConfigurationClassEnhancer] ConfigurationClassEnhancer$BeanMethodInterceptor.intercept:348 - @Bean method ScopeConfiguration.jobScope is non-static and returns an object assignable to Spring's BeanFactoryPostProcessor interface. This will result in a failure to process annotations such as @Autowired, @Resource and @PostConstruct within the method's declaring @Configuration class. Add the 'static' modifier to this method to avoid these container lifecycle issues; see @Bean javadoc for complete details. 2024-10-02 16:50:25 [main] WARN [com.atomikos.jdbc.AbstractDataSourceBean] Slf4jLogger.logWarning:12 - AtomikosDataSoureBean 'data1Ds': poolSize equals default - this may cause performance problems! 2024-10-02 16:50:26 [main] WARN [com.atomikos.jdbc.AbstractDataSourceBean] Slf4jLogger.logWarning:12 - AtomikosDataSoureBean 'data2Ds': poolSize equals default - this may cause performance problems! 2024-10-02 16:50:26 [main] WARN [com.atomikos.icatch.config.UserTransactionServiceImp] Slf4jLogger.logWarning:12 - No properties path set - looking for transactions.properties in classpath... 2024-10-02 16:50:26 [main] WARN [com.atomikos.icatch.config.UserTransactionServiceImp] Slf4jLogger.logWarning:12 - transactions.properties not found - looking for jta.properties in classpath... 2024-10-02 16:50:26 [main] WARN [com.atomikos.icatch.config.UserTransactionServiceImp] Slf4jLogger.logWarning:12 - Failed to open transactions properties file - using default values 2024-10-02 16:50:26 [main] WARN [com.atomikos.icatch.config.imp.AbstractUserTransactionService] Slf4jLogger.logWarning:12 - /logqm0/myproject could not be created - using default 2024-10-02 16:50:26 [main] WARN [com.atomikos.persistence.Utils] Slf4jLogger.logWarning:12 - /logqm0/myproject could not be created - using default 2024-10-02 16:50:27 [main] INFO [org.springframework.batch.core.repository.support.JobRepositoryFactoryBean] JobRepositoryFactoryBean.afterPropertiesSet:183 - No database type set, using meta data indicating: ORACLE 2024-10-02 16:50:27 [main] INFO [org.springframework.batch.core.launch.support.SimpleJobLauncher] SimpleJobLauncher.afterPropertiesSet:195 - No TaskExecutor has been set, defaulting to synchronous executor. 2024-10-02 16:50:27 [main] INFO [org.apache.commons.vfs2.impl.StandardFileSystemManager] VfsLog.info:136 - Using "/tmp/vfs_cache" as temporary files store. 2024-10-02 16:50:27 [main] INFO [org.springframework.jmx.export.annotation.AnnotationMBeanExporter] MBeanExporter.afterSingletonsInstantiated:431 - Registering beans for JMX exposure on startup 2024-10-02 16:50:27 [main] INFO [org.springframework.boot.autoconfigure.batch.JobLauncherCommandLineRunner] JobLauncherCommandLineRunner.run:118 - Running default command line with: [--logging.level.root=TRACE] 2024-10-02 16:50:27 [main] ERROR [org.springframework.boot.SpringApplication] SpringApplication.reportFailure:839 - Application startup failed java.lang.StackOverflowError: null at java.lang.reflect.InvocationTargetException.(InvocationTargetException.java:72) at sun.reflect.GeneratedMethodAccessor25.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) at org.springframework.batch.core.configuration.annotation.SimpleBatchConfiguration$PassthruAdvice.invoke(SimpleBatchConfiguration.java:127) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213) at com.sun.proxy.$Proxy60.getTransaction(Unknown Source) at sun.reflect.GeneratedMethodAccessor25.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) at org.springframework.batch.core.configuration.annotation.SimpleBatchConfiguration$PassthruAdvice.invoke(SimpleBatchConfiguration.java:127) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213) at com.sun.proxy.$Proxy60.getTransaction(Unknown Source) at sun.reflect.GeneratedMethodAccessor25.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) at org.springframework.batch.core.configuration.annotation.SimpleBatchConfiguration$PassthruAdvice.invoke(SimpleBatchConfiguration.java:127) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213) at com.sun.proxy.$Proxy60.getTransaction(Unknown Source) [/code] А вот мой pom.xml [code] 4.0.0