Configuration problem: spring -security-web classes are not available. For this you need to use <filter-chain-map>
I am trying to run some unit tests in my spring web application using Maven. The application installs and works fine, it generates a deployed war file everything is OK (all using Maven).
My test class (located in src / test / java):
@RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations={"file:C:/myProjects/myWebapp/src/main/webapp/WEB-INF/applicationContext-test.xml"}) @Transactional public class MyTest { ... However, I get the error:
Configuration problem: spring-security-web classes are not available. You need these to use <filter-chain-map> Offending resource: URL [file:C:/myProjects/myWebapp/src/main/webapp/WEB-INF/applicationContext-test.xml] When running Maven > test
My pom dependency is defined as
<dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-web</artifactId> <version>3.0.5.RELEASE</version> </dependency> What is the default compile scope that should be okay ? It returns the same error when I change the scope to test and provided .
And my .classpath looks like this:
<classpath> <classpathentry kind="src" output="target/classes" path="src/main/java"/> <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/> <classpathentry kind="src" output="target/test-classes" path="src/test/java"/> <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/> How to configure context and application tests correctly?
+7
Nimchimpsky
source share2 answers
You must include the Servlet library in your pom.xml:
<dependency> <groupId>javax.servlet</groupId> <artifactId>servlet-api</artifactId> <version>{version}</version> <scope>provided</scope> </dependency> +14
user845199
source share