• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 425
  • Last Modified:

How to make debug working for tomcat when using Eclipse

I have a webapplication using Eclipse EE edition as IDE and tomcat as server. Now I need to debug my web applications. I use sudo /etc/init.d/tomcat5.5 start to start tomcat, so that I put command JAVA_OPTS=$JAVA_OPTS -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5000
into /etc/default/tomcat5.5
But when I start tomcat again, it says  /etc/default/tomcat5.5: 18: -Xdebug: not found. How to correct it? In windows I put following line in catalina.bat. Then Eclipse remote debugging works.
set JAVA_OPTS=%JAVA_OPTS% -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5000

How to do it in linux?

0
JianJunShen
Asked:
JianJunShen
  • 4
  • 4
1 Solution
 
objectsCommented:
try quoting the string

0
 
objectsCommented:
JAVA_OPTS="$JAVA_OPTS -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5000"
0
 
JianJunShenAuthor Commented:
Add quote could make tomcat startup, but Eclipse debug mode would not be activated using remote application.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
objectsCommented:
how are you connecting with eclipse?
is eclipse running on same box or a different one?

0
 
JianJunShenAuthor Commented:
I use remote application to debug, I put connection type as "Standard(Socket attach)", host as "localhost" and port as 5000
0
 
objectsCommented:
if you are running eclipse on a different box then change localhost to the hostname of the box running tomcat

0
 
JianJunShenAuthor Commented:
# Run Tomcat as this user ID. Not setting this or leaving it blank will use the
# default of tomcat55.
#TOMCAT5_USER=tomcat55

# The home directory of the Java development kit (JDK). You need at least
# JDK version 1.4. If JAVA_HOME is not set, some common directories for
# the Sun JDK, various J2SE 1.4 versions, and the free runtimes
# java-gcj-compat-dev and kaffe are tried.
#JAVA_HOME=/usr/lib/jvm/java-6-sun

# Directory for per-instance configuration files and webapps. It contain the
# directories conf, logs, webapps, work and temp. See RUNNING.txt for details.
# Default: /var/lib/tomcat5.5
#CATALINA_BASE=/var/lib/tomcat5.5

# Arguments to pass to the Java virtual machine (JVM).
#JAVA_OPTS="-Djava.awt.headless=true -Xmx128M"
JAVA_OPTS="$JAVA_OPTS -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5000"

# Java compiler to use for translating JavaServer Pages (JSPs). You can use all
# compilers that are accepted by Ant's build.compiler property.
#JSP_COMPILER=jikes

# Use the Java security manager? (yes/no, default: yes)
# WARNING: Do not disable the security manager unless you understand
# the consequences!
# NOTE: java-gcj-compat-dev currently doesn't support a security
# manager.
TOMCAT5_SECURITY=no
0
 
JianJunShenAuthor Commented:
Yes. After add quotation, one need to restart tomcat. Now it works.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now