gpt4 book ai didi

java - 在 Websphere 8.5 上升级到 Spring 3.2 错误 : Resource annotations on DispatcherServlet will be ignored

转载 作者:行者123 更新时间:2023-11-29 08:49:20 26 4
gpt4 key购买 nike

我尝试在 WebSphere 8.5 上将 Spring 版本从 3.1.2 升级到 3.2.8>,但我遇到了错误:

CWNEN0047W: Resource annotations on the fields of the org.springframework.web.servlet.DispatcherServlet class will be ignored. The annotations could not be obtained because of the exception : java.lang.NoClassDefFoundError: org.springframework.web.context.WebApplicationContext

jar spring-web-3.2.8.RELEASE.jar 存在于 WAR/WEB-INF/lib 目录中。存档没有损坏,WebApplicationContext 类在那里。一切看起来都和以前一样,只是 spring 版本更高。

一切都与 Spring 3.1.2 一起工作,具有相同的 Maven 构建配置和 EAR 描述符!但是在更改 Spring 版本后(仅此而已),就会出现上述错误。

在Websphere 上升级Spring 版本时,有什么必须做的特别的事情吗?还是只是一种不相容?

该调用来自 JmxMBeanServer 的某处。当从 IBM RAD 部署/更新 EAR 时,它出现在 Web 应用程序初始化阶段。包括完整的堆栈跟踪:

[5/8/14 10:12:42:866 CEST] 0000004b InjectionProc W CWNEN0047W: Resource annotations on the fields of the org.springframework.web.servlet.DispatcherServlet class will be ignored. The annotations could not be obtained because of the exception : java.lang.NoClassDefFoundError: org.springframework.web.context.WebApplicationContext at java.lang.J9VMInternals.verifyImpl(Native Method) at java.lang.J9VMInternals.verify(J9VMInternals.java:93) at java.lang.J9VMInternals.verify(J9VMInternals.java:91) at java.lang.J9VMInternals.prepare(J9VMInternals.java:490) at java.lang.Class.getDeclaredFields(Class.java:605) at com.ibm.wsspi.injectionengine.InjectionProcessor.getAllDeclaredFields(InjectionProcessor.java:554) at com.ibm.wsspi.injectionengine.InjectionProcessor.processAllAnnotations(InjectionProcessor.java:722) at com.ibm.wsspi.injectionengine.InjectionProcessorContextImpl.processAllAnnotations(InjectionProcessorContextImpl.java:50) at com.ibm.ws.injectionengine.AbstractInjectionEngine.processAnnotations(AbstractInjectionEngine.java:750) at com.ibm.ws.injectionengine.AbstractInjectionEngine.processInjectionMetaData(AbstractInjectionEngine.java:559) at com.ibm.ws.injectionengine.SharedInjectionEngineImpl.processInjectionMetaData(SharedInjectionEngineImpl.java:208) at com.ibm.ws.injectionengine.ReferenceContextImpl.process(ReferenceContextImpl.java:838) at com.ibm.ws.webcontainer.webapp.WebAppImpl.populateJavaNameSpace(WebAppImpl.java:1112) at com.ibm.ws.webcontainer.webapp.WebAppImpl.initialize(WebAppImpl.java:328) at com.ibm.ws.webcontainer.webapp.WebGroupImpl.addWebApplication(WebGroupImpl.java:88) at com.ibm.ws.webcontainer.VirtualHostImpl.addWebApplication(VirtualHostImpl.java:169) at com.ibm.ws.webcontainer.WSWebContainer.addWebApp(WSWebContainer.java:749) at com.ibm.ws.webcontainer.WSWebContainer.addWebApplication(WSWebContainer.java:634) at com.ibm.ws.webcontainer.component.WebContainerImpl.install(WebContainerImpl.java:426) at com.ibm.ws.webcontainer.component.WebContainerImpl.start(WebContainerImpl.java:718) at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1173) at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:1370) at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:639) at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:968) at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:772) at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplicationDynamically(ApplicationMgrImpl.java:1367) at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:2172) at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:445) at com.ibm.ws.runtime.component.CompositionUnitImpl.start(CompositionUnitImpl.java:123) at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:388) at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.access$500(CompositionUnitMgrImpl.java:116) at com.ibm.ws.runtime.component.CompositionUnitMgrImpl$1.run(CompositionUnitMgrImpl.java:663) at com.ibm.ws.security.auth.ContextManagerImpl.runAs(ContextManagerImpl.java:5459) at com.ibm.ws.security.auth.ContextManagerImpl.runAsSystem(ContextManagerImpl.java:5585) at com.ibm.ws.security.core.SecurityContext.runAsSystem(SecurityContext.java:255) at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.startCompositionUnit(CompositionUnitMgrImpl.java:677) at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.startCompositionUnit(CompositionUnitMgrImpl.java:621) at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:1259) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37) at java.lang.reflect.Method.invoke(Method.java:611) at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:49) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37) at java.lang.reflect.Method.invoke(Method.java:611) at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:256) at javax.management.modelmbean.RequiredModelMBean$4.run(RequiredModelMBean.java:1148) at java.security.AccessController.doPrivileged(AccessController.java:252) at com.ibm.oti.security.CheckedAccessControlContext.securityCheck(CheckedAccessControlContext.java:30) at sun.misc.JavaSecurityAccessWrapper.doIntersectionPrivilege(JavaSecurityAccessWrapper.java:41) at javax.management.modelmbean.RequiredModelMBean.invokeMethod(RequiredModelMBean.java:1142) at javax.management.modelmbean.RequiredModelMBean.invoke(RequiredModelMBean.java:995) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:848) at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:774) at com.ibm.ws.management.AdminServiceImpl$1.run(AdminServiceImpl.java:1335) at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:118) at com.ibm.ws.management.AdminServiceImpl.invoke(AdminServiceImpl.java:1228) at com.ibm.ws.management.connector.AdminServiceDelegator.invoke(AdminServiceDelegator.java:181) at com.ibm.ws.management.connector.ipc.CallRouter.route(CallRouter.java:247) at com.ibm.ws.management.connector.ipc.IPCConnectorInboundLink.doWork(IPCConnectorInboundLink.java:360) at com.ibm.ws.management.connector.ipc.IPCConnectorInboundLink$IPCConnectorReadCallback.complete(IPCConnectorInboundLink.java:602)

