Weblogic中的Spring Webapp发布错误

时间:2014-03-10 18:00:46

标签: spring spring-mvc weblogic

当我尝试发布我的Spring MVC Webapp时,我得到以下异常:

  

上下文初始化失败|| java.lang.LinkageError:loader   约束违规:loader(实例)   组织/ springframework的/上下文/支持/ ContextTypeMatchClassLoader $ ContextOverridingClassLoader)   先前为具有名称的其他类型启动了加载   "组织/阿帕奇/ HTTP / PARAMS /的HttpParams"在   java.lang.ClassLoader.defineClass1(Native Method)at   java.lang.ClassLoader.defineClassCond(未知来源)at   java.lang.ClassLoader.defineClass(未知来源)at   java.lang.ClassLoader.defineClass(未知来源)at   org.springframework.context.support.ContextTypeMatchClassLoader $ ContextOverridingClassLoader.loadClassForOverriding(ContextTypeMatchClassLoader.java:109)     在   org.springframework.core.OverridingClassLoader.loadClass(OverridingClassLoader.java:61)     在java.lang.ClassLoader.loadClass(未知来源)at   java.lang.Class.getDeclaredMethods0(Native Method)at   java.lang.Class.privateGetDeclaredMethods(Unknown Source)at   java.lang.Class.getDeclaredMethods(未知来源)at   org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:467)     在   org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:481)     在   org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:451)     在   org.springframework.util.ReflectionUtils.getUniqueDeclaredMethods(ReflectionUtils.java:511)     在   org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryMethod(AbstractAutowireCapableBeanFactory.java:634)     在   org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:573)     在   org.springframework.beans.factory.support.AbstractBeanFactory.isTypeMatch(AbstractBeanFactory.java:510)     在   org.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:339)     在   org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:308)     在   org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:638)     在   org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:454)     在   org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:383)     在   org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:283)     在   org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)     在   weblogic.servlet.internal.EventsManager $ FireContextListenerAction.run(EventsManager.java:481)     在   weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)     在   weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)     在   weblogic.servlet.internal.EventsManager.notifyContextCreatedEvent(EventsManager.java:181)     在   weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1873)     在   weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:3161)     在   weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1511)     在   weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:483)     在   weblogic.application.internal.flow.ModuleStateDriver $ 3.next(ModuleStateDriver.java:425)     在   weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)     在   weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)     在   weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:200)     在   weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:247)     在   weblogic.application.internal.flow.ModuleStateDriver $ 3.next(ModuleStateDriver.java:425)     在   weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)     在   weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)     在   weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:27)     在   weblogic.application.internal.BaseDeployment $ 2.next(BaseDeployment.java:636)     在   weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)     在   weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:205)     在   weblogic.application.internal.EarDeployment.activate(EarDeployment.java:58)     在   weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:161)     在   weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:79)     在   weblogic.deploy.internal.targetserver.BasicDeployment.activate(BasicDeployment.java:184)     在   weblogic.deploy.internal.targetserver.BasicDeployment.activateFromServerLifecycle(BasicDeployment.java:361)     在   weblogic.management.deploy.internal.DeploymentAdapter $ 1.doActivate(DeploymentAdapter.java:51)     在   weblogic.management.deploy.internal.DeploymentAdapter.activate(DeploymentAdapter.java:200)     在   weblogic.management.deploy.internal.AppTransition $ 2.transitionApp(AppTransition.java:30)     在   weblogic.management.deploy.internal.ConfiguredDeployments.transitionApps(ConfiguredDeployments.java:240)     在   weblogic.management.deploy.internal.ConfiguredDeployments.activate(ConfiguredDeployments.java:169)     在   weblogic.management.deploy.internal.ConfiguredDeployments.deploy(ConfiguredDeployments.java:123)     在   weblogic.management.deploy.internal.DeploymentServerService.resume(DeploymentServerService.java:180)     在   weblogic.management.deploy.internal.DeploymentServerService.start(DeploymentServerService.java:96)     在weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)     在   weblogic.work.ExecuteRequestAdapter.execute(ExecuteRequestAdapter.java:21)     在weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:145)at at   weblogic.kernel.ExecuteThread.run(ExecuteThread.java:117)^^

1 个答案:

答案 0 :(得分:1)

你很可能两次加载同一个类并且有两个不同的版本。具体来说,您可能有两个版本:

org/apache/http/params/HttpParams

检查您正在加载的应用程序以及已提供的weblogic。您可以删除重复的类/ jar,如:

java.lang.LinkageError Error in Class Loading

java.lang.LinkageError: loader constraint violation previously initiated loading for a different type with name "javax/xml/soap/SOAPMessage"

或者您可以使用weblogic中的首选类来明确说明要使用的类的版本(可能是应用程序中打包的类)。参见:

NetBeans taking JSF Server library instead of registered libraries