svn commit: r942402 - /tomcat/trunk/java/org/apache/catalina/core/StandardEngine.java

2010-05-08 Thread markt
Author: markt
Date: Sat May  8 15:31:53 2010
New Revision: 942402

URL: http://svn.apache.org/viewvc?rev=942402&view=rev
Log:
Clean up experimental (from Tomcat 5) MBean registration feature of 
StandardEngine prior to Lifecycle/MBean refactoring for ContainerBase

Modified:
tomcat/trunk/java/org/apache/catalina/core/StandardEngine.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=942402&r1=942401&r2=942402&view=diff
==
--- tomcat/trunk/java/org/apache/catalina/core/StandardEngine.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/StandardEngine.java Sat May  8 
15:31:53 2010
@@ -14,14 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
-
 package org.apache.catalina.core;
 
-
-import java.io.File;
-import java.util.List;
-
 import javax.management.MBeanServer;
 import javax.management.MalformedObjectNameException;
 import javax.management.ObjectName;
@@ -38,7 +32,6 @@ import org.apache.catalina.util.ServerIn
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 import org.apache.tomcat.util.modeler.Registry;
-import org.apache.tomcat.util.modeler.modules.MbeansSource;
 
 /**
  * Standard implementation of the Engine interface.  Each
@@ -105,20 +98,6 @@ public class StandardEngine
  */
 private String baseDir = null;
 
