Re: Apache Tomcat unable to send the request. tomcat throwing 502 Gate Way error

2011-08-24 Thread rakesh k
Hi Pid

Please find the details that you had asked.

1) We are using *java 1.6.0_18 and the OS is centos*
*2) *we send requests in parallel
3)  5 concurrent requests are sent to tomcat instance.

Can you please help us regarding this, we are blocked at this point . can
you please help. where as we can move ahead..and fix the issue.

Regards
Rakesh


On Thu, Aug 18, 2011 at 2:58 PM, rakesh k  wrote:

> Hi Pid
>
> Thank you very much for replying back or this question.
>
> Please find the details that you had asked.
>
> 1) We are using *java 1.6.0_18 and the OS is centos*
> *2) *we send requests in parallel
> 3)  5 concurrent requests are sent to tomcat instance.
>
> Regards
> Rakesh
>
> On Wed, Aug 17, 2011 at 8:52 PM, Pid  wrote:
>
>> On 16/08/2011 08:08, rakesh k wrote:
>> > Hi Andre
>> >
>> > Sorry for this, I had pasted the entire xml file.. I am hereby providing
>> the
>> > server.xml with removing the commented parts.
>>
>> I've edited the below a little.
>>
>> > > > maxThreads="150" minSpareThreads="4"/>
>> >
>> > > >port="8082" protocol="HTTP/1.1"
>> >connectionTimeout="2"
>> >redirectPort="8443" />
>> >
>>
>>   ProxyPass / balancer://msf/ stickysession=JSESSIONID|**jsessionid
>> >
>> > 
>> >  BalancerMember http://localhost:8082 route=msf1
>> > 
>>
>> >> testing we are sending 5000 requests at a time, where we are getting
>> 4-5
>> >>  Bad gate way error.
>>
>> > proxy: pass request body failed to 127.0.0.3:8082 (localhost)
>> >>> [Wed Aug 10 01:00:50 2011] [error] proxy: pass request body failed
>> to
>> >>> 127.0.0.3:8082 (localhost) from 72.163.25.205 ()
>> >>> [Wed Aug 10 01:01:01 2011] [error] (103)Software caused connection
>> >>>
>> >> abort:
>>
>> I note that you are using 127.0.0.3 as a localhost address.
>> What OS are you using, & what exact version of Java?
>>
>> You state that you are sending 5000 requests at a time.
>> Do you mean in parallel or sequentially?
>>
>> How many concurrent requests per Tomcat are being sent during the test?
>>
>>
>> p
>>
>>
>


Re: TC on Windows Server Core

2011-08-24 Thread David Kerber

On 8/24/2011 5:01 PM, André Warnier wrote:

David kerber wrote:
Will TC run on a Windows Server Core installation?  For those of you 
not familiar with that term, it's a windows server installation with 
no GUI, and minimal other pieces.  The idea is a reduced disk, memory 
and cpu footprint (rather Unix/Linux like).


One might be forgiven if one were to wonder why one would then not use 
a perfectly serviceable minimal Linux base then, no ?
Once you take away the GUI, what is left that is so compelling about 
Windows Server ?


The biggest advantage I can see would be that the scripting language 
would be what I already know and am comfortable with.  Also, it would be 
easier to integrate with our domain authentication.


D




And just by curiosity, what would be this resulting footprint then, as 
compared to a normal Windows Server ? (a link to some unbiased info 
would satisfy my curiosity too; what I could find about it on MSDN is 
not very explicit).


-
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: Is there a way to bake in URL parameters to a URL path?

2011-08-24 Thread Pid
On 24/08/2011 21:21, Mattmann, Chris A (388J) wrote:
> Thanks Chris for the advice.

Or people use an MVC framework of some sort to map URLs to methods.


p



> Cheers,
> Chris
> 
> On Aug 24, 2011, at 11:26 AM, Christopher Schultz wrote:
> 
> Chris,
> 
> On 8/24/2011 10:56 AM, Mattmann, Chris A (388J) wrote:
 For example, let's say I have a web service located at:

 http://myhost/books
> 
> Your REST guys are a fun bunch :)
> 
 The web service is just backed by a Java Servlet
> 
> Okay.
> 
 I get my JSON listings from the web service in the above example is
 to pass a special request parameter called "category", and set
 its value equal to the requested category, like:

 http://myhost/books?category=fiction
> 
> That's pretty standard.
> 
 What I would like to be able to do is to set up, via configuration,
 the ability to map a new URL, say:

 http://myhost/fictionbooks

 To

 http://myhost/books?category=fiction

 In effect, creating a default URI mapping. Is there a way in Tomcat
 to do this via configuration, and if not, I'm interested in 
 contributing it, and any recommendations on the best places to
 look to do so would be sincerely appreciated.
> 
> As Chuck points out, this is (somewhat) easily done using Tuckey's
> urlrewrite, but you may find that you are writing /lots and lots/ of
> mappings.
> 
> I think the real question is this: would you rather use query-string
> semantics in your URLs, or would you rather use "path-info" (so-called
> because it uses the "path info" of the request) semantics to
> communicate with your server? I guess you could support both, but
> people usually tend to pick one and stick with it.
> 
> If you want to completely change to path-info, a code-based solution
> is probably better (either modifying your servlet(s) or writing a
> Filter to make it look like everything is in the query string -- we
> can help you with either of these techniques). If you just want to
> pretend that you support path-info, then you are probably better off
> using lots and lots of url-rewrite rules.
> 
> Hope that helps,
> -chris
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: users-h...@tomcat.apache.org
>>
> 
> 
> ++
> Chris Mattmann, Ph.D.
> Senior Computer Scientist
> NASA Jet Propulsion Laboratory Pasadena, CA 91109 USA
> Office: 171-266B, Mailstop: 171-246
> Email: chris.a.mattm...@nasa.gov
> WWW:   http://sunset.usc.edu/~mattmann/
> ++
> Adjunct Assistant Professor, Computer Science Department
> University of Southern California, Los Angeles, CA 90089 USA
> ++
> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 




signature.asc
Description: OpenPGP digital signature


Re: [OT] TC on Windows Server Core

2011-08-24 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

André,

On 8/24/2011 5:01 PM, André Warnier wrote:
> David kerber wrote:
>> Will TC run on a Windows Server Core installation?  For those of
>> you not familiar with that term, it's a windows server
>> installation with no GUI, and minimal other pieces.  The idea is
>> a reduced disk, memory and cpu footprint (rather Unix/Linux
>> like).
>> 
> One might be forgiven if one were to wonder why one would then not
> use a perfectly serviceable minimal Linux base then, no ? Once you
> take away the GUI, what is left that is so compelling about Windows
> Server ?

Why, the Registry, of course. Oh, and the rich set of command-line tools.

> And just by curiosity, what would be this resulting footprint then,
> as compared to a normal Windows Server ? (a link to some unbiased
> info would satisfy my curiosity too; what I could find about it on
> MSDN is not very explicit).

If it's supposed to be low on memory, perhaps a JVM isn't a very good
idea either :)

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

iEYEARECAAYFAk5VdXEACgkQ9CaO5/Lv0PBuUACfcS/jYXWgP4RDkghYRxmwV4eH
vRgAnjfoH82VkUVUyt1BMCyDq0RgsVUP
=2ZVX
-END PGP SIGNATURE-

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



Re: TC on Windows Server Core

2011-08-24 Thread André Warnier

David kerber wrote:
Will TC run on a Windows Server Core installation?  For those of you not 
familiar with that term, it's a windows server installation with no GUI, 
and minimal other pieces.  The idea is a reduced disk, memory and cpu 
footprint (rather Unix/Linux like).


One might be forgiven if one were to wonder why one would then not use a perfectly 
serviceable minimal Linux base then, no ?

Once you take away the GUI, what is left that is so compelling about Windows 
Server ?

And just by curiosity, what would be this resulting footprint then, as compared to a 
normal Windows Server ? (a link to some unbiased info would satisfy my curiosity too; what 
I could find about it on MSDN is not very explicit).


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



RE: TC on Windows Server Core

2011-08-24 Thread Caldarale, Charles R
> From: Christopher Schultz [mailto:ch...@christopherschultz.net] 
> Subject: Re: TC on Windows Server Core

> unless the JVM does something silly like trying to initialize 
> the graphics subsystem even when there isn't one available.

Have to differentiate between the JVM graphics subsystem and that of the 
platform.  The JVM graphics subsystem is *always* available, even on a headless 
system.  Whether or not you can display the results of JVM graphics processing 
is determined by the availability of a GUI display mechanism on the box.

I would definitely set -Djava.awt.headless=true for this environment to insure 
there's no attempt at GUI usage.

 - 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.



Re: TC on Windows Server Core

2011-08-24 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

David,

On 8/24/2011 4:39 PM, David kerber wrote:
> Will TC run on a Windows Server Core installation?  For those of
> you not familiar with that term, it's a windows server installation
> with no GUI, and minimal other pieces.  The idea is a reduced disk,
> memory and cpu footprint (rather Unix/Linux like).

I can't imagine why it wouldn't, unless the JVM does something silly
like trying to initialize the graphics subsystem even when there isn't
one available.

There doesn't seem to be a reason to me why Tomcat itself would
present a problem.

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

iEYEARECAAYFAk5VYnQACgkQ9CaO5/Lv0PDtigCeJtgZRsbR5NtdFpL41LWdfj7Q
ETEAn1OnSdI/9DZx6BXTLbBWsycyU+pg
=kPML
-END PGP SIGNATURE-

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



TC on Windows Server Core

2011-08-24 Thread David kerber
Will TC run on a Windows Server Core installation?  For those of you not 
familiar with that term, it's a windows server installation with no GUI, 
and minimal other pieces.  The idea is a reduced disk, memory and cpu 
footprint (rather Unix/Linux like).


D

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



Re: Is there a way to bake in URL parameters to a URL path?

