konto usunięte
Temat: Prośba o pomoc. Spring security.
Koledzy mam wielki problem, próbuję dodać komponent spring security do mojej prostej aplikacji i za diabła mi to nie idzie. W trakcie budowania aplikacji dostaję błąd: "[install] FAIL - Deployed application at context path /springapp but context failed to start"Zawartość web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" >
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/springapp-servlet.xml
/WEB-INF/springapp-security.xml
</param-value>
</context-param>
<filter>
<filter-name>springSecurityFilterChain</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<servlet>
<servlet-name>springapp</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>springapp</servlet-name>
<url-pattern>*.htm</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>
index.jsp
</welcome-file>
</welcome-file-list>
</web-app>
zawartość springapp-security.xml
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Sample namespace-based configuration
-
- $Id: applicationContext-security.xml 3019 2008-05-01 17:51:48Z luke_t $
-->
<beans:beans xmlns="http://www.springframework.org/schema/security"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-2.0.1.xsd">
<global-method-security secured-annotations="enabled"></global-method-security>
<http auto-config="true">
<intercept-url pattern="/**" access="IS_AUTHENTICATED_ANONYMOUSLY" />
</http>
<!--
Usernames/Passwords are
rod/koala
dianne/emu
scott/wombat
peter/opal
-->
<authentication-provider>
<password-encoder hash="md5"/>
<user-service>
<user name="rod" password="a564de63c2d0da68cf47586ee05984d7" authorities="ROLE_SUPERVISOR, ROLE_USER, ROLE_TELLER" />
<user name="dianne" password="65d15fe9156f9c4bbffd98085992a44e" authorities="ROLE_USER,ROLE_TELLER" />
<user name="scott" password="2b58af6dddbd072ed27ffc86725d7d3a" authorities="ROLE_USER" />
<user name="peter" password="22b5c9accc6e1ba628cedc63a72d57f8" authorities="ROLE_USER" />
</user-service>
</authentication-provider>
</beans:beans>
Zawartości springapp-servlet.xml nie podaję - ponieważ bez komponentu security wszystko działa.
Biblioteki jakie mam dodane (Spring w wersji 2.5):
antlr-2.7.6.jar
aopalliance-1.0.jar
asm-3.3.jar
aspectjrt-1.5.4.jar
cglib-nodep-2.1_3.jar
commons-codec-1.3.jar
commons-collections-3.1.jar
commons-dbcp-1.4.jar
commons-logging.jar
commons-pool-1.5.4.jar
dom4j-1.6.1.jar
hibernate-annotations.jar
hibernate-commons-annotations.jar
hibernate-jpa-2.0-api-1.0.0.Final.jar
hibernate3.jar
javassist-3.9.0.GA.jar
jsr107cache-1.0.jar
jstl.jar
jta-1.1.jar
junit-3.8.2.jar
log4j-1.2.14.jar
mysql-connector-java-5.1.13-bin.jar
persistence.jar
servlet-api.jar
slf4j-api-1.5.8.jar
spring-aop.jar
spring-beans.jar
spring-context-support.jar
spring-context.jar
spring-core.jar
spring-security-acl-2.0.5.RELEASE.jar
spring-security-core-2.0.5.RELEASE.jar
spring-security-core-tiger-2.0.5.RELEASE.jar
spring-security-taglibs-2.0.5.RELEASE.jar
spring-web.jar
spring-webmvc.jar
spring.jar
standard.jar
Problem pojawia się tylko i wyłącznie kiedy dodam do web.xml kod odpowiedzialny za spring security, czyli:
/WEB-INF/springapp-security.xml w parametrze contextConfigLocation
Próbowałem już chyba wszystkiego. Proszę o jakąkolwiek pomoc. Może brakuje mi jakiejś biblioteki?Łukasz Spaczyński edytował(a) ten post dnia 13.09.10 o godzinie 20:45