svn commit: r991837 - /tomcat/trunk/webapps/docs/cluster-howto.xml

2010-09-02 Thread markt
Author: markt
Date: Thu Sep  2 07:55:11 2010
New Revision: 991837

URL: http://svn.apache.org/viewvc?rev=991837&view=rev
Log:
Remove setting distributable on the Context from the docs. It gets lost on 
webapp reload() e.g. when triggered from the manager app.

Modified:
tomcat/trunk/webapps/docs/cluster-howto.xml

Modified: tomcat/trunk/webapps/docs/cluster-howto.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/cluster-howto.xml?rev=991837&r1=991836&r2=991837&view=diff
==
--- tomcat/trunk/webapps/docs/cluster-howto.xml (original)
+++ tomcat/trunk/webapps/docs/cluster-howto.xml Thu Sep  2 07:55:11 2010
@@ -116,8 +116,8 @@ should be completed:
   If you have defined custom cluster valves, make sure you have the 
ReplicationValve  defined as well under the Cluster element in 
server.xml
   If your Tomcat instances are running on the same machine, make sure the 
tcpListenPort
   attribute is unique for each instance, in most cases Tomcat is smart 
enough to resolve this on it's own by autodetecting available ports in the 
range 4000-4100
-  Make sure your web.xml has the 
 element 
-  or set at your 
+  Make sure your web.xml has the
+   element
   If you are using mod_jk, make sure that jvmRoute attribute is set at 
your Engine 
   and that the jvmRoute attribute value matches your worker name in 
workers.properties
   Make sure that all nodes have the same time and sync with NTP 
service!



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



svn commit: r991839 - in /tomcat/tc6.0.x/trunk: ./ webapps/docs/cluster-howto.xml

2010-09-02 Thread markt
Author: markt
Date: Thu Sep  2 07:56:26 2010
New Revision: 991839

URL: http://svn.apache.org/viewvc?rev=991839&view=rev
Log:
Remove setting distributable on the Context from the docs. It gets lost on 
webapp reload() e.g. when triggered from the manager app.

Modified:
tomcat/tc6.0.x/trunk/   (props changed)
tomcat/tc6.0.x/trunk/webapps/docs/cluster-howto.xml

Propchange: tomcat/tc6.0.x/trunk/
--
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Sep  2 07:56:26 2010
@@ -1 +1 @@
-/tomcat/trunk:601180,606992,612607,630314,640888,652744,653247,666232,673796,673820,677910,683969,683982,684001,684081,684234,684269-684270,685177,687503,687645,689402,690781,691392,691805,692748,693378,694992,695053,695311,696780,696782,698012,698227,698236,698613,699427,699634,701355,709294,709811,709816,710063,710066,710125,710205,711126,711600,712461,712467,713953,714002,718360,719119,719124,719602,719626,719628,720046,720069,721040,721286,721708,721886,723404,723738,726052,727303,728032,728768,728947,729057,729567,729569,729571,729681,729809,729815,729934,730250,730590,731651,732859,732863,734734,740675,740684,742677,742697,742714,744160,744238,746321,746384,746425,747834,747863,748344,750258,750291,750921,751286-751287,751289,751295,752323,753039,757335,757774,758249,758365,758596,758616,758664,759074,761601,762868,762929,762936-762937,763166,763183,763193,763228,763262,763298,763302,763325,763599,763611,763654,763681,763706,764985,764997,765662,768335,769979,770716,77
 
0809,770876,772872,776921,776924,776935,776945,777464,777466,777576,777625,778379,778523-778524,781528,781779,782145,782791,783316,783696,783724,783756,783762,783766,783863,783934,784453,784602,784614,785381,785688,785768,785859,786468,786487,786490,786496,786667,787627,787770,787985,789389,790405,791041,791184,791194,791224,791243,791326,791328,791789,792740,793372,793757,793882,793981,794082,794673,794822,795043,795152,795210,795457,795466,797168,797425,797596,797607,802727,802940,804462,804544,804734,805153,809131,809603,810916,810977,812125,812137,812432,813001,813013,813866,814180,814708,814876,815972,816252,817442,817822,819339,819361,820110,820132,820874,820954,821397,828196,828201,828210,828225,828759,830378-830379,830999,831106,831774,831785,831828,831850,831860,832214,832218,833121,833545,834047,835036,835336,836405,881396,881412,883130,883134,883146,883165,883177,883362,883565,884341,885038,885231,885241,885260,885901,885991,886019,888072,889363,889606,889716,8901
 
39,890265,890349-890350,890417,891185-891187,891583,892198,892341,892415,892464,892555,892812,892814,892817,892843,892887,893321,893493,894580,894586,894805,894831,895013,895045,895057,895191,895392,895703,896370,896384,897380-897381,897776,898126,898256,898468,898527,898555,898558,898718,898836,898906,899284,899348,899420,899653,899769-899770,899783,899788,899792,899916,899918-899919,899935,899949,903916,905020,905151,905722,905728,905735,907311,907513,907538,907652,907819,907825,907864,908002,908721,908754,908759,909097,909206,909212,909525,909636,909869,909875,909887,910266,910370,910442,910471,910485,910974,915226,915737,915861,916097,916141,916157,916170,917598,917633,918093,918489,918594,918684,918787,918792,918799,918803,918885,919851,919914,920025,920055,920298,920449,920596,920824,920840,921444,922010,926716,927062,927621,928482,928695,928732,928798,931709,932357,932967,935105,935983,939491,939551,940064,941356,941463,944409,944416,945231,945808,945835,945841,946686
 
