problem with running Spring JUnit test case under Intellij
I am having problem to run Spring JUnit test case under Intellij. with error
Configuration problem: Duplicate <http> element detected
The error happens when I load all the Spring's application context which include Spring Security configuration. E.g.
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations={"classpath*:**/*Context.xml"})
@Transactional
public class MyTestCaseWithAllContexts {
...
}
but if I only load specific context only it works. E.g.
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations={"classpath*:coreContext.xml","classpath*:myOtherContext.xml"})
@Transactional
public class MyTestCaseWithSomeContexts {
...
}
I am not sure whether it is problem with Intellij or maybe my project setup. My project is set up to use
project
|- core-module
| |- src
| |- main
| |- java
| |- MyTestCaseWithAllContexts
| |- MyTestCaseWithSomeContexts
| |- ...
|- web-module
|- src
|- main
|- resources
|- coreContext.xml
|- myOtherContext.xml
|- securityContext.xml (location of Spring Security etc)
|- ...
I use
- Spring 3
- Maven 2.2.1
Any insight or help is appreciated. Thanks
Please sign in to leave a comment.
Just tried to reproduce your use-case with the following actions:
Result: the test is successfully executed.
We need to be able to reproduce the problem at local environment, hence, it would be nice if you create minimal but complete standalone example (archive that contains standalone preconfigured IDEA project with target classes and config files) and provide it to us.
Regards, Denis