部署在Weblogic Server 10.3.4上的Spring 3.1失败

时间:2012-07-12 04:23:44

标签: spring spring-security weblogic-10.x spring-3

我一直在开发maven java spring 3.1程序并将其部署在jetty上。它在码头上成功运行。现在我需要在weblogic 10.3.4上部署它,但我总是得到这个BeanDefinitionParserDelegate错误。是否有任何内容(如库或类)我应该添加到weblogic环境中以使其工作?

以下是我的错误堆栈跟踪:

951  [[ACTIVE] ExecuteThread: '8' for queue: 'weblogic.kernel.Default (self-tuning)']
ERROR o.s.web.context.ContextLoader - Context initialization failed
org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from ServletContext resource [/WEB-INF/spring/spring-security.xml]; nested exception is java.lang.NoSuchMethodError: org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.getLocalName(Lorg/w3c/dom/Node;)Ljava/lang/String;
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:375) ~[spring-2.0.3.jar:2.0.3]
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:303) ~[spring-2.0.3.jar:2.0.3]
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:280) ~[spring-2.0.3.jar:2.0.3]
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:131) ~[spring-2.0.3.jar:2.0.3]
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:147) ~[spring-2.0.3.jar:2.0.3]
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124) ~[spring-2.0.3.jar:2.0.3]
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:92) ~[spring-2.0.3.jar:2.0.3]
at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:100) ~[spring-2.0.3.jar:2.0.3]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:298) ~[spring-2.0.3.jar:2.0.3]
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:241) ~[spring-2.0.3.jar:2.0.3]
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:184) ~[spring-2.0.3.jar:2.0.3]
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49) [spring-2.0.3.jar:2.0.3]
at weblogic.servlet.internal.EventsManager$FireContextListenerAction.run(EventsManager.java:481) [weblogic.jar:10.3.4.0]
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) [com.bea.core.weblogic.security.identity_1.1.2.1.jar:1.1.2.1]
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120) [com.bea.core.weblogic.security.wls_1.0.0.0_6-1-0-0.jar:6.1.0.0]
at weblogic.servlet.internal.EventsManager.notifyContextCreatedEvent(EventsManager.java:181) [weblogic.jar:10.3.4.0]
at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1872) [weblogic.jar:10.3.4.0]
at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:3153) [weblogic.jar:10.3.4.0]
at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1508) [weblogic.jar:10.3.4.0]
at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:482) [weblogic.jar:10.3.4.0]
at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425) [weblogic.jar:10.3.4.0]
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52) [weblogic.jar:10.3.4.0]
at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119) [weblogic.jar:10.3.4.0]
at weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:200) [weblogic.jar:10.3.4.0]
at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:247) [weblogic.jar:10.3.4.0]
at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425) [weblogic.jar:10.3.4.0]
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52) [weblogic.jar:10.3.4.0]
at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119) [weblogic.jar:10.3.4.0]
at weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:27) [weblogic.jar:10.3.4.0]
at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:636) [weblogic.jar:10.3.4.0]
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52) [weblogic.jar:10.3.4.0]
at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:205) [weblogic.jar:10.3.4.0]
at weblogic.application.internal.SingleModuleDeployment.activate(SingleModuleDeployment.java:43) [weblogic.jar:10.3.4.0]
at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:161) [weblogic.jar:10.3.4.0]
at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:79) [weblogic.jar:10.3.4.0]
at weblogic.deploy.internal.targetserver.operations.AbstractOperation.activate(AbstractOperation.java:569) [weblogic.jar:10.3.4.0]
at weblogic.deploy.internal.targetserver.operations.ActivateOperation.activateDeployment(ActivateOperation.java:150) [weblogic.jar:10.3.4.0]
at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doCommit(ActivateOperation.java:116) [weblogic.jar:10.3.4.0]
at weblogic.deploy.internal.targetserver.operations.AbstractOperation.commit(AbstractOperation.java:323) [weblogic.jar:10.3.4.0]
at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentCommit(DeploymentManager.java:844) [weblogic.jar:10.3.4.0]
at weblogic.deploy.internal.targetserver.DeploymentManager.activateDeploymentList(DeploymentManager.java:1253) [weblogic.jar:10.3.4.0]
at weblogic.deploy.internal.targetserver.DeploymentManager.handleCommit(DeploymentManager.java:440) [weblogic.jar:10.3.4.0]
at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.commit(DeploymentServiceDispatcher.java:163) [weblogic.jar:10.3.4.0]
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doCommitCallback(DeploymentReceiverCallbackDeliverer.java:195) [weblogic.jar:10.3.4.0]
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$100(DeploymentReceiverCallbackDeliverer.java:13) [weblogic.jar:10.3.4.0]
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$2.run(DeploymentReceiverCallbackDeliverer.java:68) [weblogic.jar:10.3.4.0]
at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:528) [com.bea.core.weblogic.workmanager_1.9.0.0.jar:1.9.0.0]
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207) [com.bea.core.weblogic.workmanager_1.9.0.0.jar:1.9.0.0]
at weblogic.work.ExecuteThread.run(ExecuteThread.java:176) [com.bea.core.weblogic.workmanager_1.9.0.0.jar:1.9.0.0]