,948057,950164,950596,950614,950851,950905,951615,953434,954435,955648,955655,956832,957130,957830,958192,960701,963868,964614,966177-966178,966292,981815
+/tomcat/trunk:601180,606992,612607,630314,640888,652744,653247,666232,673796,673820,677910,683969,683982,684001,684081,684234,684269-684270,685177,687503,687645,689402,690781,691392,691805,692748,693378,694992,695053,695311,696780,696782,698012,698227,698236,698613,699427,699634,701355,709294,709811,709816,710063,710066,710125,710205,711126,711600,712461,712467,713953,714002,718360,719119,719124,719602,719626,719628,720046,720069,721040,721286,721708,721886,723404,723738,726052,727303,728032,728768,728947,729057,729567,729569,729571,729681,729809,729815,729934,730250,730590,731651,732859,732863,734734,740675,740684,742677,742697,742714,744160,744238,746321,746384,746425,747834,747863,748344,750258,750291,750921,751286-751287,751289,751295,752323,753039,757335,757774,758249,758365,758596,758616,758664,759074,761601,762868,762929,762936-762937,763166,763183,763193,763228,763262,763298,763302,763325,763599,763611,763654,763681,763706,764985,764997,765662,768335,769979,770716,77
 
0809,770876,772872,776921,776924,776935,776945,777464,777466,777576,777625,778379,778523-778524,781528,781779,782145,782791,783316,783696,783724,783756,783762,783766,783863,783934,784453,784602,784614,785381,785688,785768,785859,786468,786487,786490,786496,786667,787627,787770,787985,789389,790405,791041

svn commit: r991840 - /tomcat/tc5.5.x/trunk/container/webapps/docs/cluster-howto.xml

2010-09-02 Thread markt
Author: markt
Date: Thu Sep  2 07:57:23 2010
New Revision: 991840

URL: http://svn.apache.org/viewvc?rev=991840&view=rev
Log:
Remove setting distributable on the Context from the docs. It gets lost on 
webapp reload() e.g. when triggered from the manager app.

Modified:
tomcat/tc5.5.x/trunk/container/webapps/docs/cluster-howto.xml

Modified: tomcat/tc5.5.x/trunk/container/webapps/docs/cluster-howto.xml
URL: 
http://svn.apache.org/viewvc/tomcat/tc5.5.x/trunk/container/webapps/docs/cluster-howto.xml?rev=991840&r1=991839&r2=991840&view=diff
==
--- tomcat/tc5.5.x/trunk/container/webapps/docs/cluster-howto.xml (original)
+++ tomcat/tc5.5.x/trunk/container/webapps/docs/cluster-howto.xml Thu Sep  2 
07:57:23 2010
@@ -44,8 +44,8 @@ should be completed:
 Uncomment the Valve(ReplicationValve) element in 
server.xml
 If your Tomcat instances are running on the same machine, make sure the 
tcpListenPort
 attribute is unique for each instance.
-Make sure your web.xml has the 
 element 
-or set at your 
+Make sure your web.xml has the
+ element
 Make sure that jvmRoute attribute is set at your Engine 
 Make sure that all nodes have the same time and sync with NTP service!
 Make sure that your loadbalancer is configured for sticky session 
mode.



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



svn commit: r991842 - /tomcat/trunk/java/org/apache/catalina/core/StandardContext.java

2010-09-02 Thread markt
Author: markt
Date: Thu Sep  2 08:01:20 2010
New Revision: 991842

URL: http://svn.apache.org/viewvc?rev=991842&view=rev
Log:
Add a comment as a reminder

Modified:
tomcat/trunk/java/org/apache/catalina/core/StandardContext.java

