问题遇到的现象和发生背景
区块链的项目运行在linux上,spring-core的jar版本低了,需要替换到更高版本,然后把5.2版本的jar下载下来放到区块链项目下的lib里面,低版本删除后启动不成功。
以下是错误信息:
java.lang.NoClassDefFoundError: org/springframework/core/ErrorCoded
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:1017)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:174)
at jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:800)
at jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:698)
at jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:621)
at jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:579)
at jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.lang.ClassLoader.loadClass(ClassLoader.java:522)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:1017)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:174)
at jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:800)
at jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:698)
at jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:621)
at jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:579)
at jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.lang.ClassLoader.loadClass(ClassLoader.java:522)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:1017)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:174)
at jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:800)
at jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:698)
at jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:621)
at jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:579)
at jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.lang.ClassLoader.loadClass(ClassLoader.java:522)
at org.springframework.boot.bind.RelaxedDataBinder.modifyProperties(RelaxedDataBinder.java:154) ~[spring-boot-1.5.22.RELEASE.jar:1.5.22.RELEASE]
at org.springframework.boot.bind.RelaxedDataBinder.doBind(RelaxedDataBinder.java:137) ~[spring-boot-1.5.22.RELEASE.jar:1.5.22.RELEASE]
at org.springframework.validation.DataBinder.bind(DataBinder.java:741) ~[spring-context-4.3.30.RELEASE.jar:4.3.30.RELEASE]
at org.springframework.boot.yaml.SpringProfileDocumentMatcher.extractSpringProfiles(SpringProfileDocumentMatcher.java:91) ~[spring-boot-1.5.22.RELEASE.jar:1.5.22.RELEASE]
at org.springframework.boot.yaml.SpringProfileDocumentMatcher.matches(SpringProfileDocumentMatcher.java:71) ~[spring-boot-1.5.22.RELEASE.jar:1.5.22.RELEASE]
at org.springframework.beans.factory.config.YamlProcessor.process(YamlProcessor.java:232) ~[spring-beans-4.3.30.RELEASE.jar:4.3.30.RELEASE]
at org.springframework.beans.factory.config.YamlProcessor.process(YamlProcessor.java:158) ~[spring-beans-4.3.30.RELEASE.jar:4.3.30.RELEASE]
at org.springframework.beans.factory.config.YamlProcessor.process(YamlProcessor.java:135) ~[spring-beans-4.3.30.RELEASE.jar:4.3.30.RELEASE]
at org.springframework.boot.env.YamlPropertySourceLoader$Processor.process(YamlPropertySourceLoader.java:99) ~[spring-boot-1.5.22.RELEASE.jar:1.5.22.RELEASE]
at org.springframework.boot.env.YamlPropertySourceLoader.load(YamlPropertySourceLoader.java:58) ~[spring-boot-1.5.22.RELEASE.jar:1.5.22.RELEASE]
at org.springframework.boot.env.PropertySourcesLoader.load(PropertySourcesLoader.java:126) ~[spring-boot-1.5.22.RELEASE.jar:1.5.22.RELEASE]
at org.springframework.boot.context.config.ConfigFileApplicationListener$Loader.doLoadIntoGroup(ConfigFileApplicationListener.java:465) ~[spring-boot-1.5.22.RELEASE.jar:1.5.22.RELEASE]
at org.springframework.boot.context.config.ConfigFileApplicationListener$Loader.loadIntoGroup(ConfigFileApplicationListener.java:450) ~[spring-boot-1.5.22.RELEASE.jar:1.5.22.RELEASE]
at org.springframework.boot.context.config.ConfigFileApplicationListener$Loader.load(ConfigFileApplicationListener.java:443) ~[spring-boot-1.5.22.RELEASE.jar:1.5.22.RELEASE]
at org.springframework.boot.context.config.ConfigFileApplicationListener$Loader.load(ConfigFileApplicationListener.java:370) ~[spring-boot-1.5.22.RELEASE.jar:1.5.22.RELEASE]
at org.springframework.boot.context.config.ConfigFileApplicationListener.addPropertySources(ConfigFileApplicationListener.java:216) ~[spring-boot-1.5.22.RELEASE.jar:1.5.22.RELEASE]
at org.springframework.boot.context.config.ConfigFileApplicationListener.postProcessEnvironment(ConfigFileApplicationListener.java:190) ~[spring-boot-1.5.22.RELEASE.jar:1.5.22.RELEASE]
at org.springframework.boot.context.config.ConfigFileApplicationListener.onApplicationEnvironmentPreparedEvent(ConfigFileApplicationListener.java:180) ~[spring-boot-1.5.22.RELEASE.jar:1.5.22.RELEASE]
at org.springframework.boot.context.config.ConfigFileApplicationListener.onApplicationEvent(ConfigFileApplicationListener.java:168) ~[spring-boot-1.5.22.RELEASE.jar:1.5.22.RELEASE]
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172) ~[spring-context-4.3.30.RELEASE.jar:4.3.30.RELEASE]
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165) ~[spring-context-4.3.30.RELEASE.jar:4.3.30.RELEASE]
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139) ~[spring-context-4.3.30.RELEASE.jar:4.3.30.RELEASE]
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:122) ~[spring-context-4.3.30.RELEASE.jar:4.3.30.RELEASE]
at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:75) ~[spring-boot-1.5.22.RELEASE.jar:1.5.22.RELEASE]
at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:53) ~[spring-boot-1.5.22.RELEASE.jar:1.5.22.RELEASE]
at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:320) ~[spring-boot-1.5.22.RELEASE.jar:1.5.22.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:295) ~[spring-boot-1.5.22.RELEASE.jar:1.5.22.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1082) ~[spring-boot-1.5.22.RELEASE.jar:1.5.22.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1071) ~[spring-boot-1.5.22.RELEASE.jar:1.5.22.RELEASE]
at org.bcos.browser.Application.main(Application.java:35) [fisco-bcos-browser.jar]
Caused by: java.lang.ClassNotFoundException: org.springframework.core.ErrorCoded
at jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
at jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.lang.ClassLoader.loadClass(ClassLoader.java:522)
... 57 more
操作环境、软件版本等信息
linux
尝试过的解决方法
1.linux上全文件搜索spring-core字符(find . -name '*' | xargs grep -ri "spring-core"),以期找到对应的配置文件,结果都不是要找的配置文件。(可能以别的形式储存)
2.flsco bcos官方文档搜索相关,没有找到此内容(可能我理解不够)
3.百度搜索,同flsco bcos官方文档
我想要达到的结果
linux环境下区块链项目替换(升级)jar的流程。