Skip to main content



      Home
Home » Language IDEs » ServerTools (WTP) » Multiple locations of server.xml for tomcat in WTP
Multiple locations of server.xml for tomcat in WTP [message #80908] Mon, 07 March 2005 11:48 Go to next message
Eclipse UserFriend
Originally posted by: rajbsaini.yahoo.com

Hi,

I have installed WTP and Tomcat 5.5. I have confiured Tomcat and it is
working fine. On exploring the workspace, I found the Tomcat have
server.xml file at two locations:

1. <workspace>\Servers\Tomcat v5.5 Server @ localhost-config
2. <workspace>\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\conf

I have context.xml file in META-INF directory of my project. The
contents of <context> element of this file are included in the
server.xml at second location but not in first location. However context
of my web application is configured in server.xml files at both locations.

I am not sure why there are two server.xml files and which one is used
for web application.

Any clue?

Thanks,

Raj
Re: Multiple locations of server.xml for tomcat in WTP [message #83400 is a reply to message #80908] Mon, 14 March 2005 08:44 Go to previous messageGo to next message
Eclipse UserFriend
Hi Raj,

The copy in your workspace (Servers/Tomcat...) is the one that you would
edit, share with your team, etc. When you open up the Tomcat server editor,
this is the copy you are editing.

The Tomcat support in WTP can run in two modes - running as a "test
environment" that doesn't affect your Tomcat installation at all, or
publishing out and modifying the Tomcat installation so that everything is
configured in your external Tomcat server. In the first case, the config is
copied into metadata to make a couple adjustments before launching, which
explains why you have a copy there. In the second case, the config is copied
directly into your Tomcat installation.
Re: Multiple locations of server.xml for tomcat in WTP [message #83575 is a reply to message #83400] Mon, 14 March 2005 15:24 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: starfury.cox.net

Tim deBoer wrote:

> Hi Raj,

> The copy in your workspace (Servers/Tomcat...) is the one that you would
> edit, share with your team, etc. When you open up the Tomcat server editor,
> this is the copy you are editing.

> The Tomcat support in WTP can run in two modes - running as a "test
> environment" that doesn't affect your Tomcat installation at all, or
> publishing out and modifying the Tomcat installation so that everything is
> configured in your external Tomcat server. In the first case, the config is
> copied into metadata to make a couple adjustments before launching, which
> explains why you have a copy there. In the second case, the config is copied
> directly into your Tomcat installation.

Interresting.. how does one enable the "test" mode where it won't publish
each of your web's to tomcat? We actually desire this test mode because
we have many separate workspaces each with a web, and don't want every web
config from every workspace initializing when we bring up a particular
workspace.
Re: Multiple locations of server.xml for tomcat in WTP [message #84247 is a reply to message #83575] Wed, 16 March 2005 10:29 Go to previous messageGo to next message
Eclipse UserFriend
Alex,

The "switch" in question is seen by right-clicking on the server in the
Servers View and selecting Open. If checked, the checkbox for "Run
modules directly from the workspace..." selects this "test" mode. In
this "test" mode, the <Context> elements that are added to the
server.xml file contain a docBase attribute that points back into the
project directory. If unchecked, the Publish operation would copy the
project's webapp to Tomcat's "webapps" directory, but because the
docBase is the same as in "test" mode, it is still the project's webapp
that gets served, not the one copied to the "webapps" directory.

Note that the current implementation isn't without other quirks. In
"test" mode, the server configuration files you find under the Servers
project are copied to a "tmp" subdirectory of
"<workspace>.metadata\.plugins\org.eclipse.wst.server.core" during the
Publish operation. Of these files, only the server.xml (and
catalina.policy if security is enabled) is used when running the server
in "test" mode. The server.xml still points to using the versions of
web.xml and tomcat-users.xml that are in the Tomcat installation.

Also note that "test" mode and "non-test" mode both currently use the
same log files, work directory, and "conf/Catalina/localhost" directory,
which may impact your use case. I would encourage you to explain your
use case in more detail or file an enhancement bug if you find that
current behavior doesn't cover that use case.

Cheers,
Larry


Alex Townsend wrote:
> Tim deBoer wrote:
>
>> Hi Raj,
>
>
>> The copy in your workspace (Servers/Tomcat...) is the one that you would
>> edit, share with your team, etc. When you open up the Tomcat server
>> editor,
>> this is the copy you are editing.
>
>
>> The Tomcat support in WTP can run in two modes - running as a "test
>> environment" that doesn't affect your Tomcat installation at all, or
>> publishing out and modifying the Tomcat installation so that
>> everything is
>> configured in your external Tomcat server. In the first case, the
>> config is
>> copied into metadata to make a couple adjustments before launching, which
>> explains why you have a copy there. In the second case, the config is
>> copied
>> directly into your Tomcat installation.
>
>
> Interresting.. how does one enable the "test" mode where it won't
> publish each of your web's to tomcat? We actually desire this test mode
> because we have many separate workspaces each with a web, and don't want
> every web config from every workspace initializing when we bring up a
> particular workspace.
>
Re: Multiple locations of server.xml for tomcat in WTP [message #86008 is a reply to message #84247] Tue, 22 March 2005 18:39 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: werner.sonoma.edu

Thanks for the explanations. I've noticed that modifying either the
Eclipse server.xml or the actual one in tomcat/conf - Eclipse/WTP strips
out my changes and rewrites the context. Is there a way around it? My
testing includes changes to the Context, such as a Realm,Logger, and
JNDI configuration.

Thanks,

- Nic.

Larry Isaacs wrote:
> Alex,
>
> The "switch" in question is seen by right-clicking on the server in the
> Servers View and selecting Open. If checked, the checkbox for "Run
> modules directly from the workspace..." selects this "test" mode. In
> this "test" mode, the <Context> elements that are added to the
> server.xml file contain a docBase attribute that points back into the
> project directory. If unchecked, the Publish operation would copy the
> project's webapp to Tomcat's "webapps" directory, but because the
> docBase is the same as in "test" mode, it is still the project's webapp
> that gets served, not the one copied to the "webapps" directory.
>
> Note that the current implementation isn't without other quirks. In
> "test" mode, the server configuration files you find under the Servers
> project are copied to a "tmp" subdirectory of
> "<workspace>.metadata\.plugins\org.eclipse.wst.server.core" during the
> Publish operation. Of these files, only the server.xml (and
> catalina.policy if security is enabled) is used when running the server
> in "test" mode. The server.xml still points to using the versions of
> web.xml and tomcat-users.xml that are in the Tomcat installation.
>
> Also note that "test" mode and "non-test" mode both currently use the
> same log files, work directory, and "conf/Catalina/localhost" directory,
> which may impact your use case. I would encourage you to explain your
> use case in more detail or file an enhancement bug if you find that
> current behavior doesn't cover that use case.
>
> Cheers,
> Larry
>
>
> Alex Townsend wrote:
>
>> Tim deBoer wrote:
>>
>>> Hi Raj,
>>
>>
>>
>>> The copy in your workspace (Servers/Tomcat...) is the one that you would
>>> edit, share with your team, etc. When you open up the Tomcat server
>>> editor,
>>> this is the copy you are editing.
>>
>>
>>
>>> The Tomcat support in WTP can run in two modes - running as a "test
>>> environment" that doesn't affect your Tomcat installation at all, or
>>> publishing out and modifying the Tomcat installation so that
>>> everything is
>>> configured in your external Tomcat server. In the first case, the
>>> config is
>>> copied into metadata to make a couple adjustments before launching,
>>> which
>>> explains why you have a copy there. In the second case, the config is
>>> copied
>>> directly into your Tomcat installation.
>>
>>
>>
>> Interresting.. how does one enable the "test" mode where it won't
>> publish each of your web's to tomcat? We actually desire this test
>> mode because we have many separate workspaces each with a web, and
>> don't want every web config from every workspace initializing when we
>> bring up a particular workspace.
>>
Re: Multiple locations of server.xml for tomcat in WTP [message #86187 is a reply to message #86008] Wed, 23 March 2005 10:30 Go to previous message
Eclipse UserFriend
At the moment, the only way I know to "manage" child elements of your
Contexts is to create a META-INF/context.xml file. There is handling
that will include the child elements found in this file in the Contexts
WTP writes to the server.xml file during the publish operation. You
should see evidence of this in the server.xml found under tomcat/conf or
the one under the "tmp" subdirectory.

Larry

Nic Werner wrote:
> Thanks for the explanations. I've noticed that modifying either the
> Eclipse server.xml or the actual one in tomcat/conf - Eclipse/WTP strips
> out my changes and rewrites the context. Is there a way around it? My
> testing includes changes to the Context, such as a Realm,Logger, and
> JNDI configuration.
>
> Thanks,
>
> - Nic.
>
> Larry Isaacs wrote:
>
>> Alex,
>>
>> The "switch" in question is seen by right-clicking on the server in
>> the Servers View and selecting Open. If checked, the checkbox for
>> "Run modules directly from the workspace..." selects this "test"
>> mode. In this "test" mode, the <Context> elements that are added to
>> the server.xml file contain a docBase attribute that points back into
>> the project directory. If unchecked, the Publish operation would copy
>> the project's webapp to Tomcat's "webapps" directory, but because the
>> docBase is the same as in "test" mode, it is still the project's
>> webapp that gets served, not the one copied to the "webapps" directory.
>>
>> Note that the current implementation isn't without other quirks. In
>> "test" mode, the server configuration files you find under the Servers
>> project are copied to a "tmp" subdirectory of
>> "<workspace>.metadata\.plugins\org.eclipse.wst.server.core" during the
>> Publish operation. Of these files, only the server.xml (and
>> catalina.policy if security is enabled) is used when running the
>> server in "test" mode. The server.xml still points to using the
>> versions of web.xml and tomcat-users.xml that are in the Tomcat
>> installation.
>>
>> Also note that "test" mode and "non-test" mode both currently use the
>> same log files, work directory, and "conf/Catalina/localhost"
>> directory, which may impact your use case. I would encourage you to
>> explain your use case in more detail or file an enhancement bug if you
>> find that current behavior doesn't cover that use case.
>>
>> Cheers,
>> Larry
>>
>>
>> Alex Townsend wrote:
>>
>>> Tim deBoer wrote:
>>>
>>>> Hi Raj,
>>>
>>>
>>>
>>>
>>>> The copy in your workspace (Servers/Tomcat...) is the one that you
>>>> would
>>>> edit, share with your team, etc. When you open up the Tomcat server
>>>> editor,
>>>> this is the copy you are editing.
>>>
>>>
>>>
>>>
>>>> The Tomcat support in WTP can run in two modes - running as a "test
>>>> environment" that doesn't affect your Tomcat installation at all, or
>>>> publishing out and modifying the Tomcat installation so that
>>>> everything is
>>>> configured in your external Tomcat server. In the first case, the
>>>> config is
>>>> copied into metadata to make a couple adjustments before launching,
>>>> which
>>>> explains why you have a copy there. In the second case, the config
>>>> is copied
>>>> directly into your Tomcat installation.
>>>
>>>
>>>
>>>
>>> Interresting.. how does one enable the "test" mode where it won't
>>> publish each of your web's to tomcat? We actually desire this test
>>> mode because we have many separate workspaces each with a web, and
>>> don't want every web config from every workspace initializing when we
>>> bring up a particular workspace.
>>>
Previous Topic:Enable to create any WTP project !
Next Topic:Bugs in WTP M3 ? J2EE web project wizard and custom taglibs.
Goto Forum:
  


Current Time: Wed Nov 05 12:00:15 EST 2025

Powered by FUDForum. Page generated in 0.04658 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top