0

As said in the title, My application is using SpringMVC and apache Tiles 3. It works fine when run in server in eclipse IDE but when I export a war file and deploy it in the standalone tomcat instance, it deploys Ok but when I access it I have the following exception. (Note that the server in eclipse is the same where I deploy my webapp).

> exception
> 
> javax.servlet.ServletException: Could not resolve view with name
> 'login' in servlet with name 'dispatcher'
>   org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1208)
>   org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1012)
>   org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959)
>   org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:876)
>   org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961)
>   org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:852)
>   javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
>   org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837)
>   javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
>   org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
>   org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
>   org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118)
>   org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84)
>   org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
>   org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
>   org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
>   org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:103)
>   org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
>   org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)
>   org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
>   org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:154)
>   org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
>   org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)
>   org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
>   org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:199)
>   org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
>   org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:110)
>   org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
>   org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:50)
>   org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:108)
>   org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
>   org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
>   org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
>   org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)
>   org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)
>   org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:344)
>   org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:261)
>   org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
>   org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:108)

Update : Thanks a lot @Fredlo2010. I already saw the link you mentionned

here is my web.xml file

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0">
  <display-name>Project</display-name>
  <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
  </welcome-file-list>
  <servlet>
    <servlet-name>dispatcher</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>dispatcher</servlet-name>
    <url-pattern>/</url-pattern>
  </servlet-mapping>
</web-app>

and the jstl dependency is already in pom.xml file

In one of the answers, one pointed that the project location could be a problem if it contains space and if jetty is combined with apache tiles and spring's view resolver which is not my case. However and to eliminate any doubt, I think that I should give it a try. Now I wonder where should I change my project location to a path with no space in it. Any help whould be much appreciable.

what am I doing wrong? thank you in advance.

Asma
  • 37
  • 8
  • It seems that the "login" page is not been discovered. See https://stackoverflow.com/questions/23447095/java-spring-apache-tiles-error-could-not-resolve-view-with-name-index-in-s –  Jun 30 '17 at 11:33
  • In Eclipse, I changed the deploy path from the first option which was workspace metadata to be tomcat installation. Now i've got the same exception. Do you have an idea? – Asma Jun 30 '17 at 11:33

1 Answers1

0

I can't confirm if it is caused by the space in the project location path but the upgrade from Apache Tiles 3.0.3 to 3.0.5 solved my problem.

Maybe that could help sombody facing the same issue

Asma
  • 37
  • 8