FCI-Helwan blog

Just another FCI-H weblog

Debugging Tomcat web applications using JDeveloper

Hello All

I managed to enable JDeveloper to debug with tomcat and here are the steps to accomplish that.

As a prerequisite for this, you must have a tomcat server locally installed. I need to note also that this way you won’t be able to debug jsp files (Only classes). Actually there is a way around that but it’s so buggy and tiresome.

First you need to add those lines to the java options in tomcat configuration:

-Xdebug

-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n

Second, go to the folder where tomcat is installed (for me it is “C:\Program Files\Apache Software Foundation\Tomcat 5.5\conf\Catalina\localhost”) and create a file called “project1.xml” for example, and paste this line in it.

project1\ViewController\public_html” path=”/project1″ reloadable=”true” />

Where

docBase is the path to your public_html folder

reloadable=”true” allows tomcat to pickup any changes that you make to your jsps.

Path is the path that you can access your web application through.

Third, you need to create a new run configuration for tomcat (we need a remote debugging configuration):

* Check “Remote Debugging and Profiling”
* Go to Debugger -> Remote and change
o Protocol à Attach to JPDA
o Host à 127.0.0.1 as we are debugging through the locally installed tomcat server.
o Port à 8000 ( It should match the port specified in the tomcat configuration as in step 1)

Fourth, we need to change the Output Directory from “ViewController\classes” to “ViewController\public_html\WEB-INF\classes”

And to do this go to View Controller Project settings then to Project Content and change the Output Directory Textbox.

Advertisements

February 21, 2008 - Posted by | JAVA

4 Comments »

  1. Hi,
    This step does not make sense as described. Why do this step? What is the project1.xml for?

    >>Second, go to the folder where tomcat is installed (for me it is “C:\Program Files\Apache Software Foundation\Tomcat 5.5\conf\Catalina\localhost”) and create a file called “project1.xml” for example, and paste this line in it.

    project1\ViewController\public_html” path=”/project1″ reloadable=”true” />

    Where

    docBase is the path to your public_html folder

    Comment by Steve | April 6, 2008 | Reply

  2. Hi Steve

    This step allows tomcat to see jsp’s and class files in the jdev Project path. If you didn’t do this step you will have to redeploy the web application every time you make a change.

    Comment by Shereef Sakr | April 6, 2008 | Reply

  3. shereef sakr,

    I think Steve is a bit confused because the line to paste is not complete:

    project1\ViewController\public_html” path=”/project1″ reloadable=”true” />

    should be something like this:
    <Context path=”/project1″ docBase=”PATH_TO_APP\public_html” debug=”0″ reloadable=”true”>
    <!– <Logger … /> (good thing to have) –>
    </Context>

    or you can also paste this line to {tomcat_home}/conf/server.xml under <Host> element (As far as I remember this is the way to do it in Tomcat v6).

    Comment by Evaldas | May 28, 2008 | Reply

  4. Hi Nice Blog .I think HR understands the importance of other people tracking time–IT, Lawyers, non-exempt employees, but struggles with the idea of employee time attendance.

    Comment by Jackline | January 29, 2009 | Reply


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: