tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick Horowitz <rhorow...@ni4u.com>
Subject Debugging Tomcat on JBuilder
Date Fri, 15 Sep 2000 04:26:13 GMT
Hi Steve,

Here's what I've done to get it working. Please note, I didn't read the
Borland community article you pointed me to because its kind of long and
I already have it working, so I'm not sure if I agree with the
instructions.. 

btw, I'm running on Windows NT, so cannot create a soft link (ln), but
would be interested if you get that to work...

Here's my approach to run Tomcat in JB:

1. Create a JB project.
2. Create a JB library...mine's called Tomcat...and make it contain all
of the jar files in ${TOMCAT_HOME}/lib.  Add the library to the
project's required libraries.  So that you can debug into the Tomcat
source files, set the sources for this library to reference
${TOMCAT_HOME}/src.
3. On the project RUN tab, set the project's run file to be:

	org.apache.tomcat.startup.Tomcat

4. Also on the project's RUN tab, set the following Java VM parameters:

-classic -Dtomcat.home=d:\tomcat -Duser.dir=d:\tomcat\bin

-- make sure you set the above params with your tomcat home
directory...shown are mine...

5. I use an ANT file (ANT is a makefile mechanism to be found on
www.apache.org)..highly recomend it.  I use ANT to create the .war file
for the web app that corresponds to my project.  The ANT file does the
following:
 a. delete the current .war file for my application from the tomcat
webapps directory
 b. delete the tomcat work directory
 c. copy the .war file to tomcat's webapps directory

6. If you want to be able to debug into the .java files generated from
your jsp's, add the Tomcat generated web app directory to another JB
library, that I call <app-name>JSPs. If you have jsps in subdirectories,
this won't quite work because Tomcat generates the .java files into a
flat directory structure.  You'll have to make copies of the .java and
.class files into the correct directory structure in order to be able to
set breakpoints and single step through them.

7. Now, all you have to do is set breakpoint, run the project in the
debugger, and make a request...it should work.

Good luck,

Rick Horowitz


Steven_Shaw@adc.com wrote:
> 
> Could you maybe use a soft link to the <context_dir> from somewhere else and
> call it 'jsp'.
> 
>      ln -s ${TOMCAT_HOME}/work/<context_dir> ${SOMEWHERE_ELSE}/jsp
> 
> Then point JBuilder at ${SOMEWHERE_ELSE}.
> 
> I have tried to get into using JBuilder 3.5 Foundation afew times, but having
> the .jpr files set up correctly always bothers me. It doesn't seem to compile
> things even when you change them (unless you specfically add every java source
> file to your project - the add package thing just doesn't seem to work
> properly). Also, I don't know how to set up Tomcat for use from JBuilder 'cause
> I've never got that far! I have a link to an article on that subject though:
> 
>      http://community.borland.com/article/0,1410,22057,00.html
> 
> Could you shed some light on my JBuilder woes?
> 
> cheers,
> 
> Steve.
> 
> rhorowitz@ni4u.com on 15/09/2000 08:35:46
> 
> Please respond to tomcat-user@jakarta.apache.org
> 
> 
> 
>  To:      tomcat-user@jakarta.apache.org
> 
>  cc:      (bcc: Steven Shaw/Net)
> 
> 
> 
>  Subject: JSP compilation / debug problem
> 
> 
> I just started using Tomcat and have run into something that should not
> be hard to improve, and will make it alot easier to debug JSPs in Tomcat
> with an IDE, specifically JBuilder in my case, but I imagine this
> applies across the board.
> 
> Tomcat seems to drop all the generated .java files from .jsp's into the
> ${TOMCAT_HOME}/work/<context_dir>.  The problem is, my jsp's are
> arranged hierarchically in subdirectories, the top one of which is
> jsp/.  When I try to set up JBuilder I can set a breakpoint in the
> generated .java file for a jsp, it cannot find the .java file associated
> with a .class file generated for the jsp because the package name of the
> .java file is set correctly by Tomcat as "package jsp;" in this
> instance, but the .class and .java files are not in the jsp/ directory.
> Instead, they're in the top level directory...
> 
> So, after the .java and .class files were generated, I copied them by
> hand to the
> 
> ${TOMCAT_HOME}/work/<context_dir>/jsp/
> 
> ...and it worked.
> 
> Not too hard for this situation, but I happen to have a bunch of
> subdirectories under jsp/ and it will be a real pain to do this
> correctly each time I rerun Tomcat.
> 
> So, here's the request...
> 
> I realize it may be hard to fully implement the generation of .java and
> .class files from .jsp's into the right directory structure and you may
> not want to tackle the whole thing right now (although that seems to me
> the right fix).  Instead, can you at least copy the generated files into
> the right subdirectories when they are generated?  That would make it
> easy to do source-level debugging on the generated files.
> 
> Thanks,
> 
> Rick Horowitz

Mime
View raw message