在STS中部署的Spring启动应用程序运行良好,但在IntelliJ Idea中没有

时间:2014-08-04 13:16:26

标签: spring maven intellij-idea spring-boot spring-tool-suite

我有使用Maven构建的Spring-boot应用程序。当我使用STS( Run as Spring Boot App )部署它时,它工作正常,但是当我使用IntelliJ Idea时它不起作用。

在部署过程中,日志中没有错误。但是当我尝试刷新页面时,我得到了这个:

  

Whitelabel错误页面

     

这个应用程序没有/ error的显式映射,所以你看到了   这是一个后备。 Mon Aug 04 14:48:38 CEST 2014有一个   意外错误(type = Not Found,status = 404)。

我已将Spring模块添加到项目中。在我添加了这个之后,我添加了一些XML的基于XML的配置和我的Application.java类到基于代码的配置

我已将记录更改为FINEST,并注意到当我重新加载页面时,工作版本与不工作版本之间的日志存在一些差异。

版本不正常

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

工作版

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

UrlBasedViewResolver给出一些错误的类,但我不知道我该怎么做。 Cached view [error]没有给我任何线索。

什么可能导致这个问题?

修改

我忘了提及:

STS 3.5.1

IntelliJ Idea 13.1

1 个答案:

答案 0 :(得分:5)

STS有许多你在IntelliJ中找不到的Eclipse插件。要从IntelliJ运行Spring Boot应用程序,您需要使用命令" spring-boot:run"创建Maven运行配置。如果你的应用中有多个模块,请确保它指向正确的模块。