Linux版本与jdk版本不兼容

时间:2019-03-29 03:11:56

标签: java spring-boot

相同的代码,当我使用maven在Linux 6.0.10上打包代码时,最终的jar无法成功运行,但是我在Linux 8上运行了,效果很好。 jdk version is 1.8

异常如下:

  

org.springframework.beans.factory.BeanCreationException:错误   用名字创建bean   'org.springframework.context.event.internalEventListenerProcessor':   实例化bean失败;嵌套异常为   java.lang.IllegalStateException:在bean上没有指定bean类   定义在   org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1287)   〜[spring-beans-5.1.5.RELEASE.jar!/:5.1.5.RELEASE]在   org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1181)   〜[spring-beans-5.1.5.RELEASE.jar!/:5.1.5.RELEASE]在   org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555)   〜[spring-beans-5.1.5.RELEASE.jar!/:5.1.5.RELEASE]在   org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515)   〜[spring-beans-5.1.5.RELEASE.jar!/:5.1.5.RELEASE]在   org.springframework.beans.factory.support.AbstractBeanFactory.lambda $ doGetBean $ 0(AbstractBeanFactory.java:320)   〜[spring-beans-5.1.5.RELEASE.jar!/:5.1.5.RELEASE]在   org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)   〜[spring-beans-5.1.5.RELEASE.jar!/:5.1.5.RELEASE]在   org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)   〜[spring-beans-5.1.5.RELEASE.jar!/:5.1.5.RELEASE]在   org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:204)   〜[spring-beans-5.1.5.RELEASE.jar!/:5.1.5.RELEASE]在   org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:179)   〜[spring-context-5.1.5.RELEASE.jar!/:5.1.5.RELEASE]在   org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:705)   〜[spring-context-5.1.5.RELEASE.jar!/:5.1.5.RELEASE]在   org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:531)   〜[spring-context-5.1.5.RELEASE.jar!/:5.1.5.RELEASE]在   org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:142)   〜[spring-boot-2.1.3.RELEASE.jar!/:2.1.3.RELEASE]位于   org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775)   [spring-boot-2.1.3.RELEASE.jar!/:2.1.3.RELEASE]位于   org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)   [spring-boot-2.1.3.RELEASE.jar!/:2.1.3.RELEASE]位于   org.springframework.boot.SpringApplication.run(SpringApplication.java:316)   [spring-boot-2.1.3.RELEASE.jar!/:2.1.3.RELEASE]位于   org.springframework.boot.SpringApplication.run(SpringApplication.java:1260)   [spring-boot-2.1.3.RELEASE.jar!/:2.1.3.RELEASE]位于   org.springframework.boot.SpringApplication.run(SpringApplication.java:1248)   [spring-boot-2.1.3.RELEASE.jar!/:2.1.3.RELEASE]位于   cn.j.lithium.LithiumApplication.main(LithiumApplication.java:16)   在[classes!/:0.0.1-SNAPSHOT]   sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)   〜[na:1.8.0_131]在   sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)   〜[na:1.8.0_131]在   sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)   〜[na:1.8.0_131],位于java.lang.reflect.Method.invoke(Method.java:498)   〜[na:1.8.0_131]在   org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)   [lithium-0.0.1-test.jar:0.0.1-SNAPSHOT]在   org.springframework.boot.loader.Launcher.launch(Launcher.java:87)   [lithium-0.0.1-test.jar:0.0.1-SNAPSHOT]在   org.springframework.boot.loader.Launcher.launch(Launcher.java:50)   [lithium-0.0.1-test.jar:0.0.1-SNAPSHOT]在   org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51)   [lithium-0.0.1-test.jar:0.0.1-SNAPSHOT]原因:   java.lang.IllegalStateException:在bean上没有指定bean类   定义在   org.springframework.beans.factory.support.AbstractBeanDefinition.getBeanClass(AbstractBeanDefinition.java:407)   〜[spring-beans-5.1.5.RELEASE.jar!/:5.1.5.RELEASE]在   org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:68)   〜[spring-beans-5.1.5.RELEASE.jar!/:5.1.5.RELEASE

1 个答案:

答案 0 :(得分:1)

好的。真的很难理解您发布的stacktrace发生了什么(很可能您没有完整地发布它)-所以这是我的猜测:

Linux是(kernel),并且没有这样的版本,所以我认为您是指许多发行版,可能是Debian(Google在tf.contrib.cudnn_rnn.CudnnLSTM() : Tanh 上的第一个链接)。您可以在控制台中使用Linux 6.0.10进行检查。

Distrowatch websitecat /etc/*-release与它捆绑在一起的是OpenJDK 1.6-对于您使用的Spring版本来说,它太旧了。

如果不是Debian,请随意使用后者的网站来查找您的发行版。