I am creating a Maven Spring project, which includes MVC, Data and Security. My Spring applicationContext-*.xml files are located at \\src\\main\\resources\\spring\\
My
Try with the relative path using *
@ContextConfiguration(locations = {
"classpath*:spring/applicationContext.xml",
"classpath*:spring/applicationContext-jpa.xml",
"classpath*:spring/applicationContext-security.xml" })
If not look if your xml are really on resources/spring/.
Finally try just on without location
@ContextConfiguration({"classpath*:spring/applicationContext.xml"})
The other error that you´re showing is because you have this tag duplicated on applicationContext.xml and applicationContext-security.xml
Duplicate <global-method-security>
I added the spring folder to the build path and, after clean&build, it worked.
Give the below
@ContextConfiguration(locations = {"classpath*:/spring/test-context.xml"})
And in pom.xml
give the following plugin:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.20.1</version>
<configuration>
<additionalClasspathElements>
<additionalClasspathElement>${basedir}/src/test/resources</additionalClasspathElement>
</additionalClasspathElements>
</configuration>