Modified: tomcat/trunk/java/org/apache/catalina/core/StandardContext.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/StandardContext.java?rev=991842&r1=991841&r2=991842&view=diff
==
--- tomcat/trunk/java/org/apache/catalina/core/StandardContext.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/StandardContext.java Thu Sep  2 
08:01:20 2010
@@ -5048,6 +5048,10 @@ public class StandardContext extends Con
 private void resetContext() throws Exception {
 // Restore the original state ( pre reading web.xml in start )
 // If you extend this - override this method and make sure to clean up
+
+// Don't reset anything that is read from a  element since
+//  elements are read at initialisation will not be read
+// again for this object
 children = new HashMap();
 startupTime = 0;
 startTime = 0;



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



DO NOT REPLY [Bug 49861] New: Log format of RMI ports can be improved, remove ","

2010-09-02 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=49861

   Summary: Log format of RMI ports can be improved, remove ","
   Product: Tomcat 6
   Version: 6.0.29
  Platform: PC
OS/Version: Linux
Status: NEW
  Severity: minor
  Priority: P2
 Component: Catalina
AssignedTo: dev@tomcat.apache.org
ReportedBy: p...@bieringer.de


I've enabled the fixed JMX port listen capability described in
http://tomcat.apache.org/tomcat-6.0-doc/config/listeners.html
and found, that fixed ports are logged, but format is not proper imho:

Is:
INFO: The JMX Remote Listener has configured the registry on port 10,001 and
the server on port 10,002 for the Platform server

Should:
INFO: The JMX Remote Listener has configured the registry on port 10001 and the
server on port 10002 for the Platform server

Just note that is very uncommon logging TCP/UDP ports with a ","

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

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



svn commit: r991867 - in /tomcat/trunk/webapps/docs: changelog.xml index.xml

2010-09-02 Thread markt
Author: markt
Date: Thu Sep  2 09:08:46 2010
New Revision: 991867

URL: http://svn.apache.org/viewvc?rev=991867&view=rev
Log:
Update the Servlet, JSP & EL javadoc links and add spec links.

Modified:
tomcat/trunk/webapps/docs/changelog.xml
tomcat/trunk/webapps/docs/index.xml

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=991867&r1=991866&r2=991867&view=diff
==
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Thu Sep  2 09:08:46 2010
@@ -161,6 +161,10 @@
 49585: Update JSVC documentation to reflect new packaging
 of Commons Daemon. (markt)
   
+  
+Update the Servlet, JSP and EL Javadoc links to link to the
+specifications and the relevant part of the Java EE 6 Javadoc. (markt)
+  
 
   
   

Modified: tomcat/trunk/webapps/docs/index.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/index.xml?rev=991867&r1=991866&r2=991867&view=diff
==
--- tomcat/trunk/webapps/docs/index.xml (original)
+++ tomcat/trunk/webapps/docs/index.xml Thu Sep  2 09:08:46 2010
@@ -149,11 +149,19 @@ are responsible for installing, configur
 - Complete documentation and HOWTOs on the JK native webserver connector,
   used to interface Apache Tomcat with servers like Apache HTTPd, IIS
   and others.
-
-http://java.sun.com/products/servlet/2.5/docs/servlet-2_5-mr2/index.html";>
-Servlet API Javadocs - The Servlet 2.5 API 
Javadocs.
-http://java.sun.com/products/jsp/2.1/docs/jsp-2_1-pfd2/index.html";>
-JSP API Javadocs - The JSP 2.1 API Javadocs.
+Servlet 3.0 
+http://jcp.org/aboutJava/communityprocess/final/jsr315/index.html";>
+Specification and
+http://download.oracle.com/javaee/6/api/index.html?javax/servlet/package-summary.html";>
+Javadoc
+
+http://jcp.org/aboutJava/communityprocess/mrel/jsr245/index.html";>
+JSP 2.2 and EL 2.2 Specifications,
+http://download.oracle.com/javaee/6/api/index.html?javax/servlet/jsp/package-summary.html";>
+JSP 2.2 Javadoc (note it is labelled as JSP 2.1),
+http://download.oracle.com/javaee/6/api/index.html?javax/el/package-summary.html";>
+EL 2.2 Javadoc
+
 
 
 



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



svn commit: r991915 - /tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java

2010-09-02 Thread markt
Author: markt
Date: Thu Sep  2 12:36:23 2010
New Revision: 991915

URL: http://svn.apache.org/viewvc?rev=991915&view=rev
Log:
Fix warnings

Modified:
tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java

Modified: tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java?rev=991915&r1=991914&r2=991915&view=diff
==
--- tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java (original)
+++ tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java Thu Sep  2 
12:36:23 2010
@@ -332,6 +332,7 @@ public class HostConfig
  *
  * @param event The lifecycle event that has occurred
  */
+@Override
 public void lifecycleEvent(LifecycleEvent event) {
 
 if (event.getType().equals(Lifecycle.PERIODIC_EVENT))



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



svn commit: r991959 - in /tomcat/trunk: java/org/apache/catalina/ java/org/apache/catalina/connector/ java/org/apache/catalina/core/ java/org/apache/catalina/ha/deploy/ java/org/apache/catalina/manage

2010-09-02 Thread rjung
Author: rjung
Date: Thu Sep  2 14:52:11 2010
New Revision: 991959

URL: http://svn.apache.org/viewvc?rev=991959&view=rev
Log:
BZ 48967: Replace strings "catalina.base" and "catalina.home"
by globally defined constants.

Patch provided by Marc Guillemot.

Modified:
tomcat/trunk/java/org/apache/catalina/Globals.java
tomcat/trunk/java/org/apache/catalina/connector/Connector.java
tomcat/trunk/java/org/apache/catalina/core/StandardContext.java
tomcat/trunk/java/org/apache/catalina/ha/deploy/FarmWarDeployer.java
tomcat/trunk/java/org/apache/catalina/manager/ManagerServlet.java
tomcat/trunk/java/org/apache/catalina/manager/host/HostManagerServlet.java
tomcat/trunk/java/org/apache/catalina/realm/JAASMemoryLoginModule.java
tomcat/trunk/java/org/apache/catalina/realm/MemoryRealm.java
tomcat/trunk/java/org/apache/catalina/startup/Bootstrap.java
tomcat/trunk/java/org/apache/catalina/startup/Catalina.java
tomcat/trunk/java/org/apache/catalina/startup/CatalinaProperties.java
tomcat/trunk/java/org/apache/catalina/startup/Embedded.java
tomcat/trunk/java/org/apache/catalina/startup/ExpandWar.java
tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java
tomcat/trunk/java/org/apache/catalina/startup/Tomcat.java
tomcat/trunk/java/org/apache/catalina/startup/Tool.java
tomcat/trunk/java/org/apache/catalina/users/MemoryUserDatabase.java
tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java
tomcat/trunk/java/org/apache/jasper/compiler/AntCompiler.java
tomcat/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java
tomcat/trunk/java/org/apache/tomcat/util/net/jsse/JSSESocketFactory.java
tomcat/trunk/webapps/docs/changelog.xml

Modified: tomcat/trunk/java/org/apache/catalina/Globals.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/Globals.java?rev=991959&r1=991958&r2=991959&view=diff
==
--- tomcat/trunk/java/org/apache/catalina/Globals.java (original)
+++ tomcat/trunk/java/org/apache/catalina/Globals.java Thu Sep  2 14:52:11 2010
@@ -329,4 +329,16 @@ public final class Globals {
  * Default domain for MBeans if none can be determined
  */
 public static final String DEFAULT_MBEAN_DOMAIN = "Catalina";
+
+/**
+ * Name of the system property containing
+ * the tomcat product installation path
+ */
+public static final String CATALINA_HOME_PROP = "catalina.home";
+
+/**
+ * Name of the system property containing
+ * the tomcat instance installation path
+ */
+public static final String CATALINA_BASE_PROP = "catalina.base";
 }

Modified: tomcat/trunk/java/org/apache/catalina/connector/Connector.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/Connector.java?rev=991959&r1=991958&r2=991959&view=diff
==
--- tomcat/trunk/java/org/apache/catalina/connector/Connector.java (original)
+++ tomcat/trunk/java/org/apache/catalina/connector/Connector.java Thu Sep  2 
14:52:11 2010
@@ -22,6 +22,7 @@ import java.util.HashMap;
 
 import javax.management.ObjectName;
 
+import org.apache.catalina.Globals;
 import org.apache.catalina.LifecycleException;
 import org.apache.catalina.LifecycleState;
 import org.apache.catalina.Service;
@@ -857,7 +858,7 @@ public class Connector extends Lifecycle
 protocolHandler.setAdapter(adapter);
 
 IntrospectionUtils.setProperty(protocolHandler, "jkHome",
-   System.getProperty("catalina.base"));
+   
System.getProperty(Globals.CATALINA_BASE_PROP));
 
 try {
 protocolHandler.init();

Modified: tomcat/trunk/java/org/apache/catalina/core/StandardContext.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/StandardContext.java?rev=991959&r1=991958&r2=991959&view=diff
==
--- tomcat/trunk/java/org/apache/catalina/core/StandardContext.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/StandardContext.java Thu Sep  2 
14:52:11 2010
@@ -5138,7 +5138,7 @@ public class StandardContext extends Con
  * entire servlet container (i.e. the Engine container if present).
  */
 protected File engineBase() {
-String base=System.getProperty("catalina.base");
+String base=System.getProperty(Globals.CATALINA_BASE_PROP);
 if( base == null ) {
 StandardEngine eng=(StandardEngine)this.getParent().getParent();
 base=eng.getBaseDir();
@@ -5257,7 +5257,7 @@ public class StandardContext extends Con
  */
 public File getConfigBase() {
 File configBase = 
-new File(System.getProperty("catalina.base"), "conf");
+new File(System.getProperty(Globals.CATALINA_BASE

svn commit: r991965 - in /tomcat/trunk/java/org/apache/catalina: core/StandardEngine.java startup/ContextConfig.java

2010-09-02 Thread rjung
Author: rjung
Date: Thu Sep  2 15:02:52 2010
New Revision: 991965

URL: http://svn.apache.org/viewvc?rev=991965&view=rev
Log:
Followup to r991959.

Forgot the two classes.

Modified:
tomcat/trunk/java/org/apache/catalina/core/StandardEngine.java
tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java

Modified: tomcat/trunk/java/org/apache/catalina/core/StandardEngine.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/StandardEngine.java?rev=991965&r1=991964&r2=991965&view=diff
==
--- tomcat/trunk/java/org/apache/catalina/core/StandardEngine.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/StandardEngine.java Thu Sep  2 
15:02:52 2010
@@ -22,6 +22,7 @@ import org.apache.catalina.AccessLog;
 import org.apache.catalina.Container;
 import org.apache.catalina.Context;
 import org.apache.catalina.Engine;
+import org.apache.catalina.Globals;
 import org.apache.catalina.Host;
 import org.apache.catalina.LifecycleException;
 import org.apache.catalina.Realm;
@@ -198,10 +199,10 @@ public class StandardEngine extends Cont
 
 public String getBaseDir() {
 if( baseDir==null ) {
-baseDir=System.getProperty("catalina.base");
+baseDir=System.getProperty(Globals.CATALINA_BASE_PROP);
 }
 if( baseDir==null ) {
-baseDir=System.getProperty("catalina.home");
+baseDir=System.getProperty(Globals.CATALINA_HOME_PROP);
 }
 return baseDir;
 }

Modified: tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java?rev=991965&r1=991964&r2=991965&view=diff
==
--- tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java (original)
+++ tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java Thu Sep  2 
15:02:52 2010
@@ -530,7 +530,7 @@ public class ContextConfig
 if( engineC instanceof StandardEngine ) {
 return ((StandardEngine)engineC).getBaseDir();
 }
-return System.getProperty("catalina.base");
+return System.getProperty(Globals.CATALINA_BASE_PROP);
 }
 
 
@@ -671,7 +671,7 @@ public class ContextConfig
 canonicalAppBase = canonicalAppBase.getCanonicalFile();
 } else {
 canonicalAppBase = 
-new File(System.getProperty("catalina.base"), appBase)
+new File(System.getProperty(Globals.CATALINA_BASE_PROP), 
appBase)
 .getCanonicalFile();
 }
 
@@ -778,7 +778,7 @@ public class ContextConfig
 if (!docBaseFile.isAbsolute()) {
 File file = new File(appBase);
 if (!file.isAbsolute()) {
-file = new File(System.getProperty("catalina.base"), 
appBase);
+file = new 
File(System.getProperty(Globals.CATALINA_BASE_PROP), appBase);
 }
 docBaseFile = new File(file, docBase);
 }
@@ -1145,7 +1145,7 @@ public class ContextConfig
  */
 protected File getConfigBase() {
 File configBase = 
-new File(System.getProperty("catalina.base"), "conf");
+new File(System.getProperty(Globals.CATALINA_BASE_PROP), "conf");
 if (!configBase.exists()) {
 return null;
 }



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



DO NOT REPLY [Bug 48967] Externalize Strings "catalina.base" and "catalina.home"

2010-09-02 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=48967

Rainer Jung  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED

--- Comment #2 from Rainer Jung  2010-09-02 11:07:47 
EDT ---
Thanks for the patch.

Applied to TC 7 in r991959 and r991965.

I won't propose for backport to TC 6.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

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



DO NOT REPLY [Bug 49865] New: ExceptionUtils throw NoClassDefFoundError during startup

2010-09-02 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=49865

   Summary: ExceptionUtils throw NoClassDefFoundError during
startup
   Product: Tomcat 7
   Version: trunk
  Platform: All
OS/Version: All
Status: NEW
  Severity: minor
  Priority: P2
 Component: Catalina
AssignedTo: dev@tomcat.apache.org
ReportedBy: rainer.j...@kippdata.de


Remove conf/catalina.properties and get:

SEVERE: Class loader creation threw exception
java.lang.NoClassDefFoundError: org/apache/tomcat/util/ExceptionUtils
at
org.apache.catalina.startup.CatalinaProperties.loadProperties(CatalinaProperties.java:112)
at
org.apache.catalina.startup.CatalinaProperties.(CatalinaProperties.java:52)
at
org.apache.catalina.startup.Bootstrap.createClassLoader(Bootstrap.java:110)
at
org.apache.catalina.startup.Bootstrap.initClassLoaders(Bootstrap.java:93)
at org.apache.catalina.startup.Bootstrap.init(Bootstrap.java:207)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:392)
Caused by: java.lang.ClassNotFoundException:
org.apache.tomcat.util.ExceptionUtils
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:303)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:316)

org.apache.tomcat.util.ExceptionUtils is not available for the class loader
during this early stage.

Observed in r991965, added TODO marks in CatalinaProperties.java.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

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



svn commit: r992018 - /tomcat/trunk/java/org/apache/catalina/startup/CatalinaProperties.java

2010-09-02 Thread rjung
Author: rjung
Date: Thu Sep  2 16:52:48 2010
New Revision: 992018

URL: http://svn.apache.org/viewvc?rev=992018&view=rev
Log:
BZ 49865: ExceptionUtils throw NoClassDefFoundError
during startup. Add TODO markers.

Modified:
tomcat/trunk/java/org/apache/catalina/startup/CatalinaProperties.java

Modified: tomcat/trunk/java/org/apache/catalina/startup/CatalinaProperties.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/CatalinaProperties.java?rev=992018&r1=992017&r2=992018&view=diff
==
--- tomcat/trunk/java/org/apache/catalina/startup/CatalinaProperties.java 
(original)
+++ tomcat/trunk/java/org/apache/catalina/startup/CatalinaProperties.java Thu 
Sep  2 16:52:48 2010
@@ -99,6 +99,7 @@ public class CatalinaProperties {
 is = (new URL(configUrl)).openStream();
 }
 } catch (Throwable t) {
+// TODO Throws NoClassDefFoundError for ExceptionUtils
 ExceptionUtils.handleThrowable(t);
 }
 
@@ -109,6 +110,7 @@ public class CatalinaProperties {
 File properties = new File(conf, "catalina.properties");
 is = new FileInputStream(properties);
 } catch (Throwable t) {
+// TODO Throws NoClassDefFoundError for ExceptionUtils
 ExceptionUtils.handleThrowable(t);
 }
 }
@@ -118,6 +120,7 @@ public class CatalinaProperties {
 is = CatalinaProperties.class.getResourceAsStream
 ("/org/apache/catalina/startup/catalina.properties");
 } catch (Throwable t) {
+// TODO Throws NoClassDefFoundError for ExceptionUtils
 ExceptionUtils.handleThrowable(t);
 }
 }



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



