Announcement Announcement Module
Collapse
No announcement yet.
ConcurrentSessionFilter configuration problem Page Title Module
Move Remove Collapse
This topic is closed
X
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    Cluster aware session

    I want to customize the SessionRegistry inorder to implement cluster aware concurrent session control. I am using the session-registry-ref attribute of <concurrent-session-control> to refer to the custom registry.
    But once I do this, spring security allows multiple logins.
    I am not sure what is wrong.

    Comment


    • #17
      This is the right answer.

      With JUnit, I got a similar error.

      @RunWith(SpringJUnit4ClassRunner.class)
      @TestExecutionListeners( { DependencyInjectionTestExecutionListener.class,
      TransactionalTestExecutionListener.class })
      @ContextConfiguration(locations = "/WEB-INF/config/spring-*.xml")
      @Transactional

      It turned out to be the setting of @ContextConfiguration(locations = "/WEB-INF/config/spring-*.xml"), as my master spring-application.xml imports other spring config files for different aspects. Interesting enough, only tags in spring-security.xml seems to be loaded repeatedly. Changing to @ContextConfiguration(locations = "/WEB-INF/config/spring-application.xml") fixed the problem.


      Originally posted by mickknutson View Post
      That was not the issue. But I did solve the issue:

      First off, when I was using acegi, I declared an applicationContext-test.xml that myTestNG would instanciate. I then would import my other applicationContext*.xml's that I thought I would need. Now this did not cause an issue in acegi:
      <import resource="classpath:applicationContext-service.xml"/>
      <import resource="classpath:/WEB-INF/applicationContext*.xml"/> But when I moved to Spring Security 2.0.2, I started getting this error:
      Offending resource: class path resource [applicationContext-test.xml];
      nested exception is org.springframework.beans.factory.parsing.BeanDefi nitionParsingException:
      Configuration problem: Duplicate <global-method-security> detected.
      Offending resource:
      file [C:\opt\projects\baselogic\common-services\webapp-services\web\target\test-classes\WEB-INF\applicationContext-security.xml]
      at org.springframework.beans.factory.parsing.FailFast ProblemReporter.error(FailFastProblemReporter.java :68) When I removed the <global-method-security> I got the same error in the <http> section just as the spring thread above.
      The thing that helped me to solve this, and was a strange indicator, was that when I ran this stand alone "mvn -Dcargo.wait=true cargo:start" or "mvn tomcat:run-war" the application would start, and function as expected. So I was confused as everything worked before Spring Security, but now it does not.
      The issue seems to be that if maven is deploying the application to embedded tomcat, then TestNG is starting the applicationContext-test.xml which in turn was importing classpath:/WEB-INF/applicationContext*.xml which is the same import as my web.xml is importing:
      <context-param>
      <param-name>contextConfigLocation</param-name>
      <param-value>
      /WEB-INF/applicationContext*.xml
      </param-value>
      </context-param> The strange thing is, only my Spring Security has the issue. All my other beans start just fine. So as soon as I removed that declaration from my applicationContext-test.xml for TestNG Testing, the error was fixed.

      Comment


      • #18
        when i remove the configuration of applicationContext*.xml in my web.xml,the problem is fixed!!!
        But what is wrong with this, I don't have TestNG or JUnit.
        Although there is a <http> which is indicated null for the first time in the process stack,where this http is from is the great question I think!!!!

        Comment

        Working...
        X