Java 使用 Eclipse 和 Tomcat 问题调试 Spring MVC
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/21794633/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Debug Spring MVC with eclipse and Tomcat issue
提问by user3221155
I have deployed a Spring MVC application on Tomcat server(eclipse IDE). The application comes up fine but some data is added to list.So wanted to debug . I have added debug points and did "Debug on server" ,the server started in debug mode but it says : Source not found.in the debug view.The control doesnot come to code in application code.
我已经在 Tomcat 服务器(eclipse IDE)上部署了一个 Spring MVC 应用程序。应用程序运行良好,但一些数据被添加到列表中。所以想调试。我添加了调试点并执行了“在服务器上调试”,服务器以调试模式启动,但它说:源未找到。在调试视图中。控件没有在应用程序代码中编码。
Very new to java programming , so I am sure not what i have asked is a silly question .Please help me.Let me know if i need more details.
对 Java 编程非常陌生,所以我确定我问的不是一个愚蠢的问题。请帮助我。如果我需要更多详细信息,请告诉我。
Note I donot use maven or anything like that.
注意我不使用 maven 或类似的东西。
Thanks Siddhi
谢谢悉地
回答by manish
Follow the steps given below:
请按照以下步骤操作:
- Start the Tomcat server instance from within Eclipse;
- After the server instance has started, open the Debug view. Make sure that the running threads of the application are visible in the view in a hierarchical tree-like structure. The application name should be at the top in this hierarchy;
- Stop the Tomcat server instance. The name of the application should still be visible in the Debug view;
- Right click the application name and choose Edit Source Lookup;
- Select the application root directory as one of the locations where Eclipse should look for the source code;
- Start Tomcat server instance again.
- 从 Eclipse 中启动 Tomcat 服务器实例;
- 服务器实例启动后,打开调试视图。确保应用程序的运行线程在分层树状结构的视图中可见。应用程序名称应位于此层次结构的顶部;
- 停止 Tomcat 服务器实例。应用程序的名称仍应在 Debug 视图中可见;
- 右键单击应用程序名称并选择“编辑源查找”;
- 选择应用程序根目录作为 Eclipse 查找源代码的位置之一;
- 再次启动Tomcat 服务器实例。
After the instance has come up, you should be able to debug your source code just fine.
实例启动后,您应该能够很好地调试源代码。