tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andy Lawrence <>
Subject RE: Having problems trying to setup debugging in IDE...
Date Thu, 06 Apr 2000 13:25:11 GMT
Hi all --

<random thought> 
	I am also a lurker -- but getting tomcat running in an IDE such as
VCafe, Codewarrior, or Forte might be good userguide errata. Especially
since there is really not many good options for having the combination of
the servlet 2.2 spec, a source debugger like VCafe's, and WinNT. To me (and
my team) it was a good selling point that we could do this.
</random thought>

I am (was) also using VCafe 4.0 Expert edition and am (was) able to use it
w/ Tomcat successfully.  My setup looked like this:

Apache -> d:\apache
Tomcat -> d:\apache\tomcat
webapps ->d:\apache\htdocs\<webapp>

The single biggest thing I did was put all my .vep files in the
d:\apache\tomcat folder. This meant that I did not have to modify the
ContextManager.home property in server.xml nor pass the "-f
path/to/server.xml" param (or any other params) on startup.  I suppose you
could do so if you wanted. (I did need to do these things for working with
Tomcat and Forte1.0).

 I also configured VCafe to make sure that all the jars in
d:\apache\tomcat\lib were included, that the .class output went to
d:\apache\htdocs\<webapp>\WEB-INF\classes, and that the main class was
org.apache.tomcat.startup.Tomcat.  Lastly, I added my servlets to the
project and ran it.  

It's a bit slow, but it works. You can even debug .jsps in it if you open
the generated source from your work folder and set breakpoints in it.

Good luck.

-----Original Message-----
From: Timm, Sean []
Sent: Wednesday, April 05, 2000 10:31 PM
To: Tomcat-Dev (E-mail)
Subject: Having problems trying to setup debugging in IDE...

For those of you who don't want to read the following long-winded
explanation, I'm trying to figure out how to get it so I can debug servlets
using my IDE and using the Tomcat servlet engine.  I tried following some
instructions posted on IBM's site for VisualAge (I'm using VisualCafe), and
I got to a certain point, but I'm getting errors returned from Tomcat code.
If anyone can provide me with some tips on how to make this work, I would
*greatly* appreciate it.  We've been using ServletExec, but we just found
out we need some functionality that only Servlet API 2.2 provides, so we're
trying to switch everything over to Tomcat now.  However, we need the
functionality provided by ServletExecDebugger, and the IBM article seems to
explain exactly how to do that (but it doesn't seem to be working for
me...:( )

I'm using VisualCafe 4.0 Expert Edition.  I've got a project set up with all
of the directories from a fresh CVS build placed in the directory my project
is located.  My main method calls Startup.main(args).  From here, I start
having problems.  For my first problem, it was complaining that the Server
tag was not declared.  I realized it was attempting to validate, but I
noticed a comment in the code mentioned that server.xml shouldn't be
validated yet, so I passed "-validate false" on the command-line.

When I try and run it with those parameters, I get further.  It loads the
configuration info from server.xml, but I get the following debug output:
<l:ctx path="/examples" >Add context</l:ctx>
<l:addContext path="/examples"  docBase="null" />
<l:ctx path="/test" >Add context</l:ctx>
<l:addContext path="/test"  docBase="null" />
<l:ctx path="" >Add context</l:ctx>
<l:addContext path=""  docBase="null" />
<l:startEndpoint port="0"
handler="org.apache.tomcat.service.http.HttpConnectionHandler" />
<l:startEndpoint port="8080"
handler="org.apache.tomcat.service.http.HttpConnectionHandler" />
<l:startEndpoint port="8007"
handler="org.apache.tomcat.service.connector.Ajp12ConnectionHandler" />

Notice that docBase is null for some reason.  If I run Tomcat by itself
using startup.bat, however, docBase shows up correctly.  I attempted various
means of getting around this issue.  I can specify -docbase
C:\MyProjectPath, but then I get a NullPointerException in
Config.processArgs.  The problem code snippet is as follows:
  String id =


  } else if (isArg(key) &&
      (config.getElements().size() == 1 ||
          (id.equals(getArg(Constants.Arg.ServiceId))))) {
      configElement.addAttribute(key, getArg(key));

id is assigned as null, so the call to id.equals throws an Exception.

So I did some more digging, and I think that it was printing out using
context.getDocumentBase, but it should be using context.getDocBase.

I'm kind of stumped where to go from here.  I experimented with having
setDocumentBase also update setDocBase, but that didn't seem to help any.
When I try and go to http://localhost:8080/, I receive a hit because I get
an error in the debug output as follows:
<l:tc>Error reading request null</l:tc>

Once again, if anyone can assist me, I'd greatly appreciate it.  I've been
trying to dig through the FAQs, documentation, and mailing archives, but I
have yet to come up with anything substantial that can help.  We've got the
Tomcat server up and running...just need to get it so we can debug now!

Thanks in advance,
Sean T.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message