DO NOT REPLY [Bug 48238] Tomcat-lite won't compile

2009-11-25 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=48238

Costin Manolache  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED

--- Comment #3 from Costin Manolache  2009-11-25 23:45:48 
UTC ---
Should be fixed now - HexDump ( and all StringManager deps ) gone, ByteChunk
fixed.

-- 
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 48178] org.apache.tomcat.lite.Locale2Charset.defaultMap is not threadsafe

2009-11-25 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=48178

Costin Manolache  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||WONTFIX

--- Comment #1 from Costin Manolache  2009-11-25 23:43:52 
UTC ---
It's only updated during context init from web.xml - I think read is thread
safe. Can add a comment - many other classes fit this.

-- 
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: r884424 - in /tomcat/trunk/modules/tomcat-lite/test/org/apache/tomcat/lite: TestMain.java http/LiveHttp1Test.java

2009-11-25 Thread costin
Author: costin
Date: Thu Nov 26 07:02:53 2009
New Revision: 884424

URL: http://svn.apache.org/viewvc?rev=884424&view=rev
Log:
Shouldn't do last-minute changes before a large commit...


Modified:
tomcat/trunk/modules/tomcat-lite/test/org/apache/tomcat/lite/TestMain.java

tomcat/trunk/modules/tomcat-lite/test/org/apache/tomcat/lite/http/LiveHttp1Test.java

Modified: 
tomcat/trunk/modules/tomcat-lite/test/org/apache/tomcat/lite/TestMain.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/modules/tomcat-lite/test/org/apache/tomcat/lite/TestMain.java?rev=884424&r1=884423&r2=884424&view=diff
==
--- tomcat/trunk/modules/tomcat-lite/test/org/apache/tomcat/lite/TestMain.java 
(original)
+++ tomcat/trunk/modules/tomcat-lite/test/org/apache/tomcat/lite/TestMain.java 
Thu Nov 26 07:02:53 2009
@@ -192,8 +192,8 @@
 proxy = new HttpProxyService()
 .withHttpClient(testClient);
 testProxy.setPort(port);
-testProxy.setDebugHttp(true);
-testProxy.setDebug(true);
+//testProxy.setDebugHttp(true);
+//testProxy.setDebug(true);
 
 // dispatcher rejects 'http://'
 testProxy.setHttpService(proxy);

Modified: 
tomcat/trunk/modules/tomcat-lite/test/org/apache/tomcat/lite/http/LiveHttp1Test.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/modules/tomcat-lite/test/org/apache/tomcat/lite/http/LiveHttp1Test.java?rev=884424&r1=884423&r2=884424&view=diff
==
--- 
tomcat/trunk/modules/tomcat-lite/test/org/apache/tomcat/lite/http/LiveHttp1Test.java
 (original)
+++ 
tomcat/trunk/modules/tomcat-lite/test/org/apache/tomcat/lite/http/LiveHttp1Test.java
 Thu Nov 26 07:02:53 2009
@@ -138,12 +138,7 @@
 
 httpClient.sendRequest();
 
-try {
-httpClient.readAll(bodyRecvBuffer, to);
-} catch (Throwable t) {
-t.printStackTrace();
-return;
-}
-fail("Error");
+httpClient.readAll(bodyRecvBuffer, to);
+assertEquals(0, bodyRecvBuffer.remaining());
 }
 }



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



svn commit: r884422 - in /tomcat/trunk/modules/tomcat-lite: .classpath .project coyote-nio.files

2009-11-25 Thread costin
Author: costin
Date: Thu Nov 26 06:56:33 2009
New Revision: 884422

URL: http://svn.apache.org/viewvc?rev=884422&view=rev
Log:
Added eclipse files, remove unused build helper file


Added:
tomcat/trunk/modules/tomcat-lite/.classpath   (with props)
tomcat/trunk/modules/tomcat-lite/.project   (with props)
Removed:
tomcat/trunk/modules/tomcat-lite/coyote-nio.files

Added: tomcat/trunk/modules/tomcat-lite/.classpath
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/modules/tomcat-lite/.classpath?rev=884422&view=auto
==
--- tomcat/trunk/modules/tomcat-lite/.classpath (added)
+++ tomcat/trunk/modules/tomcat-lite/.classpath Thu Nov 26 06:56:33 2009
@@ -0,0 +1,9 @@
+
+
+   
+   
+   
+   
+   
+   
+

Propchange: tomcat/trunk/modules/tomcat-lite/.classpath
--
svn:eol-style = native

Added: tomcat/trunk/modules/tomcat-lite/.project
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/modules/tomcat-lite/.project?rev=884422&view=auto
==
--- tomcat/trunk/modules/tomcat-lite/.project (added)
+++ tomcat/trunk/modules/tomcat-lite/.project Thu Nov 26 06:56:33 2009
@@ -0,0 +1,17 @@
+
+
+   tomcat-lite
+   
+   
+   
+   
+   
+   org.eclipse.jdt.core.javabuilder
+   
+   
+   
+   
+   
+   org.eclipse.jdt.core.javanature
+   
+

Propchange: tomcat/trunk/modules/tomcat-lite/.project
--
svn:eol-style = native



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



svn commit: r884421 [3/3] - in /tomcat/trunk/modules/tomcat-lite/test/org/apache: coyote/ coyote/lite/ coyote/servlet/ tomcat/lite/ tomcat/lite/http/ tomcat/lite/http/services/ tomcat/lite/io/ tomcat/

2009-11-25 Thread costin
Added: 
tomcat/trunk/modules/tomcat-lite/test/org/apache/tomcat/test/watchdog/WatchdogTestImpl.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/modules/tomcat-lite/test/org/apache/tomcat/test/watchdog/WatchdogTestImpl.java?rev=884421&view=auto
==
--- 
tomcat/trunk/modules/tomcat-lite/test/org/apache/tomcat/test/watchdog/WatchdogTestImpl.java
 (added)
+++ 
tomcat/trunk/modules/tomcat-lite/test/org/apache/tomcat/test/watchdog/WatchdogTestImpl.java
 Thu Nov 26 06:55:49 2009
