I wanted to set up remote debugging from Eclipse. Tomcat is running as a service on windows.
That bit is fine, a quick google pointed me towards the correct settings to add to wrapper.conf to enable this. There were entries already in wrapper.conf, so I copy/pasted the last entry and modified it:
wrapper.java.additional.8="-Djava.endorsed.dirs=C:/Program Files/OurApp/tomcat/common/endorsed"
wrapper.java.additional.8.stripquotes=TRUE
wrapper.java.additional.9="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=9135,suspend=n"
wrapper.java.additional.9.stripquotes=TRUE
It didn't work, because the quotes are around everything, and the stripquotes only applies to linux systems.
Theoretically the correct entries should be:
wrapper.java.additional.8=-Djava.endorsed.dirs="C:/Program Files/OurApp/tomcat/common/endorsed"
wrapper.java.additional.8.stripquotes=TRUE
wrapper.java.additional.9=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=9135,suspend=n
The second example doesn't need quotes - no spaces to break it up. The first example does - because of "Program Files" Am I correct in this assessment?
If so, how/why is the application working as is? There are several parameters ostensibly being set like this (nested in qutoes), which I believe actually have no effect.
For instance min/max memory settings.
I found an example here that has the same thing, ostensibly being a config for windows and linux.
My questions:
Will these quotes stop the config commands going through?
Why is the app working if that is the case?
AFter a bit more playing around and trolling through debug logs, I think I have isolated the issue. The problem was the mix of 1 - Being lazy and putting two configuration items on the same line. (In my defense I copied it as one line from the Tomcat FAQ 2 - Using quotes
The combination of these two was causing the issue.
wrapper.java.additional.9="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=9135,suspend=n"
wrapper.java.additional.9.stripquotes=TRUE
Like this it generates a command line:
java "-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=9135,suspend=n" ...
It treats that entire string as one argument - rather than the two as I intended.
Without the quotes wrapper.java.additional.9=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=9135,suspend=n wrapper.java.additional.9.stripquotes=TRUE It generates:
java -Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=9135,suspend=n ...
Seeing as there are no quotes to screw things up, it processes the two -X parameters as I would want it to. Even better (and probably the intended use) as two seperate entries
wrapper.java.additional.9="-Xdebug"
wrapper.java.additional.9.stripquotes=TRUE
wrapper.java.additional.10="-Xrunjdwp:transport=dt_socket,server=y,address=9135,suspend=n"
wrapper.java.additional.10.stripquotes=TRUE
java "-Xdebug" "-Xrunjdwp:transport=dt_socket,server=y,address=9135,suspend=n" ...
There are quotes around each one, and it treats them individually. The existing entries are all fine, because they only set one item per line.
So I'll just put this down to a learning experience (sigh) and realise that I now know a whole lot more about wrapper.conf that I didn't know before.
Cheers, evnafets
I'm using remote debugging in Eclipse via *.bat files. Possible it will be more easy way for you.
Steps to accomplish:
Create debug.bat file with such content as
set JPDA_ADDRESS=8000
set JPDA_TRANSPORT=dt_socket
call catalina.bat jpda start
If you'll got an error that the port already in use, change 8000 to any other (8001, 8002 etc.).
From Eclipse side:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With