DO NOT REPLY [Bug 49867] New: default library location into the project tree

2010-09-02 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=49867

   Summary: default library location into the project tree
   Product: Tomcat 7
   Version: trunk
  Platform: PC
OS/Version: Windows XP
Status: NEW
  Severity: minor
  Priority: P2
 Component: Catalina
AssignedTo: dev@tomcat.apache.org
ReportedBy: glip...@gmail.com


Created an attachment (id=25972)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=25972)
Diff attached

Proposed patch attached. Thanks

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

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



DO NOT REPLY [Bug 49868] New: refactor BeanELResolver.java invoke()

2010-09-02 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=49868

   Summary: refactor BeanELResolver.java invoke()
   Product: Tomcat 7
   Version: trunk
  Platform: PC
OS/Version: Windows XP
Status: NEW
  Severity: minor
  Priority: P2
 Component: Catalina
AssignedTo: dev@tomcat.apache.org
ReportedBy: glip...@gmail.com


Created an attachment (id=25973)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=25973)
Diff attached

Patch attached. Thanks

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

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



Voting for issues.

2010-09-02 Thread Wesley Acheson
I understand that the Apache voting system is a bit odd. For enhancement
requests though is there no way for users to vote for the features that they
would like. (Which is different to you as devs voting on whether to apply a
patch or not). I'm pretty sure that's a normal bugzilla feature but I
haven't seen it in your installation.

