Hi Experts,
I am seriously frustrated in solving my issue with j_spring_security_check while logging into server.
In my local windows laptop: I use windows7 , eclipse indigo as IDE, and my application ADMIN works beautifully and logging in as expected into login.jsp page. Now i am happy to move this on to linux server.
Linux Server : Now the issue begins. When i tried to login on server the following is exaclty the error message.
The requested URL /ADMIN/j_spring_security_check was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
------------------------------------------------------------------------------------------
Attaching 3 files below.
--- web.xml
<display-name>ADMIN</display-name>
<!-- log4j configuration -->
<context-param>
<param-name>log4jConfigLocation</param-name>
<param-value>/WEB-INF/classes/log4j.properties</param-value>
</context-param>
<!-- log4j configuration -->
<!-- Security configuration -->
<filter>
<filter-name>springSecurityFilterChain</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFil terProxy</filter-class>
</filter>
<filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>FORWARD</dispatcher>
<dispatcher>INCLUDE</dispatcher>
<dispatcher>REQUEST</dispatcher>
</filter-mapping>
<!-- Site Mesh configuation -->
<filter>
<filter-name>sitemesh</filter-name>
<filter-class>com.opensymphony.sitemesh.webapp.SiteMeshFil ter</filter-class>
</filter>
<filter-mapping>
<filter-name>sitemesh</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<!-- Struts 2 configuration. -->
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.Stru tsPrepareAndExecuteFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<!-- Spring context loader. -->
<listener>
<listener-class>org.springframework.web.context.ContextLoade rListener</listener-class>
</listener>
<!-- Struts listener -->
<listener>
<listener-class>org.apache.struts2.dispatcher.ng.listener.St rutsListener</listener-class>
</listener>
<!--
Publishes events for session creation and destruction through the application context.
Optional unless concurrent session control is being used.
-->
<listener>
<listener-class>org.springframework.security.web.session.Htt pSessionEventPublisher</listener-class>
</listener>
<session-config>
<session-timeout>10</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
<!-- <welcome-file>login.jsp</welcome-file> -->
</welcome-file-list>
</web-app>
-----------------------------------------------------------------------------------------------------------
Now -- spring-security.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns:security="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/schem...-beans-3.0.xsd
http://www.springframework.org/schema/security http://www.springframework.org/schem...curity-3.1.xsd ">
<!--<security:debug /> -->
<security:global-method-security pre-post-annotations="enabled">
<!-- AspectJ pointcut expression that locates our "post" method and applies
security that way <protect-pointcut expression="execution(* bigbank.*Service.post*(..))"
access="ROLE_TELLER"/> -->
</security:global-method-security>
<security:http pattern="/timeout.jsp" security="none" />
<security:http use-expressions="true" >
<securityort-mappings>
<securityort-mapping http="8080" https="8443"/>
</securityort-mappings>
<security:intercept-url pattern="/secure/**" access="isAuthenticated()" method="POST" />
<!-- Allow all other requests. In a real application you should adopt a whitelisting approach where access is not allowed by default -->
<security:intercept-url pattern="/**" access="permitAll" />
<security:form-login authentication-failure-url="/login.jsp?login_error=1" default-target-url="/demolink.action" />
<security:logout logout-success-url="/login.jsp" delete-cookies="JSESSIONID" />
<!-- Uncomment to limit the number of sessions a user can have -->
<security:session-management invalid-session-url="/timeout.jsp">
<security:concurrency-control
max-sessions="1" error-if-maximum-exceeded="true" />
</security:session-management>
</security:http>
<security:authentication-manager>
<security:authentication-provider user-service-ref="customUserDetailsService"/>
</security:authentication-manager>
</beans:beans>
---------------------------------------------------------------------------------------------------
Now login.jsp
<form action="<%=request.getContextPath()%>/j_spring_security_check" method="post" onsubmit="javascript:onSubmit()">
<input type="hidden" value="" name="j_password" />
<div class="full_width">
<label class="cont_lbl">User Name </label>
<input type="text" name="j_username" value="" size="56" class="da_in_text"/>
</div>
<div class="full_width">
<label class="cont_lbl">Password </label>
<input type="password" value="" name="j_password_1" size="56" class="da_in_text" />
</div>
<div class="full_width">
<input class="cont_sub_btn" type="submit" value="Submit" />
</div>
</form>
-----------------------------------------------------------------------------------------------------------
Please help me in solving my issue on server.
I apprecite it in advance.
Thank you.
Satyeah.


ort-mappings>
Reply With Quote