2011-08-24 Thread Mattmann, Chris A (388J)
On Aug 24, 2011, at 11:32 AM, Christopher Schultz wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
> 
> Chris,
> 
> On 8/24/2011 12:09 PM, Mattmann, Chris A (388J) wrote:
>> [O]n the other end of the spectrum, if you scare away people who
>> are simply trying to do what I'm trying to do with all of the
>> flexibility (and complexity) from a full-featured URL rewriter,
>> it's also probably not a great thing.
> 
> Don't be afraid of the extra features, they won't hurt you :)
> 
> Seriously, I haven't used url-rewrite myself but it appears to have a
> relatively small footprint (small code size) and your mappings only
> need to be as complex as your needs.

Okey dok, thanks.

> 
>> Anyhoo, I'll wait to see what others think and if I get the time to
>> make such a filter.
> 
> You are free to include such a Filter on the Tomcat Wiki. That's
> probably the best place for contributed code that is unlikely to make
> it into Tomcat itself.

Based on the conversation so far, it appears that it is fine for downstream 
projects to have that functionality. 

What spawned this whole discussion was looking at e.g., Solr, and looking 
at e.g., CXF and seeing this type of capability, but in the downstream project, 
written in different ways. I thought it might be a good candidate to bubble 
upstream to the app server, but it doesn't seem to have a lot of support 
so I'll drop it.

> 
>> Are there plans to include the URL filter at 
>> http://www.tuckey.org/urlrewrite/ in Tomcat proper at the ASF?
> 
> Probably not. This same question has been asked in the past and
> generally rejected because url-rewrite is such a good tool already
> that there's no reason to re-invent the wheel. Also, the servlet spec
> does not mandate this type of capability, so it's obviously not
> required from that standpoint. Most of the non-servlet-spec-defined
> utilities in Tomcat are provided because they are almost a requirement
> of having a web server -- things like access logging -- or are very
> useful security tools -- like the CsrfPreventionFilter.
> 
> That's not to say that this kind of thing would never be considered...
> it's just that there's not much motivation to babybsit another tool
> that is already freely-available and quite mature.

Sure, but that tool is BSD licensed, not ALv2 licensed and it would 
be nice to have an ALv2 licensed one is all I was saying.

Thanks,
Chris


++
Chris Mattmann, Ph.D.
Senior Computer Scientist
NASA Jet Propulsion Laboratory Pasadena, CA 91109 USA
Office: 171-266B, Mailstop: 171-246
Email: chris.a.mattm...@nasa.gov
WWW:   http://sunset.usc.edu/~mattmann/
++
Adjunct Assistant Professor, Computer Science Department
University of Southern California, Los Angeles, CA 90089 USA
++


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



Re: Is there a way to bake in URL parameters to a URL path?

2011-08-24 Thread Mattmann, Chris A (388J)
Thanks Chris for the advice.

Cheers,
Chris

On Aug 24, 2011, at 11:26 AM, Christopher Schultz wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
> 
> Chris,
> 
> On 8/24/2011 10:56 AM, Mattmann, Chris A (388J) wrote:
>> For example, let's say I have a web service located at:
>> 
>> http://myhost/books
> 
> Your REST guys are a fun bunch :)
> 
>> The web service is just backed by a Java Servlet
> 
> Okay.
> 
>> I get my JSON listings from the web service in the above example is
>> to pass a special request parameter called "category", and set
>> its value equal to the requested category, like:
>> 
>> http://myhost/books?category=fiction
> 
> That's pretty standard.
> 
>> What I would like to be able to do is to set up, via configuration,
>> the ability to map a new URL, say:
>> 
>> http://myhost/fictionbooks
>> 
>> To
>> 
>> http://myhost/books?category=fiction
>> 
>> In effect, creating a default URI mapping. Is there a way in Tomcat
>> to do this via configuration, and if not, I'm interested in 
>> contributing it, and any recommendations on the best places to
>> look to do so would be sincerely appreciated.
> 
> As Chuck points out, this is (somewhat) easily done using Tuckey's
> urlrewrite, but you may find that you are writing /lots and lots/ of
> mappings.
> 
> I think the real question is this: would you rather use query-string
> semantics in your URLs, or would you rather use "path-info" (so-called
> because it uses the "path info" of the request) semantics to
> communicate with your server? I guess you could support both, but
> people usually tend to pick one and stick with it.
> 
> If you want to completely change to path-info, a code-based solution
> is probably better (either modifying your servlet(s) or writing a
> Filter to make it look like everything is in the query string -- we
> can help you with either of these techniques). If you just want to
> pretend that you support path-info, then you are probably better off
> using lots and lots of url-rewrite rules.
> 
> Hope that helps,
> - -chris
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.10 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
> 
> iEYEARECAAYFAk5VQmMACgkQ9CaO5/Lv0PBlngCdFMWCM3Kcf0lnO71ENwJgSHta
> ID4AoJQIfqopMAgGK05Wc2CHs6QwUD8d
> =Ezh3
> -END PGP SIGNATURE-
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 


++
Chris Mattmann, Ph.D.
Senior Computer Scientist
NASA Jet Propulsion Laboratory Pasadena, CA 91109 USA
Office: 171-266B, Mailstop: 171-246
Email: chris.a.mattm...@nasa.gov
WWW:   http://sunset.usc.edu/~mattmann/
++
Adjunct Assistant Professor, Computer Science Department
University of Southern California, Los Angeles, CA 90089 USA
++


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



Re: Is there a way to bake in URL parameters to a URL path?

2011-08-24 Thread Mattmann, Chris A (388J)
Thanks Terrence!

Cheers,
Chris

On Aug 24, 2011, at 11:27 AM, Terence M. Bandoian wrote:

>  On 1:59 PM, Mattmann, Chris A (388J) wrote:
>> Thanks for your reply Chuck.
>> 
>> It looks like you can do what I'm suggesting, but it's pretty complex. I'm 
>> also
>> wondering why this isn't part of Tomcat proper. It would seem to be a very
>> useful tool to include.
>> 
>> An ALv2 licensed type of filter that does things like the URLRewrite Filter.
>> Another thing too is that this filter seems to do a huge superset of what
>> I'm actually looking for. I'm really just looking for something simple, with 
>> a
>> limited config, something like:
>> 
>> > origPath=books">
>>
>>
>> 
>> 
>> 
>> I might just write a plugin that does that and contribute it back to the
>> Apache Tomcat community. Would folks here find that useful?
>> 
>> Cheers,
>> Chris
>> 
>> On Aug 24, 2011, at 8:03 AM, Caldarale, Charles R wrote:
>> 
 From: Mattmann, Chris A (388J) [mailto:chris.a.mattm...@jpl.nasa.gov]
 Subject: Is there a way to bake in URL parameters to a URL path?
 What I would like to be able to do is to set up, via
 configuration, the ability to map a new URL, say:
 
 http://myhost/fictionbooks
 
 To
 
 http://myhost/books?category=ction
>>> The usual way to do this is with a filter, and the usual filter is the one 
>>> here:
>>> http://www.tuckey.org/urlrewrite/
>>> 
>>> - 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
>>> 
>> 
>> ++
>> Chris Mattmann, Ph.D.
>> Senior Computer Scientist
>> NASA Jet Propulsion Laboratory Pasadena, CA 91109 USA
>> Office: 171-266B, Mailstop: 171-246
>> Email: chris.a.mattm...@nasa.gov
>> WWW:   http://sunset.usc.edu/~mattmann/
>> ++
>> Adjunct Assistant Professor, Computer Science Department
>> University of Southern California, Los Angeles, CA 90089 USA
>> ++
> 
> Hi, Chris-
> 
> You might also consider using, for example:
> 
> http://myhost/books/fiction
> 
> And then map your servlet as:
> 
> 
> your_books_servlet
> /books/*
> 
> 
> Somewhere, possibly in your books servlet, you'd have to extract the 
> category (fiction, in this case) from the path info.
> 
> -Terence Bandoian
> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 


++
Chris Mattmann, Ph.D.
Senior Computer Scientist
NASA Jet Propulsion Laboratory Pasadena, CA 91109 USA
Office: 171-266B, Mailstop: 171-246
Email: chris.a.mattm...@nasa.gov
WWW:   http://sunset.usc.edu/~mattmann/
++
Adjunct Assistant Professor, Computer Science Department
University of Southern California, Los Angeles, CA 90089 USA
++


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



Re: Tomcat on Ubuntu

2011-08-24 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

János,

On 8/24/2011 4:02 PM, János Löbb wrote:
> Newbie question:  Is still /usr/local/tomcat is the default
> location for installation on Ubuntu 10.04 ?  Recently I saw it in
> an nfs directory mounted by autofs from another server and I am 
> wondering...

Sounds like a question for the Ubuntu folks.

Apache has no control over where package managers install their packages.

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

iEYEARECAAYFAk5VXIgACgkQ9CaO5/Lv0PCf+wCfXPieGWGAAqpv5cqB1/qZZHwy
rsAAnjHslpGkUU2xc13jjcv+VUyF0e2Q
=P2M8
-END PGP SIGNATURE-

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



Tomcat on Ubuntu

2011-08-24 Thread János Löbb
Hi,

Newbie question:  Is still /usr/local/tomcat is the default location for 
installation on Ubuntu 10.04 ?  Recently I saw it in an nfs directory mounted 
by autofs from another server and I am wondering...

Thanks ahead,

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



Re: jvmRoute generation

2011-08-24 Thread Andrew Todd
On Wed, Aug 24, 2011 at 2:44 PM, Christopher Schultz
 wrote:
> If you look at the stock conf/server.xml, it says:
> Documentation at /docs/config/engine.html
> "
>
> ...right above the  element.
>
> If you read that document, the jvmRoute attribute says:

I know, I have that link in the initial email for this thread. I was
talking specifically about Jeffrey's pointing to section 13 on
clustering when I made that observation.

> If you'd like to make some specific recommendations for documentation
> improvement, I could certainly make some changes.

I was dealing with asymmetric information in that I was relying on a
co-worker who is configuring the mod_jk end of things, so my situation
is not typical.

That being said, a cross-link from the Engine reference to the
connector reference would help a lot.

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



Re: Conditional Branch from Servlet to URL - Continued

2011-08-24 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Donald,

On 8/24/2011 2:23 PM, Donald Jolley wrote:
>> how can RequestDispatcher perform the forward
> 
> I'm not sure.  My objective is to institute a way of conditionally
> jumping from a servlet to a specified page.

This does work. You have to do something like the following:

public void doGet(HttpServletRequest request,
  HttpServletResponse response)
  throws IOException, ServletException
{
  // ... do something interesting

  if(/* whatever decision you have to make */)
  {
request.getRequestDispatcher("/target/url")
   .forward(request, response);

return;
  }

  // do whatever the default operation of this servlet is
}

