Re: Apache Tomcat context update listeners

2016-02-27 Thread Chiranga Alwis
Thanks Mark, I will go through and try to understand this. If any
clarifications are required I will post here.

By the way the goal I am pursuing (if it is not clear) is to enable the
loading of a set of custom configurations for every Context. These
configurations cannot be included within the typical web.xml (as we intend
to separate out these custom configurations from the typical web.xml
configurations) Other that that, this file plays a similar role to that
played by the web.xml.

On Sun, Feb 28, 2016 at 3:04 AM, Mark Thomas  wrote:

> On 27/02/2016 17:38, Chiranga Alwis wrote:
> > Well, what I am trying to achieve is as follows:
> >
> > I am trying to load certain custom configurations from a file which is
> > similar to web.xml in Tomcat, for each Context. We can define it globally
> > and also override the configurations at context level. For this I have
> > already created a custom Listener and have added it to lib folder.
> >
> > I have already constructed it in a manner in which for each configuration
> > the configurations are loaded at webapp deployment.
> >
> > But now I intend to perform this task not only at the initial deployment,
> > but also if someone makes a change to the webapp. I believe Tomcat also
> > dynamically reloads a context if modified, for example a modification to
> > the web.xml or a Java class. We don't have to switch off the Tomcat
> server
> > and restart it to load the new changes.
>
> You still haven't defined change.
>
> > In my understanding, in such a situation the Context instance that was
> > initially created at server startup is destroyed and a new Context
> instance
> > is created. I got this idea as I did not come across a new event type
> under
> > Tomcat component lifecycle which defines an event of updating a Tomcat
> > component such as a Context. The ones that exist are for starting and
> > destroying of Tomcat components.
> >
> > Is my understanding correct?
>
> No.
>
> > Or is it different?
>
> Yes.
>
> > Plus what is/are the most
> > appropriate LifeCycle events which I am to use in such a situation?
>
> It appears you are using Tomcat 6 since that is the version of the
> documentation you quoted in your first post in this thread.
>
> You really need to upgrade to at least 7.0.x where the behaviour is much
> better defined. 6.0.x is likely to have some undocumented edge cases
> that might surprise you.
>
> Then you need to read this:
> http://tomcat.apache.org/tomcat-7.0-doc/config/automatic-deployment.html
>
> Pay particular attention to the differences between reload and redeploy.
>
> Then look at the Lifecyle.CONFIGURE_START_EVENT event.
>
> Mark
>
> >
> > On Sat, Feb 27, 2016 at 6:17 PM, Mark Thomas  wrote:
> >
> >> On 26 February 2016 19:09:59 GMT+00:00, Chiranga Alwis <
> >> chirangaal...@gmail.com> wrote:
> >>> Well, sorry if the question is not clear.
> >>>
> >>> What I want to know is for what type of event we need to listen in
> >>> order to
> >>> carry out a task when a Context is modified. It would be great if there
> >>> is
> >>> a clear explanation on how this is to be checked.
> >>
> >> Again, define modified.
> >>
> >> Again, why do you want to run a task? What are you actually trying to
> >> achieve?
> >>
> >> Mark
> >>
> >>>
> >>> On Fri, Feb 26, 2016 at 5:21 PM, Mark Thomas  wrote:
> >>>
>  On 26/02/2016 11:44, Chiranga Alwis wrote:
> > Hi,
> >
> > I have currently created a LifecycleListener which listens to
> >>> Tomcat's
> > context deployment event and loads data in a custom configuration
> >>> file at
> > that point.
> >
> > I have been trying to find out whether LifecycleListeners support
> >>> context
> > update and modification events but yet in my understanding I could
> >>> not
> > discover an appropriate resource to use.
> 
>  Define update.
> 
>  Define modification.
> 
>  Better still, explain what it is you actually want to achieve rather
>  than ask for help implementing your, potentially flawed, solution.
> 
>  Mark
> 
>  -
>  To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>  For additional commands, e-mail: users-h...@tomcat.apache.org
> 
> 
> >>
> >>
> >>
> >> -
> >> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> >> For additional commands, e-mail: users-h...@tomcat.apache.org
> >>
> >>
> >
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: Apache Tomcat context update listeners

2016-02-27 Thread Mark Thomas
On 27/02/2016 17:38, Chiranga Alwis wrote:
> Well, what I am trying to achieve is as follows:
> 
> I am trying to load certain custom configurations from a file which is
> similar to web.xml in Tomcat, for each Context. We can define it globally
> and also override the configurations at context level. For this I have
> already created a custom Listener and have added it to lib folder.
> 
> I have already constructed it in a manner in which for each configuration
> the configurations are loaded at webapp deployment.
> 
> But now I intend to perform this task not only at the initial deployment,
> but also if someone makes a change to the webapp. I believe Tomcat also
> dynamically reloads a context if modified, for example a modification to
> the web.xml or a Java class. We don't have to switch off the Tomcat server
> and restart it to load the new changes.

You still haven't defined change.

> In my understanding, in such a situation the Context instance that was
> initially created at server startup is destroyed and a new Context instance
> is created. I got this idea as I did not come across a new event type under
> Tomcat component lifecycle which defines an event of updating a Tomcat
> component such as a Context. The ones that exist are for starting and
> destroying of Tomcat components.
> 
> Is my understanding correct?

No.

> Or is it different?

Yes.

> Plus what is/are the most
> appropriate LifeCycle events which I am to use in such a situation?

It appears you are using Tomcat 6 since that is the version of the
documentation you quoted in your first post in this thread.

You really need to upgrade to at least 7.0.x where the behaviour is much
better defined. 6.0.x is likely to have some undocumented edge cases
that might surprise you.

Then you need to read this:
http://tomcat.apache.org/tomcat-7.0-doc/config/automatic-deployment.html

Pay particular attention to the differences between reload and redeploy.

Then look at the Lifecyle.CONFIGURE_START_EVENT event.

Mark

> 
> On Sat, Feb 27, 2016 at 6:17 PM, Mark Thomas  wrote:
> 
>> On 26 February 2016 19:09:59 GMT+00:00, Chiranga Alwis <
>> chirangaal...@gmail.com> wrote:
>>> Well, sorry if the question is not clear.
>>>
>>> What I want to know is for what type of event we need to listen in
>>> order to
>>> carry out a task when a Context is modified. It would be great if there
>>> is
>>> a clear explanation on how this is to be checked.
>>
>> Again, define modified.
>>
>> Again, why do you want to run a task? What are you actually trying to
>> achieve?
>>
>> Mark
>>
>>>
>>> On Fri, Feb 26, 2016 at 5:21 PM, Mark Thomas  wrote:
>>>
 On 26/02/2016 11:44, Chiranga Alwis wrote:
> Hi,
>
> I have currently created a LifecycleListener which listens to
>>> Tomcat's
> context deployment event and loads data in a custom configuration
>>> file at
> that point.
>
> I have been trying to find out whether LifecycleListeners support
>>> context
> update and modification events but yet in my understanding I could
>>> not
> discover an appropriate resource to use.

 Define update.

 Define modification.

 Better still, explain what it is you actually want to achieve rather
 than ask for help implementing your, potentially flawed, solution.

 Mark

 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org


>>
>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: users-h...@tomcat.apache.org
>>
>>
> 


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Apache Tomcat context update listeners

2016-02-27 Thread Mark Eggers
Chiranga,

On 2/27/2016 9:38 AM, Chiranga Alwis wrote:
> Well, what I am trying to achieve is as follows:
> 
> I am trying to load certain custom configurations from a file which
> is similar to web.xml in Tomcat, for each Context. We can define it
> globally and also override the configurations at context level. For
> this I have already created a custom Listener and have added it to
> lib folder.
> 
> I have already constructed it in a manner in which for each
> configuration the configurations are loaded at webapp deployment.
> 
> But now I intend to perform this task not only at the initial
> deployment, but also if someone makes a change to the webapp. I
> believe Tomcat also dynamically reloads a context if modified, for
> example a modification to the web.xml or a Java class. We don't have
> to switch off the Tomcat server and restart it to load the new
> changes.
> 
> In my understanding, in such a situation the Context instance that
> was initially created at server startup is destroyed and a new
> Context instance is created. I got this idea as I did not come across
> a new event type under Tomcat component lifecycle which defines an
> event of updating a Tomcat component such as a Context. The ones that
> exist are for starting and destroying of Tomcat components.
> 
> Is my understanding correct? Or is it different? Plus what is/are the
> most appropriate LifeCycle events which I am to use in such a
> situation?
> 
> On Sat, Feb 27, 2016 at 6:17 PM, Mark Thomas 
> wrote:
> 
>> On 26 February 2016 19:09:59 GMT+00:00, Chiranga Alwis < 
>> chirangaal...@gmail.com> wrote:
>>> Well, sorry if the question is not clear.
>>> 
>>> What I want to know is for what type of event we need to listen
>>> in order to carry out a task when a Context is modified. It would
>>> be great if there is a clear explanation on how this is to be
>>> checked.
>> 
>> Again, define modified.
>> 
>> Again, why do you want to run a task? What are you actually trying
>> to achieve?
>> 
>> Mark
>> 
>>> 
>>> On Fri, Feb 26, 2016 at 5:21 PM, Mark Thomas 
>>> wrote:
>>> 
 On 26/02/2016 11:44, Chiranga Alwis wrote:
> Hi,
> 
> I have currently created a LifecycleListener which listens
> to
>>> Tomcat's
> context deployment event and loads data in a custom
> configuration
>>> file at
> that point.
> 
> I have been trying to find out whether LifecycleListeners
> support
>>> context
> update and modification events but yet in my understanding I
> could
>>> not
> discover an appropriate resource to use.
 
 Define update.
 
 Define modification.
 
 Better still, explain what it is you actually want to achieve
 rather than ask for help implementing your, potentially flawed,
 solution.
 
 Mark

My thoughts on this from an operations / sanity viewpoint.

I am always leery of changing web application configurations on the fly.
It's easy to get source code repositories not agreeing with production
code, not agreeing with Maven repositories (if you use Maven), etc.,
etc. Then when you go to debug a production problem, figuring out what
you're working with becomes challenging.

I much prefer using parallel deployment, and changing the web
application every time a configuration changes. Tomcat handles this
gracefully. We've found that Jenkins / Nexus / Maven / parallel
deployment makes it easy to manage test, UAT, and production releases.

The Jenkins job sends all interested parties email, which contains the
version of the product, who did the release, and where the release can
be found. There's also a record in the Jenkins logs, so we can look at a
product release history fairly easily.

That being said, if you absolutely want to change configurations on the
fly, I'd look at something like the following (please note that I am a
systems architect and NOT a Java developer):

1. Store your configuration in a Singleton
   Maybe use a ConcurrentHashMap

2. Populate the Singelton via a ServletContextListener on start up

3. Create a protected administrative interface
   Look at using the Remote Address Filter to provide protection

4. Reload the configuration using the protected administrative interface

I think this is ugly, and you should strongly consider releasing point
updates when the configuration changes.

. . . just my two cents
/mde/



signature.asc
Description: OpenPGP digital signature


Re: Apache Tomcat context update listeners

2016-02-27 Thread Chiranga Alwis
Well, what I am trying to achieve is as follows:

I am trying to load certain custom configurations from a file which is
similar to web.xml in Tomcat, for each Context. We can define it globally
and also override the configurations at context level. For this I have
already created a custom Listener and have added it to lib folder.

I have already constructed it in a manner in which for each configuration
the configurations are loaded at webapp deployment.

But now I intend to perform this task not only at the initial deployment,
but also if someone makes a change to the webapp. I believe Tomcat also
dynamically reloads a context if modified, for example a modification to
the web.xml or a Java class. We don't have to switch off the Tomcat server
and restart it to load the new changes.

In my understanding, in such a situation the Context instance that was
initially created at server startup is destroyed and a new Context instance
is created. I got this idea as I did not come across a new event type under
Tomcat component lifecycle which defines an event of updating a Tomcat
component such as a Context. The ones that exist are for starting and
destroying of Tomcat components.

Is my understanding correct? Or is it different? Plus what is/are the most
appropriate LifeCycle events which I am to use in such a situation?

On Sat, Feb 27, 2016 at 6:17 PM, Mark Thomas  wrote:

> On 26 February 2016 19:09:59 GMT+00:00, Chiranga Alwis <
> chirangaal...@gmail.com> wrote:
> >Well, sorry if the question is not clear.
> >
> >What I want to know is for what type of event we need to listen in
> >order to
> >carry out a task when a Context is modified. It would be great if there
> >is
> >a clear explanation on how this is to be checked.
>
> Again, define modified.
>
> Again, why do you want to run a task? What are you actually trying to
> achieve?
>
> Mark
>
> >
> >On Fri, Feb 26, 2016 at 5:21 PM, Mark Thomas  wrote:
> >
> >> On 26/02/2016 11:44, Chiranga Alwis wrote:
> >> > Hi,
> >> >
> >> > I have currently created a LifecycleListener which listens to
> >Tomcat's
> >> > context deployment event and loads data in a custom configuration
> >file at
> >> > that point.
> >> >
> >> > I have been trying to find out whether LifecycleListeners support
> >context
> >> > update and modification events but yet in my understanding I could
> >not
> >> > discover an appropriate resource to use.
> >>
> >> Define update.
> >>
> >> Define modification.
> >>
> >> Better still, explain what it is you actually want to achieve rather
> >> than ask for help implementing your, potentially flawed, solution.
> >>
> >> Mark
> >>
> >> -
> >> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> >> For additional commands, e-mail: users-h...@tomcat.apache.org
> >>
> >>
>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: Apache Tomcat context update listeners

2016-02-27 Thread Mark Thomas
On 26 February 2016 19:09:59 GMT+00:00, Chiranga Alwis 
 wrote:
>Well, sorry if the question is not clear.
>
>What I want to know is for what type of event we need to listen in
>order to
>carry out a task when a Context is modified. It would be great if there
>is
>a clear explanation on how this is to be checked.

Again, define modified.

Again, why do you want to run a task? What are you actually trying to achieve?

Mark

>
>On Fri, Feb 26, 2016 at 5:21 PM, Mark Thomas  wrote:
>
>> On 26/02/2016 11:44, Chiranga Alwis wrote:
>> > Hi,
>> >
>> > I have currently created a LifecycleListener which listens to
>Tomcat's
>> > context deployment event and loads data in a custom configuration
>file at
>> > that point.
>> >
>> > I have been trying to find out whether LifecycleListeners support
>context
>> > update and modification events but yet in my understanding I could
>not
>> > discover an appropriate resource to use.
>>
>> Define update.
>>
>> Define modification.
>>
>> Better still, explain what it is you actually want to achieve rather
>> than ask for help implementing your, potentially flawed, solution.
>>
>> Mark
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: users-h...@tomcat.apache.org
>>
>>



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Apache Tomcat context update listeners

2016-02-26 Thread Chiranga Alwis
Well, sorry if the question is not clear.

What I want to know is for what type of event we need to listen in order to
carry out a task when a Context is modified. It would be great if there is
a clear explanation on how this is to be checked.

On Fri, Feb 26, 2016 at 5:21 PM, Mark Thomas  wrote:

> On 26/02/2016 11:44, Chiranga Alwis wrote:
> > Hi,
> >
> > I have currently created a LifecycleListener which listens to Tomcat's
> > context deployment event and loads data in a custom configuration file at
> > that point.
> >
> > I have been trying to find out whether LifecycleListeners support context
> > update and modification events but yet in my understanding I could not
> > discover an appropriate resource to use.
>
> Define update.
>
> Define modification.
>
> Better still, explain what it is you actually want to achieve rather
> than ask for help implementing your, potentially flawed, solution.
>
> Mark
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: Apache Tomcat context update listeners

2016-02-26 Thread Mark Thomas
On 26/02/2016 11:44, Chiranga Alwis wrote:
> Hi,
> 
> I have currently created a LifecycleListener which listens to Tomcat's
> context deployment event and loads data in a custom configuration file at
> that point.
> 
> I have been trying to find out whether LifecycleListeners support context
> update and modification events but yet in my understanding I could not
> discover an appropriate resource to use.

Define update.

Define modification.

Better still, explain what it is you actually want to achieve rather
than ask for help implementing your, potentially flawed, solution.

Mark

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Apache Tomcat context update listeners

2016-02-26 Thread Chiranga Alwis
Hi,

I have currently created a LifecycleListener which listens to Tomcat's
context deployment event and loads data in a custom configuration file at
that point.

I have been trying to find out whether LifecycleListeners support context
update and modification events but yet in my understanding I could not
discover an appropriate resource to use.

Most specifically, no event type which is triggered at the point of Context
modification has been provided. Or does Tomcat first destroy the modified
context instance and create a new Context instance which means it calls a
destroy event on the Context and then create a new Context instance?

The ones that have come closest to the expectations are as follows:

 - A Context WatchedResource
 which simply
observes defined resources
   within a context. But yet in my understanding this does not allow me
   to monitor any modification within the context.

 - Java WatchService


It also has to be noted that currently I am collecting all the deployed
Contexts at deployment to a map along with their corresponding custom
configuration objects. Hence, there has to be a mechanism through which I
am to identify the Context which is modified.

Any help with this will be highly appreciated.


Re: tomcat context with /

