You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by "Michael P. McCutcheon" <mi...@value.net> on 2000/02/04 02:57:00 UTC

How to embed Tomcat in my Java program?

NT 4 SP6 Sun JDK 1.2.2

When I try to compile the SimpleStartup.java, I get an error:

<error>
D:\tomcat\etc>javac *.java
SimpleStartup.java:90: Method setDocumentBase(java.net.URL) not found in
class org.apache.tomcat.server.HttpServer.server.

setDocumentBase(url);
</error>

I would really like to know how to start tomcat in my own program.

Thanks.

Michael P. McCutcheon



Re: Q: Apache module translate method

Posted by Bob Jamison <rj...@lincom-asg.com>.

Bob Jamison wrote:

> I am wondering, because I am having trouble getting translate()
> on my module to be called.  Is there some special trick to this?
>

By the way,  the current design of ServerConnector/RequestImpl/
ResponseImpl works fine, and does seem to simplify and clean things
up a lot.   Thanks for the help.



Bob



Q: Apache module translate method

Posted by Bob Jamison <rj...@lincom-asg.com>.
I noticed that mod_jserv's translate method is basically
testing -all- URIs from the server as candidates for translating
into filenames, and tagging them in r->notes as ready for
servlet-handler processing.  I also noticed that jserv,
even though it is the last module typically loaded, is actually
being called by the server.  This would imply that all the other
modules' translate methods are returning DECLINED.  Is
that right?

I am wondering, because I am having trouble getting translate()
on my module to be called.  Is there some special trick to this?


Bob



RE: How to embed Tomcat in my Java program?

Posted by Conor MacNeill <co...@m64.com>.
> -----Original Message-----
> From: Shachor Gal [mailto:shachor@techunix.technion.ac.il]
> Sent: Friday, 4 February 2000 18:27
> To: tomcat-dev@jakarta.apache.org
> Subject: Re: How to embed Tomcat in my Java program?
>
>
>
> The approach is actually to use the main(String s[]) method in
> org.apache.tomcat.shell.Startup. Call it and provide command line
> parameters...
>
> One parameter for example will be the path to server.xml, so you will need
> to do something similar to:
>
> org.apache.tomcat.shell.Startup.main({"-config",
>                                       "full path to server.xml"});
>
>

I don't think that is the approach to be taken in general.

The tomcat core and the tomcat startup code are independent so you can use a
different startup mechanism with the tomcat core. This is the intention
behind SimpleStartup.java. Unfortunately this is currently broken. I think
Costin has even removed it for now. You can either wait for him to put back
a working version or try your hand at your own using the ContextManager in
place of the HttpServer.

Cheers
Conor


Re: How to embed Tomcat in my Java program?

Posted by Shachor Gal <sh...@techunix.technion.ac.il>.
The approach is actually to use the main(String s[]) method in
org.apache.tomcat.shell.Startup. Call it and provide command line
parameters... 

One parameter for example will be the path to server.xml, so you will need
to do something similar to: 

org.apache.tomcat.shell.Startup.main({"-config", 
                                      "full path to server.xml"});

On Thu, 3 Feb 2000, Michael P. McCutcheon wrote:

> NT 4 SP6 Sun JDK 1.2.2
> 
> When I try to compile the SimpleStartup.java, I get an error:
> 
> <error>
> D:\tomcat\etc>javac *.java
> SimpleStartup.java:90: Method setDocumentBase(java.net.URL) not found in
> class org.apache.tomcat.server.HttpServer.server.
> 
> setDocumentBase(url);
> </error>
> 
> I would really like to know how to start tomcat in my own program.
> 
> Thanks.
> 
> Michael P. McCutcheon
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
> 
>