问题描述:
新项目重构,从来没打过包部署过,然后打包之后部署出错,一查看错误是很常见的ClassNotFoundException,第一反应是打包错了,出现了class文件丢失,然后打开打包之后的jar包,发现确实没有对应的错误的文件,然后回本地项目查看,发现本地并没有应用到这个类,以为是其他的我们自己打的jar用到了,想着先要解决问题,就在pom文件中加上了这个包的依赖,然后重新打包,发现还是不行,同样的错误,这会儿就迷惑了,不太明白这个东西是啥,也没地方应用,咋会出现这个包的错误呢,按照程序员的逻辑来说是不可能的啊。
2020-11-27 17:08:59.309 ERROR 37552 --- [ main] o.s.boot.SpringApplica
tion : Application run failed
java.lang.NoClassDefFoundError: org/eclipse/jetty/server/RequestLog$Writer
at java.lang.Class.getDeclaredConstructors0(Native Method) ~[na:1.8.0_20
1]
at java.lang.Class.privateGetDeclaredConstructors(Unknown Source) ~[na:1
.8.0_201]
at java.lang.Class.getDeclaredConstructors(Unknown Source) ~[na:1.8.0_20
1]
at org.springframework.boot.context.properties.ConfigurationPropertiesBi
ndConstructorProvider.findConstructorBindingAnnotatedConstructor(ConfigurationPr
opertiesBindConstructorProvider.java:62) ~[spring-boot-2.2.8.RELEASE.jar!/:2.2.8
.RELEASE]
at org.springframework.boot.context.properties.ConfigurationPropertiesBi
ndConstructorProvider.getBindConstructor(ConfigurationPropertiesBindConstructorP
rovider.java:48) ~[spring-boot-2.2.8.RELEASE.jar!/:2.2.8.RELEASE]
at org.springframework.boot.context.properties.ConfigurationPropertiesBe
an$BindMethod.forType(ConfigurationPropertiesBean.java:311