@@ -0,0 +1,1172 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @Author Costin, Ramesh.Mandava
+ */
+
+package org.apache.tomcat.test.watchdog;
+
+import java.io.BufferedInputStream;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.InetAddress;
+import java.net.Socket;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.StringTokenizer;
+import java.util.Vector;
+
+import org.apache.tomcat.lite.io.Hex;
+
+// derived from Jsp
+
+public class WatchdogTestImpl {
+
+int failureCount = 0;
+
+int passCount = 0;
+
+Throwable lastError;
+
+boolean hasFailed = false;
+
+String prefix = "http";
+
+String host = "localhost";
+
+String localHost = null;
+
+String localIP = null;
+
+int port = 8080;
+
+int debug = 0;
+
+String description = "No description";
+
+String request;
+
+HashMap requestHeaders = new HashMap();
+
+String content;
+
+// true if task is nested
+private boolean nested = false;
+
+// Expected response
+boolean magnitude = true;
+
+boolean exactMatch = false;
+
+// expect a response body
+boolean expectResponseBody = true;
+
+// Match the body against a golden file
+String goldenFile;
+
+// Match the body against a string
+String responseMatch;
+
+// the response should include the following headers
+HashMap expectHeaders = new HashMap();
+
+// Headers that should not be found in response
+HashMap unexpectedHeaders = new HashMap();
+
+// Match request line
+String returnCode = "";
+
+String returnCodeMsg = "";
+
+// Actual response
+String responseLine;
+
+byte[] responseBody;
+
+HashMap headers;
+
+// For Report generation
+StringBuffer resultOut = new StringBuffer();
+
+boolean firstTask = false;
+
+boolean lastTask = false;
+
+String expectedString;
+
+String actualString;
+
+String testName;
+
+String assertion;
+
+String testStrategy;
+
+// For Session Tracking
+static Hashtable sessionHash;
+
+static Hashtable cookieHash;
+
+String testSession;
+
+Vector cookieVector;
+
+URL requestURL;
+
+CookieController cookieController;
+
+/**
+ * Creates a new GTest instance.
+ * 
+ */
+public WatchdogTestImpl() {
+}
+
+/**
+ * setTestSession adds a CookieController for the value of
+ * sessionName
+ * 
+ * @param sessionName
+ *a String value
+ */
+public void setTestSession(String sessionName) {
+testSession = sessionName;
+
+if (sessionHash == null) {
+sessionHash = new Hashtable();
+} else if (sessionHash.get(sessionName) == null) {
+sessionHash.put(sessionName, new CookieController());
+}
+}
+
+/**
+ * setTestName sets the current test name.
+ * 
+ * @param tn
+ *current testname.
+ */
+public void setTestName(String tn) {
+testName = tn;
+}
+
+/**
+ * setAssertion sets the assertion text for the current test.
+ * 
+ * @param assertion
+ *assertion text
+ */
+public void setAssertion(String assertion) {
+this.assertion = assertion;
+}
+
+/**
+ * setTestStrategy sets the test strategy for the current 
test.
+ * 
+ * @param strategy
+ *test strategy text
+ */
+public void setTestStrategy(String strategy) {
+testStrategy = strategy;
+}
+
+/**

svn commit: r884421 [2/3] - in /tomcat/trunk/modules/tomcat-lite/test/org/apache: coyote/ coyote/lite/ coyote/servlet/ tomcat/lite/ tomcat/lite/http/ tomcat/lite/http/services/ tomcat/lite/io/ tomcat/

2009-11-25 Thread costin
Added: 
tomcat/trunk/modules/tomcat-lite/test/org/apache/tomcat/lite/load/LiveHttpThreadedTest.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/modules/tomcat-lite/test/org/apache/tomcat/lite/load/LiveHttpThreadedTest.java?rev=884421&view=auto
==
--- 
tomcat/trunk/modules/tomcat-lite/test/org/apache/tomcat/lite/load/LiveHttpThreadedTest.java
 (added)
+++ 
tomcat/trunk/modules/tomcat-lite/test/org/apache/tomcat/lite/load/LiveHttpThreadedTest.java
 Thu Nov 26 06:55:49 2009
@@ -0,0 +1,116 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.tomcat.lite.load;
+
+
+import java.io.IOException;
+
+import junit.framework.TestCase;
+
+import org.apache.tomcat.lite.TestMain;
+import org.apache.tomcat.lite.http.DefaultHttpConnector;
+import org.apache.tomcat.lite.http.HttpChannel;
+import org.apache.tomcat.lite.http.HttpConnector;
+import org.apache.tomcat.lite.http.HttpChannel.HttpService;
+import org.apache.tomcat.lite.http.HttpChannel.RequestCompleted;
+
+public class LiveHttpThreadedTest extends TestCase {
+  HttpConnector staticMain = TestMain.getTestServer();
+  
+  
+  int tCount = 1;
+  Thread[] threads = new Thread[tCount];
+  int[] ok = new int[tCount];
+  private int rCount = 100;
+  
+  public void xtestSimpleRequest() throws Exception {
+long t0 = System.currentTimeMillis();
+for (int i = 0; i < tCount; i++) {
+  final int j = i;
+  threads[i] = new Thread(new Runnable() {
+public void run() {
+  makeRequests(j, true);
+}
+  });
+  threads[i].start();
+}
+
+int res = 0;
+for (int i = 0; i < tCount; i++) {
+  threads[i].join();
+  res += ok[i];
+}
+long t1 = System.currentTimeMillis();
+System.err.println("Time: " + (t1 - t0) + " " + res);
+  }
+
+  public void testSimpleRequestNB() throws Exception {
+long t0 = System.currentTimeMillis();
+for (int i = 0; i < tCount; i++) {
+  final int j = i;
+  threads[i] = new Thread(new Runnable() {
+public void run() {
+  makeRequests(j, false);
+}
+  });
+  threads[i].start();
+}
+
+int res = 0;
+for (int i = 0; i < tCount; i++) {
+  threads[i].join();
+  res += ok[i];
+}
+long t1 = System.currentTimeMillis();
+System.err.println("TimeNB: " + (t1 - t0) + " " + res);
+  }
+  
+  void makeRequests(int t, boolean b) {
+for (int i = 0; i < rCount ; i++) {
+  try {
+//System.err.println("MakeReq " + t + " " + i);
+makeRequest(t, b);
+  } catch (Exception e) {
+e.printStackTrace();
+  }
+}
+  }
+
+  static RequestCompleted reqCallback = new RequestCompleted() {
+@Override
+public void handle(HttpChannel data, Object extraData) 
+throws IOException {
+//dumpHead(cstate);  
+//System.err.println("DATA\n" + cstate.output.toString() + "\n");
+//assertTrue(cstate.bodyRecvBuffer.toString().indexOf("AAA") >= 0);
+
+data.release();
+}
+  
+  };
+  
+  void makeRequest(int i, boolean block) throws Exception {
+HttpChannel cstate = DefaultHttpConnector.get().get("localhost", 8802);
+
+cstate.getRequest().requestURI().set("/hello");
+cstate.setCompletedCallback(reqCallback);
+
+// Send the request, wait response
+cstate.sendRequest();
+  }
+  
+}

Propchange: 
tomcat/trunk/modules/tomcat-lite/test/org/apache/tomcat/lite/load/LiveHttpThreadedTest.java
--
svn:eol-style = native

Added: 
tomcat/trunk/modules/tomcat-lite/test/org/apache/tomcat/lite/load/MicroTest.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/modules/tomcat-lite/test/org/apache/tomcat/lite/load/MicroTest.java?rev=884421&view=auto
==
--- 
tomcat/trunk/modules/tomcat-lite/test/org/apache/tomcat/lite/load/MicroTest.java
 (added)
+++ 
tomcat/trunk/modules/tomcat-lite/test/org/apache/tomcat/lite/load/MicroTest.java
 Thu Nov 26 06:55:49 2009
@@ -0,0 +1,49 @@
+/*
+ */
+package org.apache.tomcat.lite.load;
+
+import

svn commit: r884420 - in /tomcat/trunk/modules/tomcat-lite: build.xml ivy.xml pom.xml

2009-11-25 Thread costin
Author: costin
Date: Thu Nov 26 06:52:28 2009
New Revision: 884420

URL: http://svn.apache.org/viewvc?rev=884420&view=rev
Log:
For downloading deps - used Ant Ivy. The actual deps are declared in a maven 
pom.xml ( Ivy is supporting it just fine ).

The maven file can be used to compile and test tomcat-lite in servlet-2.5 mode 
- I wouldn't recomend to anyone to 
use it, but if you have to and can't use build.xml - it does the basic thing.


Added:
tomcat/trunk/modules/tomcat-lite/ivy.xml   (with props)
tomcat/trunk/modules/tomcat-lite/pom.xml   (with props)
Modified:
tomcat/trunk/modules/tomcat-lite/build.xml

Modified: tomcat/trunk/modules/tomcat-lite/build.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/modules/tomcat-lite/build.xml?rev=884420&r1=884419&r2=884420&view=diff
==
--- tomcat/trunk/modules/tomcat-lite/build.xml (original)
+++ tomcat/trunk/modules/tomcat-lite/build.xml Thu Nov 26 06:52:28 2009
@@ -1,60 +1,161 @@
 
-
+
 
 
 
 
 
-
-
-
-
-
-
+
+
+
+
+
+
+
+
 
-
-
+
+ 
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 
+
+
+
+
+
+
+
+
+
+
+
+
 
-   
 
-
-
-
-
-
+
+
+
+
 
 
-
+
+
+
+
+
+
+
+
+
-
+
+
+
 
+
+
+
 
-
-
-
-
-
+ 
+
+
+
+
+
+  
+
+  
+
+  
+
+
+  
+  
+  
+  
+
+   
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 
 
+
+
+
+
+
+  
+
+  
+
+
+  
+  
+  
+  
+
+  
+  
+
+   
+
 
 
 
@@ -66,54 +167,56 @@
 
 
 
-
 
 
 
-  
-  
+
+
 
 
 
 
 
-   
-   
-
-
-
-
- 
-
- 
-
-
-
-
-
-
-  
-  
-
-
-
-
-
-
- 
- 
- 
- 
- 
- 
- 
-
-
-
 
 
 
-
+
 
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+http://repo2.maven.org/maven2/org/apache/ivy/ivy/${ivy.install.version}/ivy-${ivy.install.version}.jar";
 
+ dest="${ivy.jar.file}" usetimestamp="true"/>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 

Added: tomcat/trunk/modules/tomcat-lite/ivy.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/modules/tomcat-lite/ivy.xml?rev=884420&view=auto
==
--- tomcat/trunk/modules/tomcat-lite/ivy.xml (added)
+++ tomcat/trunk/modules/tomcat-lite/ivy.xml Thu Nov 26 06:52:28 2009
@@ -0,0 +1,32 @@
+
+
+http://www.w3.org/2001/XMLSchema-instance";
+   
xsi:noNamespaceSchemaLocation="http://ant.apache.org/ivy/schemas/ivy.xsd";>
+
+   
+   
+   
+ 
+   
+

Propchange: tomcat/trunk/modules/tomcat-lite/ivy.xml
--
svn:eol-style = native

Added: tomcat/trunk/modules/tomcat-lite/pom.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/modules/tomcat-lite/pom.xml?rev=884420&view=auto
==
--- tomcat/trunk/modules/tomcat-lite/pom.xml (added)
+++ tomcat/trunk/modules/tomcat-lite/pom.xml Thu Nov 26 06:52:28 2009
@@ -0,0 +1,119 @@
+http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd";>
+  4.0.0
+  
+  org.apache.tomcat.lite
+  lite
+  
+  0.0.1-SNAPSHOT
+  
+  
+
+com.jcraft
+jzlib
+1.0

svn commit: r884419 - in /tomcat/trunk/modules/tomcat-lite/java/org/apache/tomcat/integration: DynamicObject.java ObjectManager.java simple/AntProperties.java simple/LocalFilesystem.java simple/Main.j

2009-11-25 Thread costin
Author: costin
Date: Thu Nov 26 06:50:10 2009
New Revision: 884419

URL: http://svn.apache.org/viewvc?rev=884419&view=rev
Log:
Few change to the ObjectManager ( intended for integration with existing 
frameworks ).
The 'sample/if no other framework around' SimpleObject manager no longer 
depends on IntrospectionUtils, refactored it ( and parts of modeler )
to DynamicObject. 


Added:

tomcat/trunk/modules/tomcat-lite/java/org/apache/tomcat/integration/DynamicObject.java
   (with props)

tomcat/trunk/modules/tomcat-lite/java/org/apache/tomcat/integration/simple/AntProperties.java
   (with props)
Removed:

tomcat/trunk/modules/tomcat-lite/java/org/apache/tomcat/integration/simple/LocalFilesystem.java
Modified:

tomcat/trunk/modules/tomcat-lite/java/org/apache/tomcat/integration/ObjectManager.java

tomcat/trunk/modules/tomcat-lite/java/org/apache/tomcat/integration/simple/Main.java

tomcat/trunk/modules/tomcat-lite/java/org/apache/tomcat/integration/simple/SimpleObjectManager.java

Added: 
tomcat/trunk/modules/tomcat-lite/java/org/apache/tomcat/integration/DynamicObject.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/modules/tomcat-lite/java/org/apache/tomcat/integration/DynamicObject.java?rev=884419&view=auto
==
--- 
tomcat/trunk/modules/tomcat-lite/java/org/apache/tomcat/integration/DynamicObject.java
 (added)
+++ 
tomcat/trunk/modules/tomcat-lite/java/org/apache/tomcat/integration/DynamicObject.java
 Thu Nov 26 06:50:10 2009
@@ -0,0 +1,393 @@
+/*
+ */
+package org.apache.tomcat.integration;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.atomic.AtomicLong;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**
+ * Refactoring of IntrospectionUtils and modeler dynamic bean.
+ * 
+ * Unlike IntrospectionUtils, the method informations can be cached.
+ * Also I hope this class will be simpler to use. 
+ * There is no static cache.
+ * 
+ * @author Costin Manolache
+ */
+public class DynamicObject {
+// Based on MbeansDescriptorsIntrospectionSource
+
+static Logger log = Logger.getLogger(DynamicObject.class.getName());
+
+static Class NO_PARAMS[] = new Class[0];
+
+
+private static String strArray[] = new String[0];
+
+private static Class[] supportedTypes = new Class[] { Boolean.class,
+Boolean.TYPE, Byte.class, Byte.TYPE, Character.class,
+Character.TYPE, Short.class, Short.TYPE, Integer.class,
+Integer.TYPE, Long.class, Long.TYPE, Float.class, Float.TYPE,
+Double.class, Double.TYPE, String.class, strArray.getClass(),
+BigDecimal.class, BigInteger.class, AtomicInteger.class,
+AtomicLong.class, java.io.File.class, };
+
+
+private Class realClass;
+
+private Map getAttMap;
+
+public DynamicObject(Class beanClass) {
+this.realClass = beanClass;
+initCache();
+}
+
+public DynamicObject(Class beanClass, boolean noCache) {
+this.realClass = beanClass;
+}
+
+private void initCache() {
+Method methods[] = null;
+
+getAttMap = new HashMap();
+
+methods = realClass.getMethods();
+for (int j = 0; j < methods.length; ++j) {
+if (ignorable(methods[j])) {
+continue;
+}
+String name = methods[j].getName();
+
+Class params[] = methods[j].getParameterTypes();
+
+if (name.startsWith("get") && params.length == 0) {
+Class ret = methods[j].getReturnType();
+if (!supportedType(ret)) {
+if (log.isLoggable(Level.FINE))
+log.fine("Unsupported type " + methods[j]);
+continue;
+}
+name = unCapitalize(name.substring(3));
+
+getAttMap.put(name, methods[j]);
+} else if (name.startsWith("is") && params.length == 0) {
+Class ret = methods[j].getReturnType();
+if (Boolean.TYPE != ret) {
+if (log.isLoggable(Level.FINE))
+log.fine("Unsupported type " + methods[j] + " " + ret);
+continue;
+}
+name = unCapitalize(name.substring(2));
+
+getAttMap.put(name, methods[j]);
+}
+}
+}
+
+private boolean ignorable(Method method) {
+if (Modifier.isStatic(method.getModifiers()))
+return true;
+if (!Modifier.isPublic(method.getModifiers())) {
+return true;
+}
+

svn commit: r884413 - in /tomcat/trunk/modules/tomcat-lite/java/org/apache/tomcat/lite/proxy: ./ CopyCallback.java HttpProxyService.java ProxyFlushedCallback.java SocksServer.java StaticContentService

2009-11-25 Thread costin
Author: costin
Date: Thu Nov 26 06:42:49 2009
New Revision: 884413

URL: http://svn.apache.org/viewvc?rev=884413&view=rev
Log:
Proxy service - CONNECT doesn't seem to work ( probably because it didn't have 
a test ), the rest works 
pretty well. Also includes a small socks server I used while testing. Almost 
all work is non-blocking and
done in the selector thread.


Added:
tomcat/trunk/modules/tomcat-lite/java/org/apache/tomcat/lite/proxy/

tomcat/trunk/modules/tomcat-lite/java/org/apache/tomcat/lite/proxy/CopyCallback.java
   (with props)

tomcat/trunk/modules/tomcat-lite/java/org/apache/tomcat/lite/proxy/HttpProxyService.java
   (with props)

tomcat/trunk/modules/tomcat-lite/java/org/apache/tomcat/lite/proxy/ProxyFlushedCallback.java
   (with props)

tomcat/trunk/modules/tomcat-lite/java/org/apache/tomcat/lite/proxy/SocksServer.java
   (with props)

tomcat/trunk/modules/tomcat-lite/java/org/apache/tomcat/lite/proxy/StaticContentService.java
   (with props)

Added: 
tomcat/trunk/modules/tomcat-lite/java/org/apache/tomcat/lite/proxy/CopyCallback.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/modules/tomcat-lite/java/org/apache/tomcat/lite/proxy/CopyCallback.java?rev=884413&view=auto
==
--- 
tomcat/trunk/modules/tomcat-lite/java/org/apache/tomcat/lite/proxy/CopyCallback.java
 (added)
+++ 
tomcat/trunk/modules/tomcat-lite/java/org/apache/tomcat/lite/proxy/CopyCallback.java
 Thu Nov 26 06:42:49 2009
@@ -0,0 +1,57 @@
+/*
+ */
+package org.apache.tomcat.lite.proxy;
+
+import java.io.IOException;
+import java.nio.ByteBuffer;
+
+import org.apache.tomcat.lite.http.HttpChannel;
+import org.apache.tomcat.lite.io.IOBuffer;
+import org.apache.tomcat.lite.io.IOChannel;
+import org.apache.tomcat.lite.io.IOConnector;
+
+/**
+ *  Used by socks and http proxy. Will copy received data to a different 
+ *  channel.
+ */
+public class CopyCallback implements IOConnector.DataReceivedCallback {
+IOChannel mOutBuffer;
+
+public CopyCallback(IOChannel sc) {
+mOutBuffer = sc;
+}
+
+@Override
+public void handleReceived(IOChannel ch) throws IOException {
+IOBuffer inBuffer = ch.getIn();
+IOChannel outBuffer = mOutBuffer;
+if (outBuffer == null &&
+ch instanceof HttpChannel) {
+outBuffer = 
+(IOChannel) 
((HttpChannel)ch).getRequest().getAttribute("P");
+}
+// body.
+while (true) {
+if (outBuffer == null || outBuffer.getOut() == null) {
+return;
+}
+if (outBuffer.getOut().isAppendClosed()) {
+return;
+}
+
+ByteBuffer bb = outBuffer.getOut().getWriteBuffer();
+int rd = inBuffer.read(bb);
+outBuffer.getOut().releaseWriteBuffer(rd);
+
+if (rd == 0) {
+outBuffer.startSending();
+return;
+}
+if (rd < 0) {
+outBuffer.getOut().close();
+outBuffer.startSending();
+return;
+}
+}
+}
+}
\ No newline at end of file

Propchange: 
tomcat/trunk/modules/tomcat-lite/java/org/apache/tomcat/lite/proxy/CopyCallback.java
--
svn:eol-style = native

Added: 
tomcat/trunk/modules/tomcat-lite/java/org/apache/tomcat/lite/proxy/HttpProxyService.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/modules/tomcat-lite/java/org/apache/tomcat/lite/proxy/HttpProxyService.java?rev=884413&view=auto
==
--- 
tomcat/trunk/modules/tomcat-lite/java/org/apache/tomcat/lite/proxy/HttpProxyService.java
 (added)
+++ 
tomcat/trunk/modules/tomcat-lite/java/org/apache/tomcat/lite/proxy/HttpProxyService.java
 Thu Nov 26 06:42:49 2009
@@ -0,0 +1,370 @@
+/*
+ */
+package org.apache.tomcat.lite.proxy;
+
+import java.io.IOException;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.apache.tomcat.lite.http.HttpChannel;
+import org.apache.tomcat.lite.http.HttpConnector;
+import org.apache.tomcat.lite.http.HttpRequest;
+import org.apache.tomcat.lite.http.HttpResponse;
+import org.apache.tomcat.lite.http.MultiMap;
+import org.apache.tomcat.lite.http.HttpChannel.HttpService;
+import org.apache.tomcat.lite.http.HttpChannel.RequestCompleted;
+import org.apache.tomcat.lite.io.CBuffer;
+import org.apache.tomcat.lite.io.IOChannel;
+import org.apache.tomcat.lite.io.IOConnector;
+import org.apache.tomcat.lite.io.CBuffer;
+import org.apache.tomcat.lite.io.SocketConnector;
+
+/** 
+ * Http callback for the server-side. Will forward all requests to 
+ * a remote http server - eith

svn commit: r884412 [4/4] - /tomcat/trunk/modules/tomcat-lite/java/org/apache/tomcat/lite/http/

2009-11-25 Thread costin
Added: 
tomcat/trunk/modules/tomcat-lite/java/org/apache/tomcat/lite/http/ServerCookie.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/modules/tomcat-lite/java/org/apache/tomcat/lite/http/ServerCookie.java?rev=884412&view=auto
==
--- 
tomcat/trunk/modules/tomcat-lite/java/org/apache/tomcat/lite/http/ServerCookie.java
 (added)
+++ 
tomcat/trunk/modules/tomcat-lite/java/org/apache/tomcat/lite/http/ServerCookie.java
 Thu Nov 26 06:41:00 2009
@@ -0,0 +1,819 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.apache.tomcat.lite.http;
+
+import java.io.Serializable;
+import java.text.DateFormat;
+import java.text.FieldPosition;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.List;
+import java.util.Locale;
+import java.util.TimeZone;
+
+import org.apache.tomcat.lite.io.BBuffer;
+import org.apache.tomcat.lite.io.CBuffer;
+
+
+/**
+ *  Server-side cookie representation.
+ *  Allows recycling and uses MessageBytes as low-level
+ *  representation ( and thus the byte-> char conversion can be delayed
+ *  until we know the charset ).
+ *
+ *  Tomcat.core uses this recyclable object to represent cookies,
+ *  and the facade will convert it to the external representation.
+ */
+public class ServerCookie implements Serializable {
+
+// Version 0 (Netscape) attributes
+private BBuffer name = BBuffer.allocate();
+private BBuffer value = BBuffer.allocate();
+
+private CBuffer nameC = CBuffer.newInstance();
+
+// Expires - Not stored explicitly. Generated from Max-Age (see V1)
+private BBuffer path = BBuffer.allocate();
+private BBuffer domain = BBuffer.allocate();
+private boolean secure;
+
+// Version 1 (RFC2109) attributes
+private BBuffer comment = BBuffer.allocate();
+private int maxAge = -1;
+private int version = 0;
+
+// Other fields
+private static final String OLD_COOKIE_PATTERN =
+"EEE, dd-MMM- HH:mm:ss z";
+private static final ThreadLocal OLD_COOKIE_FORMAT =
+new ThreadLocal() {
+protected DateFormat initialValue() {
+DateFormat df =
+new SimpleDateFormat(OLD_COOKIE_PATTERN, Locale.US);
+df.setTimeZone(TimeZone.getTimeZone("GMT"));
+return df;
+}
+};
+
+private static final String ancientDate;
+
+
+static {
+ancientDate = OLD_COOKIE_FORMAT.get().format(new Date(1));
+}
+
+/**
+ * If set to true, we parse cookies according to the servlet spec,
+ */
+public static final boolean STRICT_SERVLET_COMPLIANCE =
+
Boolean.valueOf(System.getProperty("org.apache.catalina.STRICT_SERVLET_COMPLIANCE",
 "false")).booleanValue();
+
+/**
+ * If set to false, we don't use the IE6/7 Max-Age/Expires work around
+ */
+public static final boolean ALWAYS_ADD_EXPIRES =
+
Boolean.valueOf(System.getProperty("org.apache.tomcat.util.http.ServerCookie.ALWAYS_ADD_EXPIRES",
 "true")).booleanValue();
+
+// Note: Servlet Spec =< 2.5 only refers to Netscape and RFC2109,
+// not RFC2965
+
+// Version 1 (RFC2965) attributes
+// TODO Add support for CommentURL
+// Discard - implied by maxAge <0
+// TODO Add support for Port
+
+public ServerCookie() {
+}
+
+public void recycle() {
+path.recycle();
+name.recycle();
+value.recycle();
+comment.recycle();
+maxAge=-1;
+path.recycle();
+domain.recycle();
+version=0;
+secure=false;
+}
+
+public BBuffer getComment() {
+return comment;
+}
+
+public BBuffer getDomain() {
+return domain;
+}
+
+public void setMaxAge(int expiry) {
+maxAge = expiry;
+}
+
+public int getMaxAge() {
+return maxAge;
+}
+
+public BBuffer getPath() {
+return path;
+}
+
+public void setSecure(boolean flag) {
+secure = flag;
+}
+
+public boolean getSecure() {
+return secure;
+}
+
+public BBuffer getName() {
+return name;
+}
+
+public BBuffer getValue() {
+r

svn commit: r884410 [4/4] - /tomcat/trunk/modules/tomcat-lite/java/org/apache/tomcat/lite/io/

2009-11-25 Thread costin
Added: 
tomcat/trunk/modules/tomcat-lite/java/org/apache/tomcat/lite/io/WrappedException.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/modules/tomcat-lite/java/org/apache/tomcat/lite/io/WrappedException.java?rev=884410&view=auto
==
--- 
tomcat/trunk/modules/tomcat-lite/java/org/apache/tomcat/lite/io/WrappedException.java
 (added)
+++ 
tomcat/trunk/modules/tomcat-lite/java/org/apache/tomcat/lite/io/WrappedException.java
 Thu Nov 26 06:35:43 2009
@@ -0,0 +1,40 @@
+/*
+ */
+package org.apache.tomcat.lite.io;
+
+import java.io.IOException;
+
+/**
+ * For specific exceptions - also has cause ( good if compiling against
+ * JDK1.5 ) 
+ * 
+ * @author Costin Manolache
+ */
+public class WrappedException extends IOException {
+
+public WrappedException() {
+super();
+}
+
+public WrappedException(String message) {
+super(message);
+}
+
+public WrappedException(String message, Throwable cause) {
+super(message);
+initCause(cause);
+}
+
+public WrappedException(Throwable cause) {
+super("");
+initCause(cause);
+}
+
+
+public static class ClientAbortException extends WrappedException {
+public ClientAbortException(Throwable throwable) {
+super(null, throwable);
+}
+}
+
+}

Propchange: 
tomcat/trunk/modules/tomcat-lite/java/org/apache/tomcat/lite/io/WrappedException.java
--
svn:eol-style = native

Added: 
tomcat/trunk/modules/tomcat-lite/java/org/apache/tomcat/lite/io/package.html
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/modules/tomcat-lite/java/org/apache/tomcat/lite/io/package.html?rev=884410&view=auto
==
--- 
tomcat/trunk/modules/tomcat-lite/java/org/apache/tomcat/lite/io/package.html 
(added)
+++ 
tomcat/trunk/modules/tomcat-lite/java/org/apache/tomcat/lite/io/package.html 
Thu Nov 26 06:35:43 2009
@@ -0,0 +1,7 @@
+IO layer based on tomcat coyote connector and utils.
+
+There are many big changes:
+
+  
+  
+
\ No newline at end of file

Propchange: 
tomcat/trunk/modules/tomcat-lite/java/org/apache/tomcat/lite/io/package.html
--
svn:eol-style = native



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



Re: svn commit: r884341 - in /tomcat/trunk: java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java java/org/apache/catalina/core/LocalStrings.properties webapps/docs/config/listeners.xml

2009-11-25 Thread Mark Thomas
sebb wrote:
> On 25/11/2009, ma...@apache.org  wrote:
>>  +protected boolean xmlParsingProtection = true;
> 
> The variable should be private, as there are public get/set methods.
Done. And for the other protected fields too.

Mark




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



svn commit: r884351 - /tomcat/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java

2009-11-25 Thread markt
Author: markt
Date: Thu Nov 26 01:02:19 2009
New Revision: 884351

URL: http://svn.apache.org/viewvc?rev=884351&view=rev
Log:
Reduce visibility

Modified:

tomcat/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java

Modified: 
tomcat/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java?rev=884351&r1=884350&r2=884351&view=diff
==
--- 
tomcat/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java 
(original)
+++ 
tomcat/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java 
Thu Nov 26 01:02:19 2009
@@ -51,7 +51,7 @@
 
 private static final Log log =
 LogFactory.getLog(JreMemoryLeakPreventionListener.class);
-protected static final StringManager sm =
+private static final StringManager sm =
 StringManager.getManager(Constants.Package);
 
 /**
@@ -59,7 +59,7 @@
  * sun.awt.AppContext.getAppContext() is triggered by a web
  * application. Defaults to true.
  */
-protected boolean appContextProtection = true;
+private boolean appContextProtection = true;
 public boolean isAppContextProtection() { return appContextProtection; }
 public void setAppContextProtection(boolean appContextProtection) {
 this.appContextProtection = appContextProtection;
@@ -71,7 +71,7 @@
  * {...@link URLConnection}s, regardless of type. Defaults to
  * true.
  */
-protected boolean urlCacheProtection = true;
+private boolean urlCacheProtection = true;
 public boolean isUrlCacheProtection() { return urlCacheProtection; }
 public void setUrlCacheProtection(boolean urlCacheProtection) {
 this.urlCacheProtection = urlCacheProtection;
@@ -82,7 +82,7 @@
  * particularly nasty as profilers (at least YourKit and Eclispe MAT) don't
  * idenitfy any GC roots related to this. 
  */
-protected boolean xmlParsingProtection = true;
+private boolean xmlParsingProtection = true;
 public boolean isXmlParsingProtection() { return xmlParsingProtection; }
 public void setXmlParsingProtection(boolean xmlParsingProtection) {
 this.xmlParsingProtection = xmlParsingProtection;



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



Re: svn commit: r884341 - in /tomcat/trunk: java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java java/org/apache/catalina/core/LocalStrings.properties webapps/docs/config/listeners.xml

2009-11-25 Thread sebb
On 25/11/2009, ma...@apache.org  wrote:
> Author: markt
>  Date: Wed Nov 25 23:56:30 2009
>  New Revision: 884341
>
>  URL: http://svn.apache.org/viewvc?rev=884341&view=rev
>  Log:
>  More memory leak protection. This one is particularly nasty as profilers 
> don't appear to show the GC root associated with the leak.
>
>  Modified:
> 
> tomcat/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java
> tomcat/trunk/java/org/apache/catalina/core/LocalStrings.properties
> tomcat/trunk/webapps/docs/config/listeners.xml
>
>  Modified: 
> tomcat/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java
>  URL: 
> http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java?rev=884341&r1=884340&r2=884341&view=diff
>  
> ==
>  --- 
> tomcat/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java
>  (original)
>  +++ 
> tomcat/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java
>  Wed Nov 25 23:56:30 2009
>  @@ -23,6 +23,8 @@
>   import java.net.URLConnection;
>
>   import javax.imageio.ImageIO;
>  +import javax.xml.parsers.DocumentBuilderFactory;
>  +import javax.xml.parsers.ParserConfigurationException;
>
>   import org.apache.catalina.Lifecycle;
>   import org.apache.catalina.LifecycleEvent;
>  @@ -75,6 +77,17 @@
>  this.urlCacheProtection = urlCacheProtection;
>  }
>
>  +/**
>  + * XML parsing can pin a web application class loader in memory. This is
>  + * particularly nasty as profilers (at least YourKit and Eclispe MAT) 
> don't
>  + * idenitfy any GC roots related to this.
>  + */
>  +protected boolean xmlParsingProtection = true;

The variable should be private, as there are public get/set methods.

>  +public boolean isXmlParsingProtection() { return xmlParsingProtection; }
>  +public void setXmlParsingProtection(boolean xmlParsingProtection) {
>  +this.xmlParsingProtection = xmlParsingProtection;
>  +}
>  +
>  @Override
>  public void lifecycleEvent(LifecycleEvent event) {
>  // Initialise these classes when Tomcat starts
>  @@ -122,7 +135,23 @@
>  "jreLeakListener.jarUrlConnCacheFail"), e);
>  } catch (IOException e) {
>  log.error(sm.getString(
>  -"jreLeakListener.jarUrlConnCacheFail"), e);
>  +"jreLeakListener.jarUrlConnCacheFail"), e);
>  +}
>  +}
>  +
>  +/*
>  + * Haven't got to the root of what is going on with this leak 
> but if
>  + * a web app is the first to make the calls below the web
>  + * application class loader will be pinned in memory.
>  + */
>  +if (xmlParsingProtection) {
>  +DocumentBuilderFactory factory =
>  +DocumentBuilderFactory.newInstance();
>  +try {
>  +factory.newDocumentBuilder();
>  +} catch (ParserConfigurationException e) {
>  +log.error(sm.getString(
>  +"jreLeakListener.xmlParseFail"), e);
>  }
>  }
>  }
>
>  Modified: tomcat/trunk/java/org/apache/catalina/core/LocalStrings.properties
>  URL: 
> http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/LocalStrings.properties?rev=884341&r1=884340&r2=884341&view=diff
>  
> ==
>  --- tomcat/trunk/java/org/apache/catalina/core/LocalStrings.properties 
> (original)
>  +++ tomcat/trunk/java/org/apache/catalina/core/LocalStrings.properties Wed 
> Nov 25 23:56:30 2009
>  @@ -66,6 +66,7 @@
>   interceptorValve.alreadyStarted=InterceptorValve has already been started
>   interceptorValve.notStarted=InterceptorValve has not yet been started
>   jreLeakListener.jarUrlConnCacheFail=Failed to disable Jar URL connection 
> caching by default
>  +jreLeakListener.xmlParseFail=Error whilst attempting to prevent memory 
> leaks during XML parsing
>   naming.wsdlFailed=Failed to find wsdl file: {0}
>   naming.bindFailed=Failed to bind object: {0}
>   naming.jmxRegistrationFailed=Failed to register in JMX: {0}
>
>  Modified: tomcat/trunk/webapps/docs/config/listeners.xml
>  URL: 
> http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/config/listeners.xml?rev=884341&r1=884340&r2=884341&view=diff
>  
> ==
>  --- tomcat/trunk/webapps/docs/config/listeners.xml (original)
>  +++ tomcat/trunk/webapps/docs/config/listeners.xml Wed Nov 25 23:56:30 2009
>  @@ -256,6 +256,13 @@
>  case by case basis as required. Defaults to true.
>
>
>  +  
>  +Enables protection so that parsing XML files within a web 

