We Are Going To Discuss About Failed to introspect Class [org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration]. So lets Start this Java Article.
Failed to introspect Class [org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration]
- Failed to introspect Class [org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration]
The error is helpful in that it can't find the required class
javax.servlet.Filter
and a common way to have this class is through this dependency:<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-tomcat</artifactId> <scope>provided</scope> </dependency>
- Failed to introspect Class [org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration]
The error is helpful in that it can't find the required class
javax.servlet.Filter
and a common way to have this class is through this dependency:<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-tomcat</artifactId> <scope>provided</scope> </dependency>
Solution 1
If you have below dependency for spring-boot-starter-tomcat in you POM, remove scope part of it.
Existing:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
New:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</dependency>
Original Author Ajay Kumar Of This Content
Solution 2
The error is helpful in that it can’t find the required class javax.servlet.Filter
and a common way to have this class is through this dependency:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
which ends up pulling in org.apache.tomcat.embed:tomcat-embed-core
We were seeing this locally because when running the Spring Boot application from Intellij we didn’t have the option ‘Include dependencies with “Provided” scope’ in the Run/Debug Configuration ticked.
Original Author Matthew Buckett Of This Content
Solution 3
I think this dependency:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
Made a conflict with this one:
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
<type>jar</type>
</dependency>
Why do you need the last one? I think you don’t need it, because you already has starter for security, so remove it.
Original Author codeformars Of This Content
Solution 4
Try adding this to your pom.xml:
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
<version>4.0.1.RELEASE</version>
</dependency>
It helped me.
Original Author Robert Kareta Of This Content
Conclusion
So This is all About This Tutorial. Hope This Tutorial Helped You. Thank You.