Hi,
I have one utility class, which I execute on the commandline:
In this class, I use:Code:mvn exec:java -Dexec.mainClass=com.my.project.utils.Setup -Dexec.args=src/main/resources/resources.csv
and e.g.Code:appContext = new FileSystemXmlApplicationContext(new String[] { "src/main/resources/app-context.xml", "src/main/webapp/WEB-INF/app-security.xml" });
to get the beans I need for my setup straight from the config-files (myUserService is defined in app-security.xml).Code:authService = (AuthenticationService) appContext.getBean("myUserService");
However, the sole creation of the appContext fails with:
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).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>
I use spring-security-config, spring-security-web etc. in version 3.0.7.RELEASE.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="/" /> </http>
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!


Reply With Quote
