NoClassDefFoundError SpringSecurityCoreVersion
Hi,
I am trying spring-security for spnego/kerberos and am having error as below. I am pasting my pom.xml dependencies, mvn dependency:tree and error. Please see if you can help me figure out the issue.
pom.xml snippet:
<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>
[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
The catalina log error:
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)
Regards,
Miten.
Repository does not have matching versions
Quote:
Originally Posted by
Rob Winch
Make sure all your jars that start with spring-security- are the same version. You can use dependency management or explicit dependency statements in your pom to control this. For more info you can refer to the Spring Security Fundamentals
http://www.springsource.org/node/3670
Hi,
Thanks for video link but its audio is too low. I was unable to make use of that video.
The versions on http://maven.springframework.org repository for artifacts spring-security-config are 3.x.x.x while spring-security-kerberos-core are 1.x.x.x. how do I select same versions as per your suggestion ?
If the answer lines in video link then as I was unable to follow it I might be missing the solution.
If you can be specific based on my dependencies listed what versions I need to use it would be helpful.
Regards,
Miten.