Java Mailing List Archive

http://www.junlu.com/

Google
Google
Mailing List
Home
Forum Home
JBoss - Java Application Server
Struts - A MVC web framework
Tomcat - JSP/Servlet container
iText - An open source PDF Java Library
JDOM - JDOM XML Parser
J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition
J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog
Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology
JSP - A mailing list about Java Server Pages specification and reference
Struts & Hibernate
Subjects
JSP editor plugin for eclipse ?
org apache jasper JasperException: Unable to compile class for JSP
Tomcat: Connection reset by peer: socket write error
Cannot retrieve definition for form bean null
Struts Tiles Tutorial (free Struts training)
Where do I download Tomcat 4 0 6?
Data Access Object (DAO) pattern, example DAO 's
Where to download Tomcat v 4 1 24 from?
Tomcat 5 0 16 Requested resource not available
Oracle Connection Pooling in 3 2 2
Servlet : Session invalidate
Servlet action is currently unavailable
Tomcat/Struts Unicode Encoding/Decoding problems
Tomcat and webapplication specific java library path
Running a Simple JMS Example
Mapping in workers2 properties
org apache jasper JasperException
Cannot find message resources under key org apache struts action
   MESSAGE
problem with html:text bean throwing exception
Cannot find message resources under key org apache struts action MESSAGE
invalid direct reference problem with solution
Tool for jsp debug Try Sysdeo Eclipse Plugin
Tomcat 5 Cannot load JDBC driver class 'null ' SQL state: null
weblogic ejbc
java properties file
Jboss 3 2 3 Coyote Can 't re
Tomcat 5, Apache2 and mod jk2 integration problem
JBoss example problem new to J2EE
url string for connecting jboss to oracle
Value attribute of <html:checkbox
javax servlet ServletException: BeanUtils populate
HTTP Status 404 The requested resource is not available
5 0 18: Windows XP Pro vs Windows 2000
 
Using acceptCount in server.xml

Using acceptCount in server.xml

2004-01-09       - By Donie Kelly

 Back
Reply:     1     2  


Hi all

Just wondering how to use acceptCount in the Connector class. Default
example here modified to show what I'm trying to test to understand how this
works.

<Connector className="org.apache.coyote.tomcat4.CoyoteConnector Source code of org.apache.coyote.tomcat4.CoyoteConnector"
port="8443" minProcessors="1" maxProcessors="1"
              enableLookups="true"  acceptCount="2" debug="0"
scheme="https" secure="true"
              useURIValidationHack="false" disableUploadTimeout="true">
     <Factory
className="org.apache.coyote.tomcat4.CoyoteServerSocketFactory Source code of org.apache.coyote.tomcat4.CoyoteServerSocketFactory"
clientAuth="false" protocol="TLS" />
   </Connector>

I start Tomcat with this setup and see that it has only one object in it's
connection pool as expected.

I have a small servlet that just returns a number (incrementing) and has a
forced pause to simulate work being done. 2 seconds wait.

1.   I send the request with Browser 1 to the servlet and it doesn't
return yet. Should be asleep for 2 seconds
2.   I send the request with Browser 2 to the servlet and it does noting
but looks like it's busy as expected as maxProcessors=1 above
3.   Browser 1 now returns with it's incrementing number
4.   Now I expect browser 2 to be assigned to the free connection in
Tomcat's pool but nothing happens... ever.
5.   Browser 1 goes again and works after 2 seconds.

Q: Why did browser 2 not get assigned the servlet that browser 1 freed up
when it finished the request

Q: Does the acceptCount does what I think it does?

Thanks for any help in understanding how this works.
Donie



<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft
-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:dt=
"uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns="http://www.w3.org/TR/REC
-html40">