Regards,

Wes


DO NOT REPLY [Bug 49869] New: Javadoc for WebAppClassLoader constructor has copy/paste error

2010-09-02 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=49869

   Summary: Javadoc for WebAppClassLoader constructor has
copy/paste error
   Product: Tomcat 7
   Version: 7.0.0
  Platform: PC
Status: NEW
  Severity: normal
  Priority: P2
 Component: Catalina
AssignedTo: dev@tomcat.apache.org
ReportedBy: bimargul...@gmail.com


The constructor that takes a parent class loader has a copy of the doc string
from the constructor that does not take a parent class loader.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

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



DO NOT REPLY [Bug 49871] New: http 404 status error

2010-09-02 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=49871

   Summary: http 404 status error
   Product: Tomcat 6
   Version: 6.0.24
  Platform: PC
OS/Version: Windows XP
Status: NEW
  Severity: normal
  Priority: P2
 Component: Catalina
AssignedTo: dev@tomcat.apache.org
ReportedBy: nithya@gmail.com


I'm using Jdk5, and my tomcat version is 6.0 and using eclipse 3.4 version for
my project. Is these version r compatible in using all together?If so i'm not
able to solve the error of 404 status report. I have configured
everything in the eclipse. I'm not able to overcome that error. Tell me ur
suggestions to help me rectify it.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

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