That last "return" may or may not be required, but if you expected
that the forwarded request would produce a complete response, then
it's the proper thing to do.

Note that the forward() call is synchronous and /actually invokes the
other servlet/ and /then returns to your code/. This isn't like
telling the container that, after your method ends, you want the other
servlet to take over. Your servlet is calling the other one,
indirectly through the RequestDispatcher.

This surprises some people sometimes :)

If your servlet won't compile, then you need to figure that out. Look
at the entire example -- it should probably include some "import"
statements at the top of the file. There's no requirement that the
method arguments be named "request" and "response" though they often
are, by convention (I've also seen "req/rsp", "rq/rp",
"hsrRequest/hsrResponse" and some others, but most people just stick
with "request/response").

If things aren't actually working once you get your code compiled and
running, let us know and maybe we can help.

But the request dispatcher definitely works.

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

iEYEARECAAYFAk5VSJsACgkQ9CaO5/Lv0PAPDACfbsLy6wgXO5AuCwroa+srG3cp
1u4AoLx+9kPekqFBQRfSLdPIF6Bivj7m
=yQLH
-END PGP SIGNATURE-

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



Re: jvmRoute generation

2011-08-24 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Andrew,

On 8/24/2011 10:47 AM, Andrew Todd wrote:
> The documentation there is addressed towards someone who wants to
> do clustering replication and apparently already knows something
> about the subject. jvmRoute is only mentioned in the context of a
> failover.

If you look at the stock conf/server.xml, it says:

"
An Engine represents the entry point (within Catalina) that processes
every request. The Engine implementation for Tomcat stand alone
analyzes the HTTP headers included with the request, and passes them
on to the appropriate Host (virtual host).
Documentation at /docs/config/engine.html
"

...right above the  element.

If you read that document, the jvmRoute attribute says:

"
Identifier which must be used in load balancing scenarios to enable
session affinity. The identifier, which must be unique across all
Tomcat servers which participate in the cluster, will be appended to
the generated session identifier, therefore allowing the front end
proxy to always forward a particular session to the same Tomcat instance.
"

The phrase "session affinity" is synonymous with "sticky session" but
that point could be made a little better, or perhaps the documentation
could standardize on a single phrase for that concept.

It could also be more obvious, but under the "Load Balancing
Directives" documentation for mod_jk workers
(http://tomcat.apache.org/connectors-doc/reference/workers.html), the
intro has this to say in red text:

"
If you want to use session stickiness, you must set different jvmRoute
attributes in the Engine element in Tomcat's server.xml. Furthermore
the names of the workers which are managed by the balancer have to be
equal to the jvmRoute of the Tomcat instance they connect with.
"

If you'd like to make some specific recommendations for documentation
improvement, I could certainly make some changes.

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

iEYEARECAAYFAk5VRqkACgkQ9CaO5/Lv0PBIHQCguOhY5RNUviNaZ9PwBnIkCBna
gB0An0GHiYfSXGlOyNjD7DLSKLtSyRew
=QteR
-END PGP SIGNATURE-

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



Re: Too many open files error

2011-08-24 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Lance,

On 8/24/2011 11:21 AM, Campbell, Lance wrote:
> Tomcat 6.0.32 Java 1.6.27 Apache 2.0 RedHat 6.x 64 bit 
> /proc/sys/fs/file-max = 3233344
> 
> We experienced an issue where we were getting the error "too many 
> open files" in tomcat.  The server manager increase the amount of 
> open files to the above.  But the error kept coming back even
> after rebooting the server.  Is there a max number of connections
> that tomcat should run within based on the above specs?
> 
> The servlet in question that was being hit returned an XML
> document after doing a series of database queries.

You may find that the problem isn't the number of on-disk files but
the number of file descriptors, which might actually have different
meanings on your system.

It's also possible that the JVM is giving you a spurious message about
"too many files" when the problem is really the number of /threads/ --
I've seen that in the past, too.

Can you post the exact stack trace that you got along with this error?
Also, how about the output of "ulimit -a" for the user that actually
runs Tomcat? Finally, what do your  elements look like in
conf/server.xml?

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

iEYEARECAAYFAk5VRJ8ACgkQ9CaO5/Lv0PCD1gCgk7+nPVcTrN87QRiceYYYjnfi
SdEAoK/4AUixlaSqINfTdnLHty+/zI/B
=aigt
-END PGP SIGNATURE-

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



Re: Is there a way to bake in URL parameters to a URL path?

2011-08-24 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Chris,

On 8/24/2011 12:09 PM, Mattmann, Chris A (388J) wrote:
> [O]n the other end of the spectrum, if you scare away people who
> are simply trying to do what I'm trying to do with all of the
> flexibility (and complexity) from a full-featured URL rewriter,
> it's also probably not a great thing.

Don't be afraid of the extra features, they won't hurt you :)

Seriously, I haven't used url-rewrite myself but it appears to have a
relatively small footprint (small code size) and your mappings only
need to be as complex as your needs.

> Anyhoo, I'll wait to see what others think and if I get the time to
> make such a filter.

You are free to include such a Filter on the Tomcat Wiki. That's
probably the best place for contributed code that is unlikely to make
it into Tomcat itself.

> Are there plans to include the URL filter at 
> http://www.tuckey.org/urlrewrite/ in Tomcat proper at the ASF?

Probably not. This same question has been asked in the past and
generally rejected because url-rewrite is such a good tool already
that there's no reason to re-invent the wheel. Also, the servlet spec
does not mandate this type of capability, so it's obviously not
required from that standpoint. Most of the non-servlet-spec-defined
utilities in Tomcat are provided because they are almost a requirement
of having a web server -- things like access logging -- or are very
useful security tools -- like the CsrfPreventionFilter.

That's not to say that this kind of thing would never be considered...
it's just that there's not much motivation to babybsit another tool
that is already freely-available and quite mature.

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

iEYEARECAAYFAk5VQ9QACgkQ9CaO5/Lv0PDDugCfbJTxvDC+TY9bhLk5K7ibsjRj
rocAnAse07qm+1JJwZ4yb3FL1HHDXlrF
=NleM
-END PGP SIGNATURE-

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



Re: Is there a way to bake in URL parameters to a URL path?

2011-08-24 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Chris,

On 8/24/2011 10:56 AM, Mattmann, Chris A (388J) wrote:
> For example, let's say I have a web service located at:
> 
> http://myhost/books

Your REST guys are a fun bunch :)

> The web service is just backed by a Java Servlet

Okay.

> I get my JSON listings from the web service in the above example is
>  to pass a special request parameter called "category", and set
> its value equal to the requested category, like:
> 
> http://myhost/books?category=fiction

That's pretty standard.

> What I would like to be able to do is to set up, via configuration,
> the ability to map a new URL, say:
> 
> http://myhost/fictionbooks
> 
> To
> 
> http://myhost/books?category=fiction
> 
> In effect, creating a default URI mapping. Is there a way in Tomcat
>  to do this via configuration, and if not, I'm interested in 
> contributing it, and any recommendations on the best places to
> look to do so would be sincerely appreciated.

As Chuck points out, this is (somewhat) easily done using Tuckey's
urlrewrite, but you may find that you are writing /lots and lots/ of
mappings.

I think the real question is this: would you rather use query-string
semantics in your URLs, or would you rather use "path-info" (so-called
because it uses the "path info" of the request) semantics to
communicate with your server? I guess you could support both, but
people usually tend to pick one and stick with it.

If you want to completely change to path-info, a code-based solution
is probably better (either modifying your servlet(s) or writing a
Filter to make it look like everything is in the query string -- we
can help you with either of these techniques). If you just want to
pretend that you support path-info, then you are probably better off
using lots and lots of url-rewrite rules.

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

iEYEARECAAYFAk5VQmMACgkQ9CaO5/Lv0PBlngCdFMWCM3Kcf0lnO71ENwJgSHta
ID4AoJQIfqopMAgGK05Wc2CHs6QwUD8d
=Ezh3
-END PGP SIGNATURE-

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



Re: Is there a way to bake in URL parameters to a URL path?

2011-08-24 Thread Terence M. Bandoian

 On 1:59 PM, Mattmann, Chris A (388J) wrote:

Thanks for your reply Chuck.

It looks like you can do what I'm suggesting, but it's pretty complex. I'm also
wondering why this isn't part of Tomcat proper. It would seem to be a very
useful tool to include.

An ALv2 licensed type of filter that does things like the URLRewrite Filter.
Another thing too is that this filter seems to do a huge superset of what
I'm actually looking for. I'm really just looking for something simple, with a
limited config, something like:







I might just write a plugin that does that and contribute it back to the
Apache Tomcat community. Would folks here find that useful?

Cheers,
Chris

On Aug 24, 2011, at 8:03 AM, Caldarale, Charles R wrote:


From: Mattmann, Chris A (388J) [mailto:chris.a.mattm...@jpl.nasa.gov]
Subject: Is there a way to bake in URL parameters to a URL path?
What I would like to be able to do is to set up, via
configuration, the ability to map a new URL, say:

http://myhost/fictionbooks

To

http://myhost/books?category=ction

The usual way to do this is with a filter, and the usual filter is the one here:
http://www.tuckey.org/urlrewrite/

- 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



++
Chris Mattmann, Ph.D.
Senior Computer Scientist
NASA Jet Propulsion Laboratory Pasadena, CA 91109 USA
Office: 171-266B, Mailstop: 171-246
Email: chris.a.mattm...@nasa.gov
WWW:   http://sunset.usc.edu/~mattmann/
++
Adjunct Assistant Professor, Computer Science Department
University of Southern California, Los Angeles, CA 90089 USA
++


