Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm getting crazy to set up Tomcat in remote debug mode under ubuntu 10. Basically I added this to /etc/init.d/tomcat6 (at the beginning):

JAVA_OPTS="-Djava.awt.headless=true -Xmx256M -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n"

But I see no effect... in fact I can't see port 8000 open with netstat -a and Eclipse remote debugger says it can't connect. If I do ps -A u| grep java I get:

tomcat6   9612  3.1 13.1 470560 154168 ?       Sl   15:24   0:17 /usr/lib/jvm/java-6-sun/bin/java -Djava.util.logging.config.file=/var/lib/tomcat6/conf/logging.properties -Djava.awt.headless=true -Xmx128m -XX:+UseConcMarkSweepGC -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/usr/share/tomcat6/endorsed -classpath /usr/share/tomcat6/bin/bootstrap.jar -Dcatalina.base=/var/lib/tomcat6 -Dcatalina.home=/usr/share/tomcat6 -Djava.io.tmpdir=/tmp/tomcat6-tmp org.apache.catalina.startup.Bootstrap start

Notice it doesn't even set the heap size (if this is meaninful).

So any hints?

share|improve this question

1 Answer 1

up vote 8 down vote accepted

Don't touch the init script. Instead, edit the /etc/default/tomcat6 file and comment out the line enabling remote debugging there:

# To enable remote debugging uncomment the following line.
# You will then be able to use a java debugger on port 8000.
JAVA_OPTS="${JAVA_OPTS} -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n"
share|improve this answer
    
thanks man. Anyway what's the difference between what is in etc/init.d and etc/default ? –  gotch4 May 4 '11 at 14:51
    
In that specific case the difference is pretty obvious. /etc/default settings override whatever was previously set in /etc/init.d before the default file is read. This is documented around line 90. –  jlliagre May 4 '11 at 14:59

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.