为什么java.lang.NoSuchMethodError:org.springframework.util.Clas



案例1:
当我在E1环境中使用Jenkins部署应用程序时,它可以成功工作。应用程序已部署,Jenkins控制台输出没有错误

案例2:
当我在另一个环境(比如E2)中与Jenkins部署同一个应用程序时,部署操作失败,但应用程序确实在服务器中部署。尽管我在詹金斯控制台中遇到错误。我很困惑,是代码问题还是服务器问题,我该如何解决
以下是这种情况下的错误:

目标状态:在Cluster xCluster上部署失败
15:53:27 java.lang.NoSuchMethodError:org.springframework.util.ClassUtils.forName(Ljava/lang/String;)Ljava/lang/Class;15:53:27,网址:org.springframework.oxm.jaxb.JaxbUtils。(JaxbUtils.java:44)15:53:27,网址:org.springframework.oxm.jaxb.Jaxb2Marshaller.createJaxbContext(Jaxb2Marshaller.java:272)15:53:27,网址:org.springframework.oxm.jaxb.AbstractJaxbMarshaller.afterPropertiesSet(AbstractjaxbMarshallr.java:125)15:53:27,网址:org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory:java:1687)15:53:27在org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1624)15:53:27在org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555)15:53:27在org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)15:53:27,网址:org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)15:53:27在org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)15:53:27在org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)15:53:27在org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)15:53:27在org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761)15:53:27在org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867)15:53:27,网址:org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543)15:53:27在org.springframework.boot.context.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122)15:53:27在org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693)15:53:27,网址:org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360)15:53:27在org.springframework.boot.SpringApplication.run(SpringApplication.java:303)15:53:27,网址:org.springframework.boot.web.support.SpringBootServletInitializer.run(SpringBootServlet初始化器.java:154)15:53:27,网址:org.springframework.boot.web.support.SpringBootServlet初始化器.createRootApplicationContext(SpringBootServlet初始化程序.java:134)15:53:27,网址:org.springframework.boot.web.support.SpringBootServletInitializer.onStartup(SpringBootServlet初始化器.java:87)15:53:27,网址:org.springframework.web.SpringServlet ContainerInitializer.onStartup(SpringServlet ContainerInitializar.java:169)15:53:27在weblogic.servlet.internal.WebAppServlet上下文.initContainerInitializer(WebAppServlet上下文.java:1389)15:53:27在weblogic.servlet.internal.WebAppServlet上下文.initContainerInitializers(WebAppServlet上下文.java:1326)15:53:27在weblogic.servlet.internal.WebAppServlet上下文.initContainerInitializers(WebAppServlet上下文.java:1312)15:53:27在weblogic.servlet.internal.WebAppServlet上下文.proaderResources(WebAppServlet上下文.java:1829)15:53:27在weblogic.servlet.internal.WebAppServlet上下文.start(WebAppServlet上下文.java:2891)15:53:27在weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1661)15:53:27在weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:823)15:53:27在weblogic.application.internal.ExtensibleModuleWrapper$StartStateChange.next(ExtensibleModule Wrapper.java:360)15:53:27在weblogic.application.internal.ExtensibleModuleWrapper$StartStateChange.next(ExtensibleModule Wrapper.java:356)15:53:27在weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:42)15:53:27在weblogic.application.internal.ExtensibleModuleWrapper.start(ExtensibleModule Wrapper.java:138)15:53:27在weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:124)15:53:27,网址:weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:216)15:53:27,网址:weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:211)15:53:27在weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:42)15:53:27在weblogic.application.internal.flow.ModueStateDriver.start(ModuleStateDriver.java:73)15:53:27在weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:24)15:53:27在weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:729)15:53:27在weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:42)15:53:27在weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:258)15:53:27在weblogic.application.internal.EarDeployment.activate(EarDeployment.java:61)15:53:27在weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:165)15:53:27在weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:80)15:53:27在weblogic.deploy.internal.targetserver.operations.AbstractOperation.activate(AbstractOperation.java:587)15:53:27在weblogic.deploy.internal.targetserver.operations.ActivateOperation.activateDeployment(ActivateOperation.java:150)15:53:27在weblogic.deploy.internal.targetserver.operations.ActivateOperation.doCommit(ActivateOperation.java:116)15:53:27在weblogic.deploy.internal.targetserver.operations.AbstractOperation.commit(AbstractOperation.java:339)15:53:27在weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentCommit(DeploymentManager.java:846)15:53:27,网址:weblogic.deploy.internal.targetserver.DeploymentManager.activateDeploymentList(DeploymentManager.java:1275)15:53:27在weblogic.deploy.internal.targetserver.DeploymentManager.handleCommit(DeploymentManager.java:442)15:53:27,网址:weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.commit(DeploymentServiceDisptcher.java:176)15:53:27在weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doCommitCallback(DeploymentReceiverCallbackDeliverer.java:195)15:53:27在weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$100(DeploymentReceiverCallbackDeliverer.java:13)15:53:27在weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$2.run(DeploymentReceiverCallbackDeliverer.java:68)15:53:27在weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManager Impl.java:553)15:53:27在weblogic.work.ExecuteThread.execute(ExecuteThread.java:311)15:53:27在weblogic.work.ExecuteThread.run(ExecuteThread.java:263)

感谢Deinum和Roddy的评论
我解决了问题/错误,部署操作成功
以下是我所做的:
我在我的库中发现了多个版本的spring-oxm。我不得不删除最旧的一个,并保留了来自spring boot starter web服务工具包的最新一个。一旦您有了spring-oxm-jar的单一版本和最新版本,您就应该能够成功地构建、测试和部署
这是问题的根本原因

对我来说:实现'org.springframework.boot:spring-boot starter web'实现'org.springframework:springbeans:5.3.17'

只需删除实现'org.springframework:springbeans:5.3.17'它对我来说很有用。

相关内容

  • 没有找到相关文章

最新更新