【教程】解决升级weblogic 12.2.1.3报错ClassNotFoundException: org.springframework.aop.framework.AopConfigException
最近web项目的weblogic要从12.1.2升级到12.2.1.3,需要重新建域和服务,按照步骤一步一步操作,结果在启动项目的时候报错:
<2019-9-18 下午02时06分52秒 CST> <Error> <Deployer> <BEA-149231> Unable to set the activation state to true for the application "*XXX". weblogic.application.ModuleException: java.lang.RuntimeException: java.lang.ClassNotFoundExceptions: org.springframework.aop.framework.AopConfigException at weblogic.application.internal.ExtensibleModuleWrapper.start(ExtensibleModuleWrapper.java:140) at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:124) at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:233) at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:228) at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:45) Truncated. see log file for complete stacktrace Caused By: java.lang.RuntimeException: java.lang.ClassNotFoundExceptions: org.springframework.aop.framework.AopConfigException at net.sf.cglib.asm.$ClassWriter.getCommonSuperClass(Unknown Source) at net.sf.cglib.asm.$ClassWriter.a<init>(Unknown Source) at net.sf.cglib.asm.$Frame.a<init>(Unknown Source) at net.sf.cglib.asm.$Frame.a<init>(Unknown Source) at net.sf.cglib.asm.$MethodWriter.visitMaxs<init>(Unknown Source) Truncated. see log file for complete stacktrace
可是项目之前在12.1.2运行得好好的,一顿查询后,找到了解决方法:
在项目的weblogic.xml里增加如下配置:
<wls:container-descriptor> <prefer-web-inf-classes>false</prefer-web-inf-classes> <prefer-application-packages> <package-name>net.sf.cglib.*</package-name> </prefer-application-packages> </wls:container-descriptor>
上面的配置表示对net.sf.cglig.*包优先加载项目中的包。
有类似的冲突可以参考修改配置。
最近科学地上网受限,具体更详细的解释待我能够科学地上网之后再补充。