You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by iv...@gmail.com on 2009/11/24 21:08:42 UTC
Tomcat in Embedded mode
Hi guys,
I spent my day into struggling with Tomcat 6 and I just wanted to ask you
for some ideas and whether what I'm doing seems right to you.
So, I'm trying to port a legacy application which is using Tomcat 5.0.28 to
Tomcat 6.0.20.
While most of the Tomcat 5.0.28 properties are read from the server.xml,
some of the Connector properties(keyStore, keyPass, protocols, connector
address, port ...) are retrieved from other configuration files which are in
fact related to the application.
Using Tomcat 5.0.28 this is implemented by providing a custom implementation
for the CoyoteConnector and CoyoteServerSocketFactory.
Obviously, I can't do this with Tomcat6.
What I intend to do is write a class that extends the Catalina class (so
that the Digester can read my server.xml file) and then just overwrite the
addConnector method in order to overwrite the Connector properties "on the
fly" and the load method ( so that I can push my implementation in the
digester).
Then in order to use the Bootstrap (to load classes), I'll have to extend it
so that I can change the Catalina implementation with my own.
Then for starting tomcat I'll use my bootstrap.
Please, have in mind that I really don't like this hacky approach. However,
I can't do much to change it since I'm not the one who tells the
requirements.
So, what do you think? Some easier way to achieve this?
Thanks,
Ivelin
Re: Tomcat in Embedded mode
Posted by Bill Barker <bi...@verizon.net>.
<iv...@gmail.com> wrote in message
news:887c111b0911241208v65192e8fp20e0730fb09ffd74@mail.gmail.com...
> Hi guys,
>
> I spent my day into struggling with Tomcat 6 and I just wanted to ask you
> for some ideas and whether what I'm doing seems right to you.
>
> So, I'm trying to port a legacy application which is using Tomcat 5.0.28
> to
> Tomcat 6.0.20.
> While most of the Tomcat 5.0.28 properties are read from the server.xml,
> some of the Connector properties(keyStore, keyPass, protocols, connector
> address, port ...) are retrieved from other configuration files which are
> in
> fact related to the application.
> Using Tomcat 5.0.28 this is implemented by providing a custom
> implementation
> for the CoyoteConnector and CoyoteServerSocketFactory.
>
> Obviously, I can't do this with Tomcat6.
> What I intend to do is write a class that extends the Catalina class (so
> that the Digester can read my server.xml file) and then just overwrite the
> addConnector method in order to overwrite the Connector properties "on the
> fly" and the load method ( so that I can push my implementation in the
> digester).
>
If all you want is to customize the Connector, then it is much easier to
simply put into server.xml:
<Connector protocol="com.myfirm.mypackage.MyHttp11ProtocolHandler" ... />
Then, if I understand what you want, something like:
public void init() throws Exception {
fixupSettings(); // your method to make configuration changes
super.init(); // let Tomcat handle the rest
}
should work for you.
> Then in order to use the Bootstrap (to load classes), I'll have to extend
> it
> so that I can change the Catalina implementation with my own.
> Then for starting tomcat I'll use my bootstrap.
>
> Please, have in mind that I really don't like this hacky approach.
> However,
> I can't do much to change it since I'm not the one who tells the
> requirements.
>
> So, what do you think? Some easier way to achieve this?
>
> Thanks,
> Ivelin
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org