<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859 (See http://iso-8859.ora-code.com)-1">

<meta name="Microsoft Theme 2.00" content="capsules 001">

<meta name=ProgId content=Word.Document>
<meta name=Generator content="Microsoft Word 9">
<meta name=Originator content="Microsoft Word 9">
<link rel=File-List href="cid:filelist.xml@(protected)">
<!--[if gte mso 9]><xml>
<o:OfficeDocumentSettings>
 <o:DoNotRelyOnCSS/>
</o:OfficeDocumentSettings>
</xml><![endif]--><!--[if gte mso 9]><xml>
<w:WordDocument>
 <w:View>Normal</w:View>
 <w:Zoom>0</w:Zoom>
 <w:DocumentKind>DocumentEmail</w:DocumentKind>
 <w:EnvelopeVis/>
</w:WordDocument>
</xml><![endif]-->
<style>
<!--
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
  {mso-style-parent:"";
  margin:0cm;
  margin-bottom:.0001pt;
  mso-pagination:widow-orphan;
  font-size:12.0pt;
  font-family:Arial;
  mso-fareast-font-family:"Times New Roman";
  color:black;}
h1
  {mso-style-next:Normal;
  margin-top:12.0pt;
  margin-right:0cm;
  margin-bottom:3.0pt;
  margin-left:0cm;
  mso-pagination:widow-orphan;
  page-break-after:avoid;
  mso-outline-level:1;
  font-size:24.0pt;
  font-family:Arial;
  color:#000099;
  mso-font-kerning:16.0pt;
  font-weight:normal;
  mso-bidi-font-weight:bold;}
h2
  {mso-style-next:Normal;
  margin-top:12.0pt;
  margin-right:0cm;
  margin-bottom:3.0pt;
  margin-left:0cm;
  mso-pagination:widow-orphan;
  page-break-after:avoid;
  mso-outline-level:2;
  font-size:18.0pt;
  font-family:Arial;
  color:#000099;
  font-weight:normal;
  mso-bidi-font-weight:bold;
  mso-bidi-font-style:italic;}
h3
  {mso-style-next:Normal;
  margin-top:12.0pt;
  margin-right:0cm;
  margin-bottom:3.0pt;
  margin-left:0cm;
  mso-pagination:widow-orphan;
  page-break-after:avoid;
  mso-outline-level:3;
  font-size:14.0pt;
  font-family:Arial;
  color:#000099;
  font-weight:normal;
  mso-bidi-font-weight:bold;}
h4
  {mso-style-next:Normal;
  margin-top:12.0pt;
  margin-right:0cm;
  margin-bottom:3.0pt;
  margin-left:0cm;
  mso-pagination:widow-orphan;
  page-break-after:avoid;
  mso-outline-level:4;
  font-size:12.0pt;
  font-family:Arial;
  color:#000099;
  font-weight:normal;
  mso-bidi-font-weight:bold;}
h5
  {mso-style-next:Normal;
  margin-top:12.0pt;
  margin-right:0cm;
  margin-bottom:3.0pt;
  margin-left:0cm;
  mso-pagination:widow-orphan;
  mso-outline-level:5;
  font-size:10.0pt;
  font-family:Arial;
  color:#000099;
  font-weight:normal;
  mso-bidi-font-weight:bold;
  mso-bidi-font-style:italic;}
h6
  {mso-style-next:Normal;
  margin-top:12.0pt;
  margin-right:0cm;
  margin-bottom:3.0pt;
  margin-left:0cm;
  mso-pagination:widow-orphan;
  mso-outline-level:6;
  font-size:8.0pt;
  font-family:Arial;
  color:#000099;
  font-weight:normal;
  mso-bidi-font-weight:bold;}
a:link, span.MsoHyperlink
  {color:#000099;
  text-decoration:underline;
  text-underline:single;}
a:visited, span.MsoHyperlinkFollowed
  {color:#339966;
  text-decoration:underline;
  text-underline:single;}
p.MsoAutoSig, li.MsoAutoSig, div.MsoAutoSig
  {margin:0cm;
  margin-bottom:.0001pt;
  mso-pagination:widow-orphan;
  font-size:12.0pt;
  font-family:Arial;
  mso-fareast-font-family:"Times New Roman";
  color:black;}
span.EmailStyle15
  {mso-style-type:personal-compose;
  mso-ansi-font-size:10.0pt;
  mso-ascii-font-family:Arial;
  mso-hansi-font-family:Arial;
  mso-bidi-font-family:Arial;
  color:black;}
@(protected) Section1
  {size:595.3pt 841.9pt;
  margin:72.0pt 90.0pt 72.0pt 90.0pt;
  mso-header-margin:35.4pt;
  mso-footer-margin:35.4pt;
  mso-paper-source:0;}
div.Section1
  {page:Section1;}
/* List Definitions */
@(protected) l0
  {mso-list-id:711418076;
  mso-list-type:hybrid;
  mso-list-template-ids:751862652 67698703 67698713 67698715 67698703 67698713
67698715 67698703 67698713 67698715;}
ol
  {margin-bottom:0cm;}
ul
  {margin-bottom:0cm;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026"/>
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
 <o:idmap v:ext="edit" data="1"/>
</o:shapelayout></xml><![endif]-->
</head>

<body bgcolor=white background="cid:image001.gif@(protected)" lang=EN-GB
link="#000099" vlink="#339966" style='tab-interval:36.0pt'>
<img src="cid:image001.gif@(protected)"
v:src="cid:image001.gif@(protected)" v:shapes="_x0000_Mail" width=0
height=0 class=shape style='display:none;width:0;height:0'><!--[if gte mso 9]>
<xml>
<v:background id="_x0000_s1025" o:bwmode="white" o:targetscreensize="800,600">
 <v:fill src="cid:image001.gif@(protected)" o:title="captext" type=
"frame"/>
</v:background></xml><![endif]-->

<div class=Section1>

<p class=MsoNormal><span class=EmailStyle15><font size=2 color=black
face=Arial><span style='font-size:10.0pt;mso-bidi-font-size:12.0pt'>Hi all<o:p>
</o:p></span></font></span></p>

<p class=MsoNormal><span class=EmailStyle15><font size=2 color=black
face=Arial><span style='font-size:10.0pt;mso-bidi-font-size:12.0pt'><![if
!supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></font></span></p>

<p class=MsoNormal><span class=EmailStyle15><font size=2 color=black
face=Arial><span style='font-size:10.0pt;mso-bidi-font-size:12.0pt'>Just
wondering how to use acceptCount in the Connector class. Default example here
modified to show what I&#8217;m trying to test to understand how this works.<o
:p></o:p></span></font></span></p>

<p class=MsoNormal><span class=EmailStyle15><font size=2 color=black
face=Arial><span style='font-size:10.0pt;mso-bidi-font-size:12.0pt'><![if
!supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></font></span></p>

<p class=MsoNormal><span class=EmailStyle15><font size=2 color=black
face=Arial><span style='font-size:10.0pt;mso-bidi-font-size:12.0pt'>&lt
;Connector
className=&quot;org.apache.coyote.tomcat4.CoyoteConnector Source code of org.apache.coyote.tomcat4.CoyoteConnector&quot;<span
style="mso-spacerun: yes">&nbsp; </span>port=&quot;8443&quot;
minProcessors=&quot;1&quot; maxProcessors=&quot;1&quot;<o:p></o:p></span></font
></span></p>

<p class=MsoNormal><span class=EmailStyle15><font size=2 color=black
face=Arial><span style='font-size:10.0pt;mso-bidi-font-size:12.0pt'><span
style="mso-spacerun:
yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;
</span>enableLookups=&quot;true&quot;<span style="mso-spacerun: yes">&nbsp;
</span>acceptCount=&quot;2&quot; debug=&quot;0&quot; scheme=&quot;https&quot;
secure=&quot;true&quot;<o:p></o:p></span></font></span></p>

<p class=MsoNormal><span class=EmailStyle15><font size=2 color=black
face=Arial><span style='font-size:10.0pt;mso-bidi-font-size:12.0pt'><span
style="mso-spacerun:
yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;
</span>useURIValidationHack=&quot;false&quot;
disableUploadTimeout=&quot;true&quot;&gt;<o:p></o:p></span></font></span></p>

<p class=MsoNormal><span class=EmailStyle15><font size=2 color=black
face=Arial><span style='font-size:10.0pt;mso-bidi-font-size:12.0pt'><span
style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>&lt;Factory
className=&quot;org.apache.coyote.tomcat4.CoyoteServerSocketFactory Source code of org.apache.coyote.tomcat4.CoyoteServerSocketFactory&quot;
clientAuth=&quot;false&quot; protocol=&quot;TLS&quot; /&gt;<o:p></o:p></span><
/font></span></p>

<p class=MsoNormal><span class=EmailStyle15><font size=2 color=black
face=Arial><span style='font-size:10.0pt;mso-bidi-font-size:12.0pt'><span
style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </span>&lt;/Connector&gt;<o:p></o
:p></span></font></span></p>

<p class=MsoNormal><span class=EmailStyle15><font size=2 color=black
face=Arial><span style='font-size:10.0pt;mso-bidi-font-size:12.0pt'><![if
!supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></font></span></p>

<p class=MsoNormal><span class=EmailStyle15><font size=2 color=black
face=Arial><span style='font-size:10.0pt;mso-bidi-font-size:12.0pt'>I start
Tomcat with this setup and see that it has only one object in it&#8217;s
connection pool
as expected.<o:p></o:p></span></font></span></p>

<p class=MsoNormal><span class=EmailStyle15><font size=2 color=black
face=Arial><span style='font-size:10.0pt;mso-bidi-font-size:12.0pt'><![if
!supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></font></span></p>

<p class=MsoNormal><span class=EmailStyle15><font size=2 color=black
face=Arial><span style='font-size:10.0pt;mso-bidi-font-size:12.0pt'>I have a
small servlet that just returns a number (incrementing) and has a forced pause
to simulate work being done. 2 seconds wait.<o:p></o:p></span></font></span></p>

<p class=MsoNormal><span class=EmailStyle15><font size=2 color=black
face=Arial><span style='font-size:10.0pt;mso-bidi-font-size:12.0pt'><![if
!supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></font></span></p>

<ol style='mso-margin-top-alt:0cm' start=1 type=1>
<li class=MsoNormal style='mso-list:l0 level1 lfo1;tab-stops:list 36.0pt'><span
    class=EmailStyle15><font size=2 color=black face=Arial><span
    style='font-size:10.0pt;mso-bidi-font-size:12.0pt'>I send the request with
    Browser 1 to the servlet and it doesn&#8217;t return yet. Should be asleep
for 2
    seconds<o:p></o:p></span></font></span></li>
<li class=MsoNormal style='mso-list:l0 level1 lfo1;tab-stops:list 36.0pt'><span
    class=EmailStyle15><font size=2 color=black face=Arial><span
    style='font-size:10.0pt;mso-bidi-font-size:12.0pt'>I send the request with
    Browser 2 to the servlet and it does noting but looks like it&#8217;s busy
as
    expected as maxProcessors=1 above<o:p></o:p></span></font></span></li>
<li class=MsoNormal style='mso-list:l0 level1 lfo1;tab-stops:list 36.0pt'><span
    class=EmailStyle15><font size=2 color=black face=Arial><span
    style='font-size:10.0pt;mso-bidi-font-size:12.0pt'>Browser 1 now returns
    with it&#8217;s incrementing number<o:p></o:p></span></font></span></li>
<li class=MsoNormal style='mso-list:l0 level1 lfo1;tab-stops:list 36.0pt'><span
    class=EmailStyle15><font size=2 color=black face=Arial><span
    style='font-size:10.0pt;mso-bidi-font-size:12.0pt'>Now I expect browser 2
    to be assigned to the free connection in Tomcat&#8217;s pool but nothing
happens&#8230;
    ever.<o:p></o:p></span></font></span></li>
<li class=MsoNormal style='mso-list:l0 level1 lfo1;tab-stops:list 36.0pt'><span
    class=EmailStyle15><font size=2 color=black face=Arial><span
    style='font-size:10.0pt;mso-bidi-font-size:12.0pt'>Browser 1 goes again and
    works after 2 seconds.<o:p></o:p></span></font></span></li>
</ol>

<p class=MsoNormal><span class=EmailStyle15><font size=2 color=black
face=Arial><span style='font-size:10.0pt;mso-bidi-font-size:12.0pt'><![if
!supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></font></span></p>

<p class=MsoNormal><span class=EmailStyle15><font size=2 color=black
face=Arial><span style='font-size:10.0pt;mso-bidi-font-size:12.0pt'>Q: Why did
browser 2 not get assigned the servlet that browser 1 freed up when it finished
the request<o:p></o:p></span></font></span></p>

<p class=MsoNormal><span class=EmailStyle15><font size=2 color=black
face=Arial><span style='font-size:10.0pt;mso-bidi-font-size:12.0pt'><![if
!supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></font></span></p>

<p class=MsoNormal><span class=EmailStyle15><font size=2 color=black
face=Arial><span style='font-size:10.0pt;mso-bidi-font-size:12.0pt'>Q: Does the
acceptCount does what I think it does?<o:p></o:p></span></font></span></p>

<p class=MsoNormal><span class=EmailStyle15><font size=2 color=black
face=Arial><span style='font-size:10.0pt;mso-bidi-font-size:12.0pt'><![if
!supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></font></span></p>

<p class=MsoNormal><span class=EmailStyle15><font size=2 color=black
face=Arial><span style='font-size:10.0pt;mso-bidi-font-size:12.0pt'>Thanks for
any help in understanding how this works.<o:p></o:p></span></font></span></p>

<p class=MsoNormal><span class=EmailStyle15><font size=2 color=black
face=Arial><span style='font-size:10.0pt;mso-bidi-font-size:12.0pt'>Donie<o:p><
/o:p></span></font></span></p>

<p class=MsoNormal><span class=EmailStyle15><font size=2 color=black
face=Arial><span style='font-size:10.0pt;mso-bidi-font-size:12.0pt'><![if
!supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></font></span></p>

<p class=MsoNormal><span class=EmailStyle15><font size=2 color=black
face=Arial><span style='font-size:10.0pt;mso-bidi-font-size:12.0pt'><![if
!supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></font></span></p>

</div>

</body>

</html>

-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
To unsubscribe, e-mail: tomcat-user-unsubscribe@(protected)
For additional commands, e-mail: tomcat-user-help@(protected)

©2008 junlu.com - Jax Systems, LLC, U.S.A.