Home  >  Forum  >  Spring
Post New Query

java.lang.ClassNotFoundException: EnableWebSecurity in spring web boot


joined on
December 28,2013
Asked on August 09,2014
I am running Spring 4 MVC and using
spring boot as
compile 'org.springframework.boot:spring-boot-starter-web:1.1.4.RELEASE'
in gradle 
But got the error. Need solution

Error is 

java.lang.ClassNotFoundException: org.springframework.security.config.annotation.web.configuration.EnableWebSecurity
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714) ~[catalina.jar:7.0.42]
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559) ~[catalina.jar:7.0.42]
at org.springframework.core.type.classreading.RecursiveAnnotationAttributesVisitor.visitEnd(AnnotationAttributesReadingVisitor.java:182) ~[spring-core-4.0.6.RELEASE.jar:4.0.6.RELEASE]
at org.springframework.asm.ClassReader.readAnnotationValues(ClassReader.java:1788) [spring-core-4.0.6.RELEASE.jar:4.0.6.RELEASE]
at org.springframework.asm.ClassReader.accept(ClassReader.java:642) [spring-core-4.0.6.RELEASE.jar:4.0.6.RELEASE]
at org.springframework.asm.ClassReader.accept(ClassReader.java:508) [spring-core-4.0.6.RELEASE.jar:4.0.6.RELEASE]
at org.springframework.core.type.classreading.SimpleMetadataReader.<init>(SimpleMetadataReader.java:64) [spring-core-4.0.6.RELEASE.jar:4.0.6.RELEASE]
at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:82) [spring-core-4.0.6.RELEASE.jar:4.0.6.RELEASE]
at org.springframework.core.type.classreading.CachingMetadataReaderFactory.getMetadataReader(CachingMetadataReaderFactory.java:102) [spring-core-4.0.6.RELEASE.jar:4.0.6.RELEASE]
at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:77) [spring-core-4.0.6.RELEASE.jar:4.0.6.RELEASE]
at org.springframework.context.annotation.ConfigurationClassParser.asSourceClass(ConfigurationClassParser.java:564) [spring-context-4.0.6.RELEASE.jar:4.0.6.RELEASE]
at org.springframework.context.annotation.ConfigurationClassParser.asSourceClasses(ConfigurationClassParser.java:551) [spring-context-4.0.6.RELEASE.jar:4.0.6.RELEASE]
at org.springframework.context.annotation.ConfigurationClassParser.processDeferredImportSelectors(ConfigurationClassParser.java:392) [spring-context-4.0.6.RELEASE.jar:4.0.6.RELEASE]
at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:165) [spring-context-4.0.6.RELEASE.jar:4.0.6.RELEASE]
at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:305) [spring-context-4.0.6.RELEASE.jar:4.0.6.RELEASE]
at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:243) [spring-context-4.0.6.RELEASE.jar:4.0.6.RELEASE]
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:254) [spring-context-4.0.6.RELEASE.jar:4.0.6.RELEASE]
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:94) [spring-context-4.0.6.RELEASE.jar:4.0.6.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:609) [spring-context-4.0.6.RELEASE.jar:4.0.6.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464) [spring-context-4.0.6.RELEASE.jar:4.0.6.RELEASE]
at com.concretepage.WebAppInitializer.onStartup(WebAppInitializer.java:14) [WebAppInitializer.class:na]
at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:175) [spring-web-4.0.6.RELEASE.jar:4.0.6.RELEASE]
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5423) [catalina.jar:7.0.42]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [catalina.jar:7.0.42]
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901) [catalina.jar:7.0.42]
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877) [catalina.jar:7.0.42]
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633) [catalina.jar:7.0.42]
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:976) [catalina.jar:7.0.42]
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1653) [catalina.jar:7.0.42]
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [na:1.7.0_45]
at java.util.concurrent.FutureTask.run(Unknown Source) [na:1.7.0_45]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [na:1.7.0_45]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [na:1.7.0_45]
at java.lang.Thread.run(Unknown Source) [na:1.7.0_45]


joined on
October 10,2013
Replied on August 09,2014

Add below dependency in your gradle script.

compile 'org.springframework.boot:spring-boot-starter-security:1.1.4.RELEASE'



Write Answer








Copyright ©2017 concretepage.com, all rights reserved |Privacy Policy | Contact Us