Reputation: 1291
I have Spring-boot application which is built with Maven. When I deploy it with STS( Run as Spring Boot App) it works fine, but when I use IntelliJ Idea it doesn't work.
There is no error in log during deployment process. But when I try to refresh page I got this:
Whitelabel Error Page
This application has no explicit mapping for /error, so you are seeing this as a fallback. Mon Aug 04 14:48:38 CEST 2014 There was an unexpected error (type=Not Found, status=404).
I've added Spring module to project. After I added this I have added some XML's XML based configurations and my Application.java
class to Code based configurations.
I've changed logging to FINEST
and noticed that when I reload page there are some differences in logs between working and not working version.
Not working version
DEBUG [org.springframework.web.servlet.view.JstlView] - Forwarding to resource [/WEB-INF/jsp/layouts/default.jsp] in InternalResourceView 'layouts/default'
DEBUG [org.springframework.web.servlet.DispatcherServlet] - DispatcherServlet with name 'dispatcherServlet' processing GET request for [/WEB-INF/jsp/layouts/default.jsp]
DEBUG [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] - Looking up handler method for path /WEB-INF/jsp/layouts/default.jsp
DEBUG [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] - Did not find handler method for [/WEB-INF/jsp/layouts/default.jsp]
DEBUG [org.springframework.web.servlet.handler.SimpleUrlHandlerMapping] - Matching patterns for request [/WEB-INF/jsp/layouts/default.jsp] are [/**]
DEBUG [org.springframework.web.servlet.handler.SimpleUrlHandlerMapping] - URI Template variables for request [/WEB-INF/jsp/layouts/default.jsp] are {}
DEBUG [org.springframework.web.servlet.handler.SimpleUrlHandlerMapping] - Mapping [/WEB-INF/jsp/layouts/default.jsp] to HandlerExecutionChain with handler [org.springframework.web.servlet.resource.ResourceHttpRequestHandler@29a502a0] and 1 interceptor
DEBUG [org.springframework.web.servlet.DispatcherServlet] - Last-Modified value for [/WEB-INF/jsp/layouts/default.jsp] is: -1
DEBUG [org.springframework.web.servlet.resource.ResourceHttpRequestHandler] - Ignoring invalid resource path [WEB-INF/jsp/layouts/default.jsp]
DEBUG [org.springframework.web.servlet.resource.ResourceHttpRequestHandler] - No matching resource found - returning 404
DEBUG [org.springframework.web.servlet.DispatcherServlet] - Null ModelAndView returned to DispatcherServlet with name 'dispatcherServlet': assuming HandlerAdapter completed request handling
DEBUG [org.springframework.web.servlet.DispatcherServlet] - Successfully completed request
DEBUG [org.springframework.web.servlet.DispatcherServlet] - Successfully completed request
DEBUG [org.springframework.web.servlet.DispatcherServlet] - DispatcherServlet with name 'dispatcherServlet' processing GET request for [/error]
DEBUG [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] - Looking up handler method for path /error
DEBUG [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] - Returning handler method [public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest)]
DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Returning cached instance of singleton bean 'basicErrorController'
DEBUG [org.springframework.web.servlet.DispatcherServlet] - Last-Modified value for [/error] is: -1
DEBUG [org.springframework.web.servlet.view.ContentNegotiatingViewResolver] - Requested media types are [text/html, text/html;q=0.8] based on Accept header types and producible media types [text/html])
DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Returning cached instance of singleton bean 'error'
DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Invoking afterPropertiesSet() on bean with name 'error'
TRACE [class which inherates from UrlBasedViewResolver] - Cached view [error]
TRACE [class which inherates from UrlBasedViewResolver] - Cached view [error]
DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Invoking afterPropertiesSet() on bean with name 'error'
DEBUG [org.springframework.web.servlet.view.ContentNegotiatingViewResolver] - Returning [org.springframework.boot.autoconfigure.web.ErrorMvcAutoConfiguration$SpelView@758e2ae8] based on requested media type 'text/html'
DEBUG [org.springframework.web.servlet.DispatcherServlet] - Rendering view [org.springframework.boot.autoconfigure.web.ErrorMvcAutoConfiguration$SpelView@758e2ae8] in DispatcherServlet with name 'dispatcherServlet'
DEBUG [org.springframework.web.servlet.DispatcherServlet] - Successfully completed request
Working version
DEBUG [org.springframework.web.servlet.view.JstlView] - Forwarding to resource [/WEB-INF/jsp/layouts/default.jsp] in InternalResourceView 'layouts/default'
INFO [org.apache.jasper.compiler.TldLocationsCache] - At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
DEBUG [org.springframework.web.servlet.DispatcherServlet] - Successfully completed request
DEBUG [org.springframework.web.servlet.DispatcherServlet] - DispatcherServlet with name 'dispatcherServlet' processing GET request for [/bootstrap/css/bootstrap.min.css]
DEBUG [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] - Looking up handler method for path /bootstrap/css/bootstrap.min.css
DEBUG [org.springframework.web.servlet.DispatcherServlet] - DispatcherServlet with name 'dispatcherServlet' processing GET request for [/css/bootstrap-fix.css]
DEBUG [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] - Looking up handler method for path /css/bootstrap-fix.css
DEBUG [org.springframework.web.servlet.DispatcherServlet] - DispatcherServlet with name 'dispatcherServlet' processing GET request for [/bootstrap/js/bootstrap.min.js]
DEBUG [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] - Looking up handler method for path /bootstrap/js/bootstrap.min.js
DEBUG [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] - Did not find handler method for [/bootstrap/css/bootstrap.min.css]
DEBUG [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] - Did not find handler method for [/css/bootstrap-fix.css]
DEBUG [org.springframework.web.servlet.handler.SimpleUrlHandlerMapping] - Matching patterns for request [/css/bootstrap-fix.css] are [/**]
DEBUG [org.springframework.web.servlet.handler.SimpleUrlHandlerMapping] - URI Template variables for request [/css/bootstrap-fix.css] are {}
DEBUG [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] - Did not find handler method for [/bootstrap/js/bootstrap.min.js]
DEBUG [org.springframework.web.servlet.handler.SimpleUrlHandlerMapping] - Matching patterns for request [/bootstrap/js/bootstrap.min.js] are [/**]
DEBUG [org.springframework.web.servlet.handler.SimpleUrlHandlerMapping] - URI Template variables for request [/bootstrap/js/bootstrap.min.js] are {}
DEBUG [org.springframework.web.servlet.handler.SimpleUrlHandlerMapping] - Matching patterns for request [/bootstrap/css/bootstrap.min.css] are [/**]
DEBUG [org.springframework.web.servlet.handler.SimpleUrlHandlerMapping] - URI Template variables for request [/bootstrap/css/bootstrap.min.css] are {}
DEBUG [org.springframework.web.servlet.handler.SimpleUrlHandlerMapping] - Mapping [/css/bootstrap-fix.css] to HandlerExecutionChain with handler [org.springframework.web.servlet.resource.ResourceHttpRequestHandler@ff47cbc] and 1 interceptor
DEBUG [org.springframework.web.servlet.DispatcherServlet] - Last-Modified value for [/css/bootstrap-fix.css] is: -1
DEBUG [org.springframework.web.servlet.resource.ResourceHttpRequestHandler] - Trying relative path [css/bootstrap-fix.css] against base location: ServletContext resource [/]
DEBUG [org.springframework.web.servlet.resource.ResourceHttpRequestHandler] - Trying relative path [css/bootstrap-fix.css] against base location: class path resource [META-INF/resources/]
DEBUG [org.springframework.web.servlet.resource.ResourceHttpRequestHandler] - Trying relative path [css/bootstrap-fix.css] against base location: class path resource [resources/]
DEBUG [org.springframework.web.servlet.resource.ResourceHttpRequestHandler] - Trying relative path [css/bootstrap-fix.css] against base location: class path resource [static/]
DEBUG [org.springframework.web.servlet.resource.ResourceHttpRequestHandler] - Found matching resource: class path resource [static/css/bootstrap-fix.css]
DEBUG [org.springframework.web.servlet.resource.ResourceHttpRequestHandler] - Determined media type 'text/css' for class path resource [static/css/bootstrap-fix.css]
DEBUG [org.springframework.web.servlet.handler.SimpleUrlHandlerMapping] - Mapping [/bootstrap/css/bootstrap.min.css] to HandlerExecutionChain with handler [org.springframework.web.servlet.resource.ResourceHttpRequestHandler@ff47cbc] and 1 interceptor
DEBUG [org.springframework.web.servlet.DispatcherServlet] - Last-Modified value for [/bootstrap/css/bootstrap.min.css] is: -1
DEBUG [org.springframework.web.servlet.handler.SimpleUrlHandlerMapping] - Mapping [/bootstrap/js/bootstrap.min.js] to HandlerExecutionChain with handler [org.springframework.web.servlet.resource.ResourceHttpRequestHandler@ff47cbc] and 1 interceptor
DEBUG [org.springframework.web.servlet.DispatcherServlet] - Last-Modified value for [/bootstrap/js/bootstrap.min.js] is: -1
DEBUG [org.springframework.web.servlet.resource.ResourceHttpRequestHandler] - Trying relative path [bootstrap/css/bootstrap.min.css] against base location: ServletContext resource [/]
DEBUG [org.springframework.web.servlet.resource.ResourceHttpRequestHandler] - Trying relative path [bootstrap/css/bootstrap.min.css] against base location: class path resource [META-INF/resources/]
DEBUG [org.springframework.web.servlet.resource.ResourceHttpRequestHandler] - Trying relative path [bootstrap/css/bootstrap.min.css] against base location: class path resource [resources/]
DEBUG [org.springframework.web.servlet.resource.ResourceHttpRequestHandler] - Trying relative path [bootstrap/css/bootstrap.min.css] against base location: class path resource [static/]
DEBUG [org.springframework.web.servlet.resource.ResourceHttpRequestHandler] - Found matching resource: class path resource [static/bootstrap/css/bootstrap.min.css]
DEBUG [org.springframework.web.servlet.resource.ResourceHttpRequestHandler] - Determined media type 'text/css' for class path resource [static/bootstrap/css/bootstrap.min.css]
DEBUG [org.springframework.web.servlet.resource.ResourceHttpRequestHandler] - Trying relative path [bootstrap/js/bootstrap.min.js] against base location: ServletContext resource [/]
DEBUG [org.springframework.web.servlet.resource.ResourceHttpRequestHandler] - Trying relative path [bootstrap/js/bootstrap.min.js] against base location: class path resource [META-INF/resources/]
DEBUG [org.springframework.web.servlet.resource.ResourceHttpRequestHandler] - Trying relative path [bootstrap/js/bootstrap.min.js] against base location: class path resource [resources/]
DEBUG [org.springframework.web.servlet.resource.ResourceHttpRequestHandler] - Trying relative path [bootstrap/js/bootstrap.min.js] against base location: class path resource [static/]
DEBUG [org.springframework.web.servlet.resource.ResourceHttpRequestHandler] - Found matching resource: class path resource [static/bootstrap/js/bootstrap.min.js]
DEBUG [org.springframework.web.servlet.resource.ResourceHttpRequestHandler] - Determined media type 'application/javascript' for class path resource [static/bootstrap/js/bootstrap.min.js]
DEBUG [org.springframework.web.servlet.DispatcherServlet] - Null ModelAndView returned to DispatcherServlet with name 'dispatcherServlet': assuming HandlerAdapter completed request handling
DEBUG [org.springframework.web.servlet.DispatcherServlet] - Successfully completed request
DEBUG [org.springframework.web.servlet.DispatcherServlet] - Null ModelAndView returned to DispatcherServlet with name 'dispatcherServlet': assuming HandlerAdapter completed request handling
DEBUG [org.springframework.web.servlet.DispatcherServlet] - Successfully completed request
DEBUG [org.springframework.web.servlet.DispatcherServlet] - Null ModelAndView returned to DispatcherServlet with name 'dispatcherServlet': assuming HandlerAdapter completed request handling
DEBUG [org.springframework.web.servlet.DispatcherServlet] - Successfully completed request
DEBUG [org.springframework.web.servlet.DispatcherServlet] - DispatcherServlet with name 'dispatcherServlet' processing GET request for [/javascript/jquery-1.8.3.min.js]
DEBUG [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] - Looking up handler method for path /javascript/jquery-1.8.3.min.js
DEBUG [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] - Did not find handler method for [/javascript/jquery-1.8.3.min.js]
DEBUG [org.springframework.web.servlet.handler.SimpleUrlHandlerMapping] - Matching patterns for request [/javascript/jquery-1.8.3.min.js] are [/**]
DEBUG [org.springframework.web.servlet.handler.SimpleUrlHandlerMapping] - URI Template variables for request [/javascript/jquery-1.8.3.min.js] are {}
DEBUG [org.springframework.web.servlet.handler.SimpleUrlHandlerMapping] - Mapping [/javascript/jquery-1.8.3.min.js] to HandlerExecutionChain with handler [org.springframework.web.servlet.resource.ResourceHttpRequestHandler@ff47cbc] and 1 interceptor
DEBUG [org.springframework.web.servlet.DispatcherServlet] - Last-Modified value for [/javascript/jquery-1.8.3.min.js] is: -1
DEBUG [org.springframework.web.servlet.resource.ResourceHttpRequestHandler] - Trying relative path [javascript/jquery-1.8.3.min.js] against base location: ServletContext resource [/]
DEBUG [org.springframework.web.servlet.resource.ResourceHttpRequestHandler] - Trying relative path [javascript/jquery-1.8.3.min.js] against base location: class path resource [META-INF/resources/]
DEBUG [org.springframework.web.servlet.resource.ResourceHttpRequestHandler] - Trying relative path [javascript/jquery-1.8.3.min.js] against base location: class path resource [resources/]
DEBUG [org.springframework.web.servlet.resource.ResourceHttpRequestHandler] - Trying relative path [javascript/jquery-1.8.3.min.js] against base location: class path resource [static/]
DEBUG [org.springframework.web.servlet.resource.ResourceHttpRequestHandler] - Found matching resource: class path resource [static/javascript/jquery-1.8.3.min.js]
DEBUG [org.springframework.web.servlet.resource.ResourceHttpRequestHandler] - Determined media type 'application/javascript' for class path resource [static/javascript/jquery-1.8.3.min.js]
DEBUG [org.springframework.web.servlet.DispatcherServlet] - Null ModelAndView returned to DispatcherServlet with name 'dispatcherServlet': assuming HandlerAdapter completed request handling
DEBUG [org.springframework.web.servlet.DispatcherServlet] - Successfully completed request
Class which is giving some error inherates from UrlBasedViewResolver
, but I have no idea what can I do with that. Cached view [error]
gives me no clue.
What might cause this problems?
EDIT
I forgot to mention:
STS 3.5.1
IntelliJ Idea 13.1
Upvotes: 2
Views: 4739
Reputation: 7126
STS has a number of Eclipse plugins that you won't find in IntelliJ. To get a Spring Boot application running from IntelliJ, you need to create a Maven run configuration with the command "spring-boot:run" and make sure it points at the correct module, if your app has multiple modules in it.
Upvotes: 5