cancel
Showing results for 
Search instead for 
Did you mean: 

Tomcat Remote Debug not working

shukla_raghave
Champ in-the-making
Champ in-the-making
Hi,

I am new to activiti. I am unable to start Tomcat in debug mode. I added the property tomcat.enable.debug=true in setup/build.properties but still eclipse could not listen to port 8000. Although when i directly start Tomcat using

catalina jpda start

the debugging works fine and eclipse could listen to the port 8000. I am unable to follow what else needs to be done? Please help.
8 REPLIES 8

frederikherema1
Star Contributor
Star Contributor
SO you start your tomcat using the demo-setup script? I suggest, for serious projects, just using/stopping/starting your own tomcat, this way you can do whatever you want with it.

shukla_raghave
Champ in-the-making
Champ in-the-making
Yes for now i am using demo scripts. But i don't understand why is the following segment not executing

<target name="internal.tomcat.enable.debug" if="tomcat.enable.debug">
    <echo>Enabling tomcat remote debugging … </echo>
    <replace file="${tomcat.home}/bin/startup.sh">
      <replacetoken><![CDATA[exec "$PRGDIR"/"$EXECUTABLE" start "$@"]]></replacetoken>
      <replacevalue><![CDATA[exec "$PRGDIR"/"$EXECUTABLE" jpda start "$@"]]></replacevalue>
    </replace>
    <replace file="${tomcat.home}/bin/startup.bat">
      <replacetoken><![CDATA[call "%EXECUTABLE%" start %CMD_LINE_ARGS%]]></replacetoken>
      <replacevalue><![CDATA[call "%EXECUTABLE%" jpda start %CMD_LINE_ARGS%]]></replacevalue>
    </replace>
  </target>

when i have added the property - tomcat.enable.debug=true - to build.properties. I dont see the echo message Enabling Tomcat in remote… on the console.  But when i use
catalina.bat jpda startto start tomcat it works fine…Why so ?

frederikherema1
Star Contributor
Star Contributor
Looks like your changes to build.properties aren't picked up. Double-check that you editing the right file. If so, I really don't have a flu why it's not working. It's pretty straight-forward the build.xml.

Double-check you don't have a file at <property file="${user.home}/.activiti/build.properties" /> that states the opposite of the debug-true…

shukla_raghave
Champ in-the-making
Champ in-the-making
No i dont have a file at location : ${user.home}/.activiti/build.properties. Rather i cant even find any such folder by name .activiti.
I am making changes to setup\build.xml.

When and where is .activiti folder created. I am using Windows 7 and what i have found is that user.home refers to %userprofile% in windows. when i type echo %userprofile% in cmd i get a path like C:\users\<machine_name>. but at this path i dont see any folder like .activiti. Can you guess what could be the reason or suggest me something.

Thanks in advance

frederikherema1
Star Contributor
Star Contributor
The folder doesn't have to exist, it's just taken into account for build.xml… So you're editing the build.properties that is in the same folder as the build.xml?

shukla_raghave
Champ in-the-making
Champ in-the-making
Yes, i am editing the build.properties in same folder as build.xml

frederikherema1
Star Contributor
Star Contributor
No idea why it's not working… If you're stuck, just remove the -if="tomcat.enable.debug"- part in your build.xml Smiley Wink

shukla_raghave
Champ in-the-making
Champ in-the-making
probably i have figured out why it is not working . Its because of the value of default attribute of project tag i.e "demo.start" . if you see the script , demo.start target would not let target internal.tomcat.enable.debug execute. I am expecting this to be the reason not tested yet. But i expect this.

Ok i ahve tested, thats the reason now the change that i need to make is modify the target demo.start to add internal.tomcat.enable.debug to depends attribute

<target name="demo.start"
          description="Starts the demo setup and installs all components (if necessary)"
          depends="demo.install,
                   h2.start,
       internal.tomcat.enable.debug,
                   tomcat.start,
                   explorer.browser.open" />

Anyways thanks  Smiley Happy