我正在尝试使用spnego / kerberos的spring-security,并且出现以下错误。我粘贴我的pom.xml依赖项,mvn依赖:树和错误。请看看你是否可以帮我解决这个问题。
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)
此致
米滕。
答案 0 :(得分:0)
你必须在你的pom文件中包含spring-security-core,spring-security-web和spring-security-config,你可以看到只添加了配置。
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
<version>3.1.2.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
<version>3.1.2.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
<version>3.1.2.RELEASE</version>
</dependency>
这也列在here
中