猿问

java.lang.NoClassDefFoundError:

WLS 12.2.1.3 上出现错误:


Caused by: java.lang.NoClassDefFoundError: org/springframework/beans/factory/DisposableBean

at java.lang.ClassLoader.defineClass1(Native Method)

at java.lang.ClassLoader.defineClass(ClassLoader.java:763)

at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)

at weblogic.utils.classloaders.GenericClassLoader.defineClassInternal(GenericClassLoader.java:1113)

...

Caused by: java.lang.ClassNotFoundException: org.springframework.beans.factory.DisposableBean

at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:1029)

org.springframework.* 存在于 weblogic.xml 和 weblogic-application.xml 中的 preferred-application-packages 块中。


pom.xml 中的依赖层次结构没问题

spring libs 在战争中也可以。

http://img2.mukewang.com/610a51620001b8b102240192.jpg

知道我可以额外检查什么吗?


当年话下
浏览 250回答 2
2回答

繁星点点滴滴

依赖管理被添加到战争 pom.xml<dependencyManagement>&nbsp; &nbsp; <dependencies>&nbsp; &nbsp; &nbsp; &nbsp; <dependency>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <groupId>org.springframework</groupId>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <artifactId>spring-core</artifactId>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <version>${spring.version}</version>&nbsp; &nbsp; &nbsp; &nbsp; </dependency>&nbsp; &nbsp; &nbsp; &nbsp; <dependency>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <groupId>org.springframework</groupId>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <artifactId>spring-beans</artifactId>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <version>${spring.version}</version>&nbsp; &nbsp; &nbsp; &nbsp; </dependency>&nbsp; &nbsp; &nbsp; &nbsp; <dependency>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <groupId>org.springframework</groupId>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <artifactId>spring-context</artifactId>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <version>${spring.version}</version>&nbsp; &nbsp; &nbsp; &nbsp; </dependency>&nbsp; &nbsp; </dependencies></dependencyManagement>

汪汪一只猫

这是因为 jar 冲突。可能在战争之外设置了类路径,您可以从 weblogic 启动命令类路径变量中看到,并确保类路径中不包含其他版本的 spring请运行mvn dependency:tree并确保您没有引入任何其他版本的 spring 依赖项(我认为您这样做了)
随时随地看视频慕课网APP

相关分类

Java
我要回答