DO NOT REPLY [Bug 48289] ElSupport - Javadoc and generics fixes

2009-11-25 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=48289

Sebb  changed:

   What|Removed |Added

  Attachment #24620|application/octet-stream|text/plain
  mime type||
  Attachment #24620|0   |1
   is patch||

-- 
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 48289] New: ElSupport - Javadoc and generics fixes

2009-11-25 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=48289

   Summary: ElSupport - Javadoc and generics fixes
   Product: Tomcat 7
   Version: trunk
  Platform: PC
OS/Version: Windows XP
Status: NEW
  Severity: normal
  Priority: P2
 Component: Servlet & JSP API
AssignedTo: dev@tomcat.apache.org
ReportedBy: s...@apache.org


Created an attachment (id=24620)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=24620)
Patch - see description

Patch to add some Javadoc and generics fixes to ElSupport.

Note that the method coerceToEnum() remains to be fixed.

Also adds some basic test cases for the compare() method.

-- 
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: r884342 - /tomcat/tc6.0.x/trunk/STATUS.txt

2009-11-25 Thread markt
Author: markt
Date: Wed Nov 25 23:58:27 2009
New Revision: 884342

URL: http://svn.apache.org/viewvc?rev=884342&view=rev
Log:
Proposal

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

Modified: tomcat/tc6.0.x/trunk/STATUS.txt
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS.txt?rev=884342&r1=884341&r2=884342&view=diff
==
--- tomcat/tc6.0.x/trunk/STATUS.txt (original)
+++ tomcat/tc6.0.x/trunk/STATUS.txt Wed Nov 25 23:58:27 2009
@@ -468,3 +468,8 @@
   http://svn.apache.org/viewvc?rev=883362&view=rev (Qunitin)
   +1: markt
   -1: 