2015-10-06 Thread Mark Thomas
On 06/10/2015 22:56, Harish Kulkarni wrote:
> Hi
> 
> We are migrating a WebSphere app to tomcat.
> In Websphere the context is defined as /secure/admin and we have hardcode
> redirects with /secure/admin/*

Whoops. Applications are meant to be independent of the context path at
which they are deployed.

> Our war is admin.war.
> Tomcat is not allowing /secure/admin as context.
> Is there a way using tomcat rewrite or apache config to achieve this.

Rename the WAR to secure#admin.war

Mark


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: tomcat context with /

2015-10-06 Thread Harish Kulkarni
Hi

We are migrating a WebSphere app to tomcat.
In Websphere the context is defined as /secure/admin and we have hardcode
redirects with /secure/admin/*
Our war is admin.war.
Tomcat is not allowing /secure/admin as context.
Is there a way using tomcat rewrite or apache config to achieve this.

Thanks
Harish


Re: We have a problem involving weird error messages in our Tomcat context, and catalina.out growing to enormous size.

2015-06-22 Thread André Warnier

James H. H. Lampert wrote:

We have two weird things going on at the same customer installation.

First, we have a situation in which catalina.out is inexplicibly growing 
to enormous size (4558505886 bytes) in a very short time (under a week), 
and growing by 4k in under a minute. And yet the catalina.[date] files 
are all of very reasonable size.


Second, we've been finding a lot of There is no process to read data 
written to a pipe. exceptions. They're apparently being thrown by our 
own code, but we haven't been able to determine why, and while a Google 
search on that exact phrase turns up hundreds of references specific to 
aix, it doesn't turn up any specific to OS/400 (or whatever IBM is 
calling it this week). Don't know if there's any connection between that 
and the enormous catalina.out.


Tomcat version is 7.0.47, running on an AS/400.


Hi.
I don't know anything about AS/400 - OS/400.
But catalina.out is usually where the output of the *JVM* is being re-directed
(such as exceptions in the JVM etc..).
Can you see what's being written ?
(iow, is there an equivalent to tail -f filename under OS/400 ?)


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: We have a problem involving weird error messages in our Tomcat context, and catalina.out growing to enormous size.

2015-06-22 Thread James H. H. Lampert

On 6/22/15 12:11 PM, Christopher Schultz wrote:

Well... what's in the catalina.out file? Is it huge numbers of
exceptions of the type described above?


Still haven't been able to see what's in it (the terminal-based tools 
won't handle stream files that big), but when this happened before, it 
wasn't 4 gigabytes; it was 6 HUNDRED gigabytes.


--
JHHL

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: We have a problem involving weird error messages in our Tomcat context, and catalina.out growing to enormous size.

2015-06-22 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

James,

On 6/22/15 4:58 PM, James H. H. Lampert wrote:
 On 6/22/15 12:11 PM, Christopher Schultz wrote:
 Well... what's in the catalina.out file? Is it huge numbers of 
 exceptions of the type described above?
 
 Still haven't been able to see what's in it (the terminal-based
 tools won't handle stream files that big), but when this happened
 before, it wasn't 4 gigabytes; it was 6 HUNDRED gigabytes.

Wow.

Is there an AS/400 version of head (or tail)?

Even dd would work... just ask for something like bytes 1,000,000 -
2,000,000 and dump that to a file, then look at *that* file.

- -chris
-BEGIN PGP SIGNATURE-
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJViIaFAAoJEBzwKT+lPKRYiXQP/2jptaeBVRpitNQt7F6XtxWa
MnUCSZ2ru54pntBnutfJgWMZ0PoYx+6mOf5LboKSMi+FXAGH9hQYmN5x52aqiRPO
HR79YwksdsXH1CqJV7rnSbKI3L9uHLboGlA/mwlGDBdwIT+N0faZYGbvIKjDCQEK
dnXEMdWudjZG5MNUMIPhcWwKjMu+xsi12XGXbGgdkyEaVPMQqZoTUQPR+BK5eHl0
BqiJSpN6GTC8z4Jk140ErYI8ecxw3bsfyG/ZpX8G06A/r7qt5O8sLHLQxj4B2mV1
/8n5DlAG8Rub7ImxlOmmb221kCDdf990qHB0CN5AuOTNXuygwBM1LodL9bzPFZfJ
tVIEZD1kyq/VopQIv3Goe9XNMpbmC5EhecyyUBoW+C2C5iz5FLKVHQpehsK3QD1+
cljodHDOlK302/OHs9sexut4g2HjGYmQ6/fq7fqgILDVELpHhoAl1nxvJB4a6Lgw
HqMGr7yOit0vzWcCnVRWInHe683w43AC8N+hSyDB9Lm5mIKOE4qUt3JpuS5zdRRM
Y5qDin44mejQnjR9Gq3lOBDIdJFsSj1BSmaiulbo6+eQ3exnueWVNlMihLmjDlL1
k3IU3rfYJIe1W4S5kdpHTNI9AZLohcmc8lLI38w/ibcrpt2sqmJ8HS4xxi8MvFIl
1VQYDJStAvOghF3NF/iH
=W8U0
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: We have a problem involving weird error messages in our Tomcat context, and catalina.out growing to enormous size.

2015-06-22 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

James,

On 6/22/15 2:54 PM, James H. H. Lampert wrote:
 We have two weird things going on at the same customer
 installation.
 
 First, we have a situation in which catalina.out is inexplicibly
 growing to enormous size (4558505886 bytes) in a very short time
 (under a week), and growing by 4k in under a minute. And yet the
 catalina.[date] files are all of very reasonable size.
 
 Second, we've been finding a lot of There is no process to read
 data written to a pipe. exceptions. They're apparently being
 thrown by our own code, but we haven't been able to determine why,
 and while a Google search on that exact phrase turns up hundreds of
 references specific to aix, it doesn't turn up any specific to
 OS/400 (or whatever IBM is calling it this week). Don't know if
 there's any connection between that and the enormous catalina.out.

Well... what's in the catalina.out file? Is it huge numbers of
exceptions of the type described above?

 Tomcat version is 7.0.47, running on an AS/400.

You might be able to get some mileage out of using
swallowOutput=true on your Context. Depending upon the nature of
the output being logged, that may direct the tons-of-error-logging to
the daily log files, which are easier to manage (compress, delete, etc.)
.

- -chris
-BEGIN PGP SIGNATURE-
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJViF3UAAoJEBzwKT+lPKRYa50QAL4XO58veYR0JgEJ7avjwAMD
wQ92F7tEaJJQ5IJB7f5bjDzfO43pZFzWE5g4pVthZt3wi0XdD/QUE6yigtRmPslF
UFf7wr4mCox4gWqOQnBoqvLLy9zizQLkC1A6JnUev8IHGG496DeLRPrsxtsmIn+x
NzWdRFsP2tgfyyADBagSz+Tg5V1KO0EmEsj+jBLAWGFHcGlqJe7BmGi4CIaiFy0r
kZu2YdLlZ+F+ZFoezNophTiXIvNEMjZE5bkUyu0uQNqFbquwuF7yBhIWMcCy9aJF
8OPRiBeBq7fiPcq4U2zTF2+BQ5r9183bGTCJR5G1UsWhMv+ppNCGDVwswdeCu4n7
oT5MaiJ1uQJUq6F8MOlXFJFacvgmVoO7Y9on9FijO+rkdKVFj0wzKEl0iJDLdHY2
5X9GAVl9bF5JHclEFHKE3/rOebQhh1btS+UH/cFkU6en51k7dvlKgNTOVY7U2m3Y
JKrtlN3ihBMuYJ0pbp1ioS2ZyqiU9ZVqD4qmJW+jWUTA7wP07EsmZDZm/5acMgxj
bdGwQU2+gePKu8AZQDyBmVBgUl5HxLS2Qyh8fR3Ew1QcQ4I+BSTCpCWCWUtqWOU7
/zTA4aS6t6WA7SlGzc8ypL7aflhd2TtNJmMnj11XDUZ6kj5nz7ytwKDCXNjwQETa
WkgaOvzGTV2Qy5aw1tAb
=8s3O
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



We have a problem involving weird error messages in our Tomcat context, and catalina.out growing to enormous size.

2015-06-22 Thread James H. H. Lampert

We have two weird things going on at the same customer installation.

First, we have a situation in which catalina.out is inexplicibly growing 
to enormous size (4558505886 bytes) in a very short time (under a week), 
and growing by 4k in under a minute. And yet the catalina.[date] files 
are all of very reasonable size.


Second, we've been finding a lot of There is no process to read data 
written to a pipe. exceptions. They're apparently being thrown by our 
own code, but we haven't been able to determine why, and while a Google 
search on that exact phrase turns up hundreds of references specific to 
aix, it doesn't turn up any specific to OS/400 (or whatever IBM is 
calling it this week). Don't know if there's any connection between that 
and the enormous catalina.out.


Tomcat version is 7.0.47, running on an AS/400.

--
James H. H. Lampert
Touchtone Corporation

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Checking to see if a Tomcat context is alive or hung

2014-03-08 Thread Hassan Schroeder
On Fri, Mar 7, 2014 at 10:16 AM, James H. H. Lampert
jam...@touchtonecorp.com wrote:
 I've been asked to come up with a command-line (or batch job) utility
 (running on an AS/400) to check, programmatically, whether a Tomcat context
 that's part of one of our products is alive and accepting connections, or
 hung.

 Any suggestions?

Unless you're committed to rolling your own solution, how about
NewRelic https://docs.newrelic.com/docs/java/new-relic-for-java

( Disclaimer: I haven't used the java agent myself, just their Rails
agent, but that's great even at the free account level. YMMV. )

-- 
Hassan Schroeder  hassan.schroe...@gmail.com
http://about.me/hassanschroeder
twitter: @hassan

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Checking to see if a Tomcat context is alive or hung

2014-03-08 Thread Konstantin Kolinko
2014-03-07 22:16 GMT+04:00 James H. H. Lampert jam...@touchtonecorp.com:
 I've been asked to come up with a command-line (or batch job) utility
 (running on an AS/400) to check, programmatically, whether a Tomcat context
 that's part of one of our products is alive and accepting connections, or
 hung.

 I'm already attempting to pick the brains of our people who developed the
 Tomcat context, to see what they can recommend I do. And I've also asked the
 Midrange List for their suggestions.

 But I'd like the Tomcat List's input as well. One idea I had, since we
 bundle an open-source AS/400 HTTP client library called HTTPAPI with the
 product, was to send test requests to the context via HTTPAPI.

 Another idea I've had would be to run some sort of headless test Java
 program, since the AS/400 does include a JVM (after all, it wouldn't be able
 to run Tomcat without one).

 Any suggestions?


Some pointers.

http://wiki.apache.org/tomcat/FAQ/Performance_and_Monitoring
http://wiki.apache.org/tomcat/FAQ/Monitoring#External_Monitoring_Tools
http://monitoring.apache.org/status/

Best regards,
Konstantin Kolinko

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Checking to see if a Tomcat context is alive or hung

2014-03-07 Thread James H. H. Lampert
I've been asked to come up with a command-line (or batch job) utility 
(running on an AS/400) to check, programmatically, whether a Tomcat 
context that's part of one of our products is alive and accepting 
connections, or hung.


I'm already attempting to pick the brains of our people who developed 
the Tomcat context, to see what they can recommend I do. And I've also 
asked the Midrange List for their suggestions.


But I'd like the Tomcat List's input as well. One idea I had, since we 
bundle an open-source AS/400 HTTP client library called HTTPAPI with the 
product, was to send test requests to the context via HTTPAPI.


Another idea I've had would be to run some sort of headless test Java 
program, since the AS/400 does include a JVM (after all, it wouldn't be 
able to run Tomcat without one).


Any suggestions?

--
JHHL

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Checking to see if a Tomcat context is alive or hung

2014-03-07 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

James,

On 3/7/14, 1:16 PM, James H. H. Lampert wrote:
 I've been asked to come up with a command-line (or batch job)
 utility (running on an AS/400) to check, programmatically, whether
 a Tomcat context that's part of one of our products is alive and
 accepting connections, or hung.

Do you already have any kind of monitoring infrastructure? If so, what
is it?

 I'm already attempting to pick the brains of our people who
 developed the Tomcat context, to see what they can recommend I do.
 And I've also asked the Midrange List for their suggestions.
 
 But I'd like the Tomcat List's input as well. One idea I had, since
 we bundle an open-source AS/400 HTTP client library called HTTPAPI
 with the product, was to send test requests to the context via
 HTTPAPI.
 
 Another idea I've had would be to run some sort of headless test
 Java program, since the AS/400 does include a JVM (after all, it
 wouldn't be able to run Tomcat without one).

Are there any requirements that the program be local to the JVM
where Tomcat is running? You can connect via TCP to either an HTTP
connection or an AJP to see if a knock knock works, and you don't
have to do it with either an AS/400 native application /or/ Java --
you can ping it from the outside if you want.

As for telling if the context is up and running, that's a bit tough:
you'll need something available inside the context that can tell you
what you want to know. For instance, if you want to know if you can
connect and run a JSP, then just write a JSP called ping or
something that writes OK back to the response stream. Then just
connect via HTTP and look for that string.

If you're looking for something more robust, you might want to check
for other things -- like the status of the executor's thread pool,
connector status, etc. You can do stuff like via JMX, and there's
already a webapp that ships with Tomcat that will let you inspect JMX
beans via HTTP: the Manager webapp.

If you want to see how you can monitor Tomcat in this way, think about
attending ApacheCon NA 2014 in April in Denver, CO. I'll be giving a
presentation on this exact topic. (Well, not checking context
health, as that's kind of an application-specific thing).

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJTGis7AAoJEBzwKT+lPKRYT0MQAL5gBg8erFPArm+NwsItxR0D
Eg/2lvqf6Ksf8t69r8kpbo7t2nQL/2RaRlCo1mkq64fGVZxiUC246AyQofJMMpKr
cnJudhKC5XHrTcwPfb2XLtHzamkLbIrgXS6gPXcyzEXcrFgQBI38T2XTL1JIz5cJ
MPM5w/jE4ouoMFJ2t32ofFA2naXmA/EcY/EKYWW2y+TmslduauVzh+uuSuhyfTCM
9wV34dh16b9BMn7jJ2mqG5L0cyivADiYpF8cO3KoyxY+iPrmjTlLcGGtPU2boS1U
p91COAp5Cpf9zSJ9e/XUyInmTyYyx5hPGQ8oD9Fn0SUzej8167e41hU7jy93mSX/
W/XU2xvfqEVJmdv8RlsB1IQQCwhz0/wGc2snXhRiuF+a4HxomqMkMeuMHUHMG1XZ
C7sYtxJLGgGzIETO/dFhUBdQR8aK8/m7GCJpXiPZxPLux3DenWxGsqVn6UOe6gdA
Wmp4dvEqqbCmKOxkgNi51KV6/eQKGgM97FTw1kd1371AZ1oqADCS307Hf6dsFMbr
30yU+ZSwEuh9IPijTolhhqrpRAgj7wyWMOkIvu2mkYOs1kWUR9u7ErttXq1WRo8g
7jGbf5RlodSf9DroECt9Xk9p885XQPQDeSuLP5MfTx3WcV0YWe49F/9KiK9sQdJ2
9/4fUE+QAxe1+JkirWRw
=gl4p
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat context startup failed

2010-02-17 Thread André Warnier

Hadole, Nishant IN BOM SISL wrote:

Dear Simone,

The obvious error displayed from log is  java.lang.NoClassDefFoundError: 
org/apache/xerces/util/EncodingMap. First check whether the xerces jar containing 
mentioned class is in place. Try downloading new jar and again restart the tomcat 
services.



I am no great Java or Eclipse expert, but sometimes one wonders how 
explicit an error log message must be, that one would notice.


In the submitted logfile, these two errors happen first :

 16-feb-2010 16.48.14 org.apache.catalina.loader.WebappClassLoader 
validateJarFile
 INFO: validateJarFile(C:\Program 
Files\Apache\Tomcat55\webapps\Calzedonia2007\WEB-INF\lib\j2ee.jar) - jar 
not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: 
javax/servlet/Servlet.class
 16-feb-2010 16.48.14 org.apache.catalina.loader.WebappClassLoader 
validateJarFile
 INFO: validateJarFile(C:\Program 
Files\Apache\Tomcat55\webapps\Calzedonia2007\WEB-INF\lib\javaee.jar) - 
jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: 
javax/servlet/Servlet.class


In section 9.7.2 of the servlet spec, it says :

SRV.9.7.2 Web Application Class Loader

...
As described in the J2EE license agreement, servlet containers that are 
not part of a J2EE product should not allow the application to override 
J2SE platform classes, such as those in the java.*
and javax.* namespaces, that J2SE does not allow to be modified. Also, 
servlet containers that are part of a J2EE product should not allow the 
application to override J2SE or J2EE platform classes, such as those in 
java.* and javax.* namespaces, that either J2SE or J2EE do not allow to 
be modified. The container should not allow applications to override or 
access the container’s implementation...


I would tend to interpret this as :
- this web application tries to load jar files containing classes which 
would redefine classes of the JVM. The log message also indicates which 
jar's that is.
- the container (Tomcat) thus - rightly according to the spec - rejects 
the loading of these jar's.
- and then, later on, something else fails, maybe because another class 
(which may also have been in these rejected jar's) is missing.


Should not the first two errors above be attended to first ?




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat context startup failed

2010-02-17 Thread Bob Hall
Andre,

--- On Wed, 2/17/10 at 1:06 AM, André Warnier a...@ice-sa.com wrote:

  The obvious error displayed from log is 
 java.lang.NoClassDefFoundError:
 org/apache/xerces/util/EncodingMap. First check whether the
 xerces jar containing mentioned class is in place. Try
 downloading new jar and again restart the tomcat services.
  

The NoClassDefFoundError can also be caused by having more than one
copy of a given class available due to its having been loaded by
separate class loaders.

The OP should check his Tomcat installation for multiple .jars that
contain the missing class.

 I am no great Java or Eclipse expert, but sometimes one
 wonders how explicit an error log message must be, that one
 would notice.
 
 In the submitted logfile, these two errors happen first :
 
  16-feb-2010 16.48.14
 org.apache.catalina.loader.WebappClassLoader
 validateJarFile
  INFO: validateJarFile(C:\Program
 Files\Apache\Tomcat55\webapps\Calzedonia2007\WEB-INF\lib\j2ee.jar)
 - jar not loaded. See Servlet Spec 2.3, section 9.7.2.
 Offending class: javax/servlet/Servlet.class
  16-feb-2010 16.48.14
 org.apache.catalina.loader.WebappClassLoader
 validateJarFile
  INFO: validateJarFile(C:\Program
 Files\Apache\Tomcat55\webapps\Calzedonia2007\WEB-INF\lib\javaee.jar)
 - jar not loaded. See Servlet Spec 2.3, section 9.7.2.
 Offending class: javax/servlet/Servlet.class
 
 Should not the first two errors above be attended to first
 ?
 

The offending .jar files were not loaded and can't contribute to any problems.

- Bob




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Tomcat context startup failed

2010-02-17 Thread Caldarale, Charles R
 From: Bob Hall [mailto:rfha...@yahoo.com]
 Subject: Re: Tomcat context startup failed
 
 The offending .jar files were not loaded and can't contribute to any
 problems.

Don't bet on it: if the app has its own ClassLoader, it may well ignore the 
finer points of the servlet spec.  Regardless, the invalid jars should be 
removed, since it's illegal to have them there.  As André said, clean up the 
obvious errors before chasing down the more difficult ones.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Data Source Resource Declaration in Tomcat Context

2009-12-09 Thread Anurag Kapur
Tomcat version: 5.5.27
Java version: 1.5.0_14-b03

I have a datasource configured in global context (via present in
[tomcat_home]/conf/context.xml) as follows:

Context

Resource name=*@tomcat.context.ece.read.ds.resource@* auth=*Container
type=@tomcat.context.driver.type@ driverClassName=
@tomcat.context.driver.class@ url=@tomcat.context.db.url@
connectionProperties=
{validateconnecti...@tomcat.context.validate.connection@
,connectionwaittimeo...@tomcat.context.connection.wait.timeout@} username=
@tomcat.context.db.user@ password=@tomcat.context.db.password@
validationQuery=@tomcat.context.validation.query@ initialSize=
@tomcat.context.initial.size@ minIdle=@tomcat.context.min.idle@
maxActive=@tomcat.context.max.active@ maxIdle=@tomcat.context.max.idle@
  maxWait=@tomcat.context.max.wait@ removeAbandonedTimeout=60
removeAbandoned=true logAbandoned=true/*
/Context

I know a DS defined as above is visible across all the contexts defined in
the container. What I want to know is whether the data source is created for
each context or is it shared across all the available contexts?

I need to know this because if it is duplicated and not shared and the data
source establishes say 5 connections with the DB, it would mean that the
total connections to the DB would be 5 * number of contexts defined in the
container. Thus to estimate the number of DB connections this information is
needed.

Any help appreciated.

Regards

--
Anurag Kapur
Associate - Technology,
Sapient Corporation.

http://www.linkedin.com/in/anuragkapur

http://www.google.com/profiles/anuragkapur
--


Re: Data Source Resource Declaration in Tomcat Context

2009-12-09 Thread Mark Thomas
Anurag Kapur wrote:
 Tomcat version: 5.5.27
 Java version: 1.5.0_14-b03
 
 I have a datasource configured in global context (via present in
 [tomcat_home]/conf/context.xml) as follows:

snip/

 I know a DS defined as above is visible across all the contexts defined in
 the container. What I want to know is whether the data source is created for
 each context or is it shared across all the available contexts?

One DS is created for each context.

If you want a single DS, create it is a global resource and then
reference the global resource from CATALINA_BASE/conf/context.xml

Mark




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Data Source Resource Declaration in Tomcat Context

2009-12-09 Thread Anurag Kapur
Thanks Mark.

Can you confirm that I can have one data source shared across all contexts
with the following configurations:

In CATALINA_BASE/conf/server.xml, I define a GlobalNamingResource as
follows:

GlobalNamingResources
...
...
Resource name=*@tomcat.context.ece.read.ds.resource@* auth=*Container
type=@tomcat.context.driver.type@ driverClassName=
@tomcat.context.driver.class@ url=@tomcat.context.db.url@
connectionProperties=
{validateconnecti...@tomcat.context.validate.connection@
,connectionwaittimeo...@tomcat.context.connection.wait.timeout@} username=
@tomcat.context.db.user@ password=@tomcat.context.db.password@
validationQuery=@tomcat.context.validation.query@ initialSize=
@tomcat.context.initial.size@ minIdle=@tomcat.context.min.idle@
maxActive=@tomcat.context.max.active@maxIdle=@tomcat.context.max.idle@
maxWait=@tomcat.context.max.wait@removeAbandonedTimeout=60
removeAbandoned=true logAbandoned=true/*

/GlobalNamingResources

I then reference it in CATALINA_BASE/conf/context.xml as follows:

Context
ResourceLink name=@tomcat.context.ece.read.ds.resource@
global=@tomcat.context.ece.read.ds.resource@
type=@tomcat.context.driver.type@/
/Context

Information obtained from your reply and
http://tomcat.apache.org/tomcat-5.5-doc/config/globalresources.html

Kind Regards

--
Anurag Kapur
Associate - Technology,
Sapient Corporation.

http://www.linkedin.com/in/anuragkapur

http://www.google.com/profiles/anuragkapur
--
Sent from Poplar, Greater London, United Kingdom

On Wed, Dec 9, 2009 at 5:16 PM, Mark Thomas ma...@apache.org wrote:

 Anurag Kapur wrote:
  Tomcat version: 5.5.27
  Java version: 1.5.0_14-b03
 
  I have a datasource configured in global context (via present in
  [tomcat_home]/conf/context.xml) as follows:

 snip/

  I know a DS defined as above is visible across all the contexts defined
 in
  the container. What I want to know is whether the data source is created
 for
  each context or is it shared across all the available contexts?

 One DS is created for each context.

 If you want a single DS, create it is a global resource and then
 reference the global resource from CATALINA_BASE/conf/context.xml

 Mark




 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org




Re: Data Source Resource Declaration in Tomcat Context

2009-12-09 Thread Mark Thomas
Anurag Kapur wrote:
 Thanks Mark.
 
 Can you confirm that I can have one data source shared across all contexts
 with the following configurations:
 
 In CATALINA_BASE/conf/server.xml, I define a GlobalNamingResource as
 follows:
 
 GlobalNamingResources
 ...
 ...
 Resource name=*@tomcat.context.ece.read.ds.resource@* auth=*Container
 type=@tomcat.context.driver.type@ driverClassName=
 @tomcat.context.driver.class@ url=@tomcat.context.db.url@
 connectionProperties=
 {validateconnecti...@tomcat.context.validate.connection@
 ,connectionwaittimeo...@tomcat.context.connection.wait.timeout@} username=
 @tomcat.context.db.user@ password=@tomcat.context.db.password@
 validationQuery=@tomcat.context.validation.query@ initialSize=
 @tomcat.context.initial.size@ minIdle=@tomcat.context.min.idle@
 maxActive=@tomcat.context.max.active@maxIdle=@tomcat.context.max.idle@
 maxWait=@tomcat.context.max.wait@removeAbandonedTimeout=60
 removeAbandoned=true logAbandoned=true/*
 
 /GlobalNamingResources
 
 I then reference it in CATALINA_BASE/conf/context.xml as follows:
 
 Context
 ResourceLink name=@tomcat.context.ece.read.ds.resource@
 global=@tomcat.context.ece.read.ds.resource@
 type=@tomcat.context.driver.type@/
 /Context

The type looks odd but if it is correct then that should work.

Mark




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Data Source Resource Declaration in Tomcat Context

2009-12-09 Thread Anurag Kapur
Perfect Thanks!

The type I use would be:
jhttp://tomcat.apache.org/tomcat-5.5-doc/config/globalresources.html
avax.sql.DataSource

(I was using untokenized reference in my example)

Thanks for your help.

Regards
Anurag

--
Anurag Kapur
Associate - Technology,
Sapient Corporation.

http://www.linkedin.com/in/anuragkapur

http://www.google.com/profiles/anuragkapur
--
Sent from Poplar, Greater London, United Kingdom

On Wed, Dec 9, 2009 at 6:15 PM, Mark Thomas ma...@apache.org wrote:

 Anurag Kapur wrote:
  Thanks Mark.
 
  Can you confirm that I can have one data source shared across all
 contexts
  with the following configurations:
 
  In CATALINA_BASE/conf/server.xml, I define a GlobalNamingResource as
  follows:
 
  GlobalNamingResources
  ...
  ...
  Resource name=*@tomcat.context.ece.read.ds.resource@*
 auth=*Container
  type=@tomcat.context.driver.type@ driverClassName=
  @tomcat.context.driver.class@ url=@tomcat.context.db.url@
  connectionProperties=
  {validateconnecti...@tomcat.context.validate.connection@
  ,connectionwaittimeo...@tomcat.context.connection.wait.timeout@}
 username=
  @tomcat.context.db.user@ password=@tomcat.context.db.password@
  validationQuery=@tomcat.context.validation.query@ initialSize=
  @tomcat.context.initial.size@ minIdle=@tomcat.context.min.idle@
  maxActive=@tomcat.context.max.active@
 maxIdle=@tomcat.context.max.idle@
  maxWait=@tomcat.context.max.wait@removeAbandonedTimeout=60
  removeAbandoned=true logAbandoned=true/*
 
  /GlobalNamingResources
 
  I then reference it in CATALINA_BASE/conf/context.xml as follows:
 
  Context
  ResourceLink name=@tomcat.context.ece.read.ds.resource@
  global=@tomcat.context.ece.read.ds.resource@
  type=@tomcat.context.driver.type@/
  /Context

 The type looks odd but if it is correct then that should work.

 Mark




 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org




Re: Can Tomcat context path be multilevel

2009-12-09 Thread Prashantha H
Hi All,

I have an application which needs to be deployed and accessed with
multilevel context path in the url.
So I have updated the TOMCAT_HOME/Conf/Server.xml with an appropriate
entry for this.

For Example:
If my application name is Doc.war and I want it to be accessed using
multilevel context path dco/smartfolder. (
http://localhost:8080/dco/smartfolder/)

I have made the below entry in the Conf/Server.xml file.
Context path=/dco/smartfolder/ docBase=Doc
reloadable=true/Context

When I Start my Tomcat after making the above changes, it will end up
having two deploy folders created when it explodes, Documentum and another
dco(Within which it will have smartfolder directory).

Is there  a way we avoid creation of this multiple folders when it gets
deployed and still be able to be access the application using the multilevel
context path?

I have verified this in both 5.5 and 6.0.18 version of Tomcat and the
behavior is same.

Any help is appreciated.

Thanks,
Prash
o


Re: Can Tomcat context path be multilevel

2009-12-09 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Prashantha,

On 12/9/2009 2:05 PM, Prashantha H wrote:
 If my application name is Doc.war and I want it to be accessed using
 multilevel context path dco/smartfolder. (
 http://localhost:8080/dco/smartfolder/)

Heh. So, you're on Windows, then? Doc.war ought to deploy to /Doc, not
to /doc (or even /dco).

 I have made the below entry in the Conf/Server.xml file.

Don't do that: use the preferred deployment descriptor in your WAR
file's META-INF/context.xml.

 Context path=/dco/smartfolder/ docBase=Doc
 reloadable=true/Context

In META-INF/context.xml, neither the path nor the docBase attributes are
allowed. Remove them.

The easiest thing to do is to name your WAR file dco#smartfolder.war and
it will be deployed to /dco/smartfolder

 When I Start my Tomcat after making the above changes, it will end up
 having two deploy folders created when it explodes, Documentum and another
 dco(Within which it will have smartfolder directory).

It appears that Documentum is a separate webapp, and /should/ be
deployed separately.

 Is there  a way we avoid creation of this multiple folders when it gets
 deployed and still be able to be access the application using the multilevel
 context path?

Each webapp will deploy into a separate folder, regardless of any
coincident URL mappings.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAksf/HMACgkQ9CaO5/Lv0PBxUACfWc5d+pgfjlv0Z5gC3qDYLkOP
i+oAniYl20K6sfAtecDmwQ3IqYiOm+gK
=0FSX
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



webapp in tomcat context cannot access a python proxy residing in apache

2009-01-14 Thread g f
Hello all,
not sure if this should be asked here or in the apache list so I will try
here first.

I have an application running completely inside of tomcat 6...lets call it
webappTomcat which runs on port 8084.

A coworker developed an application that runs mainly on apache(html and
javascript) although he makes ajax requests to servlets. Lets call it
webappApache.
When he makes his ajax requests he does so through a pseudo proxy(to allow
cross domain) that is written in python. This proxy resides in apache on
port 80.

We need to merge both applications. I want to merge webappApache
*into*webappTomcat.

Basically bring all of the html and javascript code from webappApache into
webappTomcat and retain the use of the proxy on Apache for cross domain
calls.

When I do this, the calls to the apache python proxy fail. It seem like
there is no *path* to the proxy from tomcat.

example:

http://localhost:8084/webappTomcat/index.jsp makes an ajax call through the
proxy to http://localhost:8084/anotherTomcatWebApp/Servlet

http://localhost:8084/webappTomcat/index.jsp ---
http://localhost/webappApache/pythonProxy.py  ---
http://localhost:8084/anotherTomcatWebApp/Servlet

so the request would look something like this:

from webappTomcat an ajax request to
http://localhost/webappApache/pythonProxy.py?url=http://localhost:8084/anotherTomcatWebAppServlet?parameterX=345parameterY=199

Is there some configuration needed on tomcat for this to work?

Keep in mind that this is not a real proxy(ie, no cacheing or anything like
that).

We were thinking that perhaps a java proxy(residing in tomcat) that makes a
call to the python proxy(residing in apache) would be what we need but it
seems kind of hacky.

Thanks in advance!


RE: Question about Tomcat context

2008-10-24 Thread Peter Crowther
 From: Jerome Lepage - AKEROZ [mailto:[EMAIL PROTECTED]
 I have developped a web application on Tomcat (5.0.28).
 My webapp use Hibernate 3 and i have a Singleton pattern too.

 I want have my webapp deployed N time in same Tomcat Server.
 But i don't want to share context, hibernate and Singleton
 from one webapp to other.
 (Like database access is not the same)

Have you tried just deploying it N times, making sure all the jars are in 
WEB-INF/lib?  Each webapp should get its own classloader, and hence will have 
its own copies of Hibernate and your singleton.  I *think* they'll have 
different contexts, too, but I've not tried this.

By the way: if you start getting out of memory errors as you deploy more 
copies, make sure you have enough perm space configured in your JVM options.  
Hibernate can generate a lot of classes, and lots of copies of these classes 
can consume a lot of perm space.

- Peter

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Question about Tomcat context

2008-10-24 Thread Serge Fonville
Hi Jerome.

If you save everything that is specific to the context in that context, they
operate as separate.
Regards,

Serge Fonville

On Fri, Oct 24, 2008 at 12:02 PM, Jerome Lepage - AKEROZ 
[EMAIL PROTECTED] wrote:


 Hi, Thanks for quick answers

 My app is a Cms
 The sources, wars, deploy method is the same.
 Only a Environement String (pointing to a specific config dir) is
 différent with Context.

 I don't want to they share anything at all, because is not same customers
 for each context.
 So for security reason, i don't want to share (even i loose memory and
 space).

 My customers don't have access to tomcat at all (except the app off
 course).
 I will deploy, upgrade, remove, etc.. so if easyer it's better, but i don't
 really care about that.

 I have already separate context for previous version of my app.
 But i'm (was) not sure for sharing rules of tomcat in Singleton or
 Hibernate case.
 (Because the goal of a singleton by definition is to have unique instance)
 I was affraid in test, who i have see my Log4J logs in wrong directory
 (maybe it's because is in common/lib dir)

 So if i understand well, if the library(s) is not in common/lib but in
 WEB-INF/lib they don't share context ?

 Thanks again for your time and answers..

 Jerome Lepage
 AKEROZ


 - Original Message -
 From: Serge Fonville [EMAIL PROTECTED]
 To: Tomcat Users List users@tomcat.apache.org
 Sent: Friday, October 24, 2008 11:37 AM
 Subject: Re: Question about Tomcat context


 First a few questions;
 What does the app do
 Do the deployed applications differ
 What is the reason you want them separate
 Do they share anything, reaml,db,files,
 Do you need to be able to update them easily (all in one go)
 How do you intend to deploy them, war, copy, remote
 Is it an option to upgrade to Tomcat 6.0

 That said:

 By simply copying the same files to different contexts you have the same
 application available multiple times under different URLs.

 Regards,

 Serge Fonville

 On Fri, Oct 24, 2008 at 11:25 AM, Jerome Lepage - AKEROZ 
 [EMAIL PROTECTED] wrote:

 
  Hi @ll,
 
  I have developped a web application on Tomcat (5.0.28).
  My webapp use Hibernate 3 and i have a Singleton pattern too.
 
  I want have my webapp deployed N time in same Tomcat Server.
  But i don't want to share context, hibernate and Singleton from one
 webapp
  to other.
  (Like database access is not the same)
 
  I have see in tomcat doc, the share context parameters but i don't have
  tried at this time.
  (Or maybe in différent tomcat vhost)
 
  My question is, is it possible or not, and if yes how (almost a direction
  or a clue will be perfect).
 
  Thanks by advance for your time.
 
  Jerome Lepage
  AKEROZ



Re: Question about Tomcat context

2008-10-24 Thread Jerome Lepage - AKEROZ

Hi, Thanks to you too for your answers.

 Have you tried just deploying it N times, making sure all the jars are in 
 WEB-INF/lib?
 Each webapp should get its own classloader, and hence will have its own copies
 of Hibernate and your singleton.  I *think* they'll have different contexts, 
 too,
 but I've not tried this.

No i don't have tried at this time, i'm in beta version so i try to 
anticipate this problem before i was at this part :)
Ok i will try, thanks

 By the way: if you start getting out of memory errors as you deploy more 
 copies,
 make sure you have enough perm space configured in your JVM options.  
 Hibernate can generate a lot of classes, and lots of copies of these classes 
 can
 consume a lot of perm space.

I'm glade to discuss about that.
I'm aware that hibernate is a big giant library wich use lot of memory.
But when i launch tomcat with this env vars :
JAVA_OPTS=-XX:MaxPermSize=512m -Xms24m -Xmx512m

Tomcat looks like not really care about the memory i grant to JVM.
It's seems that tomcat have the memory but don't give to the différents contexts
I have a poor Free memory at each time...

Is it something i miss or not ?

Thanks again to you

Jerome Lepage
AKEROZ

RE: Question about Tomcat context

2008-10-24 Thread Peter Crowther
 From: Jerome Lepage - AKEROZ [mailto:[EMAIL PROTECTED]
 But when i launch tomcat with this env vars :
 JAVA_OPTS=-XX:MaxPermSize=512m -Xms24m -Xmx512m

Well, yes :-).  That should give you enough perm space.

 Tomcat looks like not really care about the memory i grant to JVM.
 It's seems that tomcat have the memory but don't give to the
 différents contexts
 I have a poor Free memory at each time...

I'm simplifying here - you're better off reading the JVM docs or waiting for 
Chuck* to tell me I'm wrong ;-).  Any Java virtual machine will only collect 
garbage a) when you tell it (and sometimes not then), or b) when it runs out of 
free memory and needs to allocate something.  Low free memory is not 
necessarily a problem - the JVM may just be being lazy about garbage collection.

- Peter

* who has forgotten more about Java virtual machines than I will ever learn

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Question about Tomcat context

2008-10-24 Thread Serge Fonville
First a few questions;
What does the app do
Do the deployed applications differ
What is the reason you want them separate
Do they share anything, reaml,db,files,
Do you need to be able to update them easily (all in one go)
How do you intend to deploy them, war, copy, remote
Is it an option to upgrade to Tomcat 6.0

That said:

By simply copying the same files to different contexts you have the same
application available multiple times under different URLs.

Regards,

Serge Fonville

On Fri, Oct 24, 2008 at 11:25 AM, Jerome Lepage - AKEROZ 
[EMAIL PROTECTED] wrote:


 Hi @ll,

 I have developped a web application on Tomcat (5.0.28).
 My webapp use Hibernate 3 and i have a Singleton pattern too.

 I want have my webapp deployed N time in same Tomcat Server.
 But i don't want to share context, hibernate and Singleton from one webapp
 to other.
 (Like database access is not the same)

 I have see in tomcat doc, the share context parameters but i don't have
 tried at this time.
 (Or maybe in différent tomcat vhost)

 My question is, is it possible or not, and if yes how (almost a direction
 or a clue will be perfect).

 Thanks by advance for your time.

 Jerome Lepage
 AKEROZ


Question about Tomcat context

2008-10-24 Thread Jerome Lepage - AKEROZ

Hi @ll,

I have developped a web application on Tomcat (5.0.28).
My webapp use Hibernate 3 and i have a Singleton pattern too.

I want have my webapp deployed N time in same Tomcat Server.
But i don't want to share context, hibernate and Singleton from one webapp to 
other.
(Like database access is not the same)

I have see in tomcat doc, the share context parameters but i don't have tried 
at this time.
(Or maybe in différent tomcat vhost)

My question is, is it possible or not, and if yes how (almost a direction or a 
clue will be perfect).

Thanks by advance for your time.

Jerome Lepage
AKEROZ

Re: Question about Tomcat context

2008-10-24 Thread Jerome Lepage - AKEROZ

Hi, Thanks for quick answers

My app is a Cms
The sources, wars, deploy method is the same.
Only a Environement String (pointing to a specific config dir) is différent 
with Context.

I don't want to they share anything at all, because is not same customers for 
each context.
So for security reason, i don't want to share (even i loose memory and space).

My customers don't have access to tomcat at all (except the app off course).
I will deploy, upgrade, remove, etc.. so if easyer it's better, but i don't 
really care about that.

I have already separate context for previous version of my app.
But i'm (was) not sure for sharing rules of tomcat in Singleton or Hibernate 
case.
(Because the goal of a singleton by definition is to have unique instance)
I was affraid in test, who i have see my Log4J logs in wrong directory (maybe 
it's because is in common/lib dir)

So if i understand well, if the library(s) is not in common/lib but in 
WEB-INF/lib they don't share context ?

Thanks again for your time and answers..

Jerome Lepage
AKEROZ


- Original Message - 
From: Serge Fonville [EMAIL PROTECTED]
To: Tomcat Users List users@tomcat.apache.org
Sent: Friday, October 24, 2008 11:37 AM
Subject: Re: Question about Tomcat context


First a few questions;
What does the app do
Do the deployed applications differ
What is the reason you want them separate
Do they share anything, reaml,db,files,
Do you need to be able to update them easily (all in one go)
How do you intend to deploy them, war, copy, remote
Is it an option to upgrade to Tomcat 6.0

That said:

By simply copying the same files to different contexts you have the same
application available multiple times under different URLs.

Regards,

Serge Fonville

On Fri, Oct 24, 2008 at 11:25 AM, Jerome Lepage - AKEROZ 
[EMAIL PROTECTED] wrote:


 Hi @ll,

 I have developped a web application on Tomcat (5.0.28).
 My webapp use Hibernate 3 and i have a Singleton pattern too.

 I want have my webapp deployed N time in same Tomcat Server.
 But i don't want to share context, hibernate and Singleton from one webapp
 to other.
 (Like database access is not the same)

 I have see in tomcat doc, the share context parameters but i don't have
 tried at this time.
 (Or maybe in différent tomcat vhost)

 My question is, is it possible or not, and if yes how (almost a direction
 or a clue will be perfect).

 Thanks by advance for your time.

 Jerome Lepage
 AKEROZ


RE: Question about Tomcat context

2008-10-24 Thread Caldarale, Charles R
 From: Peter Crowther [mailto:[EMAIL PROTECTED]
 Subject: RE: Question about Tomcat context

  From: Jerome Lepage - AKEROZ [mailto:[EMAIL PROTECTED]
  JAVA_OPTS=-XX:MaxPermSize=512m -Xms24m -Xmx512m

For server environments, you usually want to set Xms to the same value as Xmx 
to avoid heap thrashing.  Make sure you have enough RAM on the system to 
support not only the Java heap and PermGen spaces, but also the C heap, code 
space, and library/OS overhead.  If you don't have enough RAM, you'll get into 
paging, and your performance will disappera.

  It's seems that tomcat have the memory but don't give to the
  différents contexts

Heap memory is shared across all webapps, since they're all running in the same 
JVM; there's no way to provide separate heap space for each webapp.

 I'm simplifying here - you're better off reading the JVM docs
 or waiting for Chuck* to tell me I'm wrong ;-).

Nothing wrong here.

 Low free memory is not necessarily a problem - the
 JVM may just be being lazy about garbage collection.

Try using JConsole to watch the heap and PermGen while Tomcat's running; this 
will show if you are approaching a tight situation on memory space. (JVisualVM 
can also be used, but it's not as detailed.)

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Tomcat context issue

2007-05-03 Thread tb323

Hi there!
This is probably a dumb question if you're not a newbie like me. I just
installed Tomcat 6.0.10 on Ubuntu Feisty and I'm having some problems
configuring it. 
I'm attempting to move the appBase into a directory under my public_html. 

In server.xml I have this:

Host name=localhost 
appBase=/home/tb323/projects/www/public_html/webapps
unpackWARs=true autoDeploy=true
xmlValidation=false xmlNamespaceAware=false

This way I want to be able to start an app by going to
http://www.domain.com/webapps/appName
I also have Apache + Php on my server so in apache2.conf I've added :

JkMount /*.jsp ajp13_worker
JkMount /*.war ajp13_worker
JkMount /webapps/* ajp13_worker

Is there a way to avoid writing context.xmls for every webapp I place in the
appBase?
Like it is now Tomcat is looking for app at /webapps/appName while it
should be looking for /appName ..

// Tommy
-- 
View this message in context: 
http://www.nabble.com/Tomcat-context-issue-tf3686346.html#a10304508
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Tomcat context issue

2007-05-03 Thread Caldarale, Charles R
 From: tb323 [mailto:[EMAIL PROTECTED] 
 Subject: Tomcat context issue
 
 In server.xml I have this:
 
 Host name=localhost 
 appBase=/home/tb323/projects/www/public_html/webapps
 unpackWARs=true autoDeploy=true
 xmlValidation=false xmlNamespaceAware=false
 
 This way I want to be able to start an app by going to
 http://www.domain.com/webapps/appName

Normally, you wouldn't put webapps in the URL, since it's already part
of the appBase.  However, since you want to use that to route requests
from httpd to Tomcat, you'll need something to strip it out along the
way.  A valve in Tomcat could do the job; there's probably something in
httpd that will do it as well.

 JkMount /*.war ajp13_worker

The *.war setting is useless, since there won't be any direct requests
with a .war extension.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Tomcat context issue

2007-05-03 Thread tb323

Thanks for the extremely quick reply. :)
I'll check this out after work.

/Tommy


Caldarale, Charles R wrote:
 
 From: tb323 [mailto:[EMAIL PROTECTED] 
 Subject: Tomcat context issue
 
 In server.xml I have this:
 
 Host name=localhost 
 appBase=/home/tb323/projects/www/public_html/webapps
 unpackWARs=true autoDeploy=true
 xmlValidation=false xmlNamespaceAware=false
 
 This way I want to be able to start an app by going to
 http://www.domain.com/webapps/appName
 
 Normally, you wouldn't put webapps in the URL, since it's already part
 of the appBase.  However, since you want to use that to route requests
 from httpd to Tomcat, you'll need something to strip it out along the
 way.  A valve in Tomcat could do the job; there's probably something in
 httpd that will do it as well.
 
 JkMount /*.war ajp13_worker
 
 The *.war setting is useless, since there won't be any direct requests
 with a .war extension.
 
  - Chuck
 
 
 THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
 MATERIAL and is thus for use only by the intended recipient. If you
 received this in error, please contact the sender and delete the e-mail
 and its attachments from all computers.
 
 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Tomcat-context-issue-tf3686346.html#a10305254
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: tomcat context

2007-04-19 Thread Orlando Reis

Just deploy the context to anywhere you want it...
jar xvf potatos.war

Then as Andoni said:
context path=bananas
docBase=/path_contexts_directory/directory_where_you_extrated_the_war_file ...
  !-- Other stuff if necessary! --
/context

Is that it?

Orlando




On 4/17/07, José Perdigão [EMAIL PROTECTED] wrote:


OConchubhair, Andoni wrote:
 Hi,

 What do you mean by 'context path'?

 Basically, what you have is:

 context path=last_bit_of_URL docBase=name_of_war_or_folder ...
   !-- Other stuff if necessary! --
 /context

 -Original Message-
 From: José Perdigão [mailto:[EMAIL PROTECTED]
 Sent: 17 April 2007 15:37
 To: users@tomcat.apache.org
 Subject: tomcat context

 Hi,
 I'm using Apache Tomcat Version 5.5.23 and I would how is it possible to
 use a context path different to the name of the
 war file?
 Thanks

I want to deploy war files where the context name is not the same as the
original war file name, e.g. deploying potatoes.war and the context name
is /banana instead of /potatoes.

--
José Miguel Perdigão
homepage: zeperdi.pt.vu zeperdi.pt.vu

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: tomcat context

2007-04-17 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

José,

José Perdigão wrote:
 I'm using Apache Tomcat Version 5.5.23 and I would how is it possible to
 use a context path different to the name of the war file?

Most people will suggest that you use the proper WAR file name for your
context and leave it at that.

An alternative is to specify a Context element in your server.xml file
and specify the name of the context as well as the location of the WAR
file. Note that in this case I think it's a big mistake to put the WAR
file into the server's webapps directory... you're better off putting
it somewhere else or things will act funny.

- -chris

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGJOOB9CaO5/Lv0PARAqC7AJ0R3yTWejoMqeztvcC8lPSQi4JgrwCggZ+D
/+qkBthCq9fQEfiiNqVWo14=
=WxhQ
-END PGP SIGNATURE-

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



tomcat context

2007-04-17 Thread José Perdigão

Hi,
I'm using Apache Tomcat Version 5.5.23 and I would how is it possible to 
use a context path different to the name of the

war file?
Thanks
--
José Miguel Perdigão
homepage: zeperdi.pt.vu zeperdi.pt.vu

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: tomcat context

2007-04-17 Thread Caldarale, Charles R
 From: Christopher Schultz [mailto:[EMAIL PROTECTED] 
 Subject: Re: tomcat context
 
 An alternative is to specify a Context element in your 
 server.xml file and specify the name of the context as well
 as the location of the WAR file.

Gotta get you out of the 4.1 mindset, Chris :-)

Do NOT put Context elements in server.xml; any changes to them require
a restart of Tomcat.  Rather, put the Context element in
conf/Catalina/[host]/[appname].xml, where appname is the desired name of
the application - it need not match the name of the .war file.  Use a
docBase attribute for Context that points to the .war file, which MUST
be placed outside of the Host appBase directory - otherwise you will
get the application deployed twice, once under the desired name, once
under the .war name.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: tomcat context

2007-04-17 Thread OConchubhair, Andoni
Hi,

What do you mean by 'context path'?

Basically, what you have is:

context path=last_bit_of_URL docBase=name_of_war_or_folder ...
!-- Other stuff if necessary! --
/context

-Original Message-
From: José Perdigão [mailto:[EMAIL PROTECTED] 
Sent: 17 April 2007 15:37
To: users@tomcat.apache.org
Subject: tomcat context

Hi,
I'm using Apache Tomcat Version 5.5.23 and I would how is it possible to 
use a context path different to the name of the
war file?
Thanks
-- 
José Miguel Perdigão
homepage: zeperdi.pt.vu zeperdi.pt.vu

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: tomcat context

2007-04-17 Thread Caldarale, Charles R
 From: OConchubhair, Andoni [mailto:[EMAIL PROTECTED] 
 Subject: RE: tomcat context
 
 context path=last_bit_of_URL 
 docBase=name_of_war_or_folder ...
   !-- Other stuff if necessary! --
 /context

Several problems with the above:

1) It's Context, not context - this is case sensitive.

2) The path attribute is ignored unless the Context element is in
server.xml, which is strongly discouraged for Tomcat 5 and above.

3) The docBase attribute is ignored unless the Context element is in
server.xml or in conf/Catalina/[host]/[appname].xml, and even then must
not be specified unless the webapp is placed outside of the Host
appBase directory.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: tomcat context

2007-04-17 Thread José Perdigão

OConchubhair, Andoni wrote:

Hi,

What do you mean by 'context path'?

Basically, what you have is:

context path=last_bit_of_URL docBase=name_of_war_or_folder ...
!-- Other stuff if necessary! --
/context

-Original Message-
From: José Perdigão [mailto:[EMAIL PROTECTED] 
Sent: 17 April 2007 15:37

To: users@tomcat.apache.org
Subject: tomcat context

Hi,
I'm using Apache Tomcat Version 5.5.23 and I would how is it possible to 
use a context path different to the name of the

war file?
Thanks
  
I want to deploy war files where the context name is not the same as the 
original war file name, e.g. deploying potatoes.war and the context name 
is /banana instead of /potatoes.


--
José Miguel Perdigão
homepage: zeperdi.pt.vu zeperdi.pt.vu

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: tomcat context

2007-04-17 Thread Johnny Kewl

I think the answer is you dont
Have a look at this thread

http://mail-archives.apache.org/mod_mbox/tomcat-users/200704.mbox/thread?2

== Multilevel context path problem ==
Date Tue, 10 Apr 2007



- Original Message - 
From: José Perdigão [EMAIL PROTECTED]

To: users@tomcat.apache.org
Sent: Tuesday, April 17, 2007 4:36 PM
Subject: tomcat context



Hi,
I'm using Apache Tomcat Version 5.5.23 and I would how is it possible to 
use a context path different to the name of the

war file?
Thanks
--
José Miguel Perdigão
homepage: zeperdi.pt.vu zeperdi.pt.vu

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Tomcat Context

2006-08-18 Thread Bala Paranj
Thank you. The problem was that JBoss installation cannot have spaces in
the installed path. 

I did have the context defined below the host tag in server.xml. Hope
this helps someone.

-Original Message-
From: Dhiraj Ramakrishnan [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 15, 2006 10:33 PM
To: Tomcat Users List
Subject: Re: Tomcat Context

Hi ,

  How is the url mapping for the servlet in the web.xml? it should
not
include /myContext in the url mapping.

  The servlet url mapping in the web.xml should only be for
/somePath/MyServlet

  What do you get when you just type in
https://localhost:8443/myContextPath ?

Hope that helps ..

bye

Dhiraj

On 8/16/06, Bala Paranj [EMAIL PROTECTED] wrote:

 I changed the context to :

 Context path=/myContextPath appBase= docBase=C:\Program
 Files\jboss-4.0.4.GA\server\default\deploy debug=99
 reloadable=false
 /Context

 When I run the client, I get:

 Marking servlet MySeiServlet as unavailable? in the JBoss console. The
 client gets the error message:

 Server returned HTTP response code: 500 for URL:
 https://localhost:8443/myContextPath/somePath/MyServlet

 Does anyone know how to get this working? TIA.





-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Tomcat Context Problem

2006-08-15 Thread Bala Paranj
I am posting this question here because JBoss is using Tomcat
internally.
 
1. server.xml has the context path defined:
 
 Host name=localhost
autoDeploy=false deployOnStartup=false
deployXML=false  
 
Context path=/myContextPath/
 
 /Host
 
and is also configured for ssl:
 
Connector port=8443 address=${jboss.bind.address}
   maxThreads=100 strategy=ms maxHttpHeaderSize=8192
   emptySessionPath=true
   scheme=https secure=true clientAuth=false
   sslProtocol = TLS
   keystoreFile=${jboss.server.home.dir}/conf/server.keystore
   keystorePass=123456  
 
truststoreFile=${jboss.server.home.dir}/conf/server.truststore
   truststorePass=123456
   / 
 
2. web.xml has
 
servlet
servlet-nameMyServlet/servlet-name
servlet-classcom.xyz.MyServlet/servlet-class
/servlet

servlet-mapping
servlet-nameMyServlet/servlet-name
url-pattern/somePath/*/url-pattern
/servlet-mapping
 