Hi, Chris-

You might also consider using, for example:

http://myhost/books/fiction

And then map your servlet as:


your_books_servlet
/books/*


Somewhere, possibly in your books servlet, you'd have to extract the 
category (fiction, in this case) from the path info.


-Terence Bandoian


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



Conditional Branch from Servlet to URL - Continued

2011-08-24 Thread Donald Jolley
Hi --

I had difficulty replying from my digest subscription.  To resolve the
difficulty, I have unsubscribed and resubscribed without the digest.

Leo has asked the question:

> how can RequestDispatcher perform the forward

I'm not sure.  My objective is to institute a way of conditionally jumping
from a servlet to a specified page.  One purpose would be to transfer to an
errors page upon the occurrence of an exception; however, I can think of
other uses.  A paragraph in a book that I have on Tomcat caught my eye as
addressing that exact issue.  They used RequestDispatcher in their solution
which was in my original message. I'm appending the paragraph to the end of
this message.

If RequestDispatcher isn't going to do the job for me, can you point me to
what will?

I think that it's important for me to get the above question answered so I
know whether I'm even heading down the right path.  Once I know that I'm
headed in the right direction; then, I can address the finer points.

 ... doug

P.S. - PARTIAL PARAGRAPH TAKEN FROM BOOK:

Sometimes you may want one servlet to forward a request to another servlet
for processing.  For example, a servlet may do some initial processing to
validate parameters before before passing the request either to another
servelet for final processing or to an error page if validation fails.


Re: Replying to Posts

2011-08-24 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Douig,

On 8/24/2011 1:03 PM, Donald Jolley wrote:
> Suddenly I have discovered that I don't know how to reply to these
> posts.  I think that the problem is that I have a digest
> subscription and the digests seem to encapsulate the individual
> messages into a single message so that there is no way that I can 
> respond to any particular given message within the digest.

[snip]

> the mail client that I am using (gmail) does not present the
> messages individually

If you have a digest subscription to tomcat-user, then it's not your
email client's fault that the messages are not separated: it's the
digest subscription that is the problem.

I would highly recommend a "normal" subscription.

> Is my only choice to unsubscribe and re-resubscribe selecting the
> individual format rather than the digest format?  I would really
> like to avoid having list emails showing up individually in my
> inbox throughout the day.

Gmail allows you to create a filter that will put messages into a
folder-looking thing and completely skip the "inbox" "folder" if
that's what you want. I think that would be a good idea for just about
any mailing list because, as you say, the inbox tends to get cluttered.

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

iEYEARECAAYFAk5VQJEACgkQ9CaO5/Lv0PDZNQCgkfxvfJEdDHZZxSwmrgzXCpvO
YXIAoIIKjyb4WG4HL0cfZ9iraoNih905
=VU02
-END PGP SIGNATURE-

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



Re: Replying to Posts

2011-08-24 Thread Konstantin Kolinko
2011/8/24 Donald Jolley :
> I'm very new to both Tomcat and the list.  Yesterday I initiated a thread
> entitled "Conditional Branch from Servlet to URL".  So far I have received 2
> thoughtful replies.  (Thank you very much.)  Suddenly I have discovered that
> I don't know how to reply to these posts.  I think that the problem is that
> I have a digest subscription and the digests seem to encapsulate the
> individual messages into a single message so that there is no way that I can
> respond to any particular given message within the digest.  I contacted the
> list owner and he said that if the mail client that I am using (gmail) does
> not present the messages individually he had no idea as to how one would
> respond to a particular message.  So, I am looking for suggestions.  Is my
> only choice to unsubscribe and re-resubscribe selecting the individual
> format rather than the digest format?  I would really like to avoid having
> list emails showing up individually in my inbox throughout the day.
>

1. Gmail automatically groups messages by their title,  so the
wouldn't appear as individual ones, but as threads.

2. I use filters. The filters automatically tag messages according to
mailing lists (and archive those mailing lists that I review
occasionally but do not want to see in my inbox).
If you expand the sender information for a message received from a
mailing list there usually is an underlined link that allows to
quickly set up a filter. Or you can filter by addressee.

3. You can subscribe both to digest and to non-digest forms if you
want to give it a try.

Best regards,
Konstantin Kolinko

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



Replying to Posts

2011-08-24 Thread Donald Jolley
Hi --

I'm very new to both Tomcat and the list.  Yesterday I initiated a thread
entitled "Conditional Branch from Servlet to URL".  So far I have received 2
thoughtful replies.  (Thank you very much.)  Suddenly I have discovered that
I don't know how to reply to these posts.  I think that the problem is that
I have a digest subscription and the digests seem to encapsulate the
individual messages into a single message so that there is no way that I can
respond to any particular given message within the digest.  I contacted the
list owner and he said that if the mail client that I am using (gmail) does
not present the messages individually he had no idea as to how one would
respond to a particular message.  So, I am looking for suggestions.  Is my
only choice to unsubscribe and re-resubscribe selecting the individual
format rather than the digest format?  I would really like to avoid having
list emails showing up individually in my inbox throughout the day.

Thanks for any input.

 ... douig


Re: Tomcat 6.0.26 bundled with Netbeans 6.9.1

2011-08-24 Thread Ana Maria Teodorescu
This seems a reasonable solution to my problem.
I'll try this!

Thanks a lot,
Ana


> Here are two solutions based on installing the "real Tomcat" from
> tomcat.apache.org.
>
> 1. Keep your current installation
>
> a. Keep your current NetBeans installation
> b. Download Tomcat 6.0.33 from tomcat.apache.org
> c. Install it
> d. Configure NetBeans with this additional server.
>1. Add a new server in the Services panel under the Servers node
>2. Call it Tomcat 6.0.33
>3. Use this in all your projects
>
> 2. Uninstall your current installation
>
> a. Completely remove NetBeans
> b. Install the Java SE NetBeans version
>1. This will not have Tomcat - install one from tomcat.apache.org
>2. Add the web development tools under Tools->Plugins
>3. Add the Tomcat server under Tools->Servers
>
> I personally use the second method. Under NetBeans 7.0.1 I have Tomcat
> 7.0.20, 6.0.33, and 5.5.33 (plus a bunch of other servers). All of the
> servers were installed from their respective original sources, not bundled
> with the IDE.
>
> Also note if you want to work with Tomcat 7.0.x, you will need NetBeans
> 7.0.1. NetBeans 6.x does not support Tomcat 7.0.x directly (although there
> are games you can play - ask on the NetBeans J2EE mailing list or forum).
>
> . . . . just my two cents.
> /mde/
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: Is there a way to bake in URL parameters to a URL path?

2011-08-24 Thread Mattmann, Chris A (388J)
Hi Tim,

On Aug 24, 2011, at 8:55 AM, Tim Funk wrote:

> While useful ... I would conjecture that things like this eventually undergo
> feature creep and over time would turn into
> http://www.tuckey.org/urlrewrite/

Thanks. That's entirely possible, but on the other end of the spectrum, if you 
scare away people who are simply trying to do what I'm trying to do with all 
of the flexibility (and complexity) from a full-featured URL rewriter, it's 
also probably not a great thing. 

Anyhoo, I'll wait to see what others think and if I get the time to make such 
a filter. 

Are there plans to include the URL filter at 
http://www.tuckey.org/urlrewrite/ in Tomcat proper at the ASF? 
As a consumer of ASF software (and Tomcat), I think it would 
make a ton of sense to have this type of functionality inside of 
the core. Looking at the documentation on the Tomcat site, which 
I did for a half hour, as well as some Google searches, didn't yield 
much that would have pointed me in this direction. And so, 
that's what led me here. 

Thanks very much.

Cheers,
Chris

> 
> 
> -Tim
> 
> On Wed, Aug 24, 2011 at 11:14 AM, Mattmann, Chris A (388J) <
> chris.a.mattm...@jpl.nasa.gov> wrote:
> 
>> Thanks for your reply Chuck.
>> 
>> It looks like you can do what I'm suggesting, but it's pretty complex. I'm
>> also
>> wondering why this isn't part of Tomcat proper. It would seem to be a very
>> useful tool to include.
>> 
>> An ALv2 licensed type of filter that does things like the URLRewrite
>> Filter.
>> Another thing too is that this filter seems to do a huge superset of what
>> I'm actually looking for. I'm really just looking for something simple,
>> with a
>> limited config, something like:
>> 
>> >   origPath="/books">
>>  
>>  
>> 
>> 
>> 
>> I might just write a plugin that does that and contribute it back to the
>> Apache Tomcat community. Would folks here find that useful?
>> 
>> 


++
Chris Mattmann, Ph.D.
Senior Computer Scientist
NASA Jet Propulsion Laboratory Pasadena, CA 91109 USA
Office: 171-266B, Mailstop: 171-246
Email: chris.a.mattm...@nasa.gov
WWW:   http://sunset.usc.edu/~mattmann/
++
Adjunct Assistant Professor, Computer Science Department
University of Southern California, Los Angeles, CA 90089 USA
++


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



Re: Is there a way to bake in URL parameters to a URL path?

2011-08-24 Thread Tim Funk
While useful ... I would conjecture that things like this eventually undergo
feature creep and over time would turn into
http://www.tuckey.org/urlrewrite/


-Tim

On Wed, Aug 24, 2011 at 11:14 AM, Mattmann, Chris A (388J) <
chris.a.mattm...@jpl.nasa.gov> wrote:

> Thanks for your reply Chuck.
>
> It looks like you can do what I'm suggesting, but it's pretty complex. I'm
> also
> wondering why this isn't part of Tomcat proper. It would seem to be a very
> useful tool to include.
>
> An ALv2 licensed type of filter that does things like the URLRewrite
> Filter.
> Another thing too is that this filter seems to do a huge superset of what
> I'm actually looking for. I'm really just looking for something simple,
> with a
> limited config, something like:
>
> origPath="/books">
>   
>   
> 
> 
>
> I might just write a plugin that does that and contribute it back to the
> Apache Tomcat community. Would folks here find that useful?
>
>


Re: Tomcat 6.0.26 bundled with Netbeans 6.9.1

2011-08-24 Thread Mark Eggers
- Original Message -

> From: André Warnier 
> To: Tomcat Users List 
> Cc: 
> Sent: Wednesday, August 24, 2011 1:44 AM
> Subject: Re: Tomcat 6.0.26 bundled with Netbeans 6.9.1
> 
> Ana Maria Teodorescu wrote:
>>     Dear Tomcat users and experts,
>> 
>>  I downloaded Netbeans 6.9.1 including Apache Tomcat on my Mac snow leopard.
>>  When I go to the page http://localhost:8080/ the message that I've 
> setup
>>  correctly Tomcat appears. But, if I click on the following links:
>>  1)Tomcat documentation ( http://localhost:8080/docs )
>>  2) Servlet examples ( http://localhost:8080/examples/servlets/)
>>  3) JSP examples ( http://localhost:8080/examples/jsp/ )
>> 
>>  I get the error 404:  *The requested resource (/examples/jsp/, etc) is not
>>  available*
>>  *
>>  *
>>  I've spent a whole day trying to understand how to fix the problem but 
> with
>>  no success.
>>  There are no other options I can choose from during the Netbeans
>>  installation. Tomcat
>>  is configured automatically and I don't know where to put my hands on.
>> 
> The above probably means that whatever package "Netbeans 6.9.1 including 
> Apache Tomcat" you are using to install Tomcat, includes just the basic 
> Tomcat and does not include these additional "sample" applications.
> Maybe consult your package manager software and look for the missing 
> Tomcat-related packages.
> I do not know Mac at all, but under Linux Debian for example, there used to 
> be 
> one package named "Tomcat", another one named 
> "tomcat-examples", and another one named "tomcat-admin".
> 
> Or else, depending on your circumstances, de-install this "Netbeans + 
> Tomcat" package, download and install a "real Tomcat" from the 
> Tomcat website, and then re-install a "Netbeans without Tomcat" 
> package from your package source.


Here are two solutions based on installing the "real Tomcat" from 
tomcat.apache.org.

1. Keep your current installation

a. Keep your current NetBeans installation
b. Download Tomcat 6.0.33 from tomcat.apache.org
c. Install it
d. Configure NetBeans with this additional server.
   1. Add a new server in the Services panel under the Servers node
   2. Call it Tomcat 6.0.33
   3. Use this in all your projects

2. Uninstall your current installation

a. Completely remove NetBeans
b. Install the Java SE NetBeans version
   1. This will not have Tomcat - install one from tomcat.apache.org
   2. Add the web development tools under Tools->Plugins
   3. Add the Tomcat server under Tools->Servers

I personally use the second method. Under NetBeans 7.0.1 I have Tomcat 7.0.20, 
6.0.33, and 5.5.33 (plus a bunch of other servers). All of the servers were 
installed from their respective original sources, not bundled with the IDE.

Also note if you want to work with Tomcat 7.0.x, you will need NetBeans 7.0.1. 
NetBeans 6.x does not support Tomcat 7.0.x directly (although there are games 
you can play - ask on the NetBeans J2EE mailing list or forum).

. . . . just my two cents.
/mde/

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



Re: Too many open files error

2011-08-24 Thread Francis GALIEGUE
On Wed, Aug 24, 2011 at 17:33, Campbell, Lance  wrote:
> The file /etc/security/limits.d is empty.  What would be an example of 
> something you would expect to see in there that would relate to changing the 
> RMILIT_NFILE value?
>

It's a directory, not a file. Create a file named tomcat in it (or
whatever name you want) and put in these two lines:

tomcat softnofile  16384
tomcat hardnofile  16384

(if the user running Tomcat is indeed called tomcat)

If you want to see the current limit, as root, run:

su tomcat -c "ulimit -n"

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



RE: Too many open files error

2011-08-24 Thread Campbell, Lance
The file /etc/security/limits.d is empty.  What would be an example of 
something you would expect to see in there that would relate to changing the 
RMILIT_NFILE value? 

Thanks,  

From: Francis GALIEGUE [f...@one2team.com]
Sent: Wednesday, August 24, 2011 10:24 AM
To: Tomcat Users List
Subject: Re: Too many open files error

On Wed, Aug 24, 2011 at 17:21, Campbell, Lance  wrote:
> Tomcat 6.0.32
> Java 1.6.27
> Apache 2.0
> RedHat 6.x 64 bit
> /proc/sys/fs/file-max = 3233344
>
> We experienced an issue where we were getting the error "too many open files" 
> in tomcat.  The server manager increase the amount of open files to the 
> above.  But the error kept coming back even after rebooting the server.  Is 
> there a max number of connections that tomcat should run within based on the 
> above specs?
>
> The servlet in question that was being hit returned an XML document after 
> doing a series of database queries.
>

file-max is not what you want to modify. It's the user's limit: RMILIT_NFILE.

Look in /etc/security/limits.d. You'll need to restart Tomcat.

--
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

-
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: Too many open files error

2011-08-24 Thread Francis GALIEGUE
On Wed, Aug 24, 2011 at 17:21, Campbell, Lance  wrote:
> Tomcat 6.0.32
> Java 1.6.27
> Apache 2.0
> RedHat 6.x 64 bit
> /proc/sys/fs/file-max = 3233344
>
> We experienced an issue where we were getting the error "too many open files" 
> in tomcat.  The server manager increase the amount of open files to the 
> above.  But the error kept coming back even after rebooting the server.  Is 
> there a max number of connections that tomcat should run within based on the 
> above specs?
>
> The servlet in question that was being hit returned an XML document after 
> doing a series of database queries.
>

file-max is not what you want to modify. It's the user's limit: RMILIT_NFILE.

Look in /etc/security/limits.d. You'll need to restart Tomcat.

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Too many open files error

2011-08-24 Thread Campbell, Lance
Tomcat 6.0.32
Java 1.6.27
Apache 2.0
RedHat 6.x 64 bit
/proc/sys/fs/file-max = 3233344

We experienced an issue where we were getting the error "too many open files" 
in tomcat.  The server manager increase the amount of open files to the above.  
But the error kept coming back even after rebooting the server.  Is there a max 
number of connections that tomcat should run within based on the above specs?

The servlet in question that was being hit returned an XML document after doing 
a series of database queries.

Thanks,

Lance


Re: jvmRoute generation

2011-08-24 Thread Mark Thomas
On 24/08/2011 15:07, Christopher Schultz wrote:
> Jeffrey,
> 
> On 8/24/2011 9:59 AM, Jeffrey Janner wrote:
>> As Chris pointed out, it is mostly used by folks running with 
>> "sticky-sessions"
> 
> Actually, use of the jvmRoute with non-sticky sessions seems like
> an unnecessary step to me, since non-sticky sessions implies that
> you either have no sessions (and it doesn't matter at all) or you
> have replicated sessions where it doesn't matter which cluster
> member you reach.
> 
>> but from what I've been able to tell, most folks set up their 
>> clusters that way. It lessens the headaches.
> 
> Practically speaking, clustering Tomcat instances means session 
> replication, which (if you ask me) does not warrant session
> stickiness (though session replication does take some time... I
> don't know enough about TC's clustering to know whether race
> conditions are possible or probable).

If you use the Backup Manager you must use sticky sessions.

If you use the delta manager with asynchronous replication or if a
client may make concurrent requests then you must use sticky sessions.

If you use the delta manager with synchronous replication and you are
sure you will not have concurrent requests from the same client then
you don't have to use sticky sessions.

> For my money, I'd go for sticky sessions and no replication at all.
> If you really need cluster-wide session access, look to other
> solutions (memcached, db-backed sessions, etc.).

If stateless isn't an option, I'd go for a correctly configured backup
manager.

Mark

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



Re: Is there a way to bake in URL parameters to a URL path?

2011-08-24 Thread Mattmann, Chris A (388J)
Thanks for your reply Chuck.

It looks like you can do what I'm suggesting, but it's pretty complex. I'm also 
wondering why this isn't part of Tomcat proper. It would seem to be a very 
useful tool to include.

An ALv2 licensed type of filter that does things like the URLRewrite Filter. 
Another thing too is that this filter seems to do a huge superset of what 
I'm actually looking for. I'm really just looking for something simple, with a 
limited config, something like:


   
   



I might just write a plugin that does that and contribute it back to the 
Apache Tomcat community. Would folks here find that useful?

Cheers,
Chris

On Aug 24, 2011, at 8:03 AM, Caldarale, Charles R wrote:

>> From: Mattmann, Chris A (388J) [mailto:chris.a.mattm...@jpl.nasa.gov] 
>> Subject: Is there a way to bake in URL parameters to a URL path?
> 
>> What I would like to be able to do is to set up, via 
>> configuration, the ability to map a new URL, say:
>> 
>> http://myhost/fictionbooks 
>> 
>> To 
>> 
>> http://myhost/books?category=fiction
> 
> The usual way to do this is with a filter, and the usual filter is the one 
> here:
> http://www.tuckey.org/urlrewrite/
> 
> - 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
> 


++
Chris Mattmann, Ph.D.
Senior Computer Scientist
NASA Jet Propulsion Laboratory Pasadena, CA 91109 USA
Office: 171-266B, Mailstop: 171-246
Email: chris.a.mattm...@nasa.gov
WWW:   http://sunset.usc.edu/~mattmann/
++
Adjunct Assistant Professor, Computer Science Department
University of Southern California, Los Angeles, CA 90089 USA
++


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



Re: path to application in parallel deployment

2011-08-24 Thread Aristedes Maniatis

On 25/08/11 12:43 AM, Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Aristedes,

On 8/24/2011 10:36 AM, Aristedes Maniatis wrote:

On 25/08/11 12:15 AM, Christopher Schultz wrote:


So, if you could do this with code it would be:

getServletContext().getRealPath("/WEB-INF/classes/solr")

Right?


Yes.


Okay... glad I understand the goal :)


There isn't any system property for this kind of thing (since
system properties are JVM-wide, and not specific to any
particular webapp) so it would have to be, as you say, some kind
of "magic" variable that you could use.


Are all properties JVM-wide?


All system properties (retrieved using System.getProperty()) are
JVM-global.


If I define a property in:

webapps/someapp##1234/META-INF/context.xml


Those aren't system properties -- they /will/ be local to the webapp.


Right, then theoretically at least, there could be a ${APP_ROOT} which could be 
available in there so that paths within the application could be addressed. I 
guess this use case is rare since code within the application is usually able 
to find resources on the classpath within the application.



I don't believe such a variable exists. Since Solr is servlet
context-aware application (i.e. it *is* webapp), is it possible
to give it a path relative to the webapp itself? You might want
to ask the Solr folks about this.


Sure. I can try there next, but any such solution is going to
involve changing Solr code.


Maybe not. Most webapp configurations assume that paths are relative
to the webapp itself.


Our testing so far seems to suggest that it is relative to the tomcat install. 
But I'll follow this up with the Solr people. Thanks for the pointer.




Another option, which I think is a better option, would be to
locate solr/home outside of your deployment directory.


That is an option, but a very awkward one since then I have an
application separated from the configuration which is an integral
part of its functionality.


What goes in solr/home, anyway? I figured that the indexes go in
there, not just a configuration file or two.


It contains files such as the schema definition (which is similar to a database 
schema definition, only for Lucene), instructions on how to parse data sources, 
weightings for query facets, etc. The actual index can be in a different path.



This isn't some JDBC connection which differs in every deployment,
but the configuration of exactly how the application works. So
being able to keep it in our SCM with the code and deploy together
is essential.


Fair enough. I think the Solr list is the place to go. Definitely let
us know what the answer is.


Thanks again

Ari


--
-->
Aristedes Maniatis
GPG fingerprint CBFB 84B4 738D 4E87 5E5C  5EFA EF6A 7D2E 3E49 102A

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



RE: Is there a way to bake in URL parameters to a URL path?

2011-08-24 Thread Caldarale, Charles R
> From: Mattmann, Chris A (388J) [mailto:chris.a.mattm...@jpl.nasa.gov] 
> Subject: Is there a way to bake in URL parameters to a URL path?

> What I would like to be able to do is to set up, via 
> configuration, the ability to map a new URL, say:
>
> http://myhost/fictionbooks 
>
> To 
>
> http://myhost/books?category=fiction

The usual way to do this is with a filter, and the usual filter is the one here:
http://www.tuckey.org/urlrewrite/

 - 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



Is there a way to bake in URL parameters to a URL path?

2011-08-24 Thread Mattmann, Chris A (388J)
Hey Guys,

I had a question regarding Tomcat configuration. I see over and over folks 
building 
web apps that write custom code responsible for baking in URL parameters to 
some 
path. For example, let's say I have a web service located at:

http://myhost/books

that by default returns a listing of books in my book store in JSON format 
(format not 
important, but I just picked one to illustrate). The web service is just backed 
by a 
Java Servlet, and I know how to use Tomcat's web.xml file, or a context.xml 
file for 
example to configure the url path to my servlet and to my web application to 
set up 
the above situation. 

However, what I don't know how to do in Tomcat is to solve (by configuration), 
the 
following scenario. Let's say in the above example, my books have categories, 
like 
"fiction", "drama", "programming", "science", etc., and that the way I get my 
JSON 
listings from the web service in the above example is to pass a special request 
parameter
called "category", and set its value equal to the requested category, like:

http://myhost/books?category=fiction

To get fiction books, for illustration. What I would like to be able to do is 
to set up, via 
configuration, the ability to map a new URL, say:

http://myhost/fictionbooks 

To 

http://myhost/books?category=fiction

In effect, creating a default URI mapping. Is there a way in Tomcat to do this 
via 
configuration, and if not, I'm interested in contributing it, and any 
recommendations 
on the best places to look to do so would be sincerely appreciated.

Thank you.

Cheers,
Chris

++
Chris Mattmann, Ph.D.
Senior Computer Scientist
NASA Jet Propulsion Laboratory Pasadena, CA 91109 USA
Office: 171-266B, Mailstop: 171-246
Email: chris.a.mattm...@nasa.gov
WWW:   http://sunset.usc.edu/~mattmann/
++
Adjunct Assistant Professor, Computer Science Department
University of Southern California, Los Angeles, CA 90089 USA
++


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



Re: jvmRoute generation

2011-08-24 Thread Andrew Todd
On Wed, Aug 24, 2011 at 10:07 AM, Christopher Schultz
 wrote:
> For my money, I'd go for sticky sessions and no replication at all.

Correct, this is, as far as I know, what we are planning to do.

Jeffrey Janner  wrote:
> I see from your first post that you know where to find the Tomcat 7 
> documentation, take a closer look at section 18.

The documentation there is addressed towards someone who wants to do
clustering replication and apparently already knows something about
the subject. jvmRoute is only mentioned in the context of a failover.

In any case, I pushed this question out to the list because something
didn't smell right with the information I was given, and you guys
confirmed that plus some extra useful thoughts. Thanks.

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



Re: path to application in parallel deployment

2011-08-24 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Aristedes,

On 8/24/2011 10:36 AM, Aristedes Maniatis wrote:
> On 25/08/11 12:15 AM, Christopher Schultz wrote:
> 
>> So, if you could do this with code it would be:
>> 
>> getServletContext().getRealPath("/WEB-INF/classes/solr")
>> 
>> Right?
> 
> Yes.

Okay... glad I understand the goal :)

>> There isn't any system property for this kind of thing (since
>> system properties are JVM-wide, and not specific to any
>> particular webapp) so it would have to be, as you say, some kind
>> of "magic" variable that you could use.
> 
> Are all properties JVM-wide?

All system properties (retrieved using System.getProperty()) are
JVM-global.

> If I define a property in:
> 
> webapps/someapp##1234/META-INF/context.xml

Those aren't system properties -- they /will/ be local to the webapp.

>> I don't believe such a variable exists. Since Solr is servlet 
>> context-aware application (i.e. it *is* webapp), is it possible
>> to give it a path relative to the webapp itself? You might want
>> to ask the Solr folks about this.
> 
> Sure. I can try there next, but any such solution is going to
> involve changing Solr code.

Maybe not. Most webapp configurations assume that paths are relative
to the webapp itself.

>> Another option, which I think is a better option, would be to
>> locate solr/home outside of your deployment directory.
> 
> That is an option, but a very awkward one since then I have an 
> application separated from the configuration which is an integral
> part of its functionality.

What goes in solr/home, anyway? I figured that the indexes go in
there, not just a configuration file or two.

> This isn't some JDBC connection which differs in every deployment,
> but the configuration of exactly how the application works. So
> being able to keep it in our SCM with the code and deploy together
> is essential.

Fair enough. I think the Solr list is the place to go. Definitely let
us know what the answer is.

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

iEYEARECAAYFAk5VDh4ACgkQ9CaO5/Lv0PAskQCfRNrit7Aqjj4c5jn9fpjtb4sl
QZMAoJO53b00b9jKbPWOPUHN9T736dNn
=XFCc
-END PGP SIGNATURE-

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



Re: path to application in parallel deployment

2011-08-24 Thread Aristedes Maniatis

On 25/08/11 12:15 AM, Christopher Schultz wrote:


So, if you could do this with code it would be:

   getServletContext().getRealPath("/WEB-INF/classes/solr")

Right?


Yes.



There isn't any system property for this kind of thing (since system
properties are JVM-wide, and not specific to any particular webapp) so
it would have to be, as you say, some kind of "magic" variable that
you could use.


Are all properties JVM-wide? If I define a property in:

  webapps/someapp##1234/META-INF/context.xml

Then that property is available to all applications? I didn't know that. If 
that's the case, then this approach will never work.

 

I don't believe such a variable exists. Since Solr is servlet
context-aware application (i.e. it *is* webapp), is it possible to
give it a path relative to the webapp itself? You might want to ask
the Solr folks about this.


Sure. I can try there next, but any such solution is going to involve changing 
Solr code.


Another option, which I think is a better option, would be to locate
solr/home outside of your deployment directory.


That is an option, but a very awkward one since then I have an application 
separated from the configuration which is an integral part of its 
functionality. This isn't some JDBC connection which differs in every 
deployment, but the configuration of exactly how the application works. So 
being able to keep it in our SCM with the code and deploy together is essential.

Thanks

Ari


--
-->
Aristedes Maniatis
GPG fingerprint CBFB 84B4 738D 4E87 5E5C  5EFA EF6A 7D2E 3E49 102A

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



RE: jvmRoute generation

2011-08-24 Thread Jeffrey Janner
> -Original Message-
> From: Christopher Schultz [mailto:ch...@christopherschultz.net]
> Sent: Wednesday, August 24, 2011 9:08 AM
> To: Tomcat Users List
> Subject: Re: jvmRoute generation
> 
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
> 
> Jeffrey,
> 
> On 8/24/2011 9:59 AM, Jeffrey Janner wrote:
> > As Chris pointed out, it is mostly used by folks running with
> > "sticky-sessions"
> 
> Actually, use of the jvmRoute with non-sticky sessions seems like an
> unnecessary step to me, since non-sticky sessions implies that you
> either have no sessions (and it doesn't matter at all) or you have
> replicated sessions where it doesn't matter which cluster member you
> reach.
> 
> > but from what I've been able to tell, most folks set up their
> > clusters that way. It lessens the headaches.
> 
> Practically speaking, clustering Tomcat instances means session
> replication, which (if you ask me) does not warrant session stickiness
> (though session replication does take some time... I don't know enough
> about TC's clustering to know whether race conditions are possible or
> probable).
> 

Yea, it's that back-end replication stuff that causes all the headaches.  From 
what I've seen, mostly on this list, folks tend to set up the cluster 
w/replication, but keep the sessions sticky, as a fail-over scenario.  That is, 
they want to avoid requiring login on a fail-over. The httpd-JK does a pretty 
good job of load-balancing the sessions between the clusters.
Session replication delay issues totally depend on what method you are using to 
do the replication.  Only race conditions I can think of would be caused by 
subsequent requests coming in faster than replication can occur. In some 
methods you might be able to avoid that, others, not so easy.

> For my money, I'd go for sticky sessions and no replication at all. If
> you really need cluster-wide session access, look to other solutions
> (memcached, db-backed sessions, etc.).
> 
> - -chris
__

Confidentiality Notice:  This Transmission (including any attachments) may 
contain information that is privileged, confidential, and exempt from 
disclosure under applicable law.  If the reader of this message is not the 
intended recipient you are hereby notified that any dissemination, 
distribution, or copying of this communication is strictly prohibited.  

If you have received this transmission in error, please immediately reply to 
the sender or telephone (512) 343-9100 and delete this transmission from your 
system.


Re: Ajp13Processor threads are not getting closed.

2011-08-24 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1



On 8/24/2011 5:39 AM, Jagadish Raj R wrote:
> I have a Tomcat server to which another apache webserver connects 
> using AJP 1.3 Connector. I have set up a maxProcessors="75" in 
> connector settings. Whenever a user creates a connection an 
> Ajp13Processor connection thread is created. My problem is this 
> thread does not get terminated even after the user close the
> session. Please help me in finding some configuration changes that
> will allow me to close these sessions/threads after a certain
> timeout value.

Upgrade to Tomcat 6.0 or later (current is 7.0.20) and use an
, which allows threads to stop when they are idle for a
certain amount of time.

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

iEYEARECAAYFAk5VCAwACgkQ9CaO5/Lv0PB1KgCgu0xQ2vLUwhC5LKKPHjK3hCzv
swMAoIavnzaa40N2uCsD+3L2q1+/woEk
=PIxs
-END PGP SIGNATURE-

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



Re: path to application in parallel deployment

2011-08-24 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Aristedes,

On 8/24/2011 6:12 AM, Aristedes Maniatis wrote:
> I have another parallel deployment question: I am deploying Solr
> within a custom war application and it requires a path to its
> config files. Before parallel deployment I had this entry in
> context.xml:
> 
>  value="${ROOTDIR}/app/A1/webapps/search-internal/WEB-INF/classes/solr"
>
> 
type="java.lang.String" override="false"/>
> 
> But now, I cannot predict the name of the application path (since
> it looks like this "search-internal##11081701"). I have also been 
> unsucessful in putting this environment entry inside the
> application itself and using a relative path, since it appears to
> be relative to tomcat and not to the application.
> 
> Is there some magic like a ${APP_ROOT} variable I can use?

So, if you could do this with code it would be:

  getServletContext().getRealPath("/WEB-INF/classes/solr")

Right?

There isn't any system property for this kind of thing (since system
properties are JVM-wide, and not specific to any particular webapp) so
it would have to be, as you say, some kind of "magic" variable that
you could use.

I don't believe such a variable exists. Since Solr is servlet
context-aware application (i.e. it *is* webapp), is it possible to
give it a path relative to the webapp itself? You might want to ask
the Solr folks about this.

Another option, which I think is a better option, would be to locate
solr/home outside of your deployment directory.

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

iEYEARECAAYFAk5VB4EACgkQ9CaO5/Lv0PAr9QCdEGNstlZyka9uWD+ZS65tvBpz
+7wAnRjJV49BQck00kNr9UyI2l13+ty1
=ilmU
-END PGP SIGNATURE-

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



Re: jvmRoute generation

2011-08-24 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Jeffrey,

On 8/24/2011 9:59 AM, Jeffrey Janner wrote:
> As Chris pointed out, it is mostly used by folks running with
> "sticky-sessions"

Actually, use of the jvmRoute with non-sticky sessions seems like an
unnecessary step to me, since non-sticky sessions implies that you
either have no sessions (and it doesn't matter at all) or you have
replicated sessions where it doesn't matter which cluster member you
reach.

> but from what I've been able to tell, most folks set up their
> clusters that way. It lessens the headaches.

Practically speaking, clustering Tomcat instances means session
replication, which (if you ask me) does not warrant session stickiness
(though session replication does take some time... I don't know enough
about TC's clustering to know whether race conditions are possible or
probable).

For my money, I'd go for sticky sessions and no replication at all. If
you really need cluster-wide session access, look to other solutions
(memcached, db-backed sessions, etc.).

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

iEYEARECAAYFAk5VBagACgkQ9CaO5/Lv0PBM7ACeOaqKmQRe3U1/55wvDmh/qQnG
IJcAnjYfmb6SZJv2fdvHEMV8BFbzH0sr
=nr5Z
-END PGP SIGNATURE-

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



RE: jvmRoute generation

2011-08-24 Thread Jeffrey Janner
> -Original Message-
> From: Andrew Todd [mailto:andrew.todd...@gmail.com]
> Sent: Wednesday, August 24, 2011 7:53 AM
> To: Tomcat Users List
> Subject: Re: jvmRoute generation
> 
> On Tue, Aug 23, 2011 at 5:31 PM, Christopher Schultz
>  wrote:
> > If you are using sticky sessions, then it is vital to the operation
> of
> > your cluster that the jvmRoutes be set with care and configured in
> the
> > web server to match the individual Tomcat instances.
> 
> Thanks, it sounds like I need to go back to the person who is
> configuring mod_jk for us. I was told that this was essentially a
> one-way configuration value and did not have to be set on both Tomcat
> and the httpd; it was just a unique identifier that was attached to
> the sessionid.
> 

Well, it gets attached to the sessionid by Tomcat, not httpd.  It is read by 
the front-end to determine which backend is supposed to receive the request.  
As Chris pointed out, it is mostly used by folks running with 
"sticky-sessions", but from what I've been able to tell, most folks set up 
their clusters that way. It lessens the headaches.

FYI: When you see a hyperbolic, over-the-top response like my first, it's 
usually a combination of a query of "what are you trying to accomplish" and a 
hint that you might need to (re)read the documentation on the topic so you have 
a better idea of what is going on.  I see from your first post that you know 
where to find the Tomcat 7 documentation, take a closer look at section 18.
__

Confidentiality Notice:  This Transmission (including any attachments) may 
contain information that is privileged, confidential, and exempt from 
disclosure under applicable law.  If the reader of this message is not the 
intended recipient you are hereby notified that any dissemination, 
distribution, or copying of this communication is strictly prohibited.  

If you have received this transmission in error, please immediately reply to 
the sender or telephone (512) 343-9100 and delete this transmission from your 
system.


RE: Ajp13Processor threads are not getting closed.

2011-08-24 Thread Caldarale, Charles R
> From: Jagadish Raj R [mailto:jagadish_ra...@symantec.com] 
> Subject: Ajp13Processor threads are not getting closed.

> Tomcat - 4.1.27

That version of Tomcat is over eight years old, and Tomcat 4 has not been 
supported for several years.  Might want to think about upgrading...

 - 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



Re: jvmRoute generation

2011-08-24 Thread Andrew Todd
On Tue, Aug 23, 2011 at 5:31 PM, Christopher Schultz
 wrote:
> If you are using sticky sessions, then it is vital to the operation of
> your cluster that the jvmRoutes be set with care and configured in the
> web server to match the individual Tomcat instances.

Thanks, it sounds like I need to go back to the person who is
configuring mod_jk for us. I was told that this was essentially a
one-way configuration value and did not have to be set on both Tomcat
and the httpd; it was just a unique identifier that was attached to
the sessionid.

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



path to application in parallel deployment

2011-08-24 Thread Aristedes Maniatis

I have another parallel deployment question: I am deploying Solr within a 
custom war application and it requires a path to its config files. Before 
parallel deployment I had this entry in context.xml:



But now, I cannot predict the name of the application path (since it looks like this 
"search-internal##11081701"). I have also been unsucessful in putting this 
environment entry inside the application itself and using a relative path, since it 
appears to be relative to tomcat and not to the application.

Is there some magic like a ${APP_ROOT} variable I can use?


Cheers
Ari


--
-->
Aristedes Maniatis
GPG fingerprint CBFB 84B4 738D 4E87 5E5C  5EFA EF6A 7D2E 3E49 102A

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



RE: Ajp13Processor threads are not getting closed.

2011-08-24 Thread Edward Quick
You could try adding JkWatchDogInterval 30. That did the trick for me.

-Original Message-
From: Jagadish Raj R [mailto:jagadish_ra...@symantec.com]
Sent: 24 August 2011 10:39
To: Tomcat Users List
Subject: Ajp13Processor threads are not getting closed.

Hi Tomcat Users,

I have a Tomcat server to which another apache webserver connects using AJP 1.3 
Connector. I have set up a maxProcessors="75" in connector settings. Whenever a 
user creates a connection an Ajp13Processor connection thread is created. My 
problem is this thread does not get terminated even after the user close the 
session. Please help me in finding some configuration changes that will allow 
me to close these sessions/threads after a certain timeout value.

I am pasting below the configurations I am using.




Workers.properties file:-

worker.list=ajp13
worker.ajp13.port=
worker.ajp13.host=hostname
worker.ajp13.type=ajp13
worker.ajp13.connection_pool_size=75
worker.ajp13.connection_pool_minsize=15
worker.ajp13.connection_pool_timeout=60


Logs from thread dump of tomcat process:-

"Ajp13Processor[][7]" daemon prio=10 tid=0x0166c038 nid=0xe0 in 
Object.wait() [0xa64ff000..0xa64ffa28]
at java.lang.Object.wait(Native Method)
- waiting on <0xc6de9028> (a org.apache.ajp.tomcat4.Ajp13Processor)
at java.lang.Object.wait(Object.java:474)
at org.apache.ajp.tomcat4.Ajp13Processor.await(Ajp13Processor.java:316)
- locked <0xc6de9028> (a org.apache.ajp.tomcat4.Ajp13Processor)
at org.apache.ajp.tomcat4.Ajp13Processor.run(Ajp13Processor.java:576)
at java.lang.Thread.run(Thread.java:595)


Versions:-

Tomcat - 4.1.27
Mod JK -  mod_jk-apache-2.0.49-linux-i686.so




Thanks & Regards,
JAGADISH RAJ R | Symantec EAI Support | M P H A S I S an HP company | Level 2, 
Tower 7, Magarpatta SEZ, Magarpatta city, Pune-411013| Mobile: +91 9011047954| 
Email: jagadish_ra...@symantec.com


The information contained in this email is strictly confidential and for the 
use of the addressee only, unless otherwise indicated. If you are not the 
intended recipient, please do not read, copy, use or disclose to others this 
message or any attachment. Please also notify the sender by replying to this 
email or by telephone (+44 (0)20 7896 0011) and then delete the email and any 
copies of it. Opinions, conclusions (etc) that do not relate to the official 
business of this company shall be understood as neither given nor endorsed by 
it. IG Group Holdings plc is a company registered in England and Wales under 
number 01190902. VAT registration number 761 2978 07. Registered Office: Cannon 
Bridge House, 25 Dowgate Hill, London EC4R 2YA. Authorised and regulated by the 
Financial Services Authority. FSA Register number 114059.

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



Re: Ajp13Processor threads are not getting closed.

2011-08-24 Thread Mark Thomas
On 24/08/2011 10:39, Jagadish Raj R wrote:
> Hi Tomcat Users,
> 
> I have a Tomcat server to which another apache webserver connects using AJP 
> 1.3 Connector. I have set up a maxProcessors="75" in connector settings. 
> Whenever a user creates a connection an Ajp13Processor connection thread is 
> created. My problem is this thread does not get terminated even after the 
> user close the session. Please help me in finding some configuration changes 
> that will allow me to close these sessions/threads after a certain timeout 
> value.

AJP connections are persistent. They are not meant to close.

Mark

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



Ajp13Processor threads are not getting closed.

2011-08-24 Thread Jagadish Raj R
Hi Tomcat Users,

I have a Tomcat server to which another apache webserver connects using AJP 1.3 
Connector. I have set up a maxProcessors="75" in connector settings. Whenever a 
user creates a connection an Ajp13Processor connection thread is created. My 
problem is this thread does not get terminated even after the user close the 
session. Please help me in finding some configuration changes that will allow 
me to close these sessions/threads after a certain timeout value.

I am pasting below the configurations I am using.




Workers.properties file:-

worker.list=ajp13
worker.ajp13.port=
worker.ajp13.host=hostname
worker.ajp13.type=ajp13
worker.ajp13.connection_pool_size=75
worker.ajp13.connection_pool_minsize=15
worker.ajp13.connection_pool_timeout=60


Logs from thread dump of tomcat process:-

"Ajp13Processor[][7]" daemon prio=10 tid=0x0166c038 nid=0xe0 in 
Object.wait() [0xa64ff000..0xa64ffa28]
at java.lang.Object.wait(Native Method)
- waiting on <0xc6de9028> (a org.apache.ajp.tomcat4.Ajp13Processor)
at java.lang.Object.wait(Object.java:474)
at org.apache.ajp.tomcat4.Ajp13Processor.await(Ajp13Processor.java:316)
- locked <0xc6de9028> (a org.apache.ajp.tomcat4.Ajp13Processor)
at org.apache.ajp.tomcat4.Ajp13Processor.run(Ajp13Processor.java:576)
at java.lang.Thread.run(Thread.java:595)


Versions:-

Tomcat - 4.1.27
Mod JK -  mod_jk-apache-2.0.49-linux-i686.so




Thanks & Regards,
JAGADISH RAJ R | Symantec EAI Support | M P H A S I S an HP company | Level 2, 
Tower 7, Magarpatta SEZ, Magarpatta city, Pune-411013| Mobile: +91 9011047954| 
Email: jagadish_ra...@symantec.com



Re: Conditional Branch from Servlet to URL

2011-08-24 Thread Pid
On 24/08/2011 03:46, Leo Donahue - PLANDEVX wrote:
> 
> From: Donald Jolley [jolleyt...@gmail.com]
> Subject: Conditional Branch from Servlet to URL
> 
> I'm not at all surprised about the "request" and "response" symbols as they 
> appear to be undefined.
> I really expected that getRequestDispatcher would have been found in
> javax.servlet.* which is imported.
>   ... doug
> 
> *
> Shouldn't you import javax.servlet.http ? 
> If your request and response objects are undefined - wish we could see how 
> you declared them, how can RequestDispatcher perform the forward?

@Donald  Usually in a Servlet (your code *is* inside a Servlet isn't
it?) you'd see those two variables defined in the method parameters:

 protected void doGet(HttpServletRequest request, HttpServletResponse
response) throws ... {


p



signature.asc
Description: OpenPGP digital signature


Re: Tomcat 6.0.26 bundled with Netbeans 6.9.1

2011-08-24 Thread Pid
On 24/08/2011 09:44, André Warnier wrote:
> Ana Maria Teodorescu wrote:
>>Dear Tomcat users and experts,
>>
>> I downloaded Netbeans 6.9.1 including Apache Tomcat on my Mac snow
>> leopard.
>> When I go to the page http://localhost:8080/ the message that I've setup
>> correctly Tomcat appears. But, if I click on the following links:
>> 1)Tomcat documentation ( http://localhost:8080/docs )
>> 2) Servlet examples ( http://localhost:8080/examples/servlets/)
>> 3) JSP examples ( http://localhost:8080/examples/jsp/ )
>>
>> I get the error 404:  *The requested resource (/examples/jsp/, etc) is
>> not
>> available*
>> *
>> *
>> I've spent a whole day trying to understand how to fix the problem but
>> with
>> no success.
>> There are no other options I can choose from during the Netbeans
>> installation. Tomcat
>> is configured automatically and I don't know where to put my hands on.
>>
> The above probably means that whatever package "Netbeans 6.9.1 including
> Apache Tomcat" you are using to install Tomcat, includes just the basic
> Tomcat and does not include these additional "sample" applications.
> Maybe consult your package manager software and look for the missing
> Tomcat-related packages.
> I do not know Mac at all, but under Linux Debian for example, there used
> to be one package named "Tomcat", another one named "tomcat-examples",
> and another one named "tomcat-admin".

Packaging systems are available for Mac, but aren't shipped with it.

> Or else, depending on your circumstances, de-install this "Netbeans +
> Tomcat" package, download and install a "real Tomcat" from the Tomcat
> website, and then re-install a "Netbeans without Tomcat" package from
> your package source.

+1


p

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




signature.asc
Description: OpenPGP digital signature


Re: Tomcat 6.0.26 bundled with Netbeans 6.9.1

2011-08-24 Thread André Warnier

Ana Maria Teodorescu wrote:

   Dear Tomcat users and experts,

I downloaded Netbeans 6.9.1 including Apache Tomcat on my Mac snow leopard.
When I go to the page http://localhost:8080/ the message that I've setup
correctly Tomcat appears. But, if I click on the following links:
1)Tomcat documentation ( http://localhost:8080/docs )
2) Servlet examples ( http://localhost:8080/examples/servlets/)
3) JSP examples ( http://localhost:8080/examples/jsp/ )

I get the error 404:  *The requested resource (/examples/jsp/, etc) is not
available*
*
*
I've spent a whole day trying to understand how to fix the problem but with
no success.
There are no other options I can choose from during the Netbeans
installation. Tomcat
is configured automatically and I don't know where to put my hands on.

The above probably means that whatever package "Netbeans 6.9.1 including Apache Tomcat" 
you are using to install Tomcat, includes just the basic Tomcat and does not include these 
additional "sample" applications.

Maybe consult your package manager software and look for the missing 
Tomcat-related packages.
I do not know Mac at all, but under Linux Debian for example, there used to be one package 
named "Tomcat", another one named "tomcat-examples", and another one named "tomcat-admin".


Or else, depending on your circumstances, de-install this "Netbeans + Tomcat" package, 
download and install a "real Tomcat" from the Tomcat website, and then re-install a 
"Netbeans without Tomcat" package from your package source.


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



Tomcat 6.0.26 bundled with Netbeans 6.9.1

2011-08-24 Thread Ana Maria Teodorescu
   Dear Tomcat users and experts,

I downloaded Netbeans 6.9.1 including Apache Tomcat on my Mac snow leopard.
When I go to the page http://localhost:8080/ the message that I've setup
correctly Tomcat appears. But, if I click on the following links:
1)Tomcat documentation ( http://localhost:8080/docs )
2) Servlet examples ( http://localhost:8080/examples/servlets/)
3) JSP examples ( http://localhost:8080/examples/jsp/ )

I get the error 404:  *The requested resource (/examples/jsp/, etc) is not
available*
*
*
I've spent a whole day trying to understand how to fix the problem but with
no success.
There are no other options I can choose from during the Netbeans
installation. Tomcat
is configured automatically and I don't know where to put my hands on.

Please, help me!

Thank you,
Ana


Re: Appropriate version of Java

2011-08-24 Thread André Warnier

Rafael Giovanni Florez Arango - EyS wrote:

Should I install an Apache Tomcat 6.0.30 server, however I have the following 
question, what is the appropriate version of Java for this version of Tomcat?

Thank in advance any opinions or experience with it.


Go to the Tomcat website and click on "which version "

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



How to properly detect a client disconnect in servlet spec 3 (Tomcat 7)?

2011-08-24 Thread Oscar van den Bosch
I have tried writing to the Response OutputStream, because there is no proper 
disconnect callback. 
Unfortunately, this doesn't seem to work either. When the client is 
disconnected, writing and flushing the buffer did not throw an exception.

I use the following code:

private boolean write(byte[] output, AsyncContext context) {
try {
OutputStream stream  = context.getResponse().getOutputStream();
stream.write(output);
stream.flush();
return true;
} catch (IOException ex) {
// Disconnect detected
log.error(ex);
removeAsyncContext(context); 
return false;
}
}

The weird thing is, it does throws an exception the second time you try to 
write to the output stream. 
It looks like the first time you write it flips internal state to error, 
without notifying.

What is a proper way to detect whether something written to the client is 
actually received?

Oscar

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