Re: svn commit: r1513714 - in /tomcat/tc7.0.x/trunk: java/org/apache/catalina/Context.java java/org/apache/catalina/core/StandardContext.java java/org/apache/catalina/startup/TldConfig.java webapps/do
Jeremy Boynes jboy...@apache.org wrote: On Aug 14, 2013, at 12:58 AM, Mark Thomas ma...@apache.org wrote: On 14/08/2013 03:20, jboy...@apache.org wrote: Author: jboynes Date: Wed Aug 14 02:20:02 2013 New Revision: 1513714 URL: http://svn.apache.org/r1513714 Log: Deprecate TldConfig and TLD-related properties of Context as they have been removed in Tomcat 8.0.x where TLD processing is handled by Jasper. I'm not sure about this. It doesn't seem right to deprecate something in Tomcat 7 when there is nothing to replace it in Tomcat 7. There are other areas (such as the resources) that are completely removed in 8.0.x but not deprecated in 7.0.x as they are a) still being used and b) no replacement is available. To date, deprecation has been used in Tomcat 7 to signal that the code shouldn't be used that an alternative should be used. We haven't in the past deprecated everything in Tomcat n-1 that has been removed in Tomcat n. Misunderstanding on my part. I reverted this change. OK. Thanks. I'm happy with that outcome but I intended to start a discussion around how we used @deprecated to see if everyone was happy with the interpretation above. If there are no objections, I'll add something to the docs so folks understand how we do this. Mark - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Re: svn commit: r1513919 - in /tomcat/trunk: java/org/apache/catalina/connector/CoyoteAdapter.java test/org/apache/catalina/nonblocking/TestNonBlockingAPI.java
HI Mark, nice fix :-) Thanks! Why the testcase at NBReadServlet must called the listener.onDataAvailable();? I read the 3.1 spec and think the container must call onDataAvailable and we do that at CoyoteAdapter. §3.7 P 3.28 ■ onDataAvailable(). The onDataAvailable method is invoked on the ReadListener when data is available to read from the incoming request stream. The container will invoke the method the first time when data is available to read. The container will subsequently invoke the onDataAvailable method if and only if isReady method on ServletInputStream, described below, returns false. But this simple POST example at https://weblogs.java.net/blog/swchan2/archive/2013/04/16/non-blocking-io-servlet-31-example don't work. Another question is: At which time the container must call the WriteListener.onWritePossible()? After ReadListener.onDataAvailable is finished? Currently we call onWritePossible before onDataAvailable is WriteListener set. The example set WriteListener at the ReadListener has read all data! But the problem seems that no date available after POST request is dispatch. After ReadListener set the method call result from ServletInputStream.isReady() is true! Seems socket has read data. Regards Peter Am 14.08.2013 um 17:02 schrieb ma...@apache.org: Author: markt Date: Wed Aug 14 15:02:59 2013 New Revision: 1513919 URL: http://svn.apache.org/r1513919 Log: Fix non-blocking test failures on OSX. Modified: tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java tomcat/trunk/test/org/apache/catalina/nonblocking/TestNonBlockingAPI.java Modified: tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java?rev=1513919r1=1513918r2=1513919view=diff == --- tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java (original) +++ tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java Wed Aug 14 15:02:59 2013 @@ -363,6 +363,10 @@ public class CoyoteAdapter implements Ad try { Thread.currentThread().setContextClassLoader(newCL); res.onWritePossible(); +} catch (Throwable t) { +ExceptionUtils.handleThrowable(t); +res.getWriteListener().onError(t); +return false; } finally { Thread.currentThread().setContextClassLoader(oldCL); } @@ -379,6 +383,10 @@ public class CoyoteAdapter implements Ad if (request.isFinished()) { req.getReadListener().onAllDataRead(); } +} catch (Throwable t) { +ExceptionUtils.handleThrowable(t); +req.getReadListener().onError(t); +return false; } finally { Thread.currentThread().setContextClassLoader(oldCL); } Modified: tomcat/trunk/test/org/apache/catalina/nonblocking/TestNonBlockingAPI.java URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/nonblocking/TestNonBlockingAPI.java?rev=1513919r1=1513918r2=1513919view=diff == --- tomcat/trunk/test/org/apache/catalina/nonblocking/TestNonBlockingAPI.java (original) +++ tomcat/trunk/test/org/apache/catalina/nonblocking/TestNonBlockingAPI.java Wed Aug 14 15:02:59 2013 @@ -482,25 +482,20 @@ public class TestNonBlockingAPI extends } @Override -public void onDataAvailable() { -try { -ServletInputStream in = ctx.getRequest().getInputStream(); -String s = ; -byte[] b = new byte[8192]; -int read = 0; -do { -read = in.read(b); -if (read == -1) { -break; -} -s += new String(b, 0, read); -} while (in.isReady()); -log.info(s); -body.append(s); -} catch (Exception x) { -x.printStackTrace(); -ctx.complete(); -} +public void onDataAvailable() throws IOException { +ServletInputStream in = ctx.getRequest().getInputStream(); +String s = ; +byte[] b = new byte[8192]; +int read = 0; +do { +read = in.read(b); +if (read == -1) { +break; +} +s += new String(b, 0, read); +} while (in.isReady()); +
Re: svn commit: r1513919 - in /tomcat/trunk: java/org/apache/catalina/connector/CoyoteAdapter.java test/org/apache/catalina/nonblocking/TestNonBlockingAPI.java
On 15/08/2013 08:53, Peter Rossbach wrote: HI Mark, nice fix :-) Thanks! Why the testcase at NBReadServlet must called the listener.onDataAvailable();? https://issues.apache.org/bugzilla/show_bug.cgi?id=55381 I read the 3.1 spec and think the container must call onDataAvailable and we do that at CoyoteAdapter. We do, but that doesn't get triggered for the first call. I have a patch for BZ55381 that works for BIO and NIO but not APR. I know what the problem is - I just need to find a way around it. Oh, and I have only tested on Windows so far. From experience, once this works on Windows I'll need a few more tweaks to get it working on Linux and OSX as well. Another question is: At which time the container must call the WriteListener.onWritePossible()? After ReadListener.onDataAvailable is finished? The specification doesn't define an order (there was some discussion in the EG about what made sense) so applications should not assume any order. Currently we call onWritePossible before onDataAvailable is WriteListener set. The example set WriteListener at the ReadListener has read all data! But the problem seems that no date available after POST request is dispatch. After ReadListener set the method call result from ServletInputStream.isReady() is true! Seems socket has read data. I'm not sure I follow this. onWritePossible() and onDataAvailable() will be called in response to a Poller event (for NIO and APR anyway). If both a read and write event occurs, the poller will trigger an event for each. Those events will trigger creation of a socket processor each which gets passed to the executor. The executor will run them both. The order of which one fires first depends on which on enters the sync block first and that is not deterministic. BIO is a whole different issue. I suspect that there will be some applications that just don't work with BIO. Longer term, I'm wondering about dropping BIO entirely. Mark - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Re: Consider support for the Servlet profile of JSR 196 (JASPIC) in Tomcat 7.0.x
On 15/08/2013 00:02, David Blevins wrote: On Aug 14, 2013, at 2:25 AM, Arjan Tijms arjan.ti...@gmail.com wrote: markt wrote No-one said it would be difficult. TomEE has already done it. We'd just need to lift the code. Difficulty really doesn't come into it. If there is a demand for it, it will get implemented. If there isn't, it won't. Thanks, that's clear! Btw, didn't you mean Geronimo there, or really TomEE? Last time I checked TomEE didn't have JASPIC implemented yet, but Geronimo of course has. Right, the code David J wrote some time ago is in Geronimo. Thanks for the correction. If you wanted to roll up your sleeves, we'd be more than happy to see it ported or reimplemented in TomEE. or Tomcat :) Mark - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[Bug 55282] JSF PhaseListeners are duplicated
https://issues.apache.org/bugzilla/show_bug.cgi?id=55282 --- Comment #6 from Oleksii o...@ciklum.com --- I have encountered the same problem when used a workoaround solution for a SEAM project (https://issues.jboss.org/browse/JBSEAM-4401). I need the ConfigureListener to be invoked before the SeamListener. During debugging I found that the com.sun.faces.config.ConfigureListener is added twice in org.apache.catalina.core.StandardContext. The first instance is added because it is described in the web.xml. The second instance is added by a JarScanner because the listener is described in jsf-impl.jar/META-INF/jsf_core.tld. My jsf-impl has an Implementation-Version: 2.1.7-SNAPSHOT. I have no idea how to avoid the situation yet. -- 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
Re: Consider support for the Servlet profile of JSR 196 (JASPIC) in Tomcat 7.0.x
Hi, On Thursday, August 15, 2013, markt [via Tomcat] wrote: On 15/08/2013 00:02, David Blevins wrote: If you wanted to roll up your sleeves, we'd be more than happy to see it ported or reimplemented in TomEE. or Tomcat :) Definitely! I'll also try to contact the guys who said to be working on a Tomcat JASPIC bridge already. One of them had the intention to release his work as open source, although he said he had to target Tomcat 6 specifically. Kind regards, Arjan Tijms -- View this message in context: http://tomcat.10.x6.nabble.com/Consider-support-for-the-Servlet-profile-of-JSR-196-JASPIC-in-Tomcat-7-0-x-tp4993387p5003215.html Sent from the Tomcat - Dev mailing list archive at Nabble.com.
svn commit: r1514228 - in /tomcat/trunk: java/org/apache/catalina/connector/ java/org/apache/coyote/ java/org/apache/coyote/http11/ java/org/apache/tomcat/util/net/ test/org/apache/catalina/nonblockin
Author: markt Date: Thu Aug 15 10:32:15 2013 New Revision: 1514228 URL: http://svn.apache.org/r1514228 Log: The container is responsible for the first call to each of onWritePossible() and onDataAvailable() once a listener has been set. Main component is the addition to the SocketWrapper of a list of dispatch types that need to be made. Dispatch type in this case meaning process the socket using the specified SocketStatus. This is used to register trigger the first call to each of onWritePossible() and onDataAvailable() for which the container is responsible. Fix some additional issues identified in the test case. Added: tomcat/trunk/java/org/apache/tomcat/util/net/DispatchType.java (with props) Modified: tomcat/trunk/java/org/apache/catalina/connector/InputBuffer.java tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java tomcat/trunk/java/org/apache/coyote/ActionCode.java tomcat/trunk/java/org/apache/coyote/Response.java tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java tomcat/trunk/java/org/apache/coyote/http11/InternalInputBuffer.java tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java tomcat/trunk/java/org/apache/tomcat/util/net/SocketWrapper.java tomcat/trunk/test/org/apache/catalina/nonblocking/TestNonBlockingAPI.java Modified: tomcat/trunk/java/org/apache/catalina/connector/InputBuffer.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/InputBuffer.java?rev=1514228r1=1514227r2=1514228view=diff == --- tomcat/trunk/java/org/apache/catalina/connector/InputBuffer.java (original) +++ tomcat/trunk/java/org/apache/catalina/connector/InputBuffer.java Thu Aug 15 10:32:15 2013 @@ -249,6 +249,18 @@ public class InputBuffer extends Reader public void setReadListener(ReadListener listener) { coyoteRequest.setReadListener(listener); + +// The container is responsible for the first call to +// listener.onDataAvailable(). If isReady() returns true, the container +// needs to call listener.onDataAvailable() from a new thread. If +// isReady() returns false, the socket will be registered for read and +// the container will call listener.onDataAvailable() once data arrives. +// Must call isFinished() first as a call to isReady() if the request +// has been finished will register the socket for read interest and that +// is not required. +if (isFinished() || isReady()) { +coyoteRequest.action(ActionCode.DISPATCH_READ, null); +} } Modified: tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java?rev=1514228r1=1514227r2=1514228view=diff == --- tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java (original) +++ tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java Thu Aug 15 10:32:15 2013 @@ -38,6 +38,7 @@ import org.apache.tomcat.util.collection import org.apache.tomcat.util.modeler.Registry; import org.apache.tomcat.util.net.AbstractEndpoint; import org.apache.tomcat.util.net.AbstractEndpoint.Handler; +import org.apache.tomcat.util.net.DispatchType; import org.apache.tomcat.util.net.SocketStatus; import org.apache.tomcat.util.net.SocketWrapper; import org.apache.tomcat.util.res.StringManager; @@ -616,7 +617,11 @@ public abstract class AbstractProtocol i SocketState state = SocketState.CLOSED; do { -if (status == SocketStatus.DISCONNECT +if (wrapper.hasNextDispatch()) { +DispatchType nextDispatch = wrapper.getNextDispatch(); +state = processor.asyncDispatch( +nextDispatch.getSocketStatus()); +} else if (status == SocketStatus.DISCONNECT !processor.isComet()) { // Do nothing here, just wait for it to get recycled // Don't do this for Comet we need to generate an end @@ -663,7 +668,8 @@ public abstract class AbstractProtocol i ], State out: [ + state + ]); } } while (state == SocketState.ASYNC_END || -state == SocketState.UPGRADING); +state == SocketState.UPGRADING || +wrapper.hasNextDispatch()); if (state == SocketState.LONG) { // In the middle of processing a request/response. Keep the Modified: tomcat/trunk/java/org/apache/coyote/ActionCode.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ActionCode.java?rev=1514228r1=1514227r2=1514228view=diff
Re: svn commit: r1514228 - in /tomcat/trunk: java/org/apache/catalina/connector/ java/org/apache/coyote/ java/org/apache/coyote/http11/ java/org/apache/tomcat/util/net/ test/org/apache/catalina/nonblo
On 15/08/2013 11:32, ma...@apache.org wrote: Author: markt Date: Thu Aug 15 10:32:15 2013 New Revision: 1514228 URL: http://svn.apache.org/r1514228 Log: The container is responsible for the first call to each of onWritePossible() and onDataAvailable() once a listener has been set. Main component is the addition to the SocketWrapper of a list of dispatch types that need to be made. Dispatch type in this case meaning process the socket using the specified SocketStatus. This is used to register trigger the first call to each of onWritePossible() and onDataAvailable() for which the container is responsible. Fix some additional issues identified in the test case. This passes on Windows and Linux on BIO, NIO and APR and OSX on BIO and NIO but not OSX with the APR connector. BZ55381 isn't quite fixed yet. Mark - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[Bug 55282] JSF PhaseListeners are duplicated
https://issues.apache.org/bugzilla/show_bug.cgi?id=55282 Oleksii o...@ciklum.com changed: What|Removed |Added CC||o...@ciklum.com -- 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
[Bug 55282] JSF PhaseListeners are duplicated
https://issues.apache.org/bugzilla/show_bug.cgi?id=55282 --- Comment #7 from Oleksii o...@ciklum.com --- For now I applied the following workaround. I have added the jsf-impl.jar to the property tomcat.util.scan.DefaultJarScanner.jarsToSkip of the TOMCAT\conf\catalina.properties. As a result my application started running properly. But I still have to check that it won't fail in some situations. -- 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
[Bug 55282] JSF PhaseListeners are duplicated
https://issues.apache.org/bugzilla/show_bug.cgi?id=55282 Oleksii o...@ciklum.com changed: What|Removed |Added Status|RESOLVED|REOPENED Resolution|INVALID |--- -- 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
[Bug 55282] JSF PhaseListeners are duplicated
https://issues.apache.org/bugzilla/show_bug.cgi?id=55282 Mark Thomas ma...@apache.org changed: What|Removed |Added Status|REOPENED|RESOLVED Resolution|--- |INVALID -- 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: r1514237 - /tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java
Author: markt Date: Thu Aug 15 11:31:03 2013 New Revision: 1514237 URL: http://svn.apache.org/r1514237 Log: Partial fix for BZ 55381 and OSX Modified: tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java Modified: tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java?rev=1514237r1=1514236r2=1514237view=diff == --- tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java (original) +++ tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java Thu Aug 15 11:31:03 2013 @@ -1586,7 +1586,7 @@ public abstract class AbstractHttp11Proc request.getReadListener() != null) { try { try { -if (inputBuffer.nbRead() 0) { +if (inputBuffer.available() 0 || inputBuffer.nbRead() 0) { asyncStateMachine.asyncOperation(); } } catch (IOException x) { - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1514239 - in /tomcat/trunk/java/org/apache/coyote/http11: AbstractHttp11Processor.java InternalAprInputBuffer.java
Author: markt Date: Thu Aug 15 11:45:36 2013 New Revision: 1514239 URL: http://svn.apache.org/r1514239 Log: Fix non-blocking test failures on OSX when using APR. Modified: tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java tomcat/trunk/java/org/apache/coyote/http11/InternalAprInputBuffer.java Modified: tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java?rev=1514239r1=1514238r2=1514239view=diff == --- tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java (original) +++ tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java Thu Aug 15 11:45:36 2013 @@ -1586,7 +1586,7 @@ public abstract class AbstractHttp11Proc request.getReadListener() != null) { try { try { -if (inputBuffer.available() 0 || inputBuffer.nbRead() 0) { +if (inputBuffer.available() 0 || inputBuffer.nbRead() 0) { asyncStateMachine.asyncOperation(); } } catch (IOException x) { Modified: tomcat/trunk/java/org/apache/coyote/http11/InternalAprInputBuffer.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/InternalAprInputBuffer.java?rev=1514239r1=1514238r2=1514239view=diff == --- tomcat/trunk/java/org/apache/coyote/http11/InternalAprInputBuffer.java (original) +++ tomcat/trunk/java/org/apache/coyote/http11/InternalAprInputBuffer.java Thu Aug 15 11:45:36 2013 @@ -627,6 +627,13 @@ public class InternalAprInputBuffer exte return nRead; } else if (-nRead == Status.EAGAIN) { return 0; +} else if (-nRead == Status.TIMEUP) { +// Attempting to read from the socket when the poller has not +// signaled that there is data to read appears to behave like a +// blocking read with a short timeout on OSX rather than like a +// non-blocking read. If no data is read, treat the resulting +// timeout like a non-blocking read that returned no data. +return 0; } else { throw new IOException(sm.getString(iib.failedread.apr, Integer.valueOf(-nRead))); - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[Bug 55381] Issue with the Non Blocking API TestNonBlockingAPI test
https://issues.apache.org/bugzilla/show_bug.cgi?id=55381 Mark Thomas ma...@apache.org changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |FIXED --- Comment #1 from Mark Thomas ma...@apache.org --- This has been fixed in trunk and will be included in 8.0.0-RC2 onwards. -- 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
[Bug 55398] Unable to deploy war file on tomcat 6.0.13
https://issues.apache.org/bugzilla/show_bug.cgi?id=55398 Mark Thomas ma...@apache.org changed: What|Removed |Added Status|NEEDINFO|RESOLVED Resolution|--- |WORKSFORME --- Comment #2 from Mark Thomas ma...@apache.org --- There is insufficient information in this bug report to enable it to be reproduced. Please seek help from the users mailing list. If the discussion on the users mailing lists concludes that there is a bug when running on the latest 6.0.x release then please re-open this issue and provide the exact steps to reproduce on a clean install of the latest 6.0.x release. -- 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
buildbot failure in ASF Buildbot on tomcat-trunk
The Buildbot has detected a new failure on builder tomcat-trunk while building ASF Buildbot. Full details are available at: http://ci.apache.org/builders/tomcat-trunk/builds/4831 Buildbot URL: http://ci.apache.org/ Buildslave for this Build: bb-vm_ubuntu Build Reason: scheduler Build Source Stamp: [branch tomcat/trunk] 1514237 Blamelist: markt BUILD FAILED: failed compile_1 sincerely, -The Buildbot
buildbot success in ASF Buildbot on tomcat-trunk
The Buildbot has detected a restored build on builder tomcat-trunk while building ASF Buildbot. Full details are available at: http://ci.apache.org/builders/tomcat-trunk/builds/4832 Buildbot URL: http://ci.apache.org/ Buildslave for this Build: bb-vm_ubuntu Build Reason: scheduler Build Source Stamp: [branch tomcat/trunk] 1514239 Blamelist: markt Build succeeded! sincerely, -The Buildbot
[Bug 55399] Request English but Response Spanish Language (Default Locale)
https://issues.apache.org/bugzilla/show_bug.cgi?id=55399 Mark Thomas ma...@apache.org changed: What|Removed |Added Status|NEEDINFO|NEW --- Comment #5 from Mark Thomas ma...@apache.org --- This report doesn't surprise me at all. The manager application had a similar issue. I'll look at using a similar approach as used for the manager application for the error pages. -- 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: r1514281 - in /tomcat/trunk/java/org/apache/catalina/session: FileStore.java JDBCStore.java
Author: violetagg Date: Thu Aug 15 14:06:20 2013 New Revision: 1514281 URL: http://svn.apache.org/r1514281 Log: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=55357 Set the web app classloader as a context classloader before reading the object data. Modified: tomcat/trunk/java/org/apache/catalina/session/FileStore.java tomcat/trunk/java/org/apache/catalina/session/JDBCStore.java Modified: tomcat/trunk/java/org/apache/catalina/session/FileStore.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/session/FileStore.java?rev=1514281r1=1514280r2=1514281view=diff == --- tomcat/trunk/java/org/apache/catalina/session/FileStore.java (original) +++ tomcat/trunk/java/org/apache/catalina/session/FileStore.java Thu Aug 15 14:06:20 2013 @@ -250,6 +250,7 @@ public final class FileStore extends Sto ObjectInputStream ois = null; Loader loader = null; ClassLoader classLoader = null; +ClassLoader oldThreadContextCL = Thread.currentThread().getContextClassLoader(); try { fis = new FileInputStream(file.getAbsolutePath()); bis = new BufferedInputStream(fis); @@ -258,10 +259,18 @@ public final class FileStore extends Sto loader = context.getLoader(); if (loader != null) classLoader = loader.getClassLoader(); -if (classLoader != null) +if (classLoader != null) { +Thread.currentThread().setContextClassLoader(classLoader); ois = new CustomObjectInputStream(bis, classLoader); -else +} else { ois = new ObjectInputStream(bis); +} + +StandardSession session = +(StandardSession) manager.createEmptySession(); +session.readObjectData(ois); +session.setManager(manager); +return (session); } catch (FileNotFoundException e) { if (manager.getContext().getLogger().isDebugEnabled()) manager.getContext().getLogger().debug(No persisted data file found); @@ -282,21 +291,16 @@ public final class FileStore extends Sto } } throw e; -} - -try { -StandardSession session = -(StandardSession) manager.createEmptySession(); -session.readObjectData(ois); -session.setManager(manager); -return (session); } finally { -// Close the input stream -try { -ois.close(); -} catch (IOException f) { -// Ignore +if (ois != null) { +// Close the input stream +try { +ois.close(); +} catch (IOException f) { +// Ignore +} } +Thread.currentThread().setContextClassLoader(oldThreadContextCL); } } Modified: tomcat/trunk/java/org/apache/catalina/session/JDBCStore.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/session/JDBCStore.java?rev=1514281r1=1514280r2=1514281view=diff == --- tomcat/trunk/java/org/apache/catalina/session/JDBCStore.java (original) +++ tomcat/trunk/java/org/apache/catalina/session/JDBCStore.java Thu Aug 15 14:06:20 2013 @@ -607,6 +607,7 @@ public class JDBCStore extends StoreBase return (null); } +ClassLoader oldThreadContextCL = Thread.currentThread().getContextClassLoader(); try { if (preparedLoadSql == null) { String loadSql = SELECT + sessionIdCol + , @@ -629,6 +630,7 @@ public class JDBCStore extends StoreBase classLoader = loader.getClassLoader(); } if (classLoader != null) { + Thread.currentThread().setContextClassLoader(classLoader); ois = new CustomObjectInputStream(bis, classLoader); } else { @@ -667,6 +669,7 @@ public class JDBCStore extends StoreBase // Ignore } } + Thread.currentThread().setContextClassLoader(oldThreadContextCL); release(_conn); } numberOfTries--; - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1514291 - in /tomcat/trunk/java/org/apache: catalina/manager/ catalina/manager/host/ tomcat/util/ tomcat/util/res/
Author: markt Date: Thu Aug 15 14:25:30 2013 New Revision: 1514291 URL: http://svn.apache.org/r1514291 Log: Refactor to reduce code duplication Modified: tomcat/trunk/java/org/apache/catalina/manager/HTMLManagerServlet.java tomcat/trunk/java/org/apache/catalina/manager/ManagerServlet.java tomcat/trunk/java/org/apache/catalina/manager/host/HTMLHostManagerServlet.java tomcat/trunk/java/org/apache/catalina/manager/host/HostManagerServlet.java tomcat/trunk/java/org/apache/tomcat/util/Diagnostics.java tomcat/trunk/java/org/apache/tomcat/util/res/StringManager.java Modified: tomcat/trunk/java/org/apache/catalina/manager/HTMLManagerServlet.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/manager/HTMLManagerServlet.java?rev=1514291r1=1514290r2=1514291view=diff == --- tomcat/trunk/java/org/apache/catalina/manager/HTMLManagerServlet.java (original) +++ tomcat/trunk/java/org/apache/catalina/manager/HTMLManagerServlet.java Thu Aug 15 14:25:30 2013 @@ -118,7 +118,8 @@ public final class HTMLManagerServlet ex HttpServletResponse response) throws IOException, ServletException { -StringManager smClient = getStringManager(request); +StringManager smClient = StringManager.getManager( +Constants.Package, request.getLocales()); // Identify the request parameters that we need // By obtaining the command from the pathInfo, per-command security can @@ -179,7 +180,8 @@ public final class HTMLManagerServlet ex HttpServletResponse response) throws IOException, ServletException { -StringManager smClient = getStringManager(request); +StringManager smClient = StringManager.getManager( +Constants.Package, request.getLocales()); // Identify the request parameters that we need // By obtaining the command from the pathInfo, per-command security can Modified: tomcat/trunk/java/org/apache/catalina/manager/ManagerServlet.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/manager/ManagerServlet.java?rev=1514291r1=1514290r2=1514291view=diff == --- tomcat/trunk/java/org/apache/catalina/manager/ManagerServlet.java (original) +++ tomcat/trunk/java/org/apache/catalina/manager/ManagerServlet.java Thu Aug 15 14:25:30 2013 @@ -306,7 +306,8 @@ public class ManagerServlet extends Http HttpServletResponse response) throws IOException, ServletException { -StringManager smClient = getStringManager(request); +StringManager smClient = StringManager.getManager( +Constants.Package, request.getLocales()); // Identify the request parameters that we need String command = request.getPathInfo(); @@ -399,7 +400,8 @@ public class ManagerServlet extends Http HttpServletResponse response) throws IOException, ServletException { -StringManager smClient = getStringManager(request); +StringManager smClient = StringManager.getManager( +Constants.Package, request.getLocales()); // Identify the request parameters that we need String command = request.getPathInfo(); @@ -1558,21 +1560,6 @@ public class ManagerServlet extends Http } -protected StringManager getStringManager(HttpServletRequest req) { -EnumerationLocale requestedLocales = req.getLocales(); -while (requestedLocales.hasMoreElements()) { -Locale locale = requestedLocales.nextElement(); -StringManager result = StringManager.getManager(Constants.Package, -locale); -if (result.getLocale().equals(locale)) { -return result; -} -} -// Return the default -return sm; -} - - protected static boolean validateContextName(ContextName cn, PrintWriter writer, StringManager sm) { Modified: tomcat/trunk/java/org/apache/catalina/manager/host/HTMLHostManagerServlet.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/manager/host/HTMLHostManagerServlet.java?rev=1514291r1=1514290r2=1514291view=diff == --- tomcat/trunk/java/org/apache/catalina/manager/host/HTMLHostManagerServlet.java (original) +++ tomcat/trunk/java/org/apache/catalina/manager/host/HTMLHostManagerServlet.java Thu Aug 15 14:25:30 2013 @@ -80,7 +80,8 @@ public final class HTMLHostManagerServle HttpServletResponse response) throws IOException, ServletException { -StringManager smClient = getStringManager(request); +StringManager smClient = StringManager.getManager( +
svn commit: r1514305 - /tomcat/trunk/java/org/apache/catalina/valves/ErrorReportValve.java
Author: markt Date: Thu Aug 15 14:47:20 2013 New Revision: 1514305 URL: http://svn.apache.org/r1514305 Log: Partial fix for https://issues.apache.org/bugzilla/show_bug.cgi?id=55399 Base i18n of error reports on request locale rather than default server local. Modified: tomcat/trunk/java/org/apache/catalina/valves/ErrorReportValve.java Modified: tomcat/trunk/java/org/apache/catalina/valves/ErrorReportValve.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/valves/ErrorReportValve.java?rev=1514305r1=1514304r2=1514305view=diff == --- tomcat/trunk/java/org/apache/catalina/valves/ErrorReportValve.java (original) +++ tomcat/trunk/java/org/apache/catalina/valves/ErrorReportValve.java Thu Aug 15 14:47:20 2013 @@ -30,6 +30,7 @@ import org.apache.catalina.connector.Res import org.apache.catalina.util.RequestUtil; import org.apache.catalina.util.ServerInfo; import org.apache.tomcat.util.ExceptionUtils; +import org.apache.tomcat.util.res.StringManager; /** * pImplementation of a Valve that outputs HTML error pages./p @@ -158,8 +159,10 @@ public class ErrorReportValve extends Va // Do nothing if there is no report for the specified status code and // no error message provided String report = null; +StringManager smClient = StringManager.getManager( +Constants.Package, request.getLocales()); try { -report = sm.getString(http. + statusCode); +report = smClient.getString(http. + statusCode); } catch (Throwable t) { ExceptionUtils.handleThrowable(t); } @@ -167,7 +170,7 @@ public class ErrorReportValve extends Va if (message.length() == 0) { return; } else { -report = sm.getString(errorReportValve.noDescription); +report = smClient.getString(errorReportValve.noDescription); } } @@ -175,29 +178,29 @@ public class ErrorReportValve extends Va sb.append(htmlheadtitle); sb.append(ServerInfo.getServerInfo()).append( - ); -sb.append(sm.getString(errorReportValve.errorReport)); +sb.append(smClient.getString(errorReportValve.errorReport)); sb.append(/title); sb.append(style!--); sb.append(org.apache.catalina.util.TomcatCSS.TOMCAT_CSS); sb.append(--/style ); sb.append(/headbody); sb.append(h1); -sb.append(sm.getString(errorReportValve.statusHeader, +sb.append(smClient.getString(errorReportValve.statusHeader, + statusCode, message)).append(/h1); sb.append(HR size=\1\ noshade=\noshade\); sb.append(pbtype/b ); if (throwable != null) { -sb.append(sm.getString(errorReportValve.exceptionReport)); +sb.append(smClient.getString(errorReportValve.exceptionReport)); } else { -sb.append(sm.getString(errorReportValve.statusReport)); +sb.append(smClient.getString(errorReportValve.statusReport)); } sb.append(/p); sb.append(pb); -sb.append(sm.getString(errorReportValve.message)); +sb.append(smClient.getString(errorReportValve.message)); sb.append(/b u); sb.append(message).append(/u/p); sb.append(pb); -sb.append(sm.getString(errorReportValve.description)); +sb.append(smClient.getString(errorReportValve.description)); sb.append(/b u); sb.append(report); sb.append(/u/p); @@ -206,7 +209,7 @@ public class ErrorReportValve extends Va String stackTrace = getPartialServletStackTrace(throwable); sb.append(pb); -sb.append(sm.getString(errorReportValve.exception)); +sb.append(smClient.getString(errorReportValve.exception)); sb.append(/b pre); sb.append(RequestUtil.filter(stackTrace)); sb.append(/pre/p); @@ -216,7 +219,7 @@ public class ErrorReportValve extends Va while (rootCause != null (loops 10)) { stackTrace = getPartialServletStackTrace(rootCause); sb.append(pb); -sb.append(sm.getString(errorReportValve.rootCause)); +sb.append(smClient.getString(errorReportValve.rootCause)); sb.append(/b pre); sb.append(RequestUtil.filter(stackTrace)); sb.append(/pre/p); @@ -226,9 +229,9 @@ public class ErrorReportValve extends Va } sb.append(pb); -sb.append(sm.getString(errorReportValve.note)); +sb.append(smClient.getString(errorReportValve.note)); sb.append(/b u); -sb.append(sm.getString(errorReportValve.rootCauseInLogs, +sb.append(smClient.getString(errorReportValve.rootCauseInLogs,
Re: svn commit: r1514228 - in /tomcat/trunk: java/org/apache/catalina/connector/ java/org/apache/coyote/ java/org/apache/coyote/http11/ java/org/apache/tomcat/util/net/ test/org/apache/catalina/nonblo
Hi Mark, I test the current fix with my simple example at OSX (NIO) and now it works. Many thanks, Peter Am 15.08.2013 um 12:40 schrieb Mark Thomas ma...@apache.org: On 15/08/2013 11:32, ma...@apache.org wrote: Author: markt Date: Thu Aug 15 10:32:15 2013 New Revision: 1514228 URL: http://svn.apache.org/r1514228 Log: The container is responsible for the first call to each of onWritePossible() and onDataAvailable() once a listener has been set. Main component is the addition to the SocketWrapper of a list of dispatch types that need to be made. Dispatch type in this case meaning process the socket using the specified SocketStatus. This is used to register trigger the first call to each of onWritePossible() and onDataAvailable() for which the container is responsible. Fix some additional issues identified in the test case. This passes on Windows and Linux on BIO, NIO and APR and OSX on BIO and NIO but not OSX with the APR connector. BZ55381 isn't quite fixed yet. Mark - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
buildbot failure in ASF Buildbot on tomcat-trunk
The Buildbot has detected a new failure on builder tomcat-trunk while building ASF Buildbot. Full details are available at: http://ci.apache.org/builders/tomcat-trunk/builds/4833 Buildbot URL: http://ci.apache.org/ Buildslave for this Build: bb-vm_ubuntu Build Reason: scheduler Build Source Stamp: [branch tomcat/trunk] 1514281 Blamelist: violetagg BUILD FAILED: failed compile_1 sincerely, -The Buildbot
buildbot success in ASF Buildbot on tomcat-trunk
The Buildbot has detected a restored build on builder tomcat-trunk while building ASF Buildbot. Full details are available at: http://ci.apache.org/builders/tomcat-trunk/builds/4834 Buildbot URL: http://ci.apache.org/ Buildslave for this Build: bb-vm_ubuntu Build Reason: scheduler Build Source Stamp: [branch tomcat/trunk] 1514305 Blamelist: markt Build succeeded! sincerely, -The Buildbot
svn commit: r1514368 - /tomcat/trunk/java/org/apache/tomcat/util/res/StringManager.java
Author: markt Date: Thu Aug 15 16:56:01 2013 New Revision: 1514368 URL: http://svn.apache.org/r1514368 Log: Fix issue reported on users list. Because the default bundle reports as the ROOT locale rather than as ENGLISH, the request locale to resource bundle mapping failed. Modified: tomcat/trunk/java/org/apache/tomcat/util/res/StringManager.java Modified: tomcat/trunk/java/org/apache/tomcat/util/res/StringManager.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/res/StringManager.java?rev=1514368r1=1514367r2=1514368view=diff == --- tomcat/trunk/java/org/apache/tomcat/util/res/StringManager.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/res/StringManager.java Thu Aug 15 16:56:01 2013 @@ -89,7 +89,12 @@ public class StringManager { bundle = bnd; // Get the actual locale, which may be different from the requested one if (bundle != null) { -this.locale = bundle.getLocale(); +Locale bundleLocale = bundle.getLocale(); +if (bundleLocale.equals(Locale.ROOT)) { +this.locale = Locale.ENGLISH; +} else { +this.locale = bundle.getLocale(); +} } else { this.locale = null; } - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1514376 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/tomcat/util/res/StringManager.java webapps/docs/changelog.xml
Author: markt Date: Thu Aug 15 17:02:48 2013 New Revision: 1514376 URL: http://svn.apache.org/r1514376 Log: Fix issue reported on users list. Because the default bundle reports as the ROOT locale rather than as ENGLISH, the request locale to resource bundle mapping failed. Modified: tomcat/tc7.0.x/trunk/ (props changed) tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/res/StringManager.java tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Propchange: tomcat/tc7.0.x/trunk/ -- Merged /tomcat/trunk:r1514368 Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/res/StringManager.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/res/StringManager.java?rev=1514376r1=1514375r2=1514376view=diff == --- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/res/StringManager.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/res/StringManager.java Thu Aug 15 17:02:48 2013 @@ -88,7 +88,12 @@ public class StringManager { bundle = bnd; // Get the actual locale, which may be different from the requested one if (bundle != null) { -this.locale = bundle.getLocale(); +Locale bundleLocale = bundle.getLocale(); +if (bundleLocale.equals(Locale.ROOT)) { +this.locale = Locale.ENGLISH; +} else { +this.locale = bundle.getLocale(); +} } else { this.locale = null; } Modified: tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml?rev=1514376r1=1514375r2=1514376view=diff == --- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original) +++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Thu Aug 15 17:02:48 2013 @@ -224,6 +224,12 @@ Remove the experimental label from the AJP NIO connector documentation. (markt) /update + fix +Correctly associated the default resource bundle with the English locale +so that requests that specify an Accept-Language of English ahead of +French, Spanish or Japanese get the English messages they asked for. +(markt) + /fix /changelog /subsection subsection name=Other - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1514380 - /tomcat/tc6.0.x/trunk/STATUS.txt
Author: markt Date: Thu Aug 15 17:05:57 2013 New Revision: 1514380 URL: http://svn.apache.org/r1514380 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=1514380r1=1514379r2=1514380view=diff == --- tomcat/tc6.0.x/trunk/STATUS.txt (original) +++ tomcat/tc6.0.x/trunk/STATUS.txt Thu Aug 15 17:05:57 2013 @@ -131,6 +131,13 @@ PATCHES PROPOSED TO BACKPORT: +1: markt, schultz -1: +* Fix issue with Manager app and other apps that use i18n in the UI when a + request that specify an Accept-Language of English ahead of French, Spanish or + Japanese. + http://svn.apache.org/r1514376 + +1: + -1: + PATCHES/ISSUES THAT ARE STALLED - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1514381 - /tomcat/tc6.0.x/trunk/STATUS.txt
Author: markt Date: Thu Aug 15 17:06:21 2013 New Revision: 1514381 URL: http://svn.apache.org/r1514381 Log: Fix copy/paste 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=1514381r1=1514380r2=1514381view=diff == --- tomcat/tc6.0.x/trunk/STATUS.txt (original) +++ tomcat/tc6.0.x/trunk/STATUS.txt Thu Aug 15 17:06:21 2013 @@ -132,8 +132,8 @@ PATCHES PROPOSED TO BACKPORT: -1: * Fix issue with Manager app and other apps that use i18n in the UI when a - request that specify an Accept-Language of English ahead of French, Spanish or - Japanese. + request that specifies an Accept-Language of English ahead of French, Spanish + or Japanese. http://svn.apache.org/r1514376 +1: -1: - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Re: Consider support for the Servlet profile of JSR 196 (JASPIC) in Tomcat 7.0.x
On Aug 15, 2013, at 1:07 AM, Mark Thomas ma...@apache.org wrote: If you wanted to roll up your sleeves, we'd be more than happy to see it ported or reimplemented in TomEE. or Tomcat :) Even better! -David - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1514447 - in /tomcat/trunk/java/org/apache/tomcat/websocket/server: UpgradeUtil.java WsFilter.java WsServerContainer.java
Author: markt Date: Thu Aug 15 19:19:59 2013 New Revision: 1514447 URL: http://svn.apache.org/r1514447 Log: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=55314 Provide a container specific extension to the WsServerContainer to allow frameworks to more easily diaptch requests to WebSocket endpoints. Added: tomcat/trunk/java/org/apache/tomcat/websocket/server/UpgradeUtil.java (with props) Modified: tomcat/trunk/java/org/apache/tomcat/websocket/server/WsFilter.java tomcat/trunk/java/org/apache/tomcat/websocket/server/WsServerContainer.java Added: tomcat/trunk/java/org/apache/tomcat/websocket/server/UpgradeUtil.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/server/UpgradeUtil.java?rev=1514447view=auto == --- tomcat/trunk/java/org/apache/tomcat/websocket/server/UpgradeUtil.java (added) +++ tomcat/trunk/java/org/apache/tomcat/websocket/server/UpgradeUtil.java Thu Aug 15 19:19:59 2013 @@ -0,0 +1,236 @@ +/* + * 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.websocket.server; + +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Enumeration; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Queue; +import java.util.concurrent.ConcurrentLinkedQueue; + +import javax.servlet.ServletException; +import javax.servlet.ServletRequest; +import javax.servlet.ServletResponse; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.websocket.Endpoint; +import javax.websocket.Extension; +import javax.websocket.HandshakeResponse; +import javax.websocket.server.ServerEndpointConfig; + +import org.apache.tomcat.util.codec.binary.Base64; +import org.apache.tomcat.websocket.Constants; +import org.apache.tomcat.websocket.WsHandshakeResponse; +import org.apache.tomcat.websocket.pojo.PojoEndpointServer; + +public class UpgradeUtil { + +private static final byte[] WS_ACCEPT = +258EAFA5-E914-47DA-95CA-C5AB0DC85B11.getBytes( +StandardCharsets.ISO_8859_1); +private static final QueueMessageDigest sha1Helpers = +new ConcurrentLinkedQueue(); + +private UpgradeUtil() { +// Utility class. Hide default constructor. +} + +/** + * Checks to see if this is an HTTP request that includes a valid upgrade + * request to web socket. + * p + * Note: RFC 2616 does not limit HTTP upgrade to GET requests but the Java + * WebSocket spec 1.0, section 8.2 implies such a limitation and RFC + * 6455 section 4.1 requires that a WebSocket Upgrade uses GET. + */ +public static boolean isWebSocketUpgrageRequest(ServletRequest request, +ServletResponse response) { + +return ((request instanceof HttpServletRequest) +(response instanceof HttpServletResponse) +headerContainsToken((HttpServletRequest) request, +Constants.UPGRADE_HEADER_NAME, +Constants.UPGRADE_HEADER_VALUE) +GET.equals(((HttpServletRequest) request).getMethod())); +} + + +public static void doUpgrade(WsServerContainer sc, HttpServletRequest req, +HttpServletResponse resp, ServerEndpointConfig sec, +MapString,String pathParams) +throws ServletException, IOException { + +// Validate the rest of the headers and reject the request if that +// validation fails +String key; +String subProtocol = null; +ListExtension extensions = Collections.emptyList(); +if (!headerContainsToken(req, Constants.CONNECTION_HEADER_NAME, +Constants.CONNECTION_HEADER_VALUE)) { +resp.sendError(HttpServletResponse.SC_BAD_REQUEST); +return; +} +if (!headerContainsToken(req, Constants.WS_VERSION_HEADER_NAME, +
[Bug 55314] Provide option to allow programmatic deployment of server (WebSocket) endpoint at runtime
https://issues.apache.org/bugzilla/show_bug.cgi?id=55314 Mark Thomas ma...@apache.org changed: What|Removed |Added Status|REOPENED|RESOLVED Resolution|--- |FIXED --- Comment #9 from Mark Thomas ma...@apache.org --- I've implemented the method in comment #7 Feel free to re-open if this doesn't meet the requirement. -- 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
[Bug 55399] Request English but Response Spanish Language (Default Locale)
https://issues.apache.org/bugzilla/show_bug.cgi?id=55399 --- Comment #6 from Mark Thomas ma...@apache.org --- The error pages were simple to fix but fixing the HTTP response status line is going to be more invasive. That part may end up being Tomcat 8 only because of the internal changes required. -- 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
Re: Code style rules: Line length
On 14.08.2013 12:41, Mark Thomas wrote: Summarising the response to this thread so far: There is a preference for not strictly enforcing whatever limit is selected. Rules need exceptions and committers can exercise judgement. It does create a grey area but the majority is OK with that. There is a mix of views on line length but there appears to be support for increasing the max line length for code and marginally less support for increasing the max line length for comments. Therefore, I'd like to propose the following: 1. Introduce a checkstyle enforced hard limit of 200 characters per line and fix any lines that exceed it. There are currently 24 lines that exceed this limit. 2. Increase acceptable line length for new / modified code and comments to 100. No mass reformatting would take place. 3. Consider further reducing the hard limit to 100 + suitable margin over time, possibly in stages. For example, reducing it to 120 identifies 737 lines (quite a few files have multiple long lines so the number of files affected it a lot less than 737). Thoughts? I'm inclined to fix the lines identified by 1 regardless. 200+ characters per line is far too wide. Here's my late +1. Thanks. Rainer - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1514454 - /tomcat/trunk/java/org/apache/tomcat/websocket/server/WsFilter.java
Author: markt Date: Thu Aug 15 19:32:09 2013 New Revision: 1514454 URL: http://svn.apache.org/r1514454 Log: Follow-up to r1514447. Need to invert the test after the refactoring. Modified: tomcat/trunk/java/org/apache/tomcat/websocket/server/WsFilter.java Modified: tomcat/trunk/java/org/apache/tomcat/websocket/server/WsFilter.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/server/WsFilter.java?rev=1514454r1=1514453r2=1514454view=diff == --- tomcat/trunk/java/org/apache/tomcat/websocket/server/WsFilter.java (original) +++ tomcat/trunk/java/org/apache/tomcat/websocket/server/WsFilter.java Thu Aug 15 19:32:09 2013 @@ -47,7 +47,7 @@ public class WsFilter implements Filter FilterChain chain) throws IOException, ServletException { // This filter only needs to handle WebSocket upgrade requests -if (UpgradeUtil.isWebSocketUpgrageRequest(request, response)) { +if (!UpgradeUtil.isWebSocketUpgrageRequest(request, response)) { chain.doFilter(request, response); return; } - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1514455 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/catalina/session/FileStore.java java/org/apache/catalina/session/JDBCStore.java webapps/docs/changelog.xml
Author: violetagg Date: Thu Aug 15 19:37:45 2013 New Revision: 1514455 URL: http://svn.apache.org/r1514455 Log: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=55357 Merged revision 1514281 from tomcat/trunk: Set the web app classloader as a context classloader before reading the object data. Modified: tomcat/tc7.0.x/trunk/ (props changed) tomcat/tc7.0.x/trunk/java/org/apache/catalina/session/FileStore.java tomcat/tc7.0.x/trunk/java/org/apache/catalina/session/JDBCStore.java tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Propchange: tomcat/tc7.0.x/trunk/ -- Merged /tomcat/trunk:r1514281 Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/session/FileStore.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/session/FileStore.java?rev=1514455r1=1514454r2=1514455view=diff == --- tomcat/tc7.0.x/trunk/java/org/apache/catalina/session/FileStore.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/session/FileStore.java Thu Aug 15 19:37:45 2013 @@ -266,6 +266,7 @@ public final class FileStore extends Sto ObjectInputStream ois = null; Loader loader = null; ClassLoader classLoader = null; +ClassLoader oldThreadContextCL = Thread.currentThread().getContextClassLoader(); try { fis = new FileInputStream(file.getAbsolutePath()); bis = new BufferedInputStream(fis); @@ -274,10 +275,18 @@ public final class FileStore extends Sto loader = container.getLoader(); if (loader != null) classLoader = loader.getClassLoader(); -if (classLoader != null) +if (classLoader != null) { +Thread.currentThread().setContextClassLoader(classLoader); ois = new CustomObjectInputStream(bis, classLoader); -else +} else { ois = new ObjectInputStream(bis); +} + +StandardSession session = +(StandardSession) manager.createEmptySession(); +session.readObjectData(ois); +session.setManager(manager); +return (session); } catch (FileNotFoundException e) { if (manager.getContainer().getLogger().isDebugEnabled()) manager.getContainer().getLogger().debug(No persisted data file found); @@ -298,21 +307,16 @@ public final class FileStore extends Sto } } throw e; -} - -try { -StandardSession session = -(StandardSession) manager.createEmptySession(); -session.readObjectData(ois); -session.setManager(manager); -return (session); } finally { -// Close the input stream -try { -ois.close(); -} catch (IOException f) { -// Ignore +if (ois != null) { +// Close the input stream +try { +ois.close(); +} catch (IOException f) { +// Ignore +} } +Thread.currentThread().setContextClassLoader(oldThreadContextCL); } } Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/session/JDBCStore.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/session/JDBCStore.java?rev=1514455r1=1514454r2=1514455view=diff == --- tomcat/tc7.0.x/trunk/java/org/apache/catalina/session/JDBCStore.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/session/JDBCStore.java Thu Aug 15 19:37:45 2013 @@ -620,6 +620,7 @@ public class JDBCStore extends StoreBase return (null); } +ClassLoader oldThreadContextCL = Thread.currentThread().getContextClassLoader(); try { if (preparedLoadSql == null) { String loadSql = SELECT + sessionIdCol + , @@ -642,6 +643,7 @@ public class JDBCStore extends StoreBase classLoader = loader.getClassLoader(); } if (classLoader != null) { + Thread.currentThread().setContextClassLoader(classLoader); ois = new CustomObjectInputStream(bis, classLoader); } else { @@ -680,6 +682,7 @@ public class JDBCStore extends StoreBase // Ignore } } + Thread.currentThread().setContextClassLoader(oldThreadContextCL); release(_conn);
[Bug 55357] Cannot deserialize session when it contains Externalizable objects (using PersistentManager)
https://issues.apache.org/bugzilla/show_bug.cgi?id=55357 Violeta Georgieva violet...@apache.org changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |FIXED --- Comment #2 from Violeta Georgieva violet...@apache.org --- Thanks for the report. Fixed in trunk and 7.0.x and will be included in 7.0.43 onwards. -- 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
buildbot failure in ASF Buildbot on tomcat-trunk
The Buildbot has detected a new failure on builder tomcat-trunk while building ASF Buildbot. Full details are available at: http://ci.apache.org/builders/tomcat-trunk/builds/4836 Buildbot URL: http://ci.apache.org/ Buildslave for this Build: bb-vm_ubuntu Build Reason: scheduler Build Source Stamp: [branch tomcat/trunk] 1514447 Blamelist: markt BUILD FAILED: failed compile_1 sincerely, -The Buildbot
svn commit: r1514470 - /tomcat/trunk/java/org/apache/catalina/realm/JNDIRealm.java
Author: violetagg Date: Thu Aug 15 20:31:48 2013 New Revision: 1514470 URL: http://svn.apache.org/r1514470 Log: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=55354 Restore the context environment parameters after associating the Principle with the given user. Based on patch provided by Richard Begg. Modified: tomcat/trunk/java/org/apache/catalina/realm/JNDIRealm.java Modified: tomcat/trunk/java/org/apache/catalina/realm/JNDIRealm.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/realm/JNDIRealm.java?rev=1514470r1=1514469r2=1514470view=diff == --- tomcat/trunk/java/org/apache/catalina/realm/JNDIRealm.java (original) +++ tomcat/trunk/java/org/apache/catalina/realm/JNDIRealm.java Thu Aug 15 20:31:48 2013 @@ -2050,9 +2050,12 @@ public class JNDIRealm extends RealmBase User user = null; ListString roles = null; +Hashtable?, ? preservedEnvironment = null; try { if (gssCredential != null isUseDelegatedCredential()) { +// Preserve the current context environment parameters +preservedEnvironment = context.getEnvironment(); // Set up context context.addToEnvironment( Context.SECURITY_AUTHENTICATION, GSSAPI); @@ -2068,24 +2071,12 @@ public class JNDIRealm extends RealmBase roles = getRoles(context, user); } } finally { -try { -context.removeFromEnvironment( -Context.SECURITY_AUTHENTICATION); -} catch (NamingException e) { -// Ignore -} -try { -context.removeFromEnvironment( -javax.security.sasl.server.authentication); -} catch (NamingException e) { -// Ignore -} -try { -context.removeFromEnvironment( -javax.security.sasl.qop); -} catch (NamingException e) { -// Ignore -} +restoreEnvironmentParameter(context, +Context.SECURITY_AUTHENTICATION, preservedEnvironment); +restoreEnvironmentParameter(context, +javax.security.sasl.server.authentication, preservedEnvironment); +restoreEnvironmentParameter(context, javax.security.sasl.qop, +preservedEnvironment); } if (user != null) { @@ -2096,6 +2087,19 @@ public class JNDIRealm extends RealmBase return null; } +private void restoreEnvironmentParameter(DirContext context, +String parameterName, Hashtable?, ? preservedEnvironment) { +try { +context.removeFromEnvironment(parameterName); +if (preservedEnvironment != null preservedEnvironment.containsKey(parameterName)) { +context.addToEnvironment(parameterName, +preservedEnvironment.get(parameterName)); +} +} catch (NamingException e) { +// Ignore +} +} + /** * Open (if necessary) and return a connection to the configured * directory server for this Realm. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1514485 - in /tomcat/trunk/java/org/apache: coyote/ajp/AbstractAjpProcessor.java coyote/http11/AbstractOutputBuffer.java coyote/spdy/SpdyProcessor.java tomcat/util/http/HttpMessages.java
Author: markt Date: Thu Aug 15 20:51:38 2013 New Revision: 1514485 URL: http://svn.apache.org/r1514485 Log: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=55399 Have the message in the response line use the locale set for the response. Modified: tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProcessor.java tomcat/trunk/java/org/apache/coyote/http11/AbstractOutputBuffer.java tomcat/trunk/java/org/apache/coyote/spdy/SpdyProcessor.java tomcat/trunk/java/org/apache/tomcat/util/http/HttpMessages.java Modified: tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProcessor.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProcessor.java?rev=1514485r1=1514484r2=1514485view=diff == --- tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProcessor.java (original) +++ tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProcessor.java Thu Aug 15 20:51:38 2013 @@ -947,7 +947,8 @@ public abstract class AbstractAjpProcess message = response.getMessage(); } if (message == null){ -message = HttpMessages.getMessage(response.getStatus()); +message = HttpMessages.getInstance( +response.getLocale()).getMessage(response.getStatus()); } if (message == null) { // mod_jk + httpd 2.x fails with a null status message - bug 45026 Modified: tomcat/trunk/java/org/apache/coyote/http11/AbstractOutputBuffer.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/AbstractOutputBuffer.java?rev=1514485r1=1514484r2=1514485view=diff == --- tomcat/trunk/java/org/apache/coyote/http11/AbstractOutputBuffer.java (original) +++ tomcat/trunk/java/org/apache/coyote/http11/AbstractOutputBuffer.java Thu Aug 15 20:51:38 2013 @@ -133,7 +133,7 @@ public abstract class AbstractOutputBuff finished = false; // Cause loading of HttpMessages -HttpMessages.getMessage(200); +HttpMessages.getInstance(response.getLocale()).getMessage(200); } @@ -427,7 +427,8 @@ public abstract class AbstractOutputBuff message = response.getMessage(); } if (message == null) { -write(HttpMessages.getMessage(status)); +write(HttpMessages.getInstance( +response.getLocale()).getMessage(status)); } else { write(message); } Modified: tomcat/trunk/java/org/apache/coyote/spdy/SpdyProcessor.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/spdy/SpdyProcessor.java?rev=1514485r1=1514484r2=1514485view=diff == --- tomcat/trunk/java/org/apache/coyote/spdy/SpdyProcessor.java (original) +++ tomcat/trunk/java/org/apache/coyote/spdy/SpdyProcessor.java Thu Aug 15 20:51:38 2013 @@ -440,7 +440,8 @@ public class SpdyProcessor extends Abstr message = response.getMessage(); } if (message == null) { -message = HttpMessages.getMessage(response.getStatus()); +message = HttpMessages.getInstance( +response.getLocale()).getMessage(response.getStatus()); } if (message == null) { // mod_jk + httpd 2.x fails with a null status message - bug Modified: tomcat/trunk/java/org/apache/tomcat/util/http/HttpMessages.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/HttpMessages.java?rev=1514485r1=1514484r2=1514485view=diff == --- tomcat/trunk/java/org/apache/tomcat/util/http/HttpMessages.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/http/HttpMessages.java Thu Aug 15 20:51:38 2013 @@ -16,6 +16,10 @@ */ package org.apache.tomcat.util.http; +import java.util.Locale; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + import org.apache.tomcat.util.res.StringManager; /** @@ -28,14 +32,24 @@ import org.apache.tomcat.util.res.String * @author cos...@eng.sun.com */ public class HttpMessages { + +private static final MapLocale,HttpMessages instances = +new ConcurrentHashMap(); + +private static final HttpMessages DEFAULT = getInstance(Locale.getDefault()); + // XXX move message resources in this package -private static final StringManager sm = -StringManager.getManager(org.apache.tomcat.util.http.res); +private final StringManager sm; + +private String st_200 = null; +private String st_302 = null; +private String st_400 = null; +private String st_404 = null; + +private HttpMessages(StringManager sm) { +this.sm = sm; +} -private static String
svn commit: r1514486 - /tomcat/trunk/java/org/apache/catalina/valves/ErrorReportValve.java
Author: markt Date: Thu Aug 15 20:52:13 2013 New Revision: 1514486 URL: http://svn.apache.org/r1514486 Log: Have error page status message language consistent with content. Modified: tomcat/trunk/java/org/apache/catalina/valves/ErrorReportValve.java Modified: tomcat/trunk/java/org/apache/catalina/valves/ErrorReportValve.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/valves/ErrorReportValve.java?rev=1514486r1=1514485r2=1514486view=diff == --- tomcat/trunk/java/org/apache/catalina/valves/ErrorReportValve.java (original) +++ tomcat/trunk/java/org/apache/catalina/valves/ErrorReportValve.java Thu Aug 15 20:52:13 2013 @@ -161,6 +161,7 @@ public class ErrorReportValve extends Va String report = null; StringManager smClient = StringManager.getManager( Constants.Package, request.getLocales()); +response.setLocale(smClient.getLocale()); try { report = smClient.getString(http. + statusCode); } catch (Throwable t) { - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1514496 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/catalina/manager/ java/org/apache/catalina/manager/host/ java/org/apache/catalina/valves/ java/org/apache/coyote/ajp/ java/org/apach
Author: markt Date: Thu Aug 15 21:11:58 2013 New Revision: 1514496 URL: http://svn.apache.org/r1514496 Log: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=55399 Have the message in the response line use the locale set for the response. Modified: tomcat/tc7.0.x/trunk/ (props changed) tomcat/tc7.0.x/trunk/java/org/apache/catalina/manager/HTMLManagerServlet.java tomcat/tc7.0.x/trunk/java/org/apache/catalina/manager/ManagerServlet.java tomcat/tc7.0.x/trunk/java/org/apache/catalina/manager/host/HTMLHostManagerServlet.java tomcat/tc7.0.x/trunk/java/org/apache/catalina/manager/host/HostManagerServlet.java tomcat/tc7.0.x/trunk/java/org/apache/catalina/valves/ErrorReportValve.java tomcat/tc7.0.x/trunk/java/org/apache/coyote/ajp/AbstractAjpProcessor.java tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/AbstractOutputBuffer.java tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/InternalAprOutputBuffer.java tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/InternalNioOutputBuffer.java tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/HttpMessages.java tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/res/StringManager.java tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Propchange: tomcat/tc7.0.x/trunk/ -- Merged /tomcat/trunk:r1514291,1514305,1514485-1514486 Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/manager/HTMLManagerServlet.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/manager/HTMLManagerServlet.java?rev=1514496r1=1514495r2=1514496view=diff == --- tomcat/tc7.0.x/trunk/java/org/apache/catalina/manager/HTMLManagerServlet.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/manager/HTMLManagerServlet.java Thu Aug 15 21:11:58 2013 @@ -116,7 +116,8 @@ public final class HTMLManagerServlet ex HttpServletResponse response) throws IOException, ServletException { -StringManager smClient = getStringManager(request); +StringManager smClient = StringManager.getManager( +Constants.Package, request.getLocales()); // Identify the request parameters that we need // By obtaining the command from the pathInfo, per-command security can @@ -175,7 +176,8 @@ public final class HTMLManagerServlet ex HttpServletResponse response) throws IOException, ServletException { -StringManager smClient = getStringManager(request); +StringManager smClient = StringManager.getManager( +Constants.Package, request.getLocales()); // Identify the request parameters that we need // By obtaining the command from the pathInfo, per-command security can Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/manager/ManagerServlet.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/manager/ManagerServlet.java?rev=1514496r1=1514495r2=1514496view=diff == --- tomcat/tc7.0.x/trunk/java/org/apache/catalina/manager/ManagerServlet.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/manager/ManagerServlet.java Thu Aug 15 21:11:58 2013 @@ -319,7 +319,8 @@ public class ManagerServlet extends Http HttpServletResponse response) throws IOException, ServletException { -StringManager smClient = getStringManager(request); +StringManager smClient = StringManager.getManager( +Constants.Package, request.getLocales()); // Identify the request parameters that we need String command = request.getPathInfo(); @@ -406,7 +407,8 @@ public class ManagerServlet extends Http HttpServletResponse response) throws IOException, ServletException { -StringManager smClient = getStringManager(request); +StringManager smClient = StringManager.getManager( +Constants.Package, request.getLocales()); // Identify the request parameters that we need String command = request.getPathInfo(); @@ -1575,6 +1577,11 @@ public class ManagerServlet extends Http } +/** + * @deprecated Use {@link StringManager#getManager(String, Enumeration)}. + * This method will be removed in Tomcat 8. + */ +@Deprecated protected StringManager getStringManager(HttpServletRequest req) { EnumerationLocale requestedLocales = req.getLocales(); while (requestedLocales.hasMoreElements()) { Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/manager/host/HTMLHostManagerServlet.java URL:
[Bug 55399] Request English but Response Spanish Language (Default Locale)
https://issues.apache.org/bugzilla/show_bug.cgi?id=55399 Mark Thomas ma...@apache.org changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |FIXED --- Comment #7 from Mark Thomas ma...@apache.org --- This has been fixed in trunk and 7.0.x and will be included in 7.0.43 onwards. Error pages now use the Accept-Language header. All responses use the Locale set on the response. I considered parsing the Accept-Language header on every request and using that to set the locale on every response but decided not to on performance grounds (no hard numbers on this so if someone shows the performance impact is negligible then it could get added). Users that want this can easily write a filter to do so. -- 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: r1514505 - in /tomcat/tc7.0.x/trunk: ./ java/javax/websocket/ java/javax/websocket/DefaultClientConfiguration.java java/javax/websocket/DefaultServerConfiguration.java res/checkstyle/javax
Author: markt Date: Thu Aug 15 21:31:50 2013 New Revision: 1514505 URL: http://svn.apache.org/r1514505 Log: Start to back-port JSR-356 implementation to 7.0.x Added: tomcat/tc7.0.x/trunk/java/javax/websocket/ - copied from r1412268, tomcat/trunk/java/javax/websocket/ Modified: tomcat/tc7.0.x/trunk/ (props changed) tomcat/tc7.0.x/trunk/java/javax/websocket/DefaultClientConfiguration.java tomcat/tc7.0.x/trunk/java/javax/websocket/DefaultServerConfiguration.java tomcat/tc7.0.x/trunk/res/checkstyle/javax-import-control.xml Propchange: tomcat/tc7.0.x/trunk/ -- Merged /tomcat/trunk:r1412268 Modified: tomcat/tc7.0.x/trunk/java/javax/websocket/DefaultClientConfiguration.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/javax/websocket/DefaultClientConfiguration.java?rev=1514505r1=1412268r2=1514505view=diff == --- tomcat/tc7.0.x/trunk/java/javax/websocket/DefaultClientConfiguration.java (original) +++ tomcat/tc7.0.x/trunk/java/javax/websocket/DefaultClientConfiguration.java Thu Aug 15 21:31:50 2013 @@ -20,10 +20,10 @@ import java.util.ArrayList; import java.util.List; public class DefaultClientConfiguration implements ClientEndpointConfiguration { -private ListString preferredSubprotocols = new ArrayList(); -private ListString extensions = new ArrayList(); -private ListEncoder encoders = new ArrayList(); -private ListDecoder decoders = new ArrayList(); +private ListString preferredSubprotocols = new ArrayListString(); +private ListString extensions = new ArrayListString(); +private ListEncoder encoders = new ArrayListEncoder(); +private ListDecoder decoders = new ArrayListDecoder(); @Override public ListString getPreferredSubprotocols() { Modified: tomcat/tc7.0.x/trunk/java/javax/websocket/DefaultServerConfiguration.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/javax/websocket/DefaultServerConfiguration.java?rev=1514505r1=1412268r2=1514505view=diff == --- tomcat/tc7.0.x/trunk/java/javax/websocket/DefaultServerConfiguration.java (original) +++ tomcat/tc7.0.x/trunk/java/javax/websocket/DefaultServerConfiguration.java Thu Aug 15 21:31:50 2013 @@ -23,11 +23,11 @@ import java.util.List; public class DefaultServerConfiguration implements ServerEndpointConfiguration { private String path; @SuppressWarnings(unused) // TODO Remove this once implemented -private ListString subprotocols = new ArrayList(); +private ListString subprotocols = new ArrayListString(); @SuppressWarnings(unused) // TODO Remove this once implemented -private ListString extensions = new ArrayList(); -private ListEncoder encoders = new ArrayList(); -private ListDecoder decoders = new ArrayList(); +private ListString extensions = new ArrayListString(); +private ListEncoder encoders = new ArrayListEncoder(); +private ListDecoder decoders = new ArrayListDecoder(); protected DefaultServerConfiguration() { } Modified: tomcat/tc7.0.x/trunk/res/checkstyle/javax-import-control.xml URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/res/checkstyle/javax-import-control.xml?rev=1514505r1=1514504r2=1514505view=diff == --- tomcat/tc7.0.x/trunk/res/checkstyle/javax-import-control.xml (original) +++ tomcat/tc7.0.x/trunk/res/checkstyle/javax-import-control.xml Thu Aug 15 21:31:50 2013 @@ -33,6 +33,10 @@ subpackage name=mail allow pkg=javax.mail/ /subpackage + subpackage name=websocket +allow pkg=javax.websocket/ +allow pkg=javax.websocket.extensions/ + /subpackage subpackage name=persistence allow pkg=javax.persistence/ /subpackage - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Fwd: svn commit: r1514505 - in /tomcat/tc7.0.x/trunk: ./ java/javax/websocket/ java/javax/websocket/DefaultClientConfiguration.java java/javax/websocket/DefaultServerConfiguration.java res/checkstyle/
Hi how will it be backported? i ask because in tomee we can't provide it out of the box since we need to be certified against JavaEE 6 Web Profile which doesn't contain it (that's why we have several distribution and not only the plus one). If it is backported in tomcat without a spi or another pluggable solution we will not be able to update tomcat versions then :( *Romain Manni-Bucau* *Twitter: @rmannibucau https://twitter.com/rmannibucau* *Blog: **http://rmannibucau.wordpress.com/*http://rmannibucau.wordpress.com/ *LinkedIn: **http://fr.linkedin.com/in/rmannibucau* *Github: https://github.com/rmannibucau* -- Forwarded message -- From: ma...@apache.org Date: 2013/8/15 Subject: svn commit: r1514505 - in /tomcat/tc7.0.x/trunk: ./ java/javax/websocket/ java/javax/websocket/DefaultClientConfiguration.java java/javax/websocket/DefaultServerConfiguration.java res/checkstyle/javax-import-control.xml To: dev@tomcat.apache.org Author: markt Date: Thu Aug 15 21:31:50 2013 New Revision: 1514505 URL: http://svn.apache.org/r1514505 Log: Start to back-port JSR-356 implementation to 7.0.x Added: tomcat/tc7.0.x/trunk/java/javax/websocket/ - copied from r1412268, tomcat/trunk/java/javax/websocket/ Modified: tomcat/tc7.0.x/trunk/ (props changed) tomcat/tc7.0.x/trunk/java/javax/websocket/DefaultClientConfiguration.java tomcat/tc7.0.x/trunk/java/javax/websocket/DefaultServerConfiguration.java tomcat/tc7.0.x/trunk/res/checkstyle/javax-import-control.xml Propchange: tomcat/tc7.0.x/trunk/ -- Merged /tomcat/trunk:r1412268 Modified: tomcat/tc7.0.x/trunk/java/javax/websocket/DefaultClientConfiguration.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/javax/websocket/DefaultClientConfiguration.java?rev=1514505r1=1412268r2=1514505view=diff == --- tomcat/tc7.0.x/trunk/java/javax/websocket/DefaultClientConfiguration.java (original) +++ tomcat/tc7.0.x/trunk/java/javax/websocket/DefaultClientConfiguration.java Thu Aug 15 21:31:50 2013 @@ -20,10 +20,10 @@ import java.util.ArrayList; import java.util.List; public class DefaultClientConfiguration implements ClientEndpointConfiguration { -private ListString preferredSubprotocols = new ArrayList(); -private ListString extensions = new ArrayList(); -private ListEncoder encoders = new ArrayList(); -private ListDecoder decoders = new ArrayList(); +private ListString preferredSubprotocols = new ArrayListString(); +private ListString extensions = new ArrayListString(); +private ListEncoder encoders = new ArrayListEncoder(); +private ListDecoder decoders = new ArrayListDecoder(); @Override public ListString getPreferredSubprotocols() { Modified: tomcat/tc7.0.x/trunk/java/javax/websocket/DefaultServerConfiguration.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/javax/websocket/DefaultServerConfiguration.java?rev=1514505r1=1412268r2=1514505view=diff == --- tomcat/tc7.0.x/trunk/java/javax/websocket/DefaultServerConfiguration.java (original) +++ tomcat/tc7.0.x/trunk/java/javax/websocket/DefaultServerConfiguration.java Thu Aug 15 21:31:50 2013 @@ -23,11 +23,11 @@ import java.util.List; public class DefaultServerConfiguration implements ServerEndpointConfiguration { private String path; @SuppressWarnings(unused) // TODO Remove this once implemented -private ListString subprotocols = new ArrayList(); +private ListString subprotocols = new ArrayListString(); @SuppressWarnings(unused) // TODO Remove this once implemented -private ListString extensions = new ArrayList(); -private ListEncoder encoders = new ArrayList(); -private ListDecoder decoders = new ArrayList(); +private ListString extensions = new ArrayListString(); +private ListEncoder encoders = new ArrayListEncoder(); +private ListDecoder decoders = new ArrayListDecoder(); protected DefaultServerConfiguration() { } Modified: tomcat/tc7.0.x/trunk/res/checkstyle/javax-import-control.xml URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/res/checkstyle/javax-import-control.xml?rev=1514505r1=1514504r2=1514505view=diff == --- tomcat/tc7.0.x/trunk/res/checkstyle/javax-import-control.xml (original) +++ tomcat/tc7.0.x/trunk/res/checkstyle/javax-import-control.xml Thu Aug 15 21:31:50 2013 @@ -33,6 +33,10 @@ subpackage name=mail allow pkg=javax.mail/ /subpackage + subpackage name=websocket +allow pkg=javax.websocket/ +allow pkg=javax.websocket.extensions/ + /subpackage subpackage name=persistence allow pkg=javax.persistence/ /subpackage - To unsubscribe, e-mail:
svn commit: r1514510 - in /tomcat/tc7.0.x/trunk: ./ java/javax/websocket/ res/checkstyle/javax-import-control.xml
Author: markt Date: Thu Aug 15 21:46:11 2013 New Revision: 1514510 URL: http://svn.apache.org/r1514510 Log: Revert 1514505. On reflection, an svn copy is a better way to do this as it makes the history easier to read. Removed: tomcat/tc7.0.x/trunk/java/javax/websocket/ Modified: tomcat/tc7.0.x/trunk/ (props changed) tomcat/tc7.0.x/trunk/res/checkstyle/javax-import-control.xml Propchange: tomcat/tc7.0.x/trunk/ -- Reverse-merged /tomcat/trunk:r1412268 Modified: tomcat/tc7.0.x/trunk/res/checkstyle/javax-import-control.xml URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/res/checkstyle/javax-import-control.xml?rev=1514510r1=1514509r2=1514510view=diff == --- tomcat/tc7.0.x/trunk/res/checkstyle/javax-import-control.xml (original) +++ tomcat/tc7.0.x/trunk/res/checkstyle/javax-import-control.xml Thu Aug 15 21:46:11 2013 @@ -33,10 +33,6 @@ subpackage name=mail allow pkg=javax.mail/ /subpackage - subpackage name=websocket -allow pkg=javax.websocket/ -allow pkg=javax.websocket.extensions/ - /subpackage subpackage name=persistence allow pkg=javax.persistence/ /subpackage - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Re: Fwd: svn commit: r1514505 - in /tomcat/tc7.0.x/trunk: ./ java/javax/websocket/ java/javax/websocket/DefaultClientConfiguration.java java/javax/websocket/DefaultServerConfiguration.java res/checkst
On 15/08/2013 22:34, Romain Manni-Bucau wrote: Hi how will it be backported? It will be a straight copy from trunk with the minimal modifications necessary to get it to work including: - No Java 7 notation - No Servlet 3.1 APIs - Any updates to Tomcat's internals to make HTTP upgrade compatible. i ask because in tomee we can't provide it out of the box since we need to be certified against JavaEE 6 Web Profile which doesn't contain it (that's why we have several distribution and not only the plus one). If it is backported in tomcat without a spi or another pluggable solution we will not be able to update tomcat versions then :( The JSR-356 implementation is already pluggable. If you don't want it, just remove the JARs. Mark - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1514511 - /tomcat/trunk/res/checkstyle/javax-import-control.xml
Author: markt Date: Thu Aug 15 21:58:39 2013 New Revision: 1514511 URL: http://svn.apache.org/r1514511 Log: Fix ordering. Remove deleted package. Modified: tomcat/trunk/res/checkstyle/javax-import-control.xml Modified: tomcat/trunk/res/checkstyle/javax-import-control.xml URL: http://svn.apache.org/viewvc/tomcat/trunk/res/checkstyle/javax-import-control.xml?rev=1514511r1=1514510r2=1514511view=diff == --- tomcat/trunk/res/checkstyle/javax-import-control.xml (original) +++ tomcat/trunk/res/checkstyle/javax-import-control.xml Thu Aug 15 21:58:39 2013 @@ -33,10 +33,6 @@ subpackage name=mail allow pkg=javax.mail/ /subpackage - subpackage name=websocket -allow pkg=javax.websocket/ -allow pkg=javax.websocket.extensions/ - /subpackage subpackage name=persistence allow pkg=javax.persistence/ /subpackage @@ -48,6 +44,9 @@ allow pkg=javax.servlet.jsp/ /subpackage /subpackage + subpackage name=websocket +allow pkg=javax.websocket/ + /subpackage subpackage name=xml.ws allow pkg=javax.xwl.ws/ /subpackage - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
buildbot success in ASF Buildbot on tomcat-trunk
The Buildbot has detected a restored build on builder tomcat-trunk while building ASF Buildbot. Full details are available at: http://ci.apache.org/builders/tomcat-trunk/builds/4838 Buildbot URL: http://ci.apache.org/ Buildslave for this Build: bb-vm_ubuntu Build Reason: scheduler Build Source Stamp: [branch tomcat/trunk] 1514486 Blamelist: markt,violetagg Build succeeded! sincerely, -The Buildbot - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Back-porting JSR-356 implementation to 7.0.x
This isn't going to be quite as simple as I first thought. The WebSocket client API requires Java SE 7 or later. The WebSocket server API requires Java EE 6 or later. Java EE 6 requires Java 6 or later. The WebSocket server API depends on the WebSocket client API. The WebSocket client implementation makes extensive use of new Java 7 non-blocking IO features. My conclusion from the above is that the back-port is going to require Java 7. That begs the question how to do that while keeping the main build Java 6 based. My (untested) plan is as follows: - Create a WebSocket module - Back-port (i.e. copy) the trunk code to that module - Build just that module with Java 7 - Make the minimum changes necessary to get it to work - Modify the back-ported SCI so it only adds the filter if Java 7 is detected (going to need to ensure the SCI is executable on Java 6) - Ship Tomcat 7 with the WebSocket JARs Comments? Mark - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1514522 - in /tomcat/tc7.0.x/trunk/modules/websocket: ./ java/ java/javax/ java/org/ java/org/apache/ java/org/apache/tomcat/ test/ test/org/ test/org/apache/ test/org/apache/tomcat/
Author: markt Date: Thu Aug 15 22:49:12 2013 New Revision: 1514522 URL: http://svn.apache.org/r1514522 Log: Add structure to receive WebSocket backport from trunk Added: tomcat/tc7.0.x/trunk/modules/websocket/ tomcat/tc7.0.x/trunk/modules/websocket/java/ tomcat/tc7.0.x/trunk/modules/websocket/java/javax/ tomcat/tc7.0.x/trunk/modules/websocket/java/org/ tomcat/tc7.0.x/trunk/modules/websocket/java/org/apache/ tomcat/tc7.0.x/trunk/modules/websocket/java/org/apache/tomcat/ tomcat/tc7.0.x/trunk/modules/websocket/test/ tomcat/tc7.0.x/trunk/modules/websocket/test/org/ tomcat/tc7.0.x/trunk/modules/websocket/test/org/apache/ tomcat/tc7.0.x/trunk/modules/websocket/test/org/apache/tomcat/ - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1514525 - in /tomcat/tc7.0.x/trunk/modules/websocket: java/javax/websocket/ java/org/apache/tomcat/websocket/ test/org/apache/tomcat/websocket/
Author: markt Date: Thu Aug 15 22:53:11 2013 New Revision: 1514525 URL: http://svn.apache.org/r1514525 Log: Copy JSR-356 WebSocket API and implementation from trunk into new Tomcat 7 module Added: tomcat/tc7.0.x/trunk/modules/websocket/java/javax/websocket/ - copied from r1514523, tomcat/trunk/java/javax/websocket/ tomcat/tc7.0.x/trunk/modules/websocket/java/org/apache/tomcat/websocket/ - copied from r1514523, tomcat/trunk/java/org/apache/tomcat/websocket/ tomcat/tc7.0.x/trunk/modules/websocket/test/org/apache/tomcat/websocket/ - copied from r1514523, tomcat/trunk/test/org/apache/tomcat/websocket/ - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1514533 - /tomcat/tc7.0.x/trunk/test/org/apache/tomcat/util/net/TesterSupport.java
Author: markt Date: Thu Aug 15 23:06:10 2013 New Revision: 1514533 URL: http://svn.apache.org/r1514533 Log: Make method public so WebSocket module can use it Modified: tomcat/tc7.0.x/trunk/test/org/apache/tomcat/util/net/TesterSupport.java Modified: tomcat/tc7.0.x/trunk/test/org/apache/tomcat/util/net/TesterSupport.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/test/org/apache/tomcat/util/net/TesterSupport.java?rev=1514533r1=1514532r2=1514533view=diff == --- tomcat/tc7.0.x/trunk/test/org/apache/tomcat/util/net/TesterSupport.java (original) +++ tomcat/tc7.0.x/trunk/test/org/apache/tomcat/util/net/TesterSupport.java Thu Aug 15 23:06:10 2013 @@ -77,7 +77,7 @@ public final class TesterSupport { RFC_5746_SUPPORTED = result; } -protected static void initSsl(Tomcat tomcat) { +public static void initSsl(Tomcat tomcat) { initSsl(tomcat, localhost.jks, null, null); } - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1514534 - /tomcat/tc7.0.x/trunk/modules/websocket/
Author: markt Date: Thu Aug 15 23:07:50 2013 New Revision: 1514534 URL: http://svn.apache.org/r1514534 Log: Ignore some Eclipse files Modified: tomcat/tc7.0.x/trunk/modules/websocket/ (props changed) Propchange: tomcat/tc7.0.x/trunk/modules/websocket/ -- --- svn:ignore (added) +++ svn:ignore Thu Aug 15 23:07:50 2013 @@ -0,0 +1,3 @@ +.classpath +.project +.settings - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[Bug 55383] Improve markup and design of Tomcat's HTML pages
https://issues.apache.org/bugzilla/show_bug.cgi?id=55383 --- Comment #5 from Konstantin Preißer prei...@web.de --- Created attachment 30735 -- https://issues.apache.org/bugzilla/attachment.cgi?id=30735action=edit Draft for improved HTML markup of Tomcat Docs Hi, as I did not receive negative comments, I tried to apply the new markup and style to the Tomcat Docs XSLT. :-) Attached is a patch that uses improved HTML markup and a new CSS stylesheet. Note that I did not work with XSL Transformation before, so I might have done strange things in the XSLT file - I would be glad if some XSLT expert could check that. ;-) While working in the XSLT file, I found some points on which I'm not clear (maybe someone can comment on these): 1) The xsl:stylesheet element specifies version=1.0; however, I found that there's already version 3.0 of the XSLT spec [1] (a working draft), so I modified the version attribute to 3.0. Is this OK? 2) Some issues regarding HTML output: a) HTML5 specifies for the HTML syntax a recommended doctype of !DOCTYPE html For HTML generators that cannot output such a short doctype, it provides a Doctype Legacy String [2] as follows: !DOCTYPE html SYSTEM about:legacy-compat However, using the doctype-system attribute on the xsl:output element, I seem only be able to produce the longer (legacy-compat) doctype, but not the short one. In XHTML however, a doctype is not needed as there is no quirks mode. b) It seems that when using method=html, the generated .html files always contain the following meta element: META http-equiv=Content-Type content=text/html; charset=UTF-8 so I couldn't use the shorter form: meta charset=UTF-8 c) It seems that the library that produces the HTML output does not have a current view of the HTML5 void elements (such as br, img etc). For example, if I specify wbr / in the XSLT, then the generated HTML output will be wbr/wbr, although it should be only wbr, since this is a void element (specifying html-version=5.0 on the xsl:output element did not change that). Note that for XHTML, the XSLT could simply generate wbr / for void elements, as well as div / for empty non-void elements, as the browser would use a XML parser. This would avoid the need for the XSLT processor to know which elements are void elements. I think it could be worth looking at switching to XHTML sometime. However, in this case IE users would have to use at least IE 9, as that is the first IE to support XHTML. With the modified XSLT, the Doc index.html now validates when using the W3X Non-DTD based validator at http://validator.w3.org/nu/ as opposed to the previous markup which raised about 63 errors and 10 warnings. What do you think about it? [1] http://www.w3.org/TR/xslt-30/ [2] http://www.w3.org/TR/html51/syntax.html#the-doctype -- 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: r1514535 - in /tomcat/tc7.0.x/trunk/modules/websocket/test/org/apache/tomcat/websocket: ./ pojo/ server/
Author: markt Date: Thu Aug 15 23:09:06 2013 New Revision: 1514535 URL: http://svn.apache.org/r1514535 Log: Start with the easy compilation fixes. Tomcat 7 hasn't refactored web.xml parsing so change ApplicationListener import to pre-refactoring location. Modified: tomcat/tc7.0.x/trunk/modules/websocket/test/org/apache/tomcat/websocket/TestWebSocketFrameClient.java tomcat/tc7.0.x/trunk/modules/websocket/test/org/apache/tomcat/websocket/TestWsPingPongMessages.java tomcat/tc7.0.x/trunk/modules/websocket/test/org/apache/tomcat/websocket/TestWsRemoteEndpoint.java tomcat/tc7.0.x/trunk/modules/websocket/test/org/apache/tomcat/websocket/TestWsSubprotocols.java tomcat/tc7.0.x/trunk/modules/websocket/test/org/apache/tomcat/websocket/TestWsWebSocketContainer.java tomcat/tc7.0.x/trunk/modules/websocket/test/org/apache/tomcat/websocket/pojo/TestEncodingDecoding.java tomcat/tc7.0.x/trunk/modules/websocket/test/org/apache/tomcat/websocket/pojo/TestPojoEndpointBase.java tomcat/tc7.0.x/trunk/modules/websocket/test/org/apache/tomcat/websocket/pojo/TestPojoMethodMapping.java tomcat/tc7.0.x/trunk/modules/websocket/test/org/apache/tomcat/websocket/server/TestWsServerContainer.java Modified: tomcat/tc7.0.x/trunk/modules/websocket/test/org/apache/tomcat/websocket/TestWebSocketFrameClient.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/modules/websocket/test/org/apache/tomcat/websocket/TestWebSocketFrameClient.java?rev=1514535r1=1514534r2=1514535view=diff == --- tomcat/tc7.0.x/trunk/modules/websocket/test/org/apache/tomcat/websocket/TestWebSocketFrameClient.java (original) +++ tomcat/tc7.0.x/trunk/modules/websocket/test/org/apache/tomcat/websocket/TestWebSocketFrameClient.java Thu Aug 15 23:09:06 2013 @@ -30,10 +30,10 @@ import org.junit.Assert; import org.junit.Test; import org.apache.catalina.Context; +import org.apache.catalina.deploy.ApplicationListener; import org.apache.catalina.servlets.DefaultServlet; import org.apache.catalina.startup.Tomcat; import org.apache.catalina.startup.TomcatBaseTest; -import org.apache.tomcat.util.descriptor.web.ApplicationListener; import org.apache.tomcat.util.net.TesterSupport; import org.apache.tomcat.websocket.TesterMessageCountClient.BasicText; import org.apache.tomcat.websocket.TesterMessageCountClient.TesterProgrammaticEndpoint; Modified: tomcat/tc7.0.x/trunk/modules/websocket/test/org/apache/tomcat/websocket/TestWsPingPongMessages.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/modules/websocket/test/org/apache/tomcat/websocket/TestWsPingPongMessages.java?rev=1514535r1=1514534r2=1514535view=diff == --- tomcat/tc7.0.x/trunk/modules/websocket/test/org/apache/tomcat/websocket/TestWsPingPongMessages.java (original) +++ tomcat/tc7.0.x/trunk/modules/websocket/test/org/apache/tomcat/websocket/TestWsPingPongMessages.java Thu Aug 15 23:09:06 2013 @@ -31,10 +31,10 @@ import org.junit.Assert; import org.junit.Test; import org.apache.catalina.Context; +import org.apache.catalina.deploy.ApplicationListener; import org.apache.catalina.servlets.DefaultServlet; import org.apache.catalina.startup.Tomcat; import org.apache.catalina.startup.TomcatBaseTest; -import org.apache.tomcat.util.descriptor.web.ApplicationListener; import org.apache.tomcat.websocket.TesterMessageCountClient.TesterEndpoint; import org.apache.tomcat.websocket.TesterMessageCountClient.TesterProgrammaticEndpoint; Modified: tomcat/tc7.0.x/trunk/modules/websocket/test/org/apache/tomcat/websocket/TestWsRemoteEndpoint.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/modules/websocket/test/org/apache/tomcat/websocket/TestWsRemoteEndpoint.java?rev=1514535r1=1514534r2=1514535view=diff == --- tomcat/tc7.0.x/trunk/modules/websocket/test/org/apache/tomcat/websocket/TestWsRemoteEndpoint.java (original) +++ tomcat/tc7.0.x/trunk/modules/websocket/test/org/apache/tomcat/websocket/TestWsRemoteEndpoint.java Thu Aug 15 23:09:06 2013 @@ -32,10 +32,10 @@ import org.junit.Assert; import org.junit.Test; import org.apache.catalina.Context; +import org.apache.catalina.deploy.ApplicationListener; import org.apache.catalina.servlets.DefaultServlet; import org.apache.catalina.startup.Tomcat; import org.apache.catalina.startup.TomcatBaseTest; -import org.apache.tomcat.util.descriptor.web.ApplicationListener; import org.apache.tomcat.websocket.TesterMessageCountClient.AsyncHandler; import org.apache.tomcat.websocket.TesterMessageCountClient.AsyncText; import org.apache.tomcat.websocket.TesterMessageCountClient.TesterAnnotatedEndpoint; Modified: tomcat/tc7.0.x/trunk/modules/websocket/test/org/apache/tomcat/websocket/TestWsSubprotocols.java URL:
buildbot failure in ASF Buildbot on tomcat-trunk
The Buildbot has detected a new failure on builder tomcat-trunk while building ASF Buildbot. Full details are available at: http://ci.apache.org/builders/tomcat-trunk/builds/4839 Buildbot URL: http://ci.apache.org/ Buildslave for this Build: bb-vm_ubuntu Build Reason: scheduler Build Source Stamp: [branch tomcat/trunk] 1514511 Blamelist: markt BUILD FAILED: failed compile_1 sincerely, -The Buildbot
Re: Code style rules: Line length
Mark, On 8/14/13 6:41 AM, Mark Thomas wrote: Summarising the response to this thread so far: There is a preference for not strictly enforcing whatever limit is selected. Rules need exceptions and committers can exercise judgement. It does create a grey area but the majority is OK with that. There is a mix of views on line length but there appears to be support for increasing the max line length for code and marginally less support for increasing the max line length for comments. Therefore, I'd like to propose the following: 1. Introduce a checkstyle enforced hard limit of 200 characters per line and fix any lines that exceed it. There are currently 24 lines that exceed this limit. 2. Increase acceptable line length for new / modified code and comments to 100. No mass reformatting would take place. 3. Consider further reducing the hard limit to 100 + suitable margin over time, possibly in stages. For example, reducing it to 120 identifies 737 lines (quite a few files have multiple long lines so the number of files affected it a lot less than 737). Thoughts? I'm inclined to fix the lines identified by 1 regardless. 200+ characters per line is far too wide. +1 -chris signature.asc Description: OpenPGP digital signature
Re: Back-porting JSR-356 implementation to 7.0.x
On Aug 15, 2013, at 5:47 PM, Mark Thomas wrote: This isn't going to be quite as simple as I first thought. The WebSocket client API requires Java SE 7 or later. The WebSocket server API requires Java EE 6 or later. Java EE 6 requires Java 6 or later. The WebSocket server API depends on the WebSocket client API. The WebSocket client implementation makes extensive use of new Java 7 non-blocking IO features. My conclusion from the above is that the back-port is going to require Java 7. That begs the question how to do that while keeping the main build Java 6 based. My (untested) plan is as follows: - Create a WebSocket module - Back-port (i.e. copy) the trunk code to that module - Build just that module with Java 7 - Make the minimum changes necessary to get it to work - Modify the back-ported SCI so it only adds the filter if Java 7 is detected (going to need to ensure the SCI is executable on Java 6) - Ship Tomcat 7 with the WebSocket JARs Comments? Sounds workable. Not ideal. But workable. Getting the SCI compiled to be executable shouldn't be a problem. Just compile the module -source 1.6 -target 1.6 on Java 7. As long as you don't use Java 7 language features, you can still compile against the APIs. Nick - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Re: Back-porting JSR-356 implementation to 7.0.x
Mark, On 8/15/13 6:47 PM, Mark Thomas wrote: This isn't going to be quite as simple as I first thought. The WebSocket client API requires Java SE 7 or later. The WebSocket server API requires Java EE 6 or later. Java EE 6 requires Java 6 or later. Clarification: are you saying that Java EE requires that it be allowed to run on JVMs as low as Java 6? The WebSocket server API depends on the WebSocket client API. The WebSocket client implementation makes extensive use of new Java 7 non-blocking IO features. Are any of these possible (albeit with some back-flips) with Java 6? Perhaps one class (Java7NioShims) could be replaced with another implementation (Java6NioShim) at runtime depending upon the current JVM? I know nothing about the code involved... just stabbing in the dark. My conclusion from the above is that the back-port is going to require Java 7. That begs the question how to do that while keeping the main build Java 6 based. My (untested) plan is as follows: - Create a WebSocket module - Back-port (i.e. copy) the trunk code to that module - Build just that module with Java 7 - Make the minimum changes necessary to get it to work - Modify the back-ported SCI so it only adds the filter if Java 7 is detected (going to need to ensure the SCI is executable on Java 6) - Ship Tomcat 7 with the WebSocket JARs I'm not sure there's a better way, but the whole compile-one-module-with-a-higher-version thing has been a small thorn in the past (IIRC, Tomcat 6 had to be built with Java 6, but could be run with Java 5) causing a mild amount of confusion. If this could be avoided, I think it might be best. Maybe we could package JSR-356-for-Tomcat7 as an optional module that has a Java 7 prerequisite? -chris signature.asc Description: OpenPGP digital signature
Re: Code style rules: Line length
2013/8/14 Mark Thomas wrote: Summarising the response to this thread so far: There is a preference for not strictly enforcing whatever limit is selected. Rules need exceptions and committers can exercise judgement. It does create a grey area but the majority is OK with that. There is a mix of views on line length but there appears to be support for increasing the max line length for code and marginally less support for increasing the max line length for comments. Therefore, I'd like to propose the following: 1. Introduce a checkstyle enforced hard limit of 200 characters per line and fix any lines that exceed it. There are currently 24 lines that exceed this limit. 2. Increase acceptable line length for new / modified code and comments to 100. No mass reformatting would take place. 3. Consider further reducing the hard limit to 100 + suitable margin over time, possibly in stages. For example, reducing it to 120 identifies 737 lines (quite a few files have multiple long lines so the number of files affected it a lot less than 737). Thoughts? +1 Regards Violeta
Re: Fwd: svn commit: r1514505 - in /tomcat/tc7.0.x/trunk: ./ java/javax/websocket/ java/javax/websocket/DefaultClientConfiguration.java java/javax/websocket/DefaultServerConfiguration.java res/checkst
Great, thanks Mark. Le 15 août 2013 23:56, Mark Thomas ma...@apache.org a écrit : On 15/08/2013 22:34, Romain Manni-Bucau wrote: Hi how will it be backported? It will be a straight copy from trunk with the minimal modifications necessary to get it to work including: - No Java 7 notation - No Servlet 3.1 APIs - Any updates to Tomcat's internals to make HTTP upgrade compatible. i ask because in tomee we can't provide it out of the box since we need to be certified against JavaEE 6 Web Profile which doesn't contain it (that's why we have several distribution and not only the plus one). If it is backported in tomcat without a spi or another pluggable solution we will not be able to update tomcat versions then :( The JSR-356 implementation is already pluggable. If you don't want it, just remove the JARs. Mark - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Re: Back-porting JSR-356 implementation to 7.0.x
On Fri, Aug 16, 2013 at 4:34 AM, Christopher Schultz ch...@christopherschultz.net wrote: Mark, On 8/15/13 6:47 PM, Mark Thomas wrote: This isn't going to be quite as simple as I first thought. The WebSocket client API requires Java SE 7 or later. The WebSocket server API requires Java EE 6 or later. Java EE 6 requires Java 6 or later. Clarification: are you saying that Java EE requires that it be allowed to run on JVMs as low as Java 6? The WebSocket server API depends on the WebSocket client API. The WebSocket client implementation makes extensive use of new Java 7 non-blocking IO features. Are any of these possible (albeit with some back-flips) with Java 6? Perhaps one class (Java7NioShims) could be replaced with another implementation (Java6NioShim) at runtime depending upon the current JVM? I know nothing about the code involved... just stabbing in the dark. My conclusion from the above is that the back-port is going to require Java 7. That begs the question how to do that while keeping the main build Java 6 based. My (untested) plan is as follows: - Create a WebSocket module - Back-port (i.e. copy) the trunk code to that module - Build just that module with Java 7 - Make the minimum changes necessary to get it to work - Modify the back-ported SCI so it only adds the filter if Java 7 is detected (going to need to ensure the SCI is executable on Java 6) - Ship Tomcat 7 with the WebSocket JARs I'm not sure there's a better way, but the whole compile-one-module-with-a-higher-version thing has been a small thorn in the past (IIRC, Tomcat 6 had to be built with Java 6, but could be run with Java 5) causing a mild amount of confusion. If this could be avoided, I think it might be best. Maybe we could package JSR-356-for-Tomcat7 as an optional module that has a Java 7 prerequisite? +1 for making it optional and Java 7 dependent in Tomcat 7 Keep it simple if possibble Java 7 is slowly adopted in productive environments anyway. One reason is EOL http://www.oracle.com/technetwork/java/eol-135779.html -chris
svn commit: r1514588 - in /tomcat/trunk: java/org/apache/tomcat/util/descriptor/tld/ test/org/apache/tomcat/util/descriptor/tld/ test/tld/
Author: jboynes Date: Fri Aug 16 05:55:40 2013 New Revision: 1514588 URL: http://svn.apache.org/r1514588 Log: Finish converting TLD parsing to using Digester. TldParser now handles all TLD content required by Jasper rather than the minimum needed for listener scanning. Added test TLD files outside the test webapps to test edge cases. Added: tomcat/trunk/test/tld/ tomcat/trunk/test/tld/listener.tld - copied unchanged from r1514130, tomcat/trunk/test/webapp-3.0/WEB-INF/listener.tld tomcat/trunk/test/tld/tags11.tld - copied unchanged from r1514130, tomcat/trunk/test/webapp-3.0/WEB-INF/tags11.tld tomcat/trunk/test/tld/tags12.tld - copied unchanged from r1514130, tomcat/trunk/test/webapp-3.0/WEB-INF/tags12.tld tomcat/trunk/test/tld/tags20.tld - copied unchanged from r1514130, tomcat/trunk/test/webapp-3.0/WEB-INF/tags20.tld tomcat/trunk/test/tld/tags21.tld - copied unchanged from r1514130, tomcat/trunk/test/webapp-3.0/WEB-INF/tags21.tld tomcat/trunk/test/tld/test.tld - copied, changed from r1514130, tomcat/trunk/test/webapp/WEB-INF/test.tld Modified: tomcat/trunk/java/org/apache/tomcat/util/descriptor/tld/Tag.java tomcat/trunk/java/org/apache/tomcat/util/descriptor/tld/TagFile.java tomcat/trunk/java/org/apache/tomcat/util/descriptor/tld/TaglibXml.java tomcat/trunk/java/org/apache/tomcat/util/descriptor/tld/TldParser.java tomcat/trunk/java/org/apache/tomcat/util/descriptor/tld/TldRuleSet.java tomcat/trunk/java/org/apache/tomcat/util/descriptor/tld/Validator.java tomcat/trunk/test/org/apache/tomcat/util/descriptor/tld/TestTldParser.java Modified: tomcat/trunk/java/org/apache/tomcat/util/descriptor/tld/Tag.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/descriptor/tld/Tag.java?rev=1514588r1=1514587r2=1514588view=diff == --- tomcat/trunk/java/org/apache/tomcat/util/descriptor/tld/Tag.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/descriptor/tld/Tag.java Fri Aug 16 05:55:40 2013 @@ -16,23 +16,31 @@ */ package org.apache.tomcat.util.descriptor.tld; +import java.util.ArrayList; import java.util.List; +import javax.servlet.jsp.tagext.TagAttributeInfo; +import javax.servlet.jsp.tagext.TagInfo; +import javax.servlet.jsp.tagext.TagVariableInfo; + /** - * + * Model of a tag define in a tag library descriptor. + * This represents the information as parsed from the XML but differs from + * TagInfo in that is does not provide a link back to the tag library that + * defined it. */ public class Tag { private String name; private String tagClass; private String teiClass; -private String bodyContent; +private String bodyContent = TagInfo.BODY_CONTENT_JSP; private String displayName; private String smallIcon; private String largeIcon; private String info; private boolean dynamicAttributes; -private ListVariable variables; -private ListAttribute attributes; +private ListTagAttributeInfo attributes; +private ListTagVariableInfo variables; public String getName() { return name; @@ -106,144 +114,17 @@ public class Tag { this.dynamicAttributes = dynamicAttributes; } -public static class Variable { -private String nameGiven; -private String nameFromAttribute; -private String className; -private boolean declare; -private int scope; - -public String getNameGiven() { -return nameGiven; -} - -public void setNameGiven(String nameGiven) { -this.nameGiven = nameGiven; -} - -public String getNameFromAttribute() { -return nameFromAttribute; -} - -public void setNameFromAttribute(String nameFromAttribute) { -this.nameFromAttribute = nameFromAttribute; -} - -public String getClassName() { -return className; -} - -public void setClassName(String className) { -this.className = className; -} - -public boolean isDeclare() { -return declare; -} - -public void setDeclare(boolean declare) { -this.declare = declare; -} - -public int getScope() { -return scope; -} - -public void setScope(int scope) { -this.scope = scope; +public ListTagAttributeInfo getAttributes() { +if (attributes == null) { +attributes = new ArrayList(); } +return attributes; } -public static class Attribute { -private String name; -private boolean required; -private String type; -private boolean requestTime; -private boolean fragment; -private String description; -private boolean deferredValue; -private boolean deferredMethod; -
svn commit: r1514589 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/catalina/realm/JNDIRealm.java webapps/docs/changelog.xml
Author: violetagg Date: Fri Aug 16 05:58:50 2013 New Revision: 1514589 URL: http://svn.apache.org/r1514589 Log: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=55354 Merged revision 1514470 from tomcat/trunk: Restore the context environment parameters after associating the Principle with the given user. Based on patch provided by Richard Begg. Modified: tomcat/tc7.0.x/trunk/ (props changed) tomcat/tc7.0.x/trunk/java/org/apache/catalina/realm/JNDIRealm.java tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Propchange: tomcat/tc7.0.x/trunk/ -- Merged /tomcat/trunk:r1514470 Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/realm/JNDIRealm.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/realm/JNDIRealm.java?rev=1514589r1=1514588r2=1514589view=diff == --- tomcat/tc7.0.x/trunk/java/org/apache/catalina/realm/JNDIRealm.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/realm/JNDIRealm.java Fri Aug 16 05:58:50 2013 @@ -2070,9 +2070,12 @@ public class JNDIRealm extends RealmBase User user = null; ListString roles = null; +Hashtable?, ? preservedEnvironment = null; try { if (gssCredential != null isUseDelegatedCredential()) { +// Preserve the current context environment parameters +preservedEnvironment = context.getEnvironment(); // Set up context context.addToEnvironment( Context.SECURITY_AUTHENTICATION, GSSAPI); @@ -2088,24 +2091,12 @@ public class JNDIRealm extends RealmBase roles = getRoles(context, user); } } finally { -try { -context.removeFromEnvironment( -Context.SECURITY_AUTHENTICATION); -} catch (NamingException e) { -// Ignore -} -try { -context.removeFromEnvironment( -javax.security.sasl.server.authentication); -} catch (NamingException e) { -// Ignore -} -try { -context.removeFromEnvironment( -javax.security.sasl.qop); -} catch (NamingException e) { -// Ignore -} +restoreEnvironmentParameter(context, +Context.SECURITY_AUTHENTICATION, preservedEnvironment); +restoreEnvironmentParameter(context, +javax.security.sasl.server.authentication, preservedEnvironment); +restoreEnvironmentParameter(context, javax.security.sasl.qop, +preservedEnvironment); } if (user != null) { @@ -2116,6 +2107,19 @@ public class JNDIRealm extends RealmBase return null; } +private void restoreEnvironmentParameter(DirContext context, +String parameterName, Hashtable?, ? preservedEnvironment) { +try { +context.removeFromEnvironment(parameterName); +if (preservedEnvironment != null preservedEnvironment.containsKey(parameterName)) { +context.addToEnvironment(parameterName, +preservedEnvironment.get(parameterName)); +} +} catch (NamingException e) { +// Ignore +} +} + /** * Open (if necessary) and return a connection to the configured * directory server for this Realm. Modified: tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml?rev=1514589r1=1514588r2=1514589view=diff == --- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original) +++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Fri Aug 16 05:58:50 2013 @@ -108,6 +108,11 @@ ServletContext. (markt) /fix fix +bug55354/bug: Ensure that the naming context environment parameters +are restored after associating the Principle with the user name. Based +on patch provided by Richard Begg. (violetagg) + /fix + fix bug55357/bug: Ensure the web application class loader is set as a thread context class loader during session deserialization. (violetagg) /fix - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org