This is under web-inf inside the myContextPath war file
 
3. JBoss console window shows:
 
Error starting static Resources java.lang.IllegalArgumentException: 
 
Document base C:\Program
Files\jboss-4.0.4.GA\server\default\.\myContextPath
does not exist or is not a readable directory
 
 
The client gets the following error message:
 
Server returned HTTP response code: 500 for URL:
https://localhost:8443/myContextPath/somePath/MyServlet
 
 
My question is why is the path whacked out like C:\Program
Files\jboss-4.0.4.GA\server\default\.\myContextPath instead
of pointing to the right directory which is : C:\Program
Files\jboss-4.0.4.GA\server\default\deploy (the war file is in this
directory)
 
How can I make JBoss/Tomcat point to the right directory?
 
TIA
 
 
 
 
 
 


Tomcat Context

2006-08-15 Thread Bala Paranj
I changed the context to :
 
Context path=/myContextPath appBase= docBase=C:\Program
Files\jboss-4.0.4.GA\server\default\deploy debug=99
reloadable=false
/Context
 
When I run the client, I get:
 
Marking servlet MySeiServlet as unavailable? in the JBoss console. The
client gets the error message:
 
Server returned HTTP response code: 500 for URL:
https://localhost:8443/myContextPath/somePath/MyServlet
 
Does anyone know how to get this working? TIA.
 


Re: Tomcat Context

2006-08-15 Thread Dhiraj Ramakrishnan

Hi ,

 How is the url mapping for the servlet in the web.xml? it should not
include /myContext in the url mapping.

 The servlet url mapping in the web.xml should only be for
/somePath/MyServlet

 What do you get when you just type in
https://localhost:8443/myContextPath ?

Hope that helps ..

bye

Dhiraj

On 8/16/06, Bala Paranj [EMAIL PROTECTED] wrote:


I changed the context to :

Context path=/myContextPath appBase= docBase=C:\Program
Files\jboss-4.0.4.GA\server\default\deploy debug=99
reloadable=false
/Context

When I run the client, I get:

Marking servlet MySeiServlet as unavailable? in the JBoss console. The
client gets the error message:

Server returned HTTP response code: 500 for URL:
https://localhost:8443/myContextPath/somePath/MyServlet

Does anyone know how to get this working? TIA.