开发者

What are the Steps for Debugging Java Web Application?

开发者 https://www.devze.com 2023-01-07 04:28 出处:网络
I joined a project which has been already developed and its an Web Application deployed on Tomcat Server.

I joined a project which has been already developed and its an Web Application deployed on Tomcat Server.

I have configured the Web Application on my local Tomcat Server and it is running fine. I want to start debugging the Application but I am not sure where to start from and 开发者_JS百科how to debug an Java Web Application from Eclipse and so my question is

Q: How to Debug Java Web Application which is running on Tomcat Server on Local Machine in Eclipse Environment {Pointers to useful resources or other steps would be highly appreciated}?


There are at least a couple of ways to do this:

  • A quick search turned up a tutorial to use remote debugging in eclipse with tomcat to connect eclipse to the java process running tomcat.
  • If you create your project as a Dynamic Web Project using eclipses Web Tools Platform plugin then you can deploy to and debug tomcat from within eclipse easily.


Just stop your server from normal start mode and click on debug mode. Soon, after the server shows debugging,synchronised, continue using the web apps as you do normally. But before that, you must provide breakpoints and you can see the results that you need.

Works for me.


I have had to do this a few times. Often it is not convenient to create a Dynamic web project to debug a web application in tomcat. This technique is fairly simple but requires some configuration in tomcat and then using Elcipse (or netbeans) to attach to tomcat when its running.

http://wiki.apache.org/tomcat/FAQ/Developing, in particular

How do I configure Tomcat to support remote debugging? and How do I remotely debug Tomcat using Eclipse?


First get the Java EE edition of Eclipse

You then need to have the Eclipse project containing the WEB-INF folder be a Dynamic Web Project. Then the full tooling becomes available and allow you to work with your projects inside any server including Tomcat. The trick is to locate the Server view pane, and right click to add a new Tomcat server adapter.

0

精彩评论

暂无评论...
验证码 换一张
取 消