+
+* Further improvement to memory leak protection - XML parsing
+  http://svn.apache.org/viewvc?rev=884341&view=rev
+  +1: markt
+  -1: 



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



svn commit: r884341 - in /tomcat/trunk: java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java java/org/apache/catalina/core/LocalStrings.properties webapps/docs/config/listeners.xml

2009-11-25 Thread markt
Author: markt
Date: Wed Nov 25 23:56:30 2009
New Revision: 884341

URL: http://svn.apache.org/viewvc?rev=884341&view=rev
Log:
More memory leak protection. This one is particularly nasty as profilers don't 
appear to show the GC root associated with the leak.

Modified:

tomcat/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java
tomcat/trunk/java/org/apache/catalina/core/LocalStrings.properties
tomcat/trunk/webapps/docs/config/listeners.xml

Modified: 
tomcat/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java?rev=884341&r1=884340&r2=884341&view=diff
==
--- 
tomcat/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java 
(original)
+++ 
tomcat/trunk/java/org/apache/catalina/core/JreMemoryLeakPreventionListener.java 
Wed Nov 25 23:56:30 2009
@@ -23,6 +23,8 @@
 import java.net.URLConnection;
 
 import javax.imageio.ImageIO;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
 
 import org.apache.catalina.Lifecycle;
 import org.apache.catalina.LifecycleEvent;
