This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Tomcat and the fly likes debug mode (jpda) not starting Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "debug mode (jpda) not starting" Watch "debug mode (jpda) not starting" New topic
Author

debug mode (jpda) not starting

George Schrader
Greenhorn

Joined: Oct 29, 2007
Posts: 20
I am running Tomcat 5.5 on xp. I am able to start tomcat just fine, but if I start it in debug mode, the dos window opens and shuts before I can see anything and nothing appears in any of the logs. I am using the following script from the bin directory to start it:

<code>
set JPDA_ADDRESS=8000
set JPDA_TRANSPORT=dt_socket

catalina.bat jpda start
</code>

The only thing I was able to find in forums was that port 8000 may allready be open by another application. I checked and it is not.

Any ideas? Thanks in advance!
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15951
    
  19

Actually, there may not be anything wrong at all. You can start Tomcat manually from a DOS command window and not have to deal with the "flashing window" effect, but that may just be a meaningless distraction anyway.

What you actually need to determine is if, in fact, Tomcat opened port 8000 for debugging, regardless of what the windows do. I am of course, assuming that Tomcat did start up - which can be determined by sending a URL to http://localhost:8080 when running a default Tomcat.

Tomcat does not run its own debugger UI. JPDA simply sets up a listener in Tomcat's JVM that external debuggers will communicate with using tcp/ip port 8000 (or whatever port you select). You can use any conformant remote debug client, from the simplistic text-mode one that's included with the stock JDK up to and beyond the fancy GUI-based ones in most popular Java IDEs such as Eclipse, IntelliJ and NetBeans.


Customer surveys are for companies who didn't pay proper attention to begin with.
George Schrader
Greenhorn

Joined: Oct 29, 2007
Posts: 20
I tried to start it via command line and received the same open and shut dos window. I then tried to hit http://localhost:8080 to no avail.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15951
    
  19

1. Open a command window (Start/Run/cmd)

2. Set JAVA_HOME to point to the JDK that will run Tomcat (assuming you didn't set it at the system level via Control Panel). Remember that pathnames with spaces in them such such as "Program Files" need to be quoted.

3. Double-check #2 by issuing the command "java -version" at the command prompt.

4. cd to the TOMCAT home directory.

5. Issue the command "bin\catalina jpda start".

You may or may not see anything come back to this window (normally, it will at least list environment settings) and you MAY see one or more other windows pop open and shut. YMMV.

If there isn't anything informative in the command window after all this, look at logs\catalina.out AND any logs whose name starts with "localhost". Often when catalina,out has nothing it's because the problem is so severe that only the localhost logger records it. In fact, little else usually goes there.
George Schrader
Greenhorn

Joined: Oct 29, 2007
Posts: 20
I have copleted the steps in the post above and still get the same result. Nothing gets written to any of the log files.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15951
    
  19

I'm running out of suggestions - I don't entrust the open Internet to Windows, so I'm not as well versed on Windows-specific Tomcat configurations. However SOMETHING should be coming out, especially if you can run OK without JPDA.

I'm thinking that there's an interceptor that can route logs to the Windows Event logger. And I'm virtually certain that there are Windows versions of Tomcat that use an alternative log location instead of catalina.out, but I never knew where.

One thing worth trying is to attempt to run the "java" command with the same jvm debug setting as you're using with Tomcat and see how it reacts. You can use any old Java application as the executable, since it's only the debug settings you're interested in here.
Tejas Aryan
Greenhorn

Joined: Apr 12, 2009
Posts: 22
Can you check if CATALINA_HOME is set to some other installation of Tomcat. Also check your classpath environment variable for JDK settings.
George Schrader
Greenhorn

Joined: Oct 29, 2007
Posts: 20
I only have one Tomcat version on my machine and I am using a 1.6 jdk. Do I need to change the jdk to an earlier one?
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15951
    
  19

George Schrader wrote:I only have one Tomcat version on my machine and I am using a 1.6 jdk. Do I need to change the jdk to an earlier one?


No. Tomcat 5.0 doesn't support Java5 or higher, but that's the primary difference between 5.0 and 5.5.
George Schrader
Greenhorn

Joined: Oct 29, 2007
Posts: 20
Got it figured out. Catalina.bat was not picking up the correct port for jpda, so I hard-coded the port to 8000 and it started fine.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15951
    
  19

Aha!

Based on that information, then, I think you had debugging set up to pause the debugger at startup. So Tomcat WAS (technically) running, but hadn't started writing messages out to the logs. It was waiting for a "go" command from the debugging client.

A good place to set things like the JPDA port is in TOMCAT_HOME\bin\setenv.bat. This file doesn't come with Tomcat. You have to create your own. Look at the catalina.bat file to see how it's used.

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: debug mode (jpda) not starting
 
Similar Threads
How to configure Tomcat 5.5 for debug mode?
Almost there with debugging Servlet on Tomcat with Eclipse
problem with port for debugging with eclipse/tomcat
Problem in starting Tomcat in debug mode
Ant, Eclipse, Debug, Break point