我有一个 spring boot 2 应用程序,它在 IDE (IntelliJ) 中运行时按预期启动并运行。但是,当我通过命令行 (java -jar app.jar) 运行应用程序时,出现 StackOverFlowError 异常。
Caused by: java.lang.reflect.InvocationTargetException
... 1024 more
Caused by: java.lang.reflect.InvocationTargetException
... 1024 more
Caused by: java.lang.reflect.InvocationTargetException
... 1024 more
Caused by: java.lang.StackOverflowError
at java.util.concurrent.ConcurrentHashMap.putVal(ConcurrentHashMap.java:1012)
at java.util.concurrent.ConcurrentHashMap.putIfAbsent(ConcurrentHashMap.java:1535)
at java.lang.ClassLoader.getClassLoadingLock(ClassLoader.java:463)
at java.lang.ClassLoader.loadClass(ClassLoader.java:404)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
Run Code Online (Sandbox Code Playgroud)
主要类如下
@SpringBootApplication
@Configuration
@EnableAutoConfiguration
@EntityScan(basePackages="x.y.z")
@EnableJpaRepositories
@EnableTransactionManagement
@EnableAspectJAutoProxy
@EnableScheduling
@EnableAsync
@EnableRetry
@Slf4j
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
Run Code Online (Sandbox Code Playgroud)