为什么在执行Deploy操作时抛出java.lang.NoSuchMethodError:org.springframework.util.ClassUtils.forName(Ljava / lang / String;)Ljava / lang / Class吗?

时间:2018-07-17 18:49:47

标签: spring spring-boot weblogic12c spring-framework-beans spring-oxm

案例1:
当我在名为E1的环境中使用Jenkins部署应用程序时,它可以成功运行。应用已部署,并且在Jenkins控制台输出上没有错误。

情况2:
当我在另一个环境(例如E2)中使用Jenkins部署相同的应用程序时,部署操作失败,但是该应用程序确实在服务器中进行了部署。虽然在Jenkins控制台中出现错误。我很困惑,这是代码问题还是服务器问题,该如何解决?
下面是这种情况下的错误:

  

目标状态:在群集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 at org.springframework.oxm.jaxb.Jaxb2Marshaller.createJaxbContext(Jaxb2Marshaller.java:272)   15:53:27 at org.springframework.oxm.jaxb.AbstractJaxbMarshaller.afterPropertiesSet(AbstractJaxbMarshaller.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 at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543)   15:53:27在org.springframework.boot.context.embedded.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(SpringBootServletInitializer.java:154)   15:53:27在org.springframework.boot.web.support.SpringBootServletInitializer.createRootApplicationContext(SpringBootServletInitializer.java:134)   15:53:27在org.springframework.boot.web.support.SpringBootServletInitializer.onStartup(SpringBootServletInitializer.java:87)   15:53:27在org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:169)   15:53:27在weblogic.servlet.internal.WebAppServletContext.initContainerInitializer(WebAppServletContext.java:1389)   15:53:27在weblogic.servlet.internal.WebAppServletContext.initContainerInitializers(WebAppServletContext.java:1326)   15:53:27在weblogic.servlet.internal.WebAppServletContext.initContainerInitializers(WebAppServletContext.java:1312)   15:53:27位于weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1829)   15:53:27位于weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:2891)   15:53:27位于weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1661)   在weblogic.servlet.internal.WebAppModule.start 15:53:27(WebAppModule.java:823)   15:53:27在weblogic.application.internal.ExtensibleModuleWrapper $ StartStateChange.next(ExtensibleModuleWrapper.java:360)   在weblogic.application.internal.ExtensibleModuleWrapper $ StartStateChange.next(ExtensibleModuleWrapper.java:356)15:53:27   在weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:42)15:53:27   在weblogic.application.internal.ExtensibleModuleWrapper.start 15:53:27(ExtensibleModuleWrapper.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 at weblogic.application.internal.flow.ModuleStateDriver $ 3.next(ModuleStateDriver.java:211)   在weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:42)15:53:27   15:53:27在weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:73)   15:53:27在weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:24)   15:53:27 at weblogic.application.internal.BaseDeployment $ 2.next(BaseDeployment.java:729)   在weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:42)15:53:27   在weblogic.application.internal.BaseDeployment.activate 15:53:27(BaseDeployment.java:258)   在weblogic.application.internal.EarDeployment.activate(EarDeployment.java:61)15:53:27   在weblogic.application.internal.DeploymentStateChecker.activate 15:53:27(DeploymentStateChecker.java:165)   在weblogic.deploy.internal.targetserver.AppContainerInvoker.activate 15:53:27(AppContainerInvoker.java:80)   15:53:27在weblogic.deploy.internal.targetserver.operations.AbstractOperation.activate(AbstractOperation.java:587)   在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   15:53:27在weblogic.deploy.internal.targetserver.operations.AbstractOperation.commit(AbstractOperation.java:339)   在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上15:53:27(DeploymentManager.java:442)   在weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.commit(DeploymentServiceDispatcher.java:176)15:53:27   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 at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer $ 2.run(DeploymentReceiverCallbackDeliverer.java:68)   在weblogic.work.SelfTuningWorkManagerImpl $ WorkAdapterImpl.run 15:53:27(SelfTuningWorkManagerImpl.java:553)   在weblogic.work.ExecuteThread.execute(ExecuteThread.java:311)15:53:27   15:53:27在weblogic.work.ExecuteThread.run(ExecuteThread.java:263)

1 个答案:

答案 0 :(得分:0)

感谢Deinum和Roddy的意见!
我能够解决问题/错误,并且部署操作成功。
这是我做的:
我在库中找到了多个版本的spring-oxm。我不得不删除最旧的一个,并保留了最新的一个,它来自spring-boot-starter-web-services套件。一旦有了spring-oxm jar的单个版本和最新版本,就应该能够成功构建,测试和部署。
这是问题的根本原因。