• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

debug mode (jpda) not starting

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!
 
Saloon Keeper
Posts: 27763
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
George Schrader
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 27763
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 27763
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 27763
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 27763
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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'm thinking about a new battle cry. Maybe "Not in the face! Not in the face!" Any thoughts tiny ad?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic