Hi,

Generally, you extract the tomcat bin.zip (and src.zip if
you like, I found this useful), define its four .jar files
("jasper.jar", "servlet.jar", "xml.jar" and "webserver.jar" under
"lib") as a "required library" (e.g. I called it "Tomcat 3.1")
and define the org.apache.tomcat.startup.Tomcat.main
class as your "main" class.  You will also have to set a
"-Dtomcat.home=c:\jakarta-tomcat" (or wherever you extracted
Tomcat).

I use "-f" to point Tomcat directly to the config file
but be aware that Tomcat checks whether the directory around it
is valid by looking for some (sometimes irrelevant) config files
like conf/tomcat-apache.conf, the "default" conf/web.xml,
conf/server.xml and such (I think I listed all the files it looks
for, but you can trace the source for where its complaints are
coming from). ("-f" takes the name of the conf/server.xml file, but
as far as I see it MUST be under a directory named "conf" and have
the other files around it).

(In some of my projects, I use my own "main" function
which appends the current directory to the relative name
of the config file passed to "-f" and then calls
the above-mentioned "main" method, otherwise I couldn't find a
way to pass a relative argument to "-f" and cause it to find
the config file, maybe this is redundant if the right config files
are around).

Once tomcat is running that way, it's just another Java application
for JBuilder, run it (or debug it) with the "play" button.  Simple
prints to System.out will show on JBuilder's output window.  You
can access the site through http://localhost:8080/ with any browser.
There are several default "web applications" including the
ROOT web application which I found yesterday and which helped me
to just copy a .jsp file to its directory and test it through
the browser. You can't use the internal JBuilder browser as far as
I'm aware.

There is an article about this in Borland's site

http://community.borland.com/article/0,1410,22057,00.html

(last week it wasn't reachable for me for a few days, but
it's there last time I tried).

Meanwhile I think I tracked down my problem - it looks like
Tomcat will strip down stuff like "/./" in the path for security
reasons and since the "canonical" path after such stripping is
different from the original path it rejects the file name.
Moving all files down another hierarchy level (e.g. "site")
and setting docBase to the name of this directory ("site") solved
the problem.

Cheers,

--Amos Shapira
WebCollage

> -----Original Message-----
> From: Robert Nicholson [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, July 09, 2000 10:12 PM
> To: [EMAIL PROTECTED]
> Subject: Re: relative path names for Tomcat docBase
>
>
> Just how exactly do you run Tomcat with Jbuilder? Can you
> debug doing that?
>
> > -----Original Message-----
> > From: A mailing list for discussion about Sun Microsystem's
> Java Servlet
> > API Technology. [mailto:[EMAIL PROTECTED]]On
> Behalf Of Amos
> > Shapira
> > Sent: Thursday, July 06, 2000 10:10 AM
> > To: [EMAIL PROTECTED]
> > Subject: relative path names for Tomcat docBase
> >
> >
> > Hello,
> >
> > I'm trying to avoid using absolute path names in Tomcat 3.1's
> > "server.xml" file.  I can cause it to run the JSP files fine, but
> > will not find image files ONLY if the docBase is relative (it does
> > find them if docBase is absolute).
> >
> > Here are the details:
> >
> > I run Tomcat standalone under JBuilder 3.5 (Windows 2000, JDK 1.2.2)
> > With "-f" pointing to the full path name of server.xml.  Inside
> > server.xml I have the following:
> >
> > <Context path="/providercenter" docBase="." debug="100"
> > reloadable="true" />
> >
> > This works great with the JSP files, but when these JSP files
> > generate HTML
> > which causes the browser to try to fetch images files, the
> images aren't
> > found and I get the following in tomcat.log:
> >
> > Context log: path="/providercenter" In error handler 404 null / R(
> > /providercenter +  + /images/spacer.gif)
> > Context log: path="/providercenter" Error: Calling servlet
> > Wrapper(tomcat.errorPage
> S:org.apache.tomcat.servlets.DefaultErrorPage)
> >
> > Changing the docBase to the full path name of the directory
> which contains
> > the .jsp files
> > (and the images/ directory under it, e.g.
> "w:\amos\providercenter"), makes
> > the problem go
> > away (and no output in tomcat.log even though I tried to
> ask it for full
> > debug output).
> > This is the ONLY difference between the two cases.
> >
> > Any help would be greatly appreciated, as so far I couldn't
> figure out the
> > problem
> > from digging Tomcat's documents and source.
> >
> > Thanks,
> >
> > --Amos Shapira
> > WebCollage
> >
> > __________________________________________________________________
> > _________
> > To unsubscribe, send email to [EMAIL PROTECTED] and include
> > in the body
> > of the message "signoff SERVLET-INTEREST".
> >
> > Archives:
http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to