@@ -75,6 +77,17 @@
 this.urlCacheProtection = urlCacheProtection;
 }
 
+/**
+ * XML parsing can pin a web application class loader in memory. This is
+ * particularly nasty as profilers (at least YourKit and Eclispe MAT) don't
+ * idenitfy any GC roots related to this. 
+ */
+protected boolean xmlParsingProtection = true;
+public boolean isXmlParsingProtection() { return xmlParsingProtection; }
+public void setXmlParsingProtection(boolean xmlParsingProtection) {
+this.xmlParsingProtection = xmlParsingProtection;
+}
+
 @Override
 public void lifecycleEvent(LifecycleEvent event) {
 // Initialise these classes when Tomcat starts
@@ -122,7 +135,23 @@
 "jreLeakListener.jarUrlConnCacheFail"), e);
 } catch (IOException e) {
 log.error(sm.getString(
-"jreLeakListener.jarUrlConnCacheFail"), e);
+"jreLeakListener.jarUrlConnCacheFail"), e);
+}
+}
+
+/*
+ * Haven't got to the root of what is going on with this leak but 
if
+ * a web app is the first to make the calls below the web
+ * application class loader will be pinned in memory.
+ */
+if (xmlParsingProtection) {
+DocumentBuilderFactory factory =
+DocumentBuilderFactory.newInstance();
+try {
+factory.newDocumentBuilder();
+} catch (ParserConfigurationException e) {
+log.error(sm.getString(
+"jreLeakListener.xmlParseFail"), e);
 }
 }
 }