at com.ibm.ws.ssl.channel.impl.SSLReadServiceContext$SSLReadCompletedCallback.complete(SSLReadServiceContext.java:1784) at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165) at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217) at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161) at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138) at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204) at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775) at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905) at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1815) Caused by: java.lang.ClassNotFoundException: org.springframework.web.context.WebApplicationContext at java.net.URLClassLoader.findClass(URLClassLoader.java:434) at com.ibm.ws.bootstrap.ExtClassLoader.findClass(ExtClassLoader.java:204) at java.lang.ClassLoader.loadClassHelper(ClassLoader.java:688) at java.lang.ClassLoader.loadClass(ClassLoader.java:667) at com.ibm.ws.bootstrap.ExtClassLoader.loadClass(ExtClassLoader.java:119) at java.lang.ClassLoader.loadClass(ClassLoader.java:650) at com.ibm.ws.classloader.ProtectionClassLoader.loadClass(ProtectionClassLoader.java:62) at com.ibm.ws.classloader.ProtectionClassLoader.loadClass(ProtectionClassLoader.java:58) at com.ibm.ws.classloader.CompoundClassLoader.loadClass(CompoundClassLoader.java:584) at java.lang.ClassLoader.loadClass(ClassLoader.java:650) at com.ibm.ws.classloader.CompoundClassLoader.loadClass(CompoundClassLoader.java:584) at java.lang.ClassLoader.loadClass(ClassLoader.java:650) at com.ibm.ws.classloader.CompoundClassLoader.loadClass(CompoundClassLoader.java:584) at java.lang.ClassLoader.loadClass(ClassLoader.java:650) ... 72 more

最佳答案

正如堆栈跟踪所说:

The annotations could not be obtained because of the exception : java.lang.NoClassDefFoundError: org.springframework.web.context.WebApplicationContext

您的 spring-web-xyz.jar 未加载。确保它位于类路径中,即使用管理应用程序。它应该在某处:服务器 -> 应用程序服务器 -> 服务器名称 -> 进程定义 -> Java 虚拟机。

关于java - 在 Websphere 8.5 上升级到 Spring 3.2 错误 : Resource annotations on DispatcherServlet will be ignored,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23536854/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com