svn commit: r992194 - /tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java

2010-09-02 Thread mturk
Author: mturk
Date: Fri Sep  3 04:09:25 2010
New Revision: 992194

URL: http://svn.apache.org/viewvc?rev=992194&view=rev
Log:
Trim trailing spaces. No functional change

Modified:
tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java?rev=992194&r1=992193&r2=992194&view=diff
==
--- tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java Fri Sep  3 
04:09:25 2010
@@ -91,7 +91,7 @@ public class AprEndpoint extends Abstrac
  */
 protected long sslContext = 0;
 
-
+
 // - Properties
 
 
@@ -101,7 +101,7 @@ public class AprEndpoint extends Abstrac
 protected boolean deferAccept = true;
 public void setDeferAccept(boolean deferAccept) { this.deferAccept = 
deferAccept; }
 public boolean getDeferAccept() { return deferAccept; }
-
+
 
 /**
  * Size of the socket poller.
@@ -340,7 +340,7 @@ public class AprEndpoint extends Abstrac
 if (sendfiles == null) {
 return 0;
 }
-
+
 int sendfileCount = 0;
 for (int i = 0; i < sendfiles.length; i++) {
 sendfileCount += sendfiles[i].getSendfileCount();
@@ -445,7 +445,7 @@ public class AprEndpoint extends Abstrac
 sendfileThreadCount = 1;
 }
 }
-
+
 // Delay accepting of new connections until data is available
 // Only Linux kernels 2.4 + have that implemented
 // on other platforms this call is noop and will return APR_ENOTIMPL.
@@ -457,7 +457,7 @@ public class AprEndpoint extends Abstrac
 
 // Initialize SSL if needed
 if (isSSLEnabled()) {
-
+
 // SSL protocol
 int value = SSL.SSL_PROTOCOL_ALL;
 if ("SSLv2".equalsIgnoreCase(SSLProtocol)) {
@@ -632,7 +632,7 @@ public class AprEndpoint extends Abstrac
 }
 }
 }
-}
+}
 
 /**
  * Pause the endpoint, which will make it stop accepting new sockets.
@@ -711,27 +711,27 @@ public class AprEndpoint extends Abstrac
 if (running) {
 stop();
 }
-
+
 // Destroy pool if it was initialised
 if (serverSockPool != 0) {
 Pool.destroy(serverSockPool);
 serverSockPool = 0;
 }
-
+
 // Close server socket if it was initialised
 if (serverSock != 0) {
 Socket.close(serverSock);
 serverSock = 0;
 }
-
+
 sslContext = 0;
-
+
 // Close all APR memory pools and resources if initialised
 if (rootPool != 0) {
 Pool.destroy(rootPool);
 rootPool = 0;
 }
-
+
 initialized = false;
 }
 
@@ -783,7 +783,7 @@ public class AprEndpoint extends Abstrac
 }
 
 
-
+
 /**
  * Allocate a new poller of the specified size.
  */
@@ -801,7 +801,7 @@ public class AprEndpoint extends Abstrac
 }
 }
 
-
+
 /**
  * Process given socket.
  */
@@ -819,7 +819,7 @@ public class AprEndpoint extends Abstrac
 }
 return true;
 }
