Re: Problem with URL mapping

2012-06-22 Thread Konstantin Kolinko
2012/6/22  :
> Hello all
>
> I have problem with URL mappings with embedded tomcat 7
>
> I whant to handle all requests to my applications. I added filter with
> mapping /*  for my application with context path "/"
>
>    FilterMap errorFilter = new FilterMap();
>    errorFilter.setFilterName("errors-filter");
>    errorFilter.addURLPattern("/*");
>    ctx.addFilterMap(errorFilter);
>
>
> This works fine in most cases except the cases when "\" character is in the
> request URL.
>
> For examle
>
> localhost:/test/path     handled correctly, but
> localhost:/test\path     is not handled and server just returns blank
> page
>
> Any ideas?
>

What is the name of your web application? If it is "test" then the
"test\path" page is handled by the ROOT webapp. The "\" is not a
separator. It is just a character.

If you do not have ROOT webapp, then an attempt to access it will
return a zero-length response, but with correct HTTP response code and
reason phrase.

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



Problem with URL mapping

2012-06-22 Thread comm

Hello all

I have problem with URL mappings with embedded tomcat 7

I whant to handle all requests to my applications. I added filter with 
mapping /*  for my application with context path "/"


FilterMap errorFilter = new FilterMap();
errorFilter.setFilterName("errors-filter");
errorFilter.addURLPattern("/*");
ctx.addFilterMap(errorFilter);


This works fine in most cases except the cases when "\" character is in 
the request URL.


For examle

localhost:/test/path handled correctly, but
localhost:/test\path is not handled and server just returns 
blank page


Any ideas?

Kind regards,
Sergey Mashkov

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



Re: Tomcat 6 jsvc startup/shutdown script

2012-06-22 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Priscilla,

On 6/22/12 10:12 AM, Muriithi, Priscilla K. wrote:
> Can anyone send me a tomcat 6 jsvc startup/shutdown script for Red
> Hat Linux 5.4?

Please don't post the same message over and over again to the list. If
you don't get a response right away, you need to wait for a bit to see
if someone answers. If you still don't get a response, reply to your
original message and ask again, possibly providing more information.

jsvc doesn't require a complex startup/shutdown script: you can easily
write your own that makes sense for your environment. I also wouldn't
be surprised if Red Hat has their own script(s) in their yum packages
for Tomcat. If you don't want to install a package-managed version of
Tomcat, you could temporarily install one (even on a test server or VM
or whatever) and steal the script from it.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk/k10gACgkQ9CaO5/Lv0PCoMwCfepLtTegl9KtVotZBX+UkzEVx
ZzUAnj9J5Uy/cGYjI+u4uuuae8bDgXT0
=wYsU
-END PGP SIGNATURE-

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



RE: mixing authentication schemes

2012-06-22 Thread Aggarwal, Ajay
Thanks for pointing to OAuth. Any suggestion for open source OAuth Java
library both for provider side implementation and client side? And can
OAuth provider issue non-expiring tokens? That's kind of our
requirement. After asking user once for credentials, we do not want to
bother user again.


-Original Message-
From: Pid [mailto:p...@pidster.com] 
Sent: Thursday, June 21, 2012 7:01 PM
To: Tomcat Users List
Subject: Re: mixing authentication schemes

On 21/06/2012 20:34, Aggarwal, Ajay wrote:
> Sorry about the poor formatting of my message.

Research OAuth.


p

> -Original Message-
> From: Aggarwal, Ajay [mailto:ajay.aggar...@stratus.com]
> Sent: Thursday, June 21, 2012 3:27 PM
> To: users@tomcat.apache.org
> Subject: mixing authentication schemes
> 
> CURRENT ENVIRONMENT
> 
>  
> 
> Our device is managed via a tomcat 6 based web-server that runs on the

> device. We have a proprietary XML/JSON API that web based UI client 
> uses to talk to web-server. We are NOT using container managed
security.
> Instead our application has implemented its own authentication.
> Essentially client uses a proprietary login request and after a 
> successful authentication, server marks the HTTP session as 
> authenticated.
> 
>  
> 
> NEW SITUATION
> 
>  
> 
> Now we are looking to build a new multi-device management application,

> which would have its own UI and server. As the name implies this 
> application is for managing multiple devices.
> 
>  
> 
> How should this multi-device service authenticate itself with the 
> individual devices? We do not want user to enter credentials for each 
> device every time this service wants to talk to a managed device. We 
> also do not want to store each managed device's credentials with the 
> multi-device service.
> 
>  
> 
> One of the possibility is to use SSL certificate based authentication.
> So multi-device application can authenticate itself with individual 
> devices using a SSL certificate.  We only need to import multi-device 
> application's certificate into each managed device's trust-store once.
> 
>  
> 
> QUESTIONS
> 
>  
> 
> Few questions for those of you who have dealt with this type of 3-tier

> applications
> 
>  
> 
> Q1. How to get above scheme working in tomcat, such that the existing 
> device specific UI clients can continue to authenticate using 
> proprietary login request, whereas multi-device application uses SSL 
> certificate based authentication?
> 
>  
> 
> Q2. What are some of the other suggestions and/or best practices that 
> you would recommend to solve this problem?
> 
>  
> 
> Thanks.
> 
>  
> 
> -Ajay
> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 


-- 

[key:62590808]




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



Re: Request timeout option in HTTP or AJP Connector

2012-06-22 Thread Harsimranjit singh Kler
>
>>
>
>
> Please, respond to comments/questions *below* the original, not on top of
> the email.
> It makes it a lot easier to follow the logical flow of questions/responses.
>
> About your original request : the Tomcat  mentioned in
Tomcat's server.xml /have nothing to do/ with how your application talks to
anything else.
The Connectors handle only the HTTP/HTTPS/AJP requests/responses that go
between the browser and Tomcat.
If your application talks to anything else, then the timeouts have to be
set there (in whatever your application is using to do that).
Any timeouts (or any other parameter) set at the Tomcat Connector level
will not have any effect here.


Thanks,Intially i was in doubt that we can set request timeout at tomcat
connector level as well.


Re: Abtract methods in DelegatingResultSet

2012-06-22 Thread Olivier Lefevre

On 6/19/2012 11:22 AM, Mark Thomas wrote:

Compare the definition of the ResultSet interface in the version of the
JDK the class was compiled with with the definition in the version of
the JDK you are running with.


Thanks, that explains it: as I wrote before, the abstract DelegatingResultSet
methods in Tomcat 6.0.30 (resp. 7.0.27) are those marked Java 1.6 (resp. 1.7).
Now, opening the class file in an hex editor, I can see that Tomcat 6.0 (resp.
7.0) was indeed compiled against Java 1.5 (resp. 1.6).

So the problem stems from mixing Tomcat and JDBC driver classes that were
compiled against different versions of Java, correct?

-- O.L.


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



Re: Request timeout option in HTTP or AJP Connector

2012-06-22 Thread André Warnier

Harsimranjit singh Kler wrote:

External system can be jdbc ,soap ,rest or other different type of protocol
.So i dont have that freedom always.

Yes i agree i can do query timeout in Database case,but not in all External
system so i was thinking timeout from connector side.


Please, respond to comments/questions *below* the original, not on top of the 
email.
It makes it a lot easier to follow the logical flow of questions/responses.

About your original request : the Tomcat  mentioned in Tomcat's server.xml 
/have nothing to do/ with how your application talks to anything else.
The Connectors handle only the HTTP/HTTPS/AJP requests/responses that go between the 
browser and Tomcat.
If your application talks to anything else, then the timeouts have to be set there (in 
whatever your application is using to do that).
Any timeouts (or any other parameter) set at the Tomcat Connector level will not have any 
effect here.




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



Re: Fine tune or disable JMX activity

2012-06-22 Thread Jacopo Cappellato

On Jun 22, 2012, at 5:45 PM, Caldarale, Charles R wrote:

> So let's see... you're using VisualVM which depends on JMX to retrieve the 
> information it reports, and you want to disable JMX?
> 
> I think you're observing self-induced behavior.

ah ah, yes I think you are quite right and it was a dumb question indeed.

By the way, thank you, it helped me.

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



RE: Fine tune or disable JMX activity

2012-06-22 Thread Caldarale, Charles R
> From: Jacopo Cappellato [mailto:jacopo.cappell...@gmail.com] 
> Subject: Fine tune or disable JMX activity

> While doing some profiling with Java VisualVM I have noticed that a lot of 
> object (java.util.TreeMap$Entry) are created even when there is no traffic;
> they don't represent a memory leak because a garbage collection removes them
> all, but the still grow at a very high pace; they seem to be generated by
> JMX support in Tomcat.

So let's see... you're using VisualVM which depends on JMX to retrieve the 
information it reports, and you want to disable JMX?

I think you're observing self-induced behavior.

 - 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: Fine tune or disable JMX activity

2012-06-22 Thread Pid
On 22/06/2012 16:30, Jacopo Cappellato wrote:
> 
> On Jun 22, 2012, at 5:11 PM, Pid wrote:
> 
>> On 22/06/2012 16:09, Jacopo Cappellato wrote:
>>> Hi all,
>>>
>>> I am a committer of the Apache OFBiz project; OFBiz uses Tomcat 7.0.28 in 
>>> embedded mode.
>>> While doing some profiling with Java VisualVM I have noticed that a lot of 
>>> object (java.util.TreeMap$Entry) are created even when there is no traffic; 
>>> they don't represent a memory leak because a garbage collection removes 
>>> them all, but the still grow at a very high pace; they seem to be generated 
>>> by JMX support in Tomcat.
>>
>> Can you explain a little about how you concluded that Tomcat's JMX
>> support is responsible?
>>
> 
> I am actually not sure if Tomcat is responsible for this (it could actually 
> be completely unrelated); I think it is related to JMX because I have found 
> that most of the objects are created in the following stack:
> 
> https://cwiki.apache.org/confluence/download/attachments/27850262/profiler-snapshot.png

There's no Tomcat code in that tree.

How many bytes is it using, am I reading that correctly?
Is there an issue with this at all?


p


>>> Is it possible? Is there a way to disable JMX related activity (if not 
>>> needed, of course)? I am worried that this could cause an unnecessary waste 
>>> of server resources (more frequent GCs etc...).
>>>
>>> Thanks in advance,
>>>
>>> Jacopo
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>>> For additional commands, e-mail: users-h...@tomcat.apache.org
>>>
>>
>>
>> -- 
>>
>> [key:62590808]
>>
>>
>>
> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 


-- 

[key:62590808]





signature.asc
Description: OpenPGP digital signature


Re: Fine tune or disable JMX activity

2012-06-22 Thread Jacopo Cappellato

On Jun 22, 2012, at 5:11 PM, Pid wrote:

> On 22/06/2012 16:09, Jacopo Cappellato wrote:
>> Hi all,
>> 
>> I am a committer of the Apache OFBiz project; OFBiz uses Tomcat 7.0.28 in 
>> embedded mode.
>> While doing some profiling with Java VisualVM I have noticed that a lot of 
>> object (java.util.TreeMap$Entry) are created even when there is no traffic; 
>> they don't represent a memory leak because a garbage collection removes them 
>> all, but the still grow at a very high pace; they seem to be generated by 
>> JMX support in Tomcat.
> 
> Can you explain a little about how you concluded that Tomcat's JMX
> support is responsible?
> 

I am actually not sure if Tomcat is responsible for this (it could actually be 
completely unrelated); I think it is related to JMX because I have found that 
most of the objects are created in the following stack:

https://cwiki.apache.org/confluence/download/attachments/27850262/profiler-snapshot.png

Regards,

Jacopo

> 
> p
> 
> 
>> Is it possible? Is there a way to disable JMX related activity (if not 
>> needed, of course)? I am worried that this could cause an unnecessary waste 
>> of server resources (more frequent GCs etc...).
>> 
>> Thanks in advance,
>> 
>> Jacopo
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: users-h...@tomcat.apache.org
>> 
> 
> 
> -- 
> 
> [key:62590808]
> 
> 
> 


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



Re: Fine tune or disable JMX activity

2012-06-22 Thread Pid
On 22/06/2012 16:09, Jacopo Cappellato wrote:
> Hi all,
> 
> I am a committer of the Apache OFBiz project; OFBiz uses Tomcat 7.0.28 in 
> embedded mode.
> While doing some profiling with Java VisualVM I have noticed that a lot of 
> object (java.util.TreeMap$Entry) are created even when there is no traffic; 
> they don't represent a memory leak because a garbage collection removes them 
> all, but the still grow at a very high pace; they seem to be generated by JMX 
> support in Tomcat.

Can you explain a little about how you concluded that Tomcat's JMX
support is responsible?


p


> Is it possible? Is there a way to disable JMX related activity (if not 
> needed, of course)? I am worried that this could cause an unnecessary waste 
> of server resources (more frequent GCs etc...).
> 
> Thanks in advance,
> 
> Jacopo
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 


-- 

[key:62590808]





signature.asc
Description: OpenPGP digital signature


Fine tune or disable JMX activity

2012-06-22 Thread Jacopo Cappellato
Hi all,

I am a committer of the Apache OFBiz project; OFBiz uses Tomcat 7.0.28 in 
embedded mode.
While doing some profiling with Java VisualVM I have noticed that a lot of 
object (java.util.TreeMap$Entry) are created even when there is no traffic; 
they don't represent a memory leak because a garbage collection removes them 
all, but the still grow at a very high pace; they seem to be generated by JMX 
support in Tomcat.
Is it possible? Is there a way to disable JMX related activity (if not needed, 
of course)? I am worried that this could cause an unnecessary waste of server 
resources (more frequent GCs etc...).

Thanks in advance,

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



Re: iis not looking for jsp in tomcat webapps folder

2012-06-22 Thread André Warnier

Vijaya wrote:


Andre Warnier,  It is three year old system. At that time I had the 
option of installing Tomcat 6.0 but decided to install 5 and never had 
any problem so far till the ISP decided to change their software. I am 
not sure that is the problem.


I was going mad to get the same error again and again and decided to 
take a break for three days. Also decided to install the latest version 
of Tomcat and see how it goes. So we have brought our server down and 
will let you all know if the same problem exists in the latest version 
of Tomcat.


Is there any significant changes in terms of configuration files from 
Tomcat 5 to 7 that I need to pay attention to.




The main problem is that, as a connector between the front-end webserver and Tomcat, you 
are using a module called mod_jk2 (or its Windows equivalent isapi_redirector2.
Development and support for this module have been discontinued for about 9 years, so there 
are not many people that would be able to help you.


You should be using mod_jk (or its Windows equivalent isapi_redirector, which is being 
developed and maintained and supported.
Until you do that, I cannot help you further, and you probably will not find other people 
that can help you.


You have received pointers to the documentation and configuration of 
mod_jk/isapi_redirector in earlier responses in this same thread.



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



Tomcat 6 jsvc startup/shutdown script

2012-06-22 Thread Muriithi, Priscilla K.
Hello,



Can anyone send me a tomcat 6 jsvc startup/shutdown script for Red Hat Linux 
5.4?



Thanks,

Priscilla




RE: iis not looking for jsp in tomcat webapps folder

2012-06-22 Thread Caldarale, Charles R
> From: Vijaya [mailto:svij...@solutionscraft.com] 
> Subject: Re: iis not looking for jsp in tomcat webapps folder

> Is there any significant changes in terms of configuration files from Tomcat 
> 5 to 7 that I need to pay attention to.

Lots.  Read the Migration Guide (link on the Tomcat home page).

 - 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: Failed allocating AJP message buffer

2012-06-22 Thread Pierre Ayotte
Hello Christopher,

Yes we saw on wednesday taht the 1.2.37 has been release sot we just put
the it in production yesterday night. All keep you inform.

We also make thoses changes to httpd.conf base on recommendation from a
collegue:

- ThreadsPerChild down to 1000 instead of 3000
- Remove ThreadLimit 9000 because apparently this does not serve on Windows

Do you think this could help?

2012/6/21 Christopher Schultz 

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> Pierre,
>
> On 6/20/12 6:26 PM, Pierre Ayotte wrote:
> > Our Configuration = Apache Apache/2.2.22 on Windows
> > 2008 R2 x64 mod_ssl/2.2.22 OpenSSL/0.9.8t with certificates in
> > place mod_jk/1.2.35 with a load balancer to 5 workers
>
> There were a bunch of fixes in mod_jk 1.2.36 and 1.2.37. Is it
> possible to test with the latest version?
>
> - -chris
> -BEGIN PGP SIGNATURE-
> Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
> Comment: GPGTools - http://gpgtools.org
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEARECAAYFAk/jkUwACgkQ9CaO5/Lv0PD7ewCcCMNw8g2O5Ejv9CDYhIcWmAPK
> PzUAnA8RIWsETMPD9yTIVl9BQaqEo6Yu
> =chWd
> -END PGP SIGNATURE-
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: Request timeout option in HTTP or AJP Connector

2012-06-22 Thread Harsimranjit singh Kler
External system can be jdbc ,soap ,rest or other different type of protocol
.So i dont have that freedom always.

Yes i agree i can do query timeout in Database case,but not in all External
system so i was thinking timeout from connector side.

On Fri, Jun 22, 2012 at 3:41 PM, chris derham  wrote:

> >
> >
> > Using tomcat 6.0.29.
> >
> >  i want to know is there any parameter in HTTP\AJP connector  to set
> > request time out(i.e if particular request taking long time to complete
> it
> > should time out after configured timeout value).?
> >
> > My web application communicating to some external system where response
> is
> > very slow for particular queries so i want tomcat to timout those
> requests.
> >
> > How do you communicate with the external system? You say "particular
> queries" so is it jdbc? Can't you set a timeout whatever communication
> mechanism you use to connect to the external system? Then detect the
> timeout in your webapp and respond appropriately
>
> Chris
>


Re: Request timeout option in HTTP or AJP Connector

2012-06-22 Thread chris derham
>
>
> Using tomcat 6.0.29.
>
>  i want to know is there any parameter in HTTP\AJP connector  to set
> request time out(i.e if particular request taking long time to complete it
> should time out after configured timeout value).?
>
> My web application communicating to some external system where response is
> very slow for particular queries so i want tomcat to timout those requests.
>
> How do you communicate with the external system? You say "particular
queries" so is it jdbc? Can't you set a timeout whatever communication
mechanism you use to connect to the external system? Then detect the
timeout in your webapp and respond appropriately

Chris


Re: iis not looking for jsp in tomcat webapps folder

2012-06-22 Thread Vijaya


Andre Warnier,  It is three year old system. At that time I had the option 
of installing Tomcat 6.0 but decided to install 5 and never had any problem 
so far till the ISP decided to change their software. I am not sure that is 
the problem.


I was going mad to get the same error again and again and decided to take a 
break for three days. Also decided to install the latest version of Tomcat 
and see how it goes. So we have brought our server down and will let you all 
know if the same problem exists in the latest version of Tomcat.


Is there any significant changes in terms of configuration files from Tomcat 
5 to 7 that I need to pay attention to.


Thanks once again for the help.

Vijaya

-Original Message- 
From: André Warnier

Sent: Tuesday, June 19, 2012 4:22 AM
To: Tomcat Users List
Subject: Re: iis not looking for jsp in tomcat webapps folder

Pid wrote:

On 18/06/2012 10:10, Vijaya wrote:


file=c:/tomcat-5.5.16/conf/jk2.shm


So... tomcat-5.5.16 AND jk2?


I had to blow the dust of the 5.x security page...

http://tomcat.apache.org/security-5.html#Fixed_in_Apache_Tomcat_5.5.16,_5.0.SVN


just sayin'



And no easier to find : 
http://archive.apache.org/dist/tomcat/tomcat-connectors/jk2/

shows that the last release of mod_jk2 was in 2002.

Vijaya, how old is that system which you are trying to get back to work 
again ?
the mod_jk2 connector, which you are apparently using, has not been 
developed or
maintained for quite a while.  Maybe you'd like to install and configure 
mod_jk instead ?
Then we could also really help you (if the on-line documentation is not 
sufficient).

There is not a big difference in the concept between mod_jk2 and mod_jk.
Start looking here : 
http://tomcat.apache.org/connectors-doc/webserver_howto/iis.html





-
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: Re : Re: Issue with keep-alive connections, when using APR Connector on Windows and starting Processes from Servlets

2012-06-22 Thread Laurent Petit
Hello,

On Thu, 2012-06-21 at 22:53 +0200, Jeff MAURY wrote:
> Is it specific to Wordpad or any launched process will do the trick ?
> Do you tried with a non UI process (console) ?


I did an additional test, as you suggested, with a non UI process (a
small java executable launched in headless mode, whose purpose was just
to wait for 20 seconds before exiting).

I can reproduce the problem with this headless executable: the HTTP
client is blocked until the 20 seconds elapse and the process is killed.


Here is the modified servlet code I used:

https://www.refheap.com/paste/3285


and here is the code for the small java program:

https://www.refheap.com/paste/3286



Regards,

-- 
Laurent



> 
> Jeff
> 
> On Thu, Jun 21, 2012 at 10:45 PM, Laurent Petit  wrote:
> 
> > En Réponse à "Tomcat Users List"  le 21 juin
> > 2012 00:07 Can you verify your 2 threads (reading input an error) are
> > launched ? Yes they are. Verified. Can you confirm you are getting the
> > problem only on Windows ? Yes sir, we're unable to reproduce it on Ubuntu.
> > Jeff On Wed, Jun 20, 2012 at 4:19 PM, Laurent Petit 
> > wrote: > Hello, > > I have a problem with keep-alive connections, when
> > starting a subprocess > (via JDK's default ProcessBuilder/Process API),
> > while also having > started Tomcat with the APR HTTP/1.1 Connector. > > The
> > problem symptom is with Keep-Alive connection, as follows: > > - the client
> > (browser, jmeter, etc.) sends a first request > - the servlet starts a
> > Process for e.g. wordpad.exe > - the servlet returns an acknowledgment html
> > content, sets the content > length, flushes the writer, and returns > - the
> > client displays the received acknowledgement html content, sends > the
> > second request to the server. > - the server doesn't answer. No Tomcat log
> > ever reports the start of > something received. > - Then when on the server
> > you close the wordpad.exe instance, the server > finally handles the second
> > request. > > I have created a small servlet code which reproduces the
> > problem. > For the demo, it suffices to have the started subprocess be >
> > "wordpad.exe". Of course my real process is more interesting than > that
> > :-). > > You can find the servlet code for reproducing the test here: > >
> > https://www.refheap.com/paste/3254 > > > To reproduce the problem
> > deterministically, the ConnectionTimeout for > the APR HTTP Connector in
> > servlet.xml must be set sufficiently low. > With my boxes, I get a 100%
> > error hit when set at 200 ms. > > You can find here the jmeter script which
> > hits the same page again and > again with "keep-alive" option set on: > >
> > https://www.refheap.com/paste/3255 > > > So far, the only reliable
> > solution we have found to work around this > problem is to not use the
> > HTP/1.1 APR Connector. > > > My configuration : > Windows 2008 US std R2
> > 64bits > Tomcat 6.0.32 64 bits > Java 6u30 64 bits(Oracle) > > Same issue
> > has been observed on Windows 7 32 bits. > > Was not able to reproduce the
> > issue on Linux Ubuntu Desktop 11.10 or > 12.04. > > > Thanks for your
> > support, ideas, solutions, etc. > > > >
> > - > To
> > unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional
> > commands, e-mail: users-h...@tomcat.apache.org > > -- Jeff MAURY "Legacy
> > code" often differs from its suggested alternative by actually working and
> > scaling. - Bjarne Stroustrup http://www.jeffmaury.com
> > http://riadiscuss.jeffmaury.com http://www.twitter.com/jeffmaury
> 
> 
> 
> 

-- 
Laurent Petit

Agence +33 (0)4 78 47 07 49

Email lpe...@yseop.com

 



 

Yseop apporte une réponse intelligente et individualisée à chacun de vos
clients

 

www.yseop.com




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



AprLifecycleListener initialization issue

2012-06-22 Thread Francesco
Hi , i'm new in this mailing list, i've started recently to integrate 
tomcat in some of my applications ( i found a lot easyer to manage 
tomcat inside a big servlet than viceversa), as early adopted java 
developer i hope to help a bit in tomcat development when i become a bit 
more expert, at this moment my tomcat integration it's stuck with the 
AprLifecycleListener class,
i've compiled, installed apr ,jni, ssl and so fort documentation is a 
bit tricky on that... expecially for path+external variables handlings 
and compiling configurations,
i really hope to have time to build a guidelines for everything about 
that...

...anyway i'll go to explain my issue :


public class AprLifecycleListener

it's a class which load jni component and check for apr existance and 
versionm,


at first request it call  :

  private static void init()


then set a boolean private and unaccessible variable which avoid 
successive calls


   if (aprInitialized) {
return;
}


my problem is that this class seems to not recognize apr in my 
computer.. i don't know exactly when this is called, anyway if i 
overload this class and force to call the init() again within my 
overloaded class it works...




i don't have a ready to test class , it will take some time to produce, 
but if really needed i'll do..




anyway this is a test case i've done..

 this  (with my overloaded apr-Loader class ):

public static void main(String[] args) throws InterruptedException {
VarsTrackingHttpServer varsTrackingHttpServer = new 
VarsTrackingHttpServer();
//System.out.println("ORIGINAL APR AVAILABLE? " + 
AprLifecycleListener.isAprAvailable());
System.out.println("OVERLOADED APR CLASS AVAILABLE?" + 
testAprLifecycleListener.isAprAvailable());


varsTrackingHttpServer.start();
Thread.sleep(150);
varsTrackingHttpServer.stop();
varsTrackingHttpServer.waitStopped(100);

}
- produce this :
init()__ STARTED
init()__ 1
---error, aprInitialized=true
Loaded APR based Apache Tomcat Native library 1.1.24.
APR capabilities: IPv6 [true], sendfile [true], accept filters [false], 
random [true].

initializeWebServer()__start
OVERLOADED APR CLASS AVAILABLE?true
tomcat basedir = /tmp
SERVER TMPDIR = /tmp
APRAVAILABLE?::true
FastTomcat::STARTING()::Apache Tomcat/7.0.27
Jun 22, 2012 8:11:16 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-apr-8087"]


-- but this (without the overloaded class called)
public static void main(String[] args) throws InterruptedException {


VarsTrackingHttpServer varsTrackingHttpServer = new 
VarsTrackingHttpServer();
System.out.println("ORIGINAL APR AVAILABLE? " + 
AprLifecycleListener.isAprAvailable());
//System.out.println("OVERLOADED APR CLASS AVAILABLE?" + 
testAprLifecycleListener.isAprAvailable());


varsTrackingHttpServer.start();
Thread.sleep(150);
varsTrackingHttpServer.stop();
varsTrackingHttpServer.waitStopped(100);

}

-- produce this :

initializeWebServer()__start
ORIGINAL APR AVAILABLE? false
tomcat basedir = /tmp
SERVER TMPDIR = /tmp
APRAVAILABLE?::false
FastTomcat::STARTING()::Apache Tomcat/7.0.27
Jun 22, 2012 8:10:32 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8087"]



- and if i call the standard class (it will fail to 
load apr even if i call twice, because the boolean "initialized" avoid 
successive calls)  than i call my overloaded class ( it will load apr 
correctly) , than also the original class recognize apr as loaded! 
(HERE DOWN THE EXAMPLE..) so what's the trick? seems that the 
AprLifecycleListener class is being called in a moment when apr is not 
available and then there is no possibility to re-call it??



 finally this :
public static void main(String[] args) throws InterruptedException {

VarsTrackingHttpServer varsTrackingHttpServer = new 
VarsTrackingHttpServer();
System.out.println("ORIGINAL APR AVAILABLE? " + 
AprLifecycleListener.isAprAvailable());
System.out.println("OVERLOADED APR CLASS AVAILABLE?" + 
testAprLifecycleListener.isAprAvailable());
System.out.println("ORIGINAL APR AVAILABLE? " + 
AprLifecycleListener.isAprAvailable());


varsTrackingHttpServer.start();
Thread.sleep(150);
varsTrackingHttpServer.stop();
varsTrackingHttpServer.waitStopped(100);

}

 PRODUCE :
---error, aprInitialized=true
ORIGINAL APR AVAILABLE? false
init()__ STARTED
init()__ 1
Loaded APR based Apache Tomcat Native library 1.1.24.
APR capabilities: IPv6 [true], sendfile [true], accept filters [false], 
random [true].

initializeWebServer()__start
OVERLOADED APR CLASS AVAILABLE?true
ORIGINAL APR AVAILABLE? true
tomcat basedir = /tmp
SERVER TMPDIR = /tmp
APRAVAILABLE?::true
FastTomcat::STARTING()::Apache Tomcat/7.0.2