Hi,

i got a weird behaviour i dont understand.
I have two machines with an almost similar setup (win7, eclipse juno,
tomcat 7). I set up a project contaning spring3, jsf2 (apache myfaces
implementation), pretty faces, hibernate and some more.
Both machines share the some source code (eclipse project) via github.

Now if i open the link:
http://localhost:8080/jeiwomisa/auth/login.xhtml on my laptop
everything works as expected, i can see the login page.
But if i open it on my workstation i get: HTTP Status 404 -
/auth/login.xhtml: /auth/login.xhtml Not Found in ExternalContext as a
Resource

The same goes vice versa, if i open:
http://localhost:8080/jeiwomisa/faces/auth/login.xhtml (note the
"/faces/" in the path) on my workstation it works and i see the login
page and if i open the same link on my laptop i get the:  HTTP Status
404 - /auth/login.xhtml: /auth/login.xhtml Not Found in
ExternalContext as a Resource error.

This is my web.xml:
<context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>/WEB-INF/spring/root-context.xml</param-value>
</context-param>
<listener>
    
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>

<listener>
    
<listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
</listener>


<!-- -->
<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>appServlet</servlet-name>
    
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <init-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>/WEB-INF/spring/app/servlet-context.xml</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
    <servlet-name>appServlet</servlet-name>
    <url-pattern>/</url-pattern>
</servlet-mapping>

<!-- pretty faces -->

<filter>
    <filter-name>Pretty Filter</filter-name>
    <filter-class>com.ocpsoft.pretty.PrettyFilter</filter-class>
</filter>

<filter-mapping>
    <filter-name>Pretty Filter</filter-name>
    <url-pattern>/*</url-pattern>
    <dispatcher>FORWARD</dispatcher>
    <dispatcher>REQUEST</dispatcher>
    <dispatcher>ERROR</dispatcher>
</filter-mapping>


<context-param>
    <param-name>com.ocpsoft.pretty.BASE_PACKAGES</param-name>
    <param-value>de.sveri.jeiwomisa.managed</param-value>
</context-param>

<!-- Project Stage Level -->
<context-param>
    <param-name>javax.faces.PROJECT_STAGE</param-name>
    <param-value>Development</param-value>
</context-param>

<!-- JSF Servlet is defined to container -->
<servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
</servlet>

<servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.xhtml</url-pattern>
</servlet-mapping>
<context-param>
    <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
    <param-value>client</param-value>
</context-param>


And this is my security-app-context.xml where the login path is defined:
<http use-expressions="true" auto-config="true">
    <intercept-url pattern="/test/**" access="permitAll" />
    <intercept-url pattern="/tasks/**" access="isAuthenticated()" />

    <!-- <intercept-url pattern="/**" access="denyAll" /> -->
    <form-login login-page="/auth/login.xhtml" />
</http>

<context:annotation-config />
<b:bean id="userRepositoryImpl"
class="de.sveri.jeiwomisa.model.UserRepositoryImpl"
    autowire="byType">
</b:bean>

<b:bean id="passwordEncoder"
    
class="org.springframework.security.crypto.password.StandardPasswordEncoder">
</b:bean>


<authentication-manager>
    <authentication-provider user-service-ref="userRepositoryImpl">
            <password-encoder hash="md5" />
    </authentication-provider>
</authentication-manager>


The same behaviour happens for other paths too.
I am not really sure if this is a jsf problem or something else. So
i'd appreciate any pointer for this.

Best Regards,
Sven

Reply via email to