Announcement Announcement Module
No announcement yet.
Problem with FileSystemXmlApplicationContext and spring-security-web classes Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem with FileSystemXmlApplicationContext and spring-security-web classes


    I have one utility class, which I execute on the commandline:

    mvn exec:java -Dexec.args=src/main/resources/resources.csv
    In this class, I use:

    appContext = new FileSystemXmlApplicationContext(new String[] {
    and e.g.

    authService = (AuthenticationService) appContext.getBean("myUserService");
    to get the beans I need for my setup straight from the config-files (myUserService is defined in app-security.xml).

    However, the sole creation of the appContext fails with:

    Caused by: org.springframework.beans.factory.parsing.BeanDefi nitionParsingException: Configuration problem: spring-security-web classes are not available. You need these to use <filter-chain-map>
    The offending part of my app-security.xml is the <http> section (I found out through commenting every part of that file, and if I comment the <http>-part, it works).

    HTML Code:
    <http auto-config="true" use-expressions="true" disable-url-rewriting="true">
    		<intercept-url pattern="/static/**" filters="none" />
    		<intercept-url pattern="/admin" access="hasRole('ROLE_ADMIN')" />
    		<intercept-url pattern="/admin/**" access="hasRole('ROLE_ADMIN')" />
    		<intercept-url pattern="/**" access="permitAll" />
    		<form-login login-page="/login" authentication-failure-url="/login?authfailed=true" authentication-success-handler-ref="postSuccessAuthHandler" />
    		<logout logout-success-url="/" />
    I use spring-security-config, spring-security-web etc. in version 3.0.7.RELEASE.

    How to fix this? Do I need a seperate config-file without the http-part? Should the beans (myUserService) be defined elsewhere, although they are used for security/authentication? Thanks in advance!