Caused by: java.lang.NoSuchMethodError: org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.getLocalName(Lorg/w3c/dom/Node;)Ljava/lang/String;
at org.springframework.security.config.SecurityNamespaceHandler.parse(SecurityNamespaceHandler.java:69) ~[spring-security-config-3.1.0.RELEASE.jar:3.1.0.RELEASE]
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1114) ~[spring-2.0.3.jar:2.0.3]
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1104) ~[spring-2.0.3.jar:2.0.3]
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:133) ~[spring-2.0.3.jar:2.0.3]
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:90) ~[spring-2.0.3.jar:2.0.3]
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:458) ~[spring-2.0.3.jar:2.0.3]
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:353) ~[spring-2.0.3.jar:2.0.3]
... 48 common frames omitted

这是我在spring-security.xml中的xml代码

<beans:beans xmlns="http://www.springframework.org/schema/security"
         xmlns:beans="http://www.springframework.org/schema/beans"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://www.springframework.org/schema/beans
               http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
               http://www.springframework.org/schema/security
               http://www.springframework.org/schema/security/spring-security-3.1.xsd">

<global-method-security pre-post-annotations="enabled" />

<beans:bean id="customAuthFilter" class="org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter">
    <beans:property name="sessionAuthenticationStrategy" ref="sas"/>
    <beans:property name="authenticationManager" ref="authenticationManager" />
    <beans:property name="allowSessionCreation" value="true" />
</beans:bean>

<beans:bean id="sas" class="org.springframework.security.web.authentication.session.ConcurrentSessionControlStrategy">
    <beans:constructor-arg name="sessionRegistry" ref="sessionRegistry"/>
    <beans:property name="maximumSessions" value="1" />
</beans:bean>

<beans:bean id="sessionRegistry" class="org.springframework.security.core.session.SessionRegistryImpl" />

<beans:bean id="loginService" class="com.pusilkom.artajasa.billing.service.LoginService" />

<beans:bean id="customAuthenticationProvider" class="com.pusilkom.artajasa.billing.util.ArtajasaAuthenticationProvider" />
<authentication-manager alias="authenticationManager">
    <authentication-provider ref="customAuthenticationProvider" />
</authentication-manager>

<beans:bean id="accessDeniedHandler" class="com.pusilkom.artajasa.billing.util.ThouShaltNoPass">
    <beans:property name="accessDeniedURL" value="/session/403/" />
</beans:bean>

任何人都可以提供帮助吗?

2 个答案:

答案 0 :(得分:2)

您的日志显示您的类路径上有Spring 2.0.3,您需要至少使用Spring 3.0.6才能使用Spring Security 3.1.x.因此,请尝试清理类路径或检查jar是否包含在其他项目中。

at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1114) ~[spring-2.0.3.jar:2.0.3]

答案 1 :(得分:0)

您是否尝试过使用prefer-web-inf-classes元素?在WEB-INF/weblogic.xmlweb.xml

旁边
<?xml version="1.0" encoding="UTF-8"?>
<weblogic-web-app
 xmlns="http://www.bea.com/ns/weblogic/90"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://www.bea.com/ns/weblogic/90 
http://www.bea.com/ns/weblogic/90/weblogic- web-app.xsd">
<container-descriptor>
    <prefer-web-inf-classes>true</prefer-web-inf-classes>
 </container-descriptor>
</weblogic-web-app>

请参阅:Weblogic 10.3.1.0 is using com.bea.core.apache.commons.net_1.0.0.0_1-4-1.jar... I want to use commons-net-2.0.jar from my code