0
我正在嘗試spnego/kerberos的spring-security,並且錯誤如下。我正在粘貼我的pom.xml依賴項,mvn依賴項:樹和錯誤。請看看你能否幫我弄清楚這個問題。spring-security spnego/kerberos NoClassDefFoundError SpringSecurityCoreVersion
的pom.xml片段:
<properties>
<jsf-mojarra.version>2.2.0-m05</jsf-mojarra.version>
<tomcat.manager.url>http://pinkydebian:8080/manager/html</tomcat.manager.url>
<maven.tomcat.exec.war.serverXml>server.xml</maven.tomcat.exec.war.serverXml>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.security.extensions </groupId>
<artifactId>spring-security-kerberos-core</artifactId>
<version>1.0.0.M1</version>
</dependency>
<!-- jsf dependencies -->
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>${jsf-mojarra.version}</version>
</dependency>
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-impl</artifactId>
<version>${jsf-mojarra.version}</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.1</version>
</dependency>
<dependency>
<groupId>com.sun.el</groupId>
<artifactId>el-ri</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
<version>3.1.2.RELEASE</version>
</dependency>
</dependencies>
MVN依賴:樹輸出:
[INFO] --- maven-dependency-plugin:2.1:tree (default-cli) @ jsf-sso ---
[INFO] com.primesystems.sso:jsf-sso:war:1.0-SNAPSHOT
[INFO] +- junit:junit:jar:3.8.1:test
[INFO] +- org.springframework.security.extensions:spring-security-kerberos-core:jar:1.0.0.M1:compile
[INFO] | +- org.springframework.security:spring-security-core:jar:3.0.0.M2:compile
[INFO] | | +- org.springframework:spring-expression:jar:3.0.0.M4:compile
[INFO] | | +- org.springframework:spring-tx:jar:3.0.0.M4:compile
[INFO] | | +- org.aspectj:aspectjrt:jar:1.6.4:compile
[INFO] | | +- org.aspectj:aspectjweaver:jar:1.6.4:compile
[INFO] | | +- commons-logging:commons-logging:jar:1.1.1:compile
[INFO] | | +- commons-codec:commons-codec:jar:1.3:compile
[INFO] | | \- commons-collections:commons-collections:jar:3.2:compile
[INFO] | \- org.springframework.security:spring-security-web:jar:3.0.0.M2:compile
[INFO] | \- org.springframework:spring-web:jar:3.0.0.M4:compile
[INFO] +- com.sun.faces:jsf-api:jar:2.2.0-m05:compile
[INFO] +- com.sun.faces:jsf-impl:jar:2.2.0-m05:compile
[INFO] +- javax.servlet:jstl:jar:1.2:compile
[INFO] +- javax.servlet:servlet-api:jar:2.5:compile
[INFO] +- javax.servlet.jsp:jsp-api:jar:2.1:compile
[INFO] +- com.sun.el:el-ri:jar:1.0:compile
[INFO] \- org.springframework.security:spring-security-config:jar:3.1.2.RELEASE:compile
[INFO] +- org.springframework:spring-core:jar:3.0.7.RELEASE:compile
[INFO] | \- org.springframework:spring-asm:jar:3.0.7.RELEASE:compile
[INFO] +- org.springframework:spring-aop:jar:3.0.7.RELEASE:compile
[INFO] +- org.springframework:spring-context:jar:3.0.7.RELEASE:compile
[INFO] +- aopalliance:aopalliance:jar:1.0:compile
[INFO] \- org.springframework:spring-beans:jar:3.0.7.RELEASE:compile
卡塔利娜日誌錯誤:
Caused by: org.springframework.beans.BeanInstantiationExcepti on: Could not instantiate bean class [org.springframework.security.config.SecurityNamesp aceHandler]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: org/springframework/security/core/SpringSecurityCoreVersion
at org.springframework.beans.BeanUtils.instantiateCla ss(BeanUtils.java:143)
at org.springframework.beans.BeanUtils.instantiateCla ss(BeanUtils.java:106)
at org.springframework.beans.factory.xml.DefaultNames paceHandlerResolver.resolve(DefaultNamespaceHandle rResolver.java:129)
at org.springframework.beans.factory.xml.BeanDefiniti onParserDelegate.parseCustomElement(BeanDefinition ParserDelegate.java:1322)
at org.springframework.beans.factory.xml.BeanDefiniti onParserDelegate.parseCustomElement(BeanDefinition ParserDelegate.java:1317)
at org.springframework.beans.factory.xml.DefaultBeanD efinitionDocumentReader.parseBeanDefinitions(Defau ltBeanDefinitionDocumentReader.java:135)
at org.springframework.beans.factory.xml.DefaultBeanD efinitionDocumentReader.registerBeanDefinitions(De faultBeanDefinitionDocumentReader.java:92)
at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.registerBeanDefinitions(XmlBeanDefinit ionReader.java:475)
問候,
米滕。
你是正確的。我也從春季論壇得到了同樣的答案。我並不完全理解你所提供的頁面上的依賴關係,因爲它認爲spring-security應該處理它。 http://forum.springsource.org/showthread.php?130719-NoClassDefFoundError-SpringSecurityCoreVersion&p=426421&posted=1#post426421。問候,Miten。 – Miten