简体   繁体   English

如何调试Spring MVC tomcat应用程序?

[英]How to debug Spring MVC tomcat application?

I am trying a spring MVC application on tomcat server.. 我正在tomcat服务器上尝试Spring MVC应用程序。

I am always getting the error as resource not found( please see the question if you have time )..I think there is some problem with the view resolver.. 我总是收到找不到资源的错误( 如果有时间请查看问题 )。我认为视图解析器存在一些问题。

I want debug this application to know where i am doing wrong... 我想调试此应用程序以了解我在哪里做错了...

Is that possible? 那可能吗?

I don't know if it is a lame question for senior developers :) 对于高级开发人员,我不知道这是一个la脚的问题:)

If you are using Eclipse, you can add Tomcat runtime in preferences and add new server in servers view in eclipse. 如果使用的是Eclipse,则可以在首选项中添加Tomcat运行时,并在Eclipse的服务器视图中添加新服务器。 Then you can run the server in debug mode. 然后,您可以在调试模式下运行服务器。

Also you can attach source code for jar files(in your case spring jars) in eclipse so that when you debug it will load proper source files. 您还可以在eclipse中附加jar文件(在您的情况下为spring jar)的源代码,以便在调试时将加载正确的源文件。

I would set the logging level of DispatcherServlet to DEBUG and see what it says. 我将DispatcherServlet的日志记录级别设置为DEBUG,然后查看其内容。 Spring contains mostly good logging at DEBUG level to tell you what's going on (despite that it's INFO level is nigh-useless). Spring在DEBUG级别上包含的日志大多不错,可以告诉您发生了什么(尽管INFO级别几乎没有用)。

If DispatcherServlet 's logging doesn't say much, try some of the other classes you have configured in your application (do one at a time or you'll get overwhelmed with log messages) 如果DispatcherServlet的日志记录不多,请尝试在应用程序中配置的其他一些类(一次执行一次,否则日志消息将使您不知所措)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM