0

Now I have seen questions just like this on here but the answers were a bit confusing for me. I have a Struts2 application I am currently running on a Tomcat servlet. I am having an issue in one of my action classes and can't seem to debug it correctly - it just skips around the class and goes inside if statements that should not have been validated.

I think my issue is that I did not have Tomcat in debugging mode. I installed a JDK and am now trying to figure out how to set up Tomcat to debug. I found a couple posts on here talking about a Catalina.bat file - but I do not have one in my tomcat folder - I wanted to comment on the post and ask but don't have enough reputation to do so yet.

EDIT: this is the link I was talking about, sorry for the poor formating How to start debug mode from command prompt for apache tomcat server?

Community
  • 1
  • 1
Guenevere
  • 75
  • 1
  • 10
  • Are you sure that Tomcat is running the code you are seeing? Sometimes you don't clean the project properly and the war generated does not change, then, on Eclipse (or wherever you are debugging), you will see the new lines, but the code run will be the old. – luanjot Jun 26 '14 at 15:03
  • Do you want to setup a remote debugging? Also spell it correctly, because nobody understand what are talking. – Roman C Jun 26 '14 at 15:04
  • The famous TOmCat serlet Dubugging problem. – Andrea Ligios Jun 26 '14 at 15:11
  • I didn't realize one capitalization accident was a big deal - I fixed it. Yes, I would like to set up remote debugging Roman C. and luanjot - when you say clean the project properly that is a good point I will check into it. – Guenevere Jun 26 '14 at 15:14
  • @Guenevere the capitalization is the minor. Dubug -> debug, serlet -> server ? Then you said you have seen some related answers you can't comment due to low rep, and you have not linked them in the question. Take your time to write a question understandable, invest a bit of effort to get a better help. Would you be able to answer a question like this written by another guy ? You may be interested in reading this post from Jon Skeet: http://msmvps.com/blogs/jon_skeet/archive/2010/08/29/writing-the-perfect-question.aspx – Andrea Ligios Jun 26 '14 at 15:19
  • Andrea - you are right I am sorry I was a bit aggressive, I'll edit it and include the link – Guenevere Jun 26 '14 at 16:00

1 Answers1

0

To start your tomcat in debug mode you need enable JPDA (Java Platform Debugger Architecture) as you might have figured in different articles you looked in. Here is another post which tells you what you need to post that describes the same.

How to start debug mode from command prompt for apache tomcat server?

As far as Catalina.bat is concerned, it's an executable file and like any other Java projects (example maven or ant), all executable are generally in bin folder under home directory. For Tomcat look in CATALINA_HOME\bin folder.

Community
  • 1
  • 1
user2866507
  • 166
  • 2
  • 5