-/** Optional mbeans config file. This will replace the "hacks" in
- * jk and ServerListener. The mbeans file will support (transparent) 
- * persistence - soon. It'll probably replace jk2.properties and could
- * replace server.xml. Of course - the same beans could be loaded and 
- * managed by an external entity - like the embedding app - which
- *  can use a different persistence mechanism.
- */ 
-private String mbeansFile = null;
-
-/** Mbeans loaded by the engine.  
- */ 
-private List mbeans;
-
-
 /**
  * The JVM Route ID for this Tomcat instance. All Route ID's must be unique
  * across the cluster.
@@ -226,14 +205,6 @@ public class StandardEngine
 this.service = service;
 }
 
-public String getMbeansFile() {
-return mbeansFile;
-}
-
-public void setMbeansFile(String mbeansFile) {
-this.mbeansFile = mbeansFile;
-}
-
 public String getBaseDir() {
 if( baseDir==null ) {
 baseDir=System.getProperty("catalina.base");
@@ -315,42 +286,6 @@ public class StandardEngine
 }
 }
 
-if( mbeansFile == null ) {
-String defaultMBeansFile=getBaseDir() + "/conf/tomcat5-mbeans.xml";
-File f=new File( defaultMBeansFile );
-if( f.exists() ) mbeansFile=f.getAbsolutePath();
-}
-if( mbeansFile != null ) {
-readEngineMbeans();
-}
-if( mbeans != null ) {
-try {
-Registry.getRegistry(null, null).invoke(mbeans, "init", false);
-} catch (Exception e) {
-log.error("Error in init() for " + mbeansFile, e);
-}
-}
-
-// not needed since the following if statement does the same thing the 
right way
-// remove later after checking
-//if( service==null ) {
-//try {
-//ObjectName serviceName=getParentName();
-//if( mserver.isRegistered( serviceName )) {
-//log.info("Registering with the service ");
-//try {
-//mserver.invoke( serviceName, "setContainer",
-//new Object[] { this },
-//new String[] { 
"org.apache.catalina.Container" } );
-//} catch( Exception ex ) {
-//   ex.printStackTrace();
-//}
-//}
-//} catch( Exception ex ) {
-//log.error("Error registering with service ");
-//}
-//}
-
 if( service==null ) {
 // for consistency...: we are probably in embedded mode
 try {
@@ -364,37 +299,6 @@ public class StandardEngine
 
 }
 
-@Override
-protected void destroyInternal() throws LifecycleException {
-
-if( mbeans != null ) {
-try {
-Registry.getRegistry(null, null)
-.invoke(mbeans, "destroy", false);
-} catch (Exception e) {
-
log.error(sm.getString("standardEngine.unregister.mbeans.failed" ,mbeansFile), 
e);
-}
-}
-// 
-if( mbeans != null ) {
-try {
-for( int i=0; i

svn commit: r942407 - /tomcat/trunk/test/org/apache/catalina/startup/TomcatBaseTest.java

2010-05-08 Thread markt
Author: markt
Date: Sat May  8 15:54:44 2010
New Revision: 942407

URL: http://svn.apache.org/viewvc?rev=942407&view=rev
Log:
Fix JULI configuration so JULI is actually used.
Fix FindBugs warnings

Modified:
tomcat/trunk/test/org/apache/catalina/startup/TomcatBaseTest.java

Modified: tomcat/trunk/test/org/apache/catalina/startup/TomcatBaseTest.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/startup/TomcatBaseTest.java?rev=942407&r1=942406&r2=942407&view=diff
==
--- tomcat/trunk/test/org/apache/catalina/startup/TomcatBaseTest.java (original)
+++ tomcat/trunk/test/org/apache/catalina/startup/TomcatBaseTest.java Sat May  
8 15:54:44 2010
@@ -25,15 +25,12 @@ import java.net.HttpURLConnection;
 import java.net.URL;
 import java.util.List;
 import java.util.Map;
-import java.util.logging.ConsoleHandler;
-import java.util.logging.LogManager;
 
 import javax.servlet.ServletException;
 import javax.servlet.http.HttpServlet;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
-import org.apache.catalina.Lifecycle;
 import org.apache.catalina.LifecycleState;
 import org.apache.tomcat.util.buf.ByteChunk;
 
@@ -82,17 +79,19 @@ public abstract class TomcatBaseTest ext
 
 @Override
 public void setUp() throws Exception {
-// Need to use JULI and to configure a ConsoleHandler so log messages
-// from the tests are visible
-System.setProperty("java.util.logging.config.class",
+// Need to use JULI so log messages from the tests are visible
+System.setProperty("java.util.logging.manager",
 "org.apache.juli.ClassLoaderLogManager");
-LogManager.getLogManager().getLogger("").addHandler(
-new ConsoleHandler());
 
 tempDir = new File(System.getProperty("tomcat.test.temp", 
"output/tmp"));
-tempDir.mkdir();
+if (!tempDir.mkdir()) {
+fail("Unable to create temporary directory for test");
+}
+
 File appBase = new File(tempDir, "webapps");
-appBase.mkdir();
+if (!appBase.mkdir()) {
+fail("Unable to create appBase for test");
+}
 
 tomcat = new Tomcat();
 tomcat.setBaseDir(tempDir.getAbsolutePath());
@@ -139,9 +138,9 @@ public abstract class TomcatBaseTest ext
 return out;
 }
 
-public static int getUrl(String path, 
- ByteChunk out, 
- Map> resHead) throws 
IOException {
+public static int getUrl(String path, ByteChunk out,
+Map> resHead) throws IOException {
+
 URL url = new URL(path);
 HttpURLConnection connection = 
 (HttpURLConnection) url.openConnection();
@@ -153,11 +152,22 @@ public abstract class TomcatBaseTest ext
 resHead.putAll(head);
 }
 InputStream is = connection.getInputStream();
-BufferedInputStream bis = new BufferedInputStream(is);
-byte[] buf = new byte[2048];
-int rd = 0;
-while((rd = bis.read(buf)) > 0) {
-out.append(buf, 0, rd);
+BufferedInputStream bis = null;
+try {
+bis = new BufferedInputStream(is);
+byte[] buf = new byte[2048];
+int rd = 0;
+while((rd = bis.read(buf)) > 0) {
+out.append(buf, 0, rd);
+}
+} finally {
+if (bis != null) {
+try {
+bis.close();
+} catch (IOException e) {
+// Ignore
+}
+}
 }
 return rc;
 }



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



svn commit: r942409 - /tomcat/trunk/test/org/apache/catalina/startup/TomcatBaseTest.java

2010-05-08 Thread markt
Author: markt
Date: Sat May  8 16:01:16 2010
New Revision: 942409

URL: http://svn.apache.org/viewvc?rev=942409&view=rev
Log:
Stop the tests failing

Modified:
tomcat/trunk/test/org/apache/catalina/startup/TomcatBaseTest.java

Modified: tomcat/trunk/test/org/apache/catalina/startup/TomcatBaseTest.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/startup/TomcatBaseTest.java?rev=942409&r1=942408&r2=942409&view=diff
==
--- tomcat/trunk/test/org/apache/catalina/startup/TomcatBaseTest.java (original)
+++ tomcat/trunk/test/org/apache/catalina/startup/TomcatBaseTest.java Sat May  
8 16:01:16 2010
@@ -84,12 +84,12 @@ public abstract class TomcatBaseTest ext
 "org.apache.juli.ClassLoaderLogManager");
 
 tempDir = new File(System.getProperty("tomcat.test.temp", 
"output/tmp"));
-if (!tempDir.mkdir()) {
+if (!tempDir.exists() && !tempDir.mkdir()) {
 fail("Unable to create temporary directory for test");
 }
 
 File appBase = new File(tempDir, "webapps");
-if (!appBase.mkdir()) {
+if (!appBase.exists() && !appBase.mkdir()) {
 fail("Unable to create appBase for test");
 }
 



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



svn commit: r942423 - in /tomcat: tc5.5.x/trunk/STATUS.txt tc6.0.x/trunk/STATUS.txt

2010-05-08 Thread kkolinko
Author: kkolinko
Date: Sat May  8 17:43:36 2010
New Revision: 942423

URL: http://svn.apache.org/viewvc?rev=942423&view=rev
Log:
votes

Modified:
tomcat/tc5.5.x/trunk/STATUS.txt
tomcat/tc6.0.x/trunk/STATUS.txt

Modified: tomcat/tc5.5.x/trunk/STATUS.txt
URL: 
http://svn.apache.org/viewvc/tomcat/tc5.5.x/trunk/STATUS.txt?rev=942423&r1=942422&r2=942423&view=diff
==
--- tomcat/tc5.5.x/trunk/STATUS.txt (original)
+++ tomcat/tc5.5.x/trunk/STATUS.txt Sat May  8 17:43:36 2010
@@ -132,5 +132,5 @@ PATCHES PROPOSED TO BACKPORT:
 
 * Update to DBCP 1.3
   http://people.apache.org/~markt/patches/2010-05-06-dbcp13-tc5.patch
-  +1: markt
+  +1: markt, kkolinko
   -1: 
\ No newline at end of file

Modified: tomcat/tc6.0.x/trunk/STATUS.txt
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS.txt?rev=942423&r1=942422&r2=942423&view=diff
==
--- tomcat/tc6.0.x/trunk/STATUS.txt (original)
+++ tomcat/tc6.0.x/trunk/STATUS.txt Sat May  8 17:43:36 2010
@@ -244,8 +244,11 @@ PATCHES PROPOSED TO BACKPORT:
   -1: 
   Alternative patch that addresses Konstatin's review comments
   http://people.apache.org/~markt/patches/2010-05-05-bug49158.patch
-  +1: markt
+  +1: markt, kkolinko
   -1: 
+   kkolinko: (Trivial: in generateCookieString() you can declare
+ httpOnlyParam as "final" and get rid of a local variable.)
+
 
 * Configure Tomcat to use HttpOnly for session cookies by default
   
http://people.apache.org/~kkolinko/patches/2010-04-21_tc6_context_httpOnly.patch
@@ -262,7 +265,7 @@ PATCHES PROPOSED TO BACKPORT:
 
 * Make the principal implement Serializable 
  http://svn.apache.org/viewvc?view=revision&revision=939491
- +1: fhanik, markt
+ +1: fhanik, markt, kkolinko
  -1: 
 
 * Log unexpected errors in ApplicationContext#getResource() and 
#getResourceAsStream()
@@ -292,5 +295,5 @@ PATCHES PROPOSED TO BACKPORT:
 
 * Update to DBCP 1.3
   http://people.apache.org/~markt/patches/2010-05-06-dbcp13-tc6.patch
-  +1: markt
+  +1: markt, kkolinko
   -1: 



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



Re: clearReferencesThreads, Poller SunPKCS11-Solaris and strange context class loader

2010-05-08 Thread Rainer Jung

On 07.05.2010 20:08, Filip Hanik - Dev Lists wrote:

On 05/07/2010 08:03 AM, Rainer Jung wrote:

It's there after JDK start with some version of the JDK. It's not
there if I only start a plain Java test doing only a sleep using the
same JDK.


well, if the app uses java.net.URL to a https, then this would make
sense that the thread got started with the webapp's class loader


Yes, but there is no app. The thread is there even when I remove all 
webapps (except for the ROOT context I kept). I guess I need to do more 
systematic testing.


Regards,

Rainer

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