Modified: tomcat/trunk/java/org/apache/catalina/core/LocalStrings.properties
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/LocalStrings.properties?rev=884341&r1=884340&r2=884341&view=diff
==
--- tomcat/trunk/java/org/apache/catalina/core/LocalStrings.properties 
(original)
+++ tomcat/trunk/java/org/apache/catalina/core/LocalStrings.properties Wed Nov 
25 23:56:30 2009
@@ -66,6 +66,7 @@
 interceptorValve.alreadyStarted=InterceptorValve has already been started
 interceptorValve.notStarted=InterceptorValve has not yet been started
 jreLeakListener.jarUrlConnCacheFail=Failed to disable Jar URL connection 
caching by default
+jreLeakListener.xmlParseFail=Error whilst attempting to prevent memory leaks 
during XML parsing
 naming.wsdlFailed=Failed to find wsdl file: {0}
 naming.bindFailed=Failed to bind object: {0}
 naming.jmxRegistrationFailed=Failed to register in JMX: {0}

Modified: tomcat/trunk/webapps/docs/config/listeners.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/config/listeners.xml?rev=884341&r1=884340&r2=884341&view=diff
==
--- tomcat/trunk/webapps/docs/config/listeners.xml (original)
+++ tomcat/trunk/webapps/docs/config/listeners.xml Wed Nov 25 23:56:30 2009
@@ -256,6 +256,13 @@
 case by case basis as required. Defaults to true.
   
 