-
+
 
 /**
  * Process given socket.
@@ -838,7 +838,7 @@ public class AprEndpoint extends Abstrac
 }
 return true;
 }
-
+
 
 /**
  * Process given socket for an event.
@@ -858,7 +858,7 @@ public class AprEndpoint extends Abstrac
 } else {
 Thread.currentThread().setContextClassLoader(
 getClass().getClassLoader());
-}
+}
 getExecutor().execute(proc);
 } finally {
 if (IS_SECURITY_ENABLED) {
@@ -879,7 +879,7 @@ public class AprEndpoint extends Abstrac
 }
 return true;
 }
-
+
 
 // --- Acceptor Inner Class
 
@@ -952,7 +952,7 @@ public class AprEndpoint extends Abstrac
 
 protected long[] addS;
 protected volatile int addCount = 0;
-
+
 protected boolean comet = true;
 
 protected volatile int keepAliveCount = 0;
@@ -961,7 +961,7 @@ public class AprEndpoint extends Abstrac
 public Poller(boolean comet) {
 this.comet = comet;
 }
-
+
 /**
  * Create the poller. With some versions of APR, the maximum poller 
size will
  * be 62 (recompiling APR is necessary to remove this limitation).
@@ -,7 +,7 @@ public class AprEndpoint extends Abstrac
 // Check for failed s

svn commit: r992199 - /tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java

2010-09-02 Thread mturk
Author: mturk
Date: Fri Sep  3 04:26:23 2010
New Revision: 992199

URL: http://svn.apache.org/viewvc?rev=992199&view=rev
Log:
Store the Acceptor instances in the array like we do for other threads

Modified:
tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java?rev=992199&r1=992198&r2=992199&view=diff
==
--- tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java Fri Sep  3 
04:26:23 2010
@@ -92,6 +92,9 @@ public class AprEndpoint extends Abstrac
 protected long sslContext = 0;
 
 
+private Acceptor acceptors[] = null;
+
+
 // - Properties
 
 
@@ -570,8 +573,10 @@ public class AprEndpoint extends Abstrac
 }
 
 // Start acceptor threads
+acceptors = new Acceptor[acceptorThreadCount];
 for (int i = 0; i < acceptorThreadCount; i++) {
-Thread acceptorThread = new Thread(new Acceptor(), getName() + 
"-Acceptor-" + i);
+acceptors[i] = new Acceptor();
+Thread acceptorThread = new Thread(acceptors[i], getName() + 
"-Acceptor-" + i);
 acceptorThread.setPriority(threadPriority);
 acceptorThread.setDaemon(getDaemon());
 acceptorThread.start();



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



svn commit: r992200 - /tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java

2010-09-02 Thread mturk
Author: mturk
Date: Fri Sep  3 04:36:46 2010
New Revision: 992200

URL: http://svn.apache.org/viewvc?rev=992200&view=rev
Log:
Make sure we exit the thread if not running. Otherwise the thread will block in 
run until the VM shuts down

Modified:
tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java?rev=992200&r1=992199&r2=992200&view=diff
==
--- tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java Fri Sep  3 
04:36:46 2010
@@ -905,7 +905,7 @@ public class AprEndpoint extends Abstrac
 while (running) {
 
 // Loop if endpoint is paused
-while (paused) {
+while (paused && running) {
 try {
 Thread.sleep(1000);
 } catch (InterruptedException e) {
@@ -913,6 +913,9 @@ public class AprEndpoint extends Abstrac
 }
 }
 
+if (!running) {
+break;
+}
 try {
 // Accept the next incoming connection from the server 
socket
 long socket = Socket.accept(serverSock);
@@ -1058,7 +1061,7 @@ public class AprEndpoint extends Abstrac
 // Loop until we receive a shutdown command
 while (running) {
 // Loop if endpoint is paused
-while (paused) {
+while (paused && running) {
 try {
 Thread.sleep(1000);
 } catch (InterruptedException e) {
@@ -1066,9 +1069,12 @@ public class AprEndpoint extends Abstrac
 }
 }
 
+if (!running) {
+break;
+}
 if (keepAliveCount < 1 && addCount < 1) {
 synchronized (this) {
-while (keepAliveCount < 1 && addCount < 1) {
+while (keepAliveCount < 1 && addCount < 1 && running) {
 // Reset maintain time.
 maintainTime = 0;
 try {
@@ -1080,6 +1086,9 @@ public class AprEndpoint extends Abstrac
 }
 }
 
+if (!running) {
+break;
+}
 try {
 // Add sockets which are waiting to the poller
 if (addCount > 0) {
@@ -1252,6 +1261,7 @@ public class AprEndpoint extends Abstrac
 SendfileData data = addS.get(i);
 Socket.destroy(data.socket);
 }
+addS.clear();
 // Close all sockets still in the poller
 int rv = Poll.pollset(sendfilePollset, desc);
 if (rv > 0) {
@@ -1345,7 +1355,7 @@ public class AprEndpoint extends Abstrac
 while (running) {
 
 // Loop if endpoint is paused
-while (paused) {
+while (paused && running) {
 try {
 Thread.sleep(1000);
 } catch (InterruptedException e) {
@@ -1353,9 +1363,12 @@ public class AprEndpoint extends Abstrac
 }
 }
 
+if (!running) {
+break;
+}
 if (sendfileCount < 1 && addCount < 1) {
 synchronized (this) {
-while (sendfileCount < 1 && addS.size() < 1) {
+while (sendfileCount < 1 && addS.size() < 1 && 
running) {
 // Reset maintain time.
 maintainTime = 0;
 try {
@@ -1367,6 +1380,9 @@ public class AprEndpoint extends Abstrac
 }
 }
 
+if (!running) {
+break;
+}
 try {
 // Add socket to the poller
 if (addCount > 0) {



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



svn commit: r992208 - in /tomcat/native/trunk/native/src: network.c pool.c

2010-09-02 Thread mturk
Author: mturk
Date: Fri Sep  3 05:22:07 2010
New Revision: 992208

URL: http://svn.apache.org/viewvc?rev=992208&view=rev
Log:
Don't destroy pools explicitly if we are inside apr_terminate call

Modified:
tomcat/native/trunk/native/src/network.c
tomcat/native/trunk/native/src/pool.c

Modified: tomcat/native/trunk/native/src/network.c
URL: 
http://svn.apache.org/viewvc/tomcat/native/trunk/native/src/network.c?rev=992208&r1=992207&r2=992208&view=diff
==
--- tomcat/native/trunk/native/src/network.c (original)
+++ tomcat/native/trunk/native/src/network.c Fri Sep  3 05:22:07 2010
@@ -222,6 +222,11 @@ TCN_IMPLEMENT_CALL(void, Socket, destroy
 UNREFERENCED_STDARGS;
 TCN_ASSERT(sock != 0);
 
+if (!tcn_global_pool) {
+/* Socket will be destroyed by the cleanup
+ */
+return;
+}
 as = s->sock;
 s->sock = NULL;
 apr_pool_cleanup_kill(s->pool, s, sp_socket_cleanup);

Modified: tomcat/native/trunk/native/src/pool.c
URL: 
http://svn.apache.org/viewvc/tomcat/native/trunk/native/src/pool.c?rev=992208&r1=992207&r2=992208&view=diff
==
--- tomcat/native/trunk/native/src/pool.c (original)
+++ tomcat/native/trunk/native/src/pool.c Fri Sep  3 05:22:07 2010
@@ -69,7 +69,8 @@ TCN_IMPLEMENT_CALL(void, Pool, destroy)(
 apr_pool_t *p = J2P(pool, apr_pool_t *);
 UNREFERENCED_STDARGS;
 TCN_ASSERT(pool != 0);
-apr_pool_destroy(p);
+if (tcn_global_pool)
+apr_pool_destroy(p);
 }
 
 TCN_IMPLEMENT_CALL(jlong, Pool, parentGet)(TCN_STDARGS, jlong pool)
