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.

public class MyTestCaseWithAllContexts {

but if I only load specific context only it works. E.g.

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

  |- 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

1 comment
Comment actions Permalink

Just tried to reproduce your use-case with the following actions:

  • created two IDEA Spring-aware modules;
  • put two Spring config files and Spring Security file to source root of one module;
  • created spring test class at another module and made that module depend from the one with config files;

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


Please sign in to leave a comment.