debugging with ANT
posted 19 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Guys,
(newbie to ANT) I wonder if it is possible to debug a sturts application with ANT? is there any target I need to add to single tomcat that it's a debug mode
thanks
(newbie to ANT) I wonder if it is possible to debug a sturts application with ANT? is there any target I need to add to single tomcat that it's a debug mode
thanks
posted 19 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Some IDE's (such as Eclipse) have Ant debuggers. However these are for debugging the build itself. Using Ant to debug a Struts application though can't be done - Ant is not an IDE.
Peter Primrose
Ranch Hand
Posts: 755
posted 19 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
I guess I�ve explained myself incorrectly:
Let me try again:
I'm using eclipse. I'm building a struts application. I'm using ANT to do all the compile,debug,deploy...
Now, say I want to check the flow of events when an Action is preformed - how can I do that?
I tried to place a breakpoint on that specific Action - and when running the application (with ant) the application did not stop at the breakpoint.
My question: how to stop the application at a specific breakpoint and look at the code.
Thanks
Let me try again:
I'm using eclipse. I'm building a struts application. I'm using ANT to do all the compile,debug,deploy...
Now, say I want to check the flow of events when an Action is preformed - how can I do that?
I tried to place a breakpoint on that specific Action - and when running the application (with ant) the application did not stop at the breakpoint.
My question: how to stop the application at a specific breakpoint and look at the code.
Thanks
posted 19 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
You first have to start tomcat in debug mode. Since you are using ant to start the server you will have to modify the build.xml file so that appropriate parameters are passed to tomcat during start up.
Search for the target in your build.xml and add the parameters
<target name="tomcat-start-debug">
<java jar="${tomcat.home}/bin/bootstrap.jar" fork="true">
<jvmarg value="-Dcatalina.home=${tomcat.home}"/>
<jvmarg value="-Xdebug"/>
<jvmarg
value="-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n"/>
</java>
</target>
Search for the target in your build.xml and add the parameters
<target name="tomcat-start-debug">
<java jar="${tomcat.home}/bin/bootstrap.jar" fork="true">
<jvmarg value="-Dcatalina.home=${tomcat.home}"/>
<jvmarg value="-Xdebug"/>
<jvmarg
value="-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n"/>
</java>
</target>
Peter Primrose
Ranch Hand
Posts: 755
posted 19 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
mmmm....ok this is a good start.
how do you configure tomcat to run in debug mode (using tomcat 5.0)?
I get this message with Ant:
I notice my eclipse: window-prefnces-romcat-jvm settings is configured to jre1.5.0_06, isn't that J2SE 5.0???
I also set the project-prefrences-java build path-libraries to use jre1.5.0

how do you configure tomcat to run in debug mode (using tomcat 5.0)?
I get this message with Ant:
I notice my eclipse: window-prefnces-romcat-jvm settings is configured to jre1.5.0_06, isn't that J2SE 5.0???
I also set the project-prefrences-java build path-libraries to use jre1.5.0

Anay Nayak
Greenhorn
Posts: 26
posted 19 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
I guess you are running the ant target directly from eclipse. In that case, select the target, in run menu select "Run..." and then in the JRE tab select the JVM you want to use.
Peter Primrose
Ranch Hand
Posts: 755
posted 19 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
thank you Anay. I'm getting there (almost)
few things:
1. Yes, I'm using eclipse.
2. I'm using Tomcat 5.5 - I have the small icon next to the clock and I set it as: Start Service (should I do it from eclipse ANT???)
When Runnnig ANT (now after fixing the problem with the J2SE5.0)
I get this message:
( i googled for 2hr the error: class file has wrong version 49.0, should be 48.0....still don't get it...I'm using 1.5 in the project??)
few things:
1. Yes, I'm using eclipse.
2. I'm using Tomcat 5.5 - I have the small icon next to the clock and I set it as: Start Service (should I do it from eclipse ANT???)
When Runnnig ANT (now after fixing the problem with the J2SE5.0)
I get this message:
( i googled for 2hr the error: class file has wrong version 49.0, should be 48.0....still don't get it...I'm using 1.5 in the project??)
posted 19 years ago
Looks like you can't run Tomcat from Ant because there is something else using a port it needs. I'd guess it is another instance of Tomcat you've forgotten to stop. Check to see if that is the case.
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
java.net.BindException: Address already in use: JVM_Bind:8080
Looks like you can't run Tomcat from Ant because there is something else using a port it needs. I'd guess it is another instance of Tomcat you've forgotten to stop. Check to see if that is the case.
Peter Primrose
Ranch Hand
Posts: 755
posted 19 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
right! I had it running twice.
what does this error mean?
what does this error mean?
posted 19 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Just curious --
If you're in Eclipse, why are you using Ant to start/stop Tomcat? Is that a requirement for your project?
Why don't you use the Servers view and define a Tomcat instance in that and use that to stop and start Tomcat? It's far easier and allows you to stop/start/restart it in either debug or normal mode on demand independantly of your Ant script.
If you're in Eclipse, why are you using Ant to start/stop Tomcat? Is that a requirement for your project?
Why don't you use the Servers view and define a Tomcat instance in that and use that to stop and start Tomcat? It's far easier and allows you to stop/start/restart it in either debug or normal mode on demand independantly of your Ant script.
Peter Primrose
Ranch Hand
Posts: 755
posted 19 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
no it's not a requirment. I don't stop/start tomcat. I redeploy.
What I'm trying to get here is deployment AND debugging.
I get the deployment well but not debugging.
I fixed the class file has wrong version 49.0, should be 48.0 with the ANT jars (from eclipse).
anyhow, the result of the ANT is below BUT I cann't debug
What I'm trying to get here is deployment AND debugging.
I get the deployment well but not debugging.
I fixed the class file has wrong version 49.0, should be 48.0 with the ANT jars (from eclipse).
anyhow, the result of the ANT is below BUT I cann't debug
Anay Nayak
Greenhorn
Posts: 26
posted 19 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
In your last log file i can see two errors
1) SEVERE: Parse Error at line 49 column 17: The content of element type "struts-config" must match
Your struts-config file has some errors. Remove those errors.
2) You are possibly running two instances again! I hope you are only using the ant script now...and not the "start service" button . The ant task only starts tomcat. It doesnt shut it down.
1) SEVERE: Parse Error at line 49 column 17: The content of element type "struts-config" must match
Your struts-config file has some errors. Remove those errors.
2) You are possibly running two instances again! I hope you are only using the ant script now...and not the "start service" button . The ant task only starts tomcat. It doesnt shut it down.
Peter Primrose
Ranch Hand
Posts: 755
posted 19 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
OK.............
This case is closes!!! THANK YOU ALL!!!
Yes, Anay, you were right...I realized that once again 2 inst where running. I also realized that some settings had to be done in ECLIPSE - tomcat section!
anyway Thanks again!!! it works....now the real job :-)

This case is closes!!! THANK YOU ALL!!!
Yes, Anay, you were right...I realized that once again 2 inst where running. I also realized that some settings had to be done in ECLIPSE - tomcat section!
anyway Thanks again!!! it works....now the real job :-)
| Try 100 things. 2 will work out, but you will never know in advance which 2. This tiny ad might be one: The new gardening playing cards kickstarter is now live! https://www.kickstarter.com/projects/paulwheaton/garden-cards |