@@ -179,7 +180,7 @@ static apr_status_t generic_pool_data_cl
 if (data) {
 JNIEnv *env;
 tcn_get_java_env(&env);
-
+
 if (!TCN_IS_NULL(env, cb->obj)) {
 TCN_UNLOAD_CLASS(env, cb->obj);
 }
@@ -204,7 +205,7 @@ TCN_IMPLEMENT_CALL(jint, Pool, dataSet)(
 apr_pool_cleanup_run(p, old, generic_pool_data_cleanup);
 }
 if (data) {
-JNIEnv *e;
+JNIEnv *e;
 tcn_callback_t *cb = (tcn_callback_t *)malloc(sizeof(tcn_callback_t));
 tcn_get_java_env(&e);
 cb->obj = (*e)->NewGlobalRef(e, data);



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



svn commit: r992211 - /tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java

2010-09-02 Thread mturk
Author: mturk
Date: Fri Sep  3 05:27:24 2010
New Revision: 992211

URL: http://svn.apache.org/viewvc?rev=992211&view=rev
Log:
Join poller and sendfile threads on destroy. This requires to change the Poller 
and Sendile to Thread instead Runnable for simplicity.

Modified:
tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java?rev=992211&r1=992210&r2=992211&view=diff
==
--- tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java Fri Sep  3 
05:27:24 2010
@@ -542,10 +542,10 @@ public class AprEndpoint extends Abstrac
 for (int i = 0; i < pollerThreadCount; i++) {
 pollers[i] = new Poller(false);
 pollers[i].init();
-Thread pollerThread = new Thread(pollers[i], getName() + 
"-Poller-" + i);
-pollerThread.setPriority(threadPriority);
-pollerThread.setDaemon(true);
-pollerThread.start();
+pollers[i].setName(getName() + "-Poller-" + i);
+pollers[i].setPriority(threadPriority);
+pollers[i].setDaemon(true);
+pollers[i].start();
 }
 
 // Start comet poller threads
@@ -553,10 +553,10 @@ public class AprEndpoint extends Abstrac
 for (int i = 0; i < pollerThreadCount; i++) {
 cometPollers[i] = new Poller(true);
 cometPollers[i].init();
-Thread pollerThread = new Thread(cometPollers[i], getName() + 
"-CometPoller-" + i);
-pollerThread.setPriority(threadPriority);
-pollerThread.setDaemon(true);
-pollerThread.start();
+cometPollers[i].setName(getName() + "-CometPoller-" + i);
+cometPollers[i].setPriority(threadPriority);
+cometPollers[i].setDaemon(true);
+cometPollers[i].start();
 }
 
 // Start sendfile threads
@@ -565,10 +565,10 @@ public class AprEndpoint extends Abstrac
 for (int i = 0; i < sendfileThreadCount; i++) {
 sendfiles[i] = new Sendfile();
 sendfiles[i].init();
-Thread sendfileThread = new Thread(sendfiles[i], getName() 
+ "-Sendfile-" + i);
-sendfileThread.setPriority(threadPriority);
-sendfileThread.setDaemon(true);
-sendfileThread.start();
+sendfiles[i].setName(getName() + "-Sendfile-" + i);
+sendfiles[i].setPriority(threadPriority);
+sendfiles[i].setDaemon(true);
+sendfiles[i].start();
 }
 }
 
@@ -576,10 +576,10 @@ public class AprEndpoint extends Abstrac
 acceptors = new Acceptor[acceptorThreadCount];
 for (int i = 0; i < acceptorThreadCount; i++) {
 acceptors[i] = new Acceptor();
-Thread acceptorThread = new Thread(acceptors[i], getName() + 
"-Acceptor-" + i);
-acceptorThread.setPriority(threadPriority);
-acceptorThread.setDaemon(getDaemon());
-acceptorThread.start();
+acceptors[i].setName(getName() + "-Acceptor-" + i);
+acceptors[i].setPriority(threadPriority);
+acceptors[i].setDaemon(getDaemon());
+acceptors[i].start();
 }
 
 }
@@ -670,6 +670,16 @@ public class AprEndpoint extends Abstrac
 if (running) {
 running = false;
 unlockAccept();
+for (int i = 0; i < acceptors.length; i++) {
+if (acceptors[i].isAlive()) {
+try {
+acceptors[i].interrupt();
+acceptors[i].join();
+} catch (InterruptedException e) {
+// Ignore
+}
+}
+}
 // Wait for polltime before doing anything, so that the poller 
threads
 // exit, otherwise parallel destruction of sockets which are still
 // in the poller can cause problems
@@ -682,27 +692,36 @@ public class AprEndpoint extends Abstrac
 }
 for (int i = 0; i < pollers.length; i++) {
 pollers[i].destroy();
+try {
+pollers[i].interrupt();
+pollers[i].join();
+} catch (InterruptedException e) {
+// Ignore
+}
 }
 pollers = null;
 for (int i = 0; i < cometPollers.length; i++) {
 cometPolle

AprEndpoint Runnable->Thread fixes

2010-09-02 Thread Mladen Turk

Hi,

I changed the Poller, Sendfile and Acceptor classes to
extend the Thread instead just implement Runnable.

Now, that was the easy hack cause we really don't
need to extend the Thread behavior for those classes
so might no be an optimal solution.

In essence we need to wait on each of those threads
on edpoint destroy(), so we can safely call the APR
terminate ensuring those classes won't call any of the
APR methods afterwards.

If extending Thread is wrong we could add separate
Thread[] array or new interface extending Runnable
which could store the Thread instance so we do a join().

Comments?

Regards
--
^TM

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