+  
+Enables protection so that parsing XML files within a web 
application
+does not result in a memopry leak. Note that memory profilers may not
+display the GC root associated with this leak making it particularly
+hard to diagnose. Defaults to true.
+  
+
 
 
   



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

DO NOT REPLY [Bug 48288] Patch to fix generics in javax.el package helpers

2009-11-25 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=48288

Sebb  changed:

   What|Removed |Added

  Attachment #24619|application/octet-stream|text/plain
  mime type||
  Attachment #24619|0   |1
   is patch||

-- 
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 48288] New: Patch to fix generics in javax.el package helpers

2009-11-25 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=48288

   Summary: Patch to fix generics in javax.el package helpers
   Product: Tomcat 7
   Version: trunk
  Platform: PC
OS/Version: Windows XP
Status: NEW
  Severity: normal
  Priority: P2
 Component: Servlet & JSP API
AssignedTo: dev@tomcat.apache.org
ReportedBy: s...@apache.org


Created an attachment (id=24619)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=24619)
Patch

It's not possible to fix all the compiler warnings in the javax.el helper
classes, because some of the overridden methods in javax.el use raw types in
the specification.

Patch to follow suppresses these warnings in ELContextWrapper and
EvaluationContext

-- 
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 48287] ApplicationContextFacade - generics fixes

2009-11-25 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=48287

Sebb  changed:

   What|Removed |Added

  Attachment #24618|application/octet-stream|text/plain
  mime type||
  Attachment #24618|0   |1
   is patch||

-- 
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 48287] New: ApplicationContextFacade - generics fixes

2009-11-25 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=48287

   Summary: ApplicationContextFacade - generics fixes
   Product: Tomcat 7
   Version: trunk
  Platform: PC
OS/Version: Windows XP
Status: NEW
  Severity: normal
  Priority: P2
 Component: Catalina
AssignedTo: dev@tomcat.apache.org
ReportedBy: s...@apache.org


Created an attachment (id=24618)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=24618)
Patch

ApplicationContextFacade generates lots of "Type safety: Unchecked cast ..."
warnings which are caused by the doPrivileged() method wrapper.

These can be suppressed with the patch to follow.

-- 
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 48285] New: ApplicationFilterFactory.matchDispatcher() fails to check ASYNC

2009-11-25 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=48285

   Summary: ApplicationFilterFactory.matchDispatcher() fails to
check ASYNC
   Product: Tomcat 7
   Version: trunk
  Platform: PC
OS/Version: Windows XP
Status: NEW
  Severity: normal
  Priority: P2
 Component: Catalina
AssignedTo: dev@tomcat.apache.org
ReportedBy: s...@apache.org


catalina.core.ApplicationFilterFactory.matchDispatcher(FilterMap filterMap,
DispatcherType type) fails to check for type == ASYNC

The extra case ought to be added (but I don't know what it should contain, so
cannot provide a patch)

-- 
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 48282] New: Possible NPE in org.apache.tomcat.util.modeler.Registry

2009-11-25 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=48282

   Summary: Possible NPE in
org.apache.tomcat.util.modeler.Registry
   Product: Tomcat 7
   Version: trunk
  Platform: PC
OS/Version: Windows XP
Status: NEW
  Severity: normal
  Priority: P2
 Component: Catalina
AssignedTo: dev@tomcat.apache.org
ReportedBy: s...@apache.org


Created an attachment (id=24612)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=24612)
Patch - see description

There is a possible NPE in org.apache.tomcat.util.modeler.Registry:


if ((group == null) && (item.getGroup() == null)) {
results.add(item.getName());
} else if (group.equals(item.getGroup())) { // group may be null
results.add(item.getName());
}

The Javadoc implies that the item.getGroup() check should be nested.

Patch to follow; also fixes one raw type.

-- 
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 48267] Patch to fix generics in javax packages

2009-11-25 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=48267

Sebb  changed:

   What|Removed |Added

  Attachment #24597|0   |1
is obsolete||

--- Comment #4 from Sebb  2009-11-25 06:22:13 UTC ---
Created an attachment (id=24611)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=24611)
Modified patch which does not change API spec.

-- 
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 48267] Patch to fix generics in javax packages

2009-11-25 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=48267

--- Comment #3 from Mark Thomas  2009-11-25 03:16:03 GMT ---
(In reply to comment #2)
> How about applying generics fixes just to internal code and private variables,
> and using @SuppressWarnings on the rest?
+1

> If so, I can create a new patch.
Tx

-- 
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 45255] support disable jsessionid from url against session fixation attacks

2009-11-25 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=45255

Maxim Valyanskiy  changed:

   What|Removed |Added

 CC||max.valjan...@gmail.com

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