Re: svn commit: r1576770 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/catalina/realm/MemoryRealm.java test/org/apache/catalina/realm/TestMemoryRealm.java webapps/docs/changelog.xml

2014-03-13 Thread Konstantin Kolinko
2014-03-12 18:53 GMT+04:00  ma...@apache.org:
 Author: markt
 Date: Wed Mar 12 14:53:29 2014
 New Revision: 1576770

 URL: http://svn.apache.org/r1576770
 Log:
 Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=56246
 Fix NullPointerException in MemoryRealm when authenticating an unknown user.

 Added:
 tomcat/tc7.0.x/trunk/test/org/apache/catalina/realm/TestMemoryRealm.java
   - copied unchanged from r1576768, 
 tomcat/trunk/test/org/apache/catalina/realm/TestMemoryRealm.java
 Modified:
 tomcat/tc7.0.x/trunk/   (props changed)
 tomcat/tc7.0.x/trunk/java/org/apache/catalina/realm/MemoryRealm.java
 tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml

 Propchange: tomcat/tc7.0.x/trunk/
 --
   Merged /tomcat/trunk:r1576768

 Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/realm/MemoryRealm.java
 URL: 
 http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/realm/MemoryRealm.java?rev=1576770r1=1576769r2=1576770view=diff
 ==
 --- tomcat/tc7.0.x/trunk/java/org/apache/catalina/realm/MemoryRealm.java 
 (original)
 +++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/realm/MemoryRealm.java Wed 
 Mar 12 14:53:29 2014
 @@ -140,7 +140,12 @@ public class MemoryRealm  extends RealmB

  GenericPrincipal principal = principals.get(username);


Tomcat 6 code here also protected against credentials != null.

 -boolean validated = compareCredentials(credentials, 
 principal.getPassword());
 +boolean validated;
 +if (principal == null) {
 +validated = false;
 +} else {
 +validated = compareCredentials(credentials, 
 principal.getPassword());
 +}

  if (validated) {
  if (log.isDebugEnabled())


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



svn commit: r1577073 - in /tomcat/trunk/test/org/apache/tomcat/websocket: TestWebSocketFrameClient.java TestWebSocketFrameClientSSL.java

2014-03-13 Thread remm
Author: remm
Date: Thu Mar 13 09:29:30 2014
New Revision: 1577073

URL: http://svn.apache.org/r1577073
Log:
The test now uses too much memory for the test server, so split it SSL / non 
SSL.

Added:

tomcat/trunk/test/org/apache/tomcat/websocket/TestWebSocketFrameClientSSL.java
Modified:
tomcat/trunk/test/org/apache/tomcat/websocket/TestWebSocketFrameClient.java

Modified: 
tomcat/trunk/test/org/apache/tomcat/websocket/TestWebSocketFrameClient.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/tomcat/websocket/TestWebSocketFrameClient.java?rev=1577073r1=1577072r2=1577073view=diff
==
--- tomcat/trunk/test/org/apache/tomcat/websocket/TestWebSocketFrameClient.java 
(original)
+++ tomcat/trunk/test/org/apache/tomcat/websocket/TestWebSocketFrameClient.java 
Thu Mar 13 09:29:30 2014
@@ -86,124 +86,4 @@ public class TestWebSocketFrameClient ex
 }
 }
 
-
-@Test
-public void testConnectToServerEndpointSSL() throws Exception {
-
-Tomcat tomcat = getTomcatInstance();
-// Must have a real docBase - just use temp
-Context ctx =
-tomcat.addContext(, System.getProperty(java.io.tmpdir));
-ctx.addApplicationListener(new ApplicationListener(
-TesterFirehoseServer.Config.class.getName(), false));
-Tomcat.addServlet(ctx, default, new DefaultServlet());
-ctx.addServletMapping(/, default);
-
-TesterSupport.initSsl(tomcat);
-
-tomcat.start();
-
-WebSocketContainer wsContainer =
-ContainerProvider.getWebSocketContainer();
-ClientEndpointConfig clientEndpointConfig =
-ClientEndpointConfig.Builder.create().build();
-clientEndpointConfig.getUserProperties().put(
-WsWebSocketContainer.SSL_TRUSTSTORE_PROPERTY,
-test/org/apache/tomcat/util/net/ca.jks);
-Session wsSession = wsContainer.connectToServer(
-TesterProgrammaticEndpoint.class,
-clientEndpointConfig,
-new URI(wss://localhost: + getPort() +
-TesterFirehoseServer.Config.PATH));
-CountDownLatch latch =
-new CountDownLatch(TesterFirehoseServer.MESSAGE_COUNT);
-BasicText handler = new BasicText(latch);
-wsSession.addMessageHandler(handler);
-wsSession.getBasicRemote().sendText(Hello);
-
-System.out.println(Sent Hello message, waiting for data);
-
-// Ignore the latch result as the message count test below will tell us
-// if the right number of messages arrived
-handler.getLatch().await(TesterFirehoseServer.WAIT_TIME_MILLIS,
-TimeUnit.MILLISECONDS);
-
-QueueString messages = handler.getMessages();
-Assert.assertEquals(
-TesterFirehoseServer.MESSAGE_COUNT, messages.size());
-for (String message : messages) {
-Assert.assertEquals(TesterFirehoseServer.MESSAGE, message);
-}
-}
-
-
-@Test
-public void testBug56032() throws Exception {
-// TODO Investigate options to get this test to pass with the HTTP BIO
-//  connector.
-if (getTomcatInstance().getConnector().getProtocol().equals(
-org.apache.coyote.http11.Http11Protocol)) {
-return;
-}
-
-Tomcat tomcat = getTomcatInstance();
-// Must have a real docBase - just use temp
-Context ctx =
-tomcat.addContext(, System.getProperty(java.io.tmpdir));
-ctx.addApplicationListener(new ApplicationListener(
-TesterFirehoseServer.Config.class.getName(), false));
-Tomcat.addServlet(ctx, default, new DefaultServlet());
-ctx.addServletMapping(/, default);
-
-TesterSupport.initSsl(tomcat);
-
-tomcat.start();
-
-WebSocketContainer wsContainer =
-ContainerProvider.getWebSocketContainer();
-ClientEndpointConfig clientEndpointConfig =
-ClientEndpointConfig.Builder.create().build();
-clientEndpointConfig.getUserProperties().put(
-WsWebSocketContainer.SSL_TRUSTSTORE_PROPERTY,
-test/org/apache/tomcat/util/net/ca.jks);
-Session wsSession = wsContainer.connectToServer(
-TesterProgrammaticEndpoint.class,
-clientEndpointConfig,
-new URI(wss://localhost: + getPort() +
-TesterFirehoseServer.Config.PATH));
-
-// Process incoming messages very slowly
-MessageHandler handler = new SleepingText(5000);
-wsSession.addMessageHandler(handler);
-wsSession.getBasicRemote().sendText(Hello);
-
-// Wait long enough for the buffers to fill and the send to timeout
-int count = 0;
-int limit = TesterFirehoseServer.WAIT_TIME_MILLIS / 100;
-
-

svn commit: r1577077 - /tomcat/trunk/test/org/apache/tomcat/websocket/TestWebSocketFrameClient.java

2014-03-13 Thread markt
Author: markt
Date: Thu Mar 13 09:51:03 2014
New Revision: 1577077

URL: http://svn.apache.org/r1577077
Log:
Remove unused imports

Modified:
tomcat/trunk/test/org/apache/tomcat/websocket/TestWebSocketFrameClient.java

Modified: 
tomcat/trunk/test/org/apache/tomcat/websocket/TestWebSocketFrameClient.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/tomcat/websocket/TestWebSocketFrameClient.java?rev=1577077r1=1577076r2=1577077view=diff
==
--- tomcat/trunk/test/org/apache/tomcat/websocket/TestWebSocketFrameClient.java 
(original)
+++ tomcat/trunk/test/org/apache/tomcat/websocket/TestWebSocketFrameClient.java 
Thu Mar 13 09:51:03 2014
@@ -23,7 +23,6 @@ import java.util.concurrent.TimeUnit;
 
 import javax.websocket.ClientEndpointConfig;
 import javax.websocket.ContainerProvider;
-import javax.websocket.MessageHandler;
 import javax.websocket.Session;
 import javax.websocket.WebSocketContainer;
 
@@ -35,9 +34,7 @@ import org.apache.catalina.servlets.Defa
 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.SleepingText;
 import 
org.apache.tomcat.websocket.TesterMessageCountClient.TesterProgrammaticEndpoint;
 
 public class TestWebSocketFrameClient extends TomcatBaseTest {



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



svn commit: r1577080 - /tomcat/trunk/test/org/apache/tomcat/websocket/TestWebSocketFrameClientSSL.java

2014-03-13 Thread remm
Author: remm
Date: Thu Mar 13 10:00:47 2014
New Revision: 1577080

URL: http://svn.apache.org/r1577080
Log:
Set eol prop.

Modified:

tomcat/trunk/test/org/apache/tomcat/websocket/TestWebSocketFrameClientSSL.java  
 (props changed)

Propchange: 
tomcat/trunk/test/org/apache/tomcat/websocket/TestWebSocketFrameClientSSL.java
--
svn:eol-style = native



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



[Bug 56256] New: Multiple cookies and parallel deployment

2014-03-13 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56256

Bug ID: 56256
   Summary: Multiple cookies and parallel deployment
   Product: Tomcat 8
   Version: 8.0.3
  Hardware: All
OS: All
Status: NEW
  Severity: minor
  Priority: P2
 Component: Catalina
  Assignee: dev@tomcat.apache.org
  Reporter: knst.koli...@gmail.com

The following is based on reviewing the code of
CoyoteAdapter.postParseRequest(..)

Suppose the following scenario:

1) There are multiple versions of /foo web application.
2) Both /foo and ROOT web application create session cookies
3) A new version of /foo is deployed in parallel to the old one
4) Browser sends several SESSIONID cookies: for the ROOT webapp and for the old
version of /foo webapp.

Will the old version of /foo selected in this scenario?

The problem is that Tomcat first selects the only sessionID among several
cookies (in CoyoteAdapter.parseSessionCookiesId(..)) and then uses that only
sessionID to select webapp version (in CoyoteAdapter.postParseRequest(..)).


All works if there is a cookie that belongs to the latest version of the
webapp. On the first mapping the request is mapped to the latest version. Thus
'parseSessionCookiesId(..)' by default looks for sessionid that belongs to the
latest version of the web application.

If the cookie belongs to an earlier version, the 'parseSessionCookiesId(..)'
method selects sessionID value from the last cookie among SESSIONID cookies
sent by browser.

-- 
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: r1577087 - /tomcat/trunk/java/org/apache/catalina/core/StandardContext.java

2014-03-13 Thread kkolinko
Author: kkolinko
Date: Thu Mar 13 10:23:35 2014
New Revision: 1577087

URL: http://svn.apache.org/r1577087
Log:
Reduce calls to getManager().
(That is not a simple getter, but it performs some locking).

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

Modified: tomcat/trunk/java/org/apache/catalina/core/StandardContext.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/StandardContext.java?rev=1577087r1=1577086r2=1577087view=diff
==
--- tomcat/trunk/java/org/apache/catalina/core/StandardContext.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/StandardContext.java Thu Mar 13 
10:23:35 2014
@@ -1648,12 +1648,13 @@ public class StandardContext extends Con
this.distributable);
 
 // Bugzilla 32866
-if(getManager() != null) {
+Manager manager = getManager();
+if(manager != null) {
 if(log.isDebugEnabled()) {
 log.debug(Propagating distributable= + distributable
   +  to manager);
 }
-getManager().setDistributable(distributable);
+manager.setDistributable(distributable);
 }
 }
 
@@ -5172,7 +5173,7 @@ public class StandardContext extends Con
 // Start manager
 Manager manager = getManager();
 if ((manager != null)  (manager instanceof Lifecycle)) {
-((Lifecycle) getManager()).start();
+((Lifecycle) manager).start();
 }
 } catch(Exception e) {
 log.error(Error manager.start(), e);



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



svn commit: r1577103 - in /tomcat/trunk: java/org/apache/catalina/webresources/ test/org/apache/catalina/webresources/ webapps/docs/

2014-03-13 Thread markt
Author: markt
Date: Thu Mar 13 10:42:49 2014
New Revision: 1577103

URL: http://svn.apache.org/r1577103
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=56253
When listing resources that are provided by a JAR, fix possible 
StringIndexOutOfBoundsExceptions. Add some unit tests for this and similar 
scenarios and fix the additional issues those unit tests identified. Based on a 
patch by Larry Isaacs. 

Modified:

tomcat/trunk/java/org/apache/catalina/webresources/AbstractArchiveResourceSet.java
tomcat/trunk/java/org/apache/catalina/webresources/JarResourceRoot.java
tomcat/trunk/java/org/apache/catalina/webresources/LocalStrings.properties

tomcat/trunk/test/org/apache/catalina/webresources/AbstractTestResourceSet.java
tomcat/trunk/webapps/docs/changelog.xml

Modified: 
tomcat/trunk/java/org/apache/catalina/webresources/AbstractArchiveResourceSet.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/webresources/AbstractArchiveResourceSet.java?rev=1577103r1=1577102r2=1577103view=diff
==
--- 
tomcat/trunk/java/org/apache/catalina/webresources/AbstractArchiveResourceSet.java
 (original)
+++ 
tomcat/trunk/java/org/apache/catalina/webresources/AbstractArchiveResourceSet.java
 Thu Mar 13 10:42:49 2014
@@ -75,7 +75,7 @@ public abstract class AbstractArchiveRes
 String pathInJar =
 getInternalPath() + path.substring(webAppMount.length());
 // Always strip off the leading '/' to get the JAR path
-if (pathInJar.charAt(0) == '/') {
+if (pathInJar.length()  0  pathInJar.charAt(0) == '/') {
 pathInJar = pathInJar.substring(1);
 }
 IteratorString entries = jarFileEntries.keySet().iterator();
@@ -128,11 +128,13 @@ public abstract class AbstractArchiveRes
 getInternalPath() + path.substring(webAppMount.length());
 // Always strip off the leading '/' to get the JAR path and make
 // sure it ends in '/'
-if (pathInJar.charAt(pathInJar.length() - 1) != '/') {
-pathInJar = pathInJar.substring(1) + '/';
-}
-if (pathInJar.charAt(0) == '/') {
-pathInJar = pathInJar.substring(1);
+if (pathInJar.length()  0) {
+if (pathInJar.charAt(pathInJar.length() - 1) != '/') {
+pathInJar = pathInJar.substring(1) + '/';
+}
+if (pathInJar.charAt(0) == '/') {
+pathInJar = pathInJar.substring(1);
+}
 }
 
 IteratorString entries = jarFileEntries.keySet().iterator();
@@ -218,6 +220,10 @@ public abstract class AbstractArchiveRes
 }
 if (pathInJar.equals()) {
 // Special case
+// This is a directory resource so the path must end with /
+if (!path.endsWith(/)) {
+path = path + /;
+}
 return new JarResourceRoot(root, new File(getBase()),
 baseUrlString, path);
 } else {

Modified: 
tomcat/trunk/java/org/apache/catalina/webresources/JarResourceRoot.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/webresources/JarResourceRoot.java?rev=1577103r1=1577102r2=1577103view=diff
==
--- tomcat/trunk/java/org/apache/catalina/webresources/JarResourceRoot.java 
(original)
+++ tomcat/trunk/java/org/apache/catalina/webresources/JarResourceRoot.java Thu 
Mar 13 10:42:49 2014
@@ -38,16 +38,16 @@ public class JarResourceRoot extends Abs
 public JarResourceRoot(WebResourceRoot root, File base, String baseUrl,
 String webAppPath) {
 super(root, webAppPath);
+// Validate the webAppPath before going any further
+if (!webAppPath.endsWith(/)) {
+throw new IllegalArgumentException(sm.getString(
+jarResourceRoot.invalidWebAppPath, webAppPath));
+}
 this.base = base;
 this.baseUrl = jar: + baseUrl;
 // Extract the name from the webAppPath
-// Strip any trailing '/' character
-String resourceName;
-if (webAppPath.endsWith(/)) {
-resourceName = webAppPath.substring(0, webAppPath.length() - 1);
-} else {
-resourceName = webAppPath;
-}
+// Strip the trailing '/' character
+String resourceName = webAppPath.substring(0, webAppPath.length() - 1);
 int i = resourceName.lastIndexOf('/');
 if (i  -1) {
 resourceName = resourceName.substring(i + 1);

Modified: 
tomcat/trunk/java/org/apache/catalina/webresources/LocalStrings.properties
URL: 

[Bug 56253] StringIndexOutOfBoundsException in AbstractArchiveResourceSet.list() method

2014-03-13 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56253

Mark Thomas ma...@apache.org changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #1 from Mark Thomas ma...@apache.org ---
Thanks for the report. I added some test cases for this and the other methods
that use pathInJar. That found a couple of other issues that I also fixed.

The fix is in 8.0.x for 8.0.4 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



Re: svn commit: r1560931 - in /tomcat/tc7.0.x/trunk: build.xml java/org/apache/tomcat/util/descriptor/DigesterFactory.java

2014-03-13 Thread Violeta Georgieva
Hi,

In OSGi world the functionality is separated in different bundles and
schemes for servlet API is in one bundle and schemes for JSP API in
another.
With that change we pack all schemes in servlet-api.jar. Till this changed
one was able to use whatever servlet api bundle compatible with Tomcat but
with that change we enforce people to use only the jar provided by Tomcat
which is not a bundle also.

Is it possible to return back the check with JSPContext? Something like
this?

Index:
C:/tc7.0.x/java/org/apache/tomcat/util/descriptor/DigesterFactory.java
===
--- C:/tc7.0.x/java/org/apache/tomcat/util/descriptor/DigesterFactory.java
(revision
1577108)
+++ C:/tc7.0.x/java/org/apache/tomcat/util/descriptor/DigesterFactory.java
(working
copy)
@@ -22,6 +22,7 @@
 import java.util.Map;

 import javax.servlet.ServletContext;
+import javax.servlet.jsp.JspContext;

 import org.apache.tomcat.util.digester.Digester;
 import org.apache.tomcat.util.digester.RuleSet;
@@ -103,6 +104,9 @@
 URL id = ServletContext.class.getResource(resources/ + url);
 if (id == null) {
 id = ServletContext.class.getResource(jsp/resources/ + url);
+if (id == null) {
+id = JspContext.class.getResource(resources/ + url);
+}
 }
 return id.toExternalForm();
 }


Thanks
Violeta


Re: svn commit: r1560931 - in /tomcat/tc7.0.x/trunk: build.xml java/org/apache/tomcat/util/descriptor/DigesterFactory.java

2014-03-13 Thread Mark Thomas
On 13/03/2014 12:28, Violeta Georgieva wrote:
 Hi,
 
 In OSGi world the functionality is separated in different bundles and
 schemes for servlet API is in one bundle and schemes for JSP API in
 another.

Then I'd argue that those bundles are broken as far as validation goes.
You can't validate a web.xml document without access to the JSP schemas
but it should not be necessary to have a dependency on the jsp-api just
to validate a web.xml document.

 With that change we pack all schemes in servlet-api.jar. Till this changed
 one was able to use whatever servlet api bundle compatible with Tomcat but
 with that change we enforce people to use only the jar provided by Tomcat
 which is not a bundle also.
 
 Is it possible to return back the check with JSPContext? Something like
 this?

No. That creates a dependency on jsp-api.jar.

A solution should be possible but it is going to be more complex that
the patch proposed here.

Mark


 
 Index:
 C:/tc7.0.x/java/org/apache/tomcat/util/descriptor/DigesterFactory.java
 ===
 --- C:/tc7.0.x/java/org/apache/tomcat/util/descriptor/DigesterFactory.java
 (revision
 1577108)
 +++ C:/tc7.0.x/java/org/apache/tomcat/util/descriptor/DigesterFactory.java
 (working
 copy)
 @@ -22,6 +22,7 @@
  import java.util.Map;
 
  import javax.servlet.ServletContext;
 +import javax.servlet.jsp.JspContext;
 
  import org.apache.tomcat.util.digester.Digester;
  import org.apache.tomcat.util.digester.RuleSet;
 @@ -103,6 +104,9 @@
  URL id = ServletContext.class.getResource(resources/ + url);
  if (id == null) {
  id = ServletContext.class.getResource(jsp/resources/ + url);
 +if (id == null) {
 +id = JspContext.class.getResource(resources/ + url);
 +}
  }
  return id.toExternalForm();
  }
 
 
 Thanks
 Violeta
 


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



Re: svn commit: r1560931 - in /tomcat/tc7.0.x/trunk: build.xml java/org/apache/tomcat/util/descriptor/DigesterFactory.java

2014-03-13 Thread Violeta Georgieva
Hi Mark,


2014-03-13 15:01 GMT+02:00 Mark Thomas ma...@apache.org:

 On 13/03/2014 12:28, Violeta Georgieva wrote:
  Hi,
 
  In OSGi world the functionality is separated in different bundles and
  schemes for servlet API is in one bundle and schemes for JSP API in
  another.

 Then I'd argue that those bundles are broken as far as validation goes.
 You can't validate a web.xml document without access to the JSP schemas
 but it should not be necessary to have a dependency on the jsp-api just
 to validate a web.xml document.


if you have two bundles one with the servlet API and another with JSP API
then Servlet API bundle can import optionally the resources from JSP API
bundle.
That's the way bundles use when need some functionality. When you import it
optionally you say that you need these resources/functionality but you can
run also without it.
Using this way you cover xml validation on and off in this particular
scenario.

  With that change we pack all schemes in servlet-api.jar. Till this
changed
  one was able to use whatever servlet api bundle compatible with Tomcat
but
  with that change we enforce people to use only the jar provided by
Tomcat
  which is not a bundle also.
 
  Is it possible to return back the check with JSPContext? Something like
  this?

 No. That creates a dependency on jsp-api.jar.

:( You are right


 A solution should be possible but it is going to be more complex that
 the patch proposed here.

What we can do if we want to cover this scenario?


Thanks
Violeta


 Mark


 
  Index:
  C:/tc7.0.x/java/org/apache/tomcat/util/descriptor/DigesterFactory.java
  ===
  ---
C:/tc7.0.x/java/org/apache/tomcat/util/descriptor/DigesterFactory.java
  (revision
  1577108)
  +++
C:/tc7.0.x/java/org/apache/tomcat/util/descriptor/DigesterFactory.java
  (working
  copy)
  @@ -22,6 +22,7 @@
   import java.util.Map;
 
   import javax.servlet.ServletContext;
  +import javax.servlet.jsp.JspContext;
 
   import org.apache.tomcat.util.digester.Digester;
   import org.apache.tomcat.util.digester.RuleSet;
  @@ -103,6 +104,9 @@
   URL id = ServletContext.class.getResource(resources/ + url);
   if (id == null) {
   id = ServletContext.class.getResource(jsp/resources/ +
url);
  +if (id == null) {
  +id = JspContext.class.getResource(resources/ + url);
  +}
   }
   return id.toExternalForm();
   }
 
 
  Thanks
  Violeta
 


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



Re: svn commit: r1560931 - in /tomcat/tc7.0.x/trunk: build.xml java/org/apache/tomcat/util/descriptor/DigesterFactory.java

2014-03-13 Thread Mark Thomas
On 13/03/2014 13:09, Violeta Georgieva wrote:
 Hi Mark,
 
 
 2014-03-13 15:01 GMT+02:00 Mark Thomas ma...@apache.org:

 On 13/03/2014 12:28, Violeta Georgieva wrote:
 Hi,

 In OSGi world the functionality is separated in different bundles and
 schemes for servlet API is in one bundle and schemes for JSP API in
 another.

 Then I'd argue that those bundles are broken as far as validation goes.
 You can't validate a web.xml document without access to the JSP schemas
 but it should not be necessary to have a dependency on the jsp-api just
 to validate a web.xml document.

 
 if you have two bundles one with the servlet API and another with JSP API
 then Servlet API bundle can import optionally the resources from JSP API
 bundle.
 That's the way bundles use when need some functionality. When you import it
 optionally you say that you need these resources/functionality but you can
 run also without it.
 Using this way you cover xml validation on and off in this particular
 scenario.

My point is the the JSP API bundle should not be required at all to
validate a schema from the Servlet API bundle. The Servlet API bundle
should be self-contained.

 With that change we pack all schemes in servlet-api.jar. Till this
 changed
 one was able to use whatever servlet api bundle compatible with Tomcat
 but
 with that change we enforce people to use only the jar provided by
 Tomcat
 which is not a bundle also.

 Is it possible to return back the check with JSPContext? Something like
 this?

 No. That creates a dependency on jsp-api.jar.
 
 :( You are right
 

 A solution should be possible but it is going to be more complex that
 the patch proposed here.
 
 What we can do if we want to cover this scenario?

What exactly is it that we want to cover? I can think of a number of
requirements.

1. Ensure that Tomcat still works (excluding validation) if using a
servlet API implementation that does not include the JSP schemas.

2. Ensure that Tomcat can still validate web.xml files if using a
Servlet API implementation that does not include JSP schemas along with
a JSP API implementation that does.

Any more?

Both of the above should be do-able.

Mark

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



Re: svn commit: r1560931 - in /tomcat/tc7.0.x/trunk: build.xml java/org/apache/tomcat/util/descriptor/DigesterFactory.java

2014-03-13 Thread Violeta Georgieva
2014-03-13 15:28 GMT+02:00 Mark Thomas ma...@apache.org:

 On 13/03/2014 13:09, Violeta Georgieva wrote:
  Hi Mark,
 
 
  2014-03-13 15:01 GMT+02:00 Mark Thomas ma...@apache.org:
 
  On 13/03/2014 12:28, Violeta Georgieva wrote:
  Hi,
 
  In OSGi world the functionality is separated in different bundles and
  schemes for servlet API is in one bundle and schemes for JSP API in
  another.
 
  Then I'd argue that those bundles are broken as far as validation goes.
  You can't validate a web.xml document without access to the JSP schemas
  but it should not be necessary to have a dependency on the jsp-api just
  to validate a web.xml document.
 
 
  if you have two bundles one with the servlet API and another with JSP
API
  then Servlet API bundle can import optionally the resources from JSP API
  bundle.
  That's the way bundles use when need some functionality. When you
import it
  optionally you say that you need these resources/functionality but you
can
  run also without it.
  Using this way you cover xml validation on and off in this particular
  scenario.

 My point is the the JSP API bundle should not be required at all to
 validate a schema from the Servlet API bundle. The Servlet API bundle
 should be self-contained.

  With that change we pack all schemes in servlet-api.jar. Till this
  changed
  one was able to use whatever servlet api bundle compatible with Tomcat
  but
  with that change we enforce people to use only the jar provided by
  Tomcat
  which is not a bundle also.
 
  Is it possible to return back the check with JSPContext? Something
like
  this?
 
  No. That creates a dependency on jsp-api.jar.
 
  :( You are right
 
 
  A solution should be possible but it is going to be more complex that
  the patch proposed here.
 
  What we can do if we want to cover this scenario?

 What exactly is it that we want to cover? I can think of a number of
 requirements.

 1. Ensure that Tomcat still works (excluding validation) if using a
 servlet API implementation that does not include the JSP schemas.

 2. Ensure that Tomcat can still validate web.xml files if using a
 Servlet API implementation that does not include JSP schemas along with
 a JSP API implementation that does.

 Any more?

No. These two cover the scenario.

 Both of the above should be do-able.

 Mark

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



svn commit: r1577173 - /tomcat/trunk/test/org/apache/tomcat/websocket/TestWebSocketFrameClientSSL.java

2014-03-13 Thread remm
Author: remm
Date: Thu Mar 13 14:13:32 2014
New Revision: 1577173

URL: http://svn.apache.org/r1577173
Log:
Disable SSL websocket firehose test for now on NIO2, since a legitimate 
explanation for the failure has been found.

Modified:

tomcat/trunk/test/org/apache/tomcat/websocket/TestWebSocketFrameClientSSL.java

Modified: 
tomcat/trunk/test/org/apache/tomcat/websocket/TestWebSocketFrameClientSSL.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/tomcat/websocket/TestWebSocketFrameClientSSL.java?rev=1577173r1=1577172r2=1577173view=diff
==
--- 
tomcat/trunk/test/org/apache/tomcat/websocket/TestWebSocketFrameClientSSL.java 
(original)
+++ 
tomcat/trunk/test/org/apache/tomcat/websocket/TestWebSocketFrameClientSSL.java 
Thu Mar 13 14:13:32 2014
@@ -45,6 +45,15 @@ public class TestWebSocketFrameClientSSL
 
 @Test
 public void testConnectToServerEndpoint() throws Exception {
+// TODO Skip NIO2 since its CPU use on non blocking writes to
+//  do the encryption inline apparently messes up
+//  the websockets writes, which deadlock until timedout.
+//  Can be reproduced in NIO by adding a Thread.sleep in
+//  writes. Reenable later when investigated and fixed.
+if (getTomcatInstance().getConnector().getProtocol().equals(
+org.apache.coyote.http11.Http11Nio2Protocol)) {
+return;
+}
 
 Tomcat tomcat = getTomcatInstance();
 // Must have a real docBase - just use temp



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



svn commit: r1577182 - in /tomcat/trunk: java/org/apache/catalina/manager/LocalStrings.properties java/org/apache/catalina/manager/ManagerServlet.java java/org/apache/catalina/startup/HostConfig.java

2014-03-13 Thread markt
Author: markt
Date: Thu Mar 13 14:48:14 2014
New Revision: 1577182

URL: http://svn.apache.org/r1577182
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=56248
Allow the deployer to update an existing WAR file without
undeploying the existing application if the update flag is set.
This allows any existing custom context.xml for the application
to be retained. To update an application and remove any existing
context.xml simply undeploy the old version of the application
before deploying the new version.

Modified:
tomcat/trunk/java/org/apache/catalina/manager/LocalStrings.properties
tomcat/trunk/java/org/apache/catalina/manager/ManagerServlet.java
tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java
tomcat/trunk/webapps/docs/changelog.xml

Modified: tomcat/trunk/java/org/apache/catalina/manager/LocalStrings.properties
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/manager/LocalStrings.properties?rev=1577182r1=1577181r2=1577182view=diff
==
--- tomcat/trunk/java/org/apache/catalina/manager/LocalStrings.properties 
(original)
+++ tomcat/trunk/java/org/apache/catalina/manager/LocalStrings.properties Thu 
Mar 13 14:48:14 2014
@@ -80,6 +80,7 @@ managerServlet.exception=FAIL - Encounte
 managerServlet.findleaksFail=FAIL - Find leaks failed: Host not instance of 
StandardHost
 managerServlet.findleaksList=OK - Found potential memory leaks in the 
following applications:
 managerServlet.findleaksNone=OK - No memory leaks found
+managerServlet.invalidCommand=FAIL - Invalid parameters supplied for command 
[{0}]
 managerServlet.invalidPath=FAIL - Invalid context path {0} was specified
 managerServlet.listed=OK - Listed applications for virtual host {0}
 managerServlet.listitem={0}:{1}:{2}:{3}

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=1577182r1=1577181r2=1577182view=diff
==
--- tomcat/trunk/java/org/apache/catalina/manager/ManagerServlet.java (original)
+++ tomcat/trunk/java/org/apache/catalina/manager/ManagerServlet.java Thu Mar 
13 14:48:14 2014
@@ -54,6 +54,7 @@ import org.apache.catalina.Wrapper;
 import org.apache.catalina.connector.Connector;
 import org.apache.catalina.core.StandardHost;
 import org.apache.catalina.core.StandardServer;
+import org.apache.catalina.startup.ExpandWar;
 import org.apache.catalina.util.ContextName;
 import org.apache.catalina.util.RequestUtil;
 import org.apache.catalina.util.ServerInfo;
@@ -179,8 +180,7 @@ public class ManagerServlet extends Http
 
 /**
  * File object representing the directory into which the deploy() command
- * will store the WAR and context configuration files that have been
- * uploaded.
+ * will deploy uploaded WAR files (normally the appBase).
  */
 protected File deployed = null;
 
@@ -340,8 +340,11 @@ public class ManagerServlet extends Http
 } else if (command.equals(/deploy)) {
 if (war != null || config != null) {
 deploy(writer, config, cn, war, update, smClient);
-} else {
+} else if (tag != null) {
 deploy(writer, cn, tag, smClient);
+} else {
+writer.println(smClient.getString(
+managerServlet.invalidCommand, command));
 }
 } else if (command.equals(/list)) {
 list(writer, smClient);
@@ -654,21 +657,16 @@ public class ManagerServlet extends Http
 String baseName = cn.getBaseName();
 String displayPath = cn.getDisplayName();
 
-// Check if app already exists, or undeploy it if updating
+// If app exists deployment can only proceed if update is true
+// Note existing WAR will be deleted and then replaced
 Context context = (Context) host.findChild(name);
-if (update) {
-if (context != null) {
-undeploy(writer, cn, smClient);
-}
-context = (Context) host.findChild(name);
-}
-if (context != null) {
+if (context != null  !update) {
 writer.println(smClient.getString(managerServlet.alreadyContext,
 displayPath));
 return;
 }
 
-// Calculate the base path
+// Determine directory where WAR will be uploaded to
 File deployedPath = deployed;
 if (tag != null) {
 deployedPath = new File(versioned, tag);
@@ -679,26 +677,30 @@ public class ManagerServlet extends Http
 }
 }
 
-// Upload the web application archive to a local WAR file
+// Determine full path for uploaded WAR
 File localWar = new File(deployedPath, baseName + .war);
 if (debug = 2) {
  

Re: svn commit: r1577182 - in /tomcat/trunk: java/org/apache/catalina/manager/LocalStrings.properties java/org/apache/catalina/manager/ManagerServlet.java java/org/apache/catalina/startup/HostConfig.j

2014-03-13 Thread Mark Thomas
On 13/03/2014 14:48, ma...@apache.org wrote:
 Author: markt
 Date: Thu Mar 13 14:48:14 2014
 New Revision: 1577182
 
 URL: http://svn.apache.org/r1577182
 Log:
 Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=56248
 Allow the deployer to update an existing WAR file without
 undeploying the existing application if the update flag is set.
 This allows any existing custom context.xml for the application
 to be retained. To update an application and remove any existing
 context.xml simply undeploy the old version of the application
 before deploying the new version.

Reviewing the back-port to 7.0.x, the logic isn't quite right when tag
!= null. I'm working on an update.

Mark

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



svn commit: r1577195 - /tomcat/trunk/java/org/apache/catalina/manager/ManagerServlet.java

2014-03-13 Thread markt
Author: markt
Date: Thu Mar 13 15:23:31 2014
New Revision: 1577195

URL: http://svn.apache.org/r1577195
Log:
Correct some errors in r1577182

Modified:
tomcat/trunk/java/org/apache/catalina/manager/ManagerServlet.java

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=1577195r1=1577194r2=1577195view=diff
==
--- tomcat/trunk/java/org/apache/catalina/manager/ManagerServlet.java (original)
+++ tomcat/trunk/java/org/apache/catalina/manager/ManagerServlet.java Thu Mar 
13 15:23:31 2014
@@ -666,41 +666,41 @@ public class ManagerServlet extends Http
 return;
 }
 
-// Determine directory where WAR will be uploaded to
-File deployedPath = deployed;
-if (tag != null) {
-deployedPath = new File(versioned, tag);
-if (!deployedPath.mkdirs()  !deployedPath.isDirectory()) {
+File deployedWar = new File(deployed, baseName + .war);
+
+// Determine full path for uploaded WAR
+File uploadedWar;
+if (tag == null) {
+uploadedWar = deployedWar;
+} else {
+File uploadPath = new File(versioned, tag);
+if (!uploadPath.mkdirs()  !uploadPath.isDirectory()) {
 writer.println(smClient.getString(managerServlet.mkdirFail,
-deployedPath));
+uploadPath));
 return;
 }
+uploadedWar = new File(uploadPath, baseName + .war);
 }
-
-// Determine full path for uploaded WAR
-File localWar = new File(deployedPath, baseName + .war);
 if (debug = 2) {
-log(Uploading WAR file to  + localWar);
+log(Uploading WAR file to  + uploadedWar);
 }
 
 try {
 if (!isServiced(name)) {
 addServiced(name);
 try {
-if (update  tag == null  localWar.isFile()) {
-if (!localWar.delete()) {
+if (update  tag == null  deployedWar.isFile()) {
+if (!deployedWar.delete()) {
 
writer.println(smClient.getString(managerServlet.deleteFail,
-localWar));
+deployedWar));
 return;
 }
 }
 // Upload WAR
-uploadWar(writer, request, localWar, smClient);
+uploadWar(writer, request, uploadedWar, smClient);
 if (tag != null) {
 // Copy WAR to the host's appBase
-deployedPath = deployed;
-File localWarCopy = new File(deployedPath, baseName + 
.war);
-copy(localWar, localWarCopy);
+copy(uploadedWar, deployedWar);
 }
 // Perform new deployment
 check(name);
@@ -753,17 +753,19 @@ public class ManagerServlet extends Http
 // Find the local WAR file
 File localWar = new File(versioned, baseName + .war);
 
+File deployedWar = new File(host.getAppBaseFile(), baseName + .war);
+
 // Copy WAR to appBase
 try {
 if (!isServiced(name)) {
 addServiced(name);
 try {
-if (!localWar.delete()) {
+if (!deployedWar.delete()) {
 
writer.println(smClient.getString(managerServlet.deleteFail,
-localWar));
+deployedWar));
 return;
 }
-copy(localWar, new File(host.getAppBaseFile(), baseName + 
.war));
+copy(localWar, deployedWar);
 // Perform new deployment
 check(name);
 } finally {



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



svn commit: r1577199 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/catalina/manager/LocalStrings.properties java/org/apache/catalina/manager/ManagerServlet.java java/org/apache/catalina/startup/HostC

2014-03-13 Thread markt
Author: markt
Date: Thu Mar 13 15:30:35 2014
New Revision: 1577199

URL: http://svn.apache.org/r1577199
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=56248
Allow the deployer to update an existing WAR file without
undeploying the existing application if the update flag is set.
This allows any existing custom context.xml for the application
to be retained. To update an application and remove any existing
context.xml simply undeploy the old version of the application
before deploying the new version.

Modified:
tomcat/tc7.0.x/trunk/   (props changed)

tomcat/tc7.0.x/trunk/java/org/apache/catalina/manager/LocalStrings.properties
tomcat/tc7.0.x/trunk/java/org/apache/catalina/manager/ManagerServlet.java
tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/HostConfig.java
tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml

Propchange: tomcat/tc7.0.x/trunk/
--
  Merged /tomcat/trunk:r1577182,1577195

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/catalina/manager/LocalStrings.properties
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/manager/LocalStrings.properties?rev=1577199r1=1577198r2=1577199view=diff
==
--- 
tomcat/tc7.0.x/trunk/java/org/apache/catalina/manager/LocalStrings.properties 
(original)
+++ 
tomcat/tc7.0.x/trunk/java/org/apache/catalina/manager/LocalStrings.properties 
Thu Mar 13 15:30:35 2014
@@ -79,6 +79,7 @@ managerServlet.exception=FAIL - Encounte
 managerServlet.findleaksFail=FAIL - Find leaks failed: Host not instance of 
StandardHost
 managerServlet.findleaksList=OK - Found potential memory leaks in the 
following applications:
 managerServlet.findleaksNone=OK - No memory leaks found
+managerServlet.invalidCommand=FAIL - Invalid parameters supplied for command 
[{0}]
 managerServlet.invalidPath=FAIL - Invalid context path {0} was specified
 managerServlet.invalidWar=FAIL - Invalid application URL {0} was specified
 managerServlet.listed=OK - Listed applications for virtual host {0}

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=1577199r1=1577198r2=1577199view=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 Mar 13 15:30:35 2014
@@ -52,6 +52,7 @@ import org.apache.catalina.Session;
 import org.apache.catalina.Wrapper;
 import org.apache.catalina.core.StandardHost;
 import org.apache.catalina.core.StandardServer;
+import org.apache.catalina.startup.ExpandWar;
 import org.apache.catalina.util.ContextName;
 import org.apache.catalina.util.RequestUtil;
 import org.apache.catalina.util.ServerInfo;
@@ -189,8 +190,7 @@ public class ManagerServlet extends Http
 
 /**
  * File object representing the directory into which the deploy() command
- * will store the WAR and context configuration files that have been
- * uploaded.
+ * will deploy uploaded WAR files (normally the appBase).
  */
 protected File deployed = null;
 
@@ -366,8 +366,11 @@ public class ManagerServlet extends Http
 } else if (command.equals(/deploy)) {
 if (war != null || config != null) {
 deploy(writer, config, cn, war, update, smClient);
-} else {
+} else if (tag != null) {
 deploy(writer, cn, tag, smClient);
+} else {
+writer.println(smClient.getString(
+managerServlet.invalidCommand, command));
 }
 } else if (command.equals(/list)) {
 list(writer, smClient);
@@ -639,51 +642,50 @@ public class ManagerServlet extends Http
 String baseName = cn.getBaseName();
 String displayPath = cn.getDisplayName();
 
-// Check if app already exists, or undeploy it if updating
+// If app exists deployment can only proceed if update is true
+// Note existing WAR will be deleted and then replaced
 Context context = (Context) host.findChild(name);
-if (update) {
-if (context != null) {
-undeploy(writer, cn, smClient);
-}
-context = (Context) host.findChild(name);
-}
-if (context != null) {
+if (context != null  !update) {
 writer.println(smClient.getString(managerServlet.alreadyContext,
 displayPath));
 return;
 }
 
-// Calculate the base path
-File deployedPath = deployed;
-if (tag != null) {
-deployedPath = new File(versioned, tag);
-if (!deployedPath.mkdirs()  

[Bug 56248] Automatic deployment with TCD deletes customized context.xml file

2014-03-13 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56248

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 8.0.x for 8.0.4 onwards and in 7.0.x for 5.0.53 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



Re: [Bug 56248] Automatic deployment with TCD deletes customized context.xml file

2014-03-13 Thread sebb
On 13 March 2014 15:30,  bugzi...@apache.org wrote:
 https://issues.apache.org/bugzilla/show_bug.cgi?id=56248

 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 8.0.x for 8.0.4 onwards and in 7.0.x for 5.0.53 
 onwards.

5.0.53 ??

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


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



svn commit: r1577201 - /tomcat/trunk/java/org/apache/catalina/manager/ManagerServlet.java

2014-03-13 Thread markt
Author: markt
Date: Thu Mar 13 15:33:14 2014
New Revision: 1577201

URL: http://svn.apache.org/r1577201
Log:
Clean-up / consistency

Modified:
tomcat/trunk/java/org/apache/catalina/manager/ManagerServlet.java

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=1577201r1=1577200r2=1577201view=diff
==
--- tomcat/trunk/java/org/apache/catalina/manager/ManagerServlet.java (original)
+++ tomcat/trunk/java/org/apache/catalina/manager/ManagerServlet.java Thu Mar 
13 15:33:14 2014
@@ -179,13 +179,6 @@ public class ManagerServlet extends Http
 
 
 /**
- * File object representing the directory into which the deploy() command
- * will deploy uploaded WAR files (normally the appBase).
- */
-protected File deployed = null;
-
-
-/**
  * Path used to store revisions of webapps.
  */
 protected File versioned = null;
@@ -470,9 +463,6 @@ public class ManagerServlet extends Http
 versioned = (File) getServletContext().getAttribute
 (ServletContext.TEMPDIR);
 
-// Identify the appBase of the owning Host of this Context
-// (if any)
-deployed = ((Host) context.getParent()).getAppBaseFile();
 configBase = new File(context.getCatalinaBase(), conf);
 Container container = context;
 Container host = null;
@@ -666,7 +656,7 @@ public class ManagerServlet extends Http
 return;
 }
 
-File deployedWar = new File(deployed, baseName + .war);
+File deployedWar = new File(host.getAppBaseFile(), baseName + .war);
 
 // Determine full path for uploaded WAR
 File uploadedWar;



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



[Bug 56248] Automatic deployment with TCD deletes customized context.xml file

2014-03-13 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56248

--- Comment #2 from Jesse Barnum jsb_apa...@360works.com ---
Wow, thank you!!!

-- 
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 success in ASF Buildbot on tomcat-trunk

2014-03-13 Thread buildbot
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/5589

Buildbot URL: http://ci.apache.org/

Buildslave for this Build: bb-vm_ubuntu

Build Reason: scheduler
Build Source Stamp: [branch tomcat/trunk] 1577173
Blamelist: remm

Build succeeded!

sincerely,
 -The Buildbot





[GUMP@vmgump]: Project tomcat-trunk-validate (in module tomcat-trunk) failed

2014-03-13 Thread Bill Barker
To whom it may engage...

This is an automated request, but not an unsolicited one. For 
more information please visit http://gump.apache.org/nagged.html, 
and/or contact the folk at gene...@gump.apache.org.

Project tomcat-trunk-validate has an issue affecting its community integration.
This issue affects 1 projects.
The current state of this project is 'Failed', with reason 'Build Failed'.
For reference only, the following projects are affected by this:
- tomcat-trunk-validate :  Tomcat 8.x, a web server implementing the Java 
Servlet 3.1,
...


Full details are available at:

http://vmgump.apache.org/gump/public/tomcat-trunk/tomcat-trunk-validate/index.html

That said, some information snippets are provided here.

The following annotations (debug/informational/warning/error messages) were 
provided:
 -DEBUG- Dependency on checkstyle exists, no need to add for property 
checkstyle.jar.
 -INFO- Failed with reason build failed



The following work was performed:
http://vmgump.apache.org/gump/public/tomcat-trunk/tomcat-trunk-validate/gump_work/build_tomcat-trunk_tomcat-trunk-validate.html
Work Name: build_tomcat-trunk_tomcat-trunk-validate (Type: Build)
Work ended in a state of : Failed
Elapsed: 22 secs
Command Line: /usr/lib/jvm/java-7-oracle/bin/java -Djava.awt.headless=true 
-Dbuild.sysclasspath=only org.apache.tools.ant.Main 
-Dgump.merge=/srv/gump/public/gump/work/merge.xml 
-Dcheckstyle.jar=/srv/gump/public/workspace/checkstyle/target/checkstyle-5.7-SNAPSHOT.jar
 -Dexecute.validate=true validate 
[Working Directory: /srv/gump/public/workspace/tomcat-trunk]
CLASSPATH: 
/usr/lib/jvm/java-7-oracle/lib/tools.jar:/srv/gump/public/workspace/ant/dist/lib/ant.jar:/srv/gump/public/workspace/ant/dist/lib/ant-launcher.jar:/srv/gump/public/workspace/ant/dist/lib/ant-jmf.jar:/srv/gump/public/workspace/ant/dist/lib/ant-junit.jar:/srv/gump/public/workspace/ant/dist/lib/ant-junit4.jar:/srv/gump/public/workspace/ant/dist/lib/ant-swing.jar:/srv/gump/public/workspace/ant/dist/lib/ant-apache-resolver.jar:/srv/gump/public/workspace/ant/dist/lib/ant-apache-xalan2.jar:/srv/gump/public/workspace/xml-commons/java/build/resolver.jar:/srv/gump/packages/antlr/antlr-3.1.3.jar:/srv/gump/public/workspace/checkstyle/target/checkstyle-5.7-SNAPSHOT.jar:/srv/gump/public/workspace/apache-commons/beanutils/dist/commons-beanutils-20140313.jar:/srv/gump/public/workspace/apache-commons/cli/target/commons-cli-1.3-SNAPSHOT.jar:/srv/gump/public/workspace/commons-collections-3.x/target/commons-collections-3.3-SNAPSHOT.jar:/srv/gump/public/workspace/apache-commons/exec/tar
 
get/commons-exec-1.3-SNAPSHOT.jar:/srv/gump/public/workspace/apache-commons/logging/target/commons-logging-20140313.jar:/srv/gump/public/workspace/apache-commons/logging/target/commons-logging-api-20140313.jar:/srv/gump/public/workspace/apache-commons/validator/dist/commons-validator-20140313.jar:/srv/gump/public/workspace/google-guava/guava/target/guava-17.0-SNAPSHOT.jar:/srv/gump/packages/javamail-1.4/mail.jar:/srv/gump/packages/javamail-1.4/lib/mailapi.jar:/srv/gump/packages/jaf-1.1ea/activation.jar
-
Buildfile: /srv/gump/public/workspace/tomcat-trunk/build.xml

build-prepare:
   [delete] Deleting directory 
/srv/gump/public/workspace/tomcat-trunk/output/build/temp
[mkdir] Created dir: 
/srv/gump/public/workspace/tomcat-trunk/output/build/temp

compile-prepare:

download-validate:

proxyflags:

setproxy:

testexist:
 [echo] Testing  for 
/srv/gump/public/workspace/checkstyle/target/checkstyle-5.7-SNAPSHOT.jar

downloadzip:

validate:
[mkdir] Created dir: 
/srv/gump/public/workspace/tomcat-trunk/output/res/checkstyle
[checkstyle] Running Checkstyle 5.7-SNAPSHOT on 2771 files
[checkstyle] 
/srv/gump/public/workspace/tomcat-trunk/webapps/docs/changelog.xml:127: Line 
matches the illegal pattern '\s+$'.

BUILD FAILED
/srv/gump/public/workspace/tomcat-trunk/build.xml:539: Got 1 errors and 0 
warnings.

Total time: 22 seconds
-

To subscribe to this information via syndicated feeds:
- RSS: 
http://vmgump.apache.org/gump/public/tomcat-trunk/tomcat-trunk-validate/rss.xml
- Atom: 
http://vmgump.apache.org/gump/public/tomcat-trunk/tomcat-trunk-validate/atom.xml

== Gump Tracking Only ===
Produced by Apache Gump(TM) version 2.3.
Gump Run 20140313180005, vmgump.apache.org:vmgump:20140313180005
Gump E-mail Identifier (unique within run) #1.

--
Apache Gump
http://gump.apache.org/ [Instance: vmgump]

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



svn commit: r1577299 - /tomcat/trunk/webapps/docs/changelog.xml

2014-03-13 Thread markt
Author: markt
Date: Thu Mar 13 19:46:59 2014
New Revision: 1577299

URL: http://svn.apache.org/r1577299
Log:
Whitespace police

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

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1577299r1=1577298r2=1577299view=diff
==
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Thu Mar 13 19:46:59 2014
@@ -124,7 +124,7 @@
 bug56253/bug: When listing resources that are provided by a JAR, 
fix
 possible codeStringIndexOutOfBoundsException/codes. Add some unit
 tests for this and similar scenarios and fix the additional issues 
those
-unit tests identified. Based on a patch by Larry Isaacs. (markt) 
+unit tests identified. Based on a patch by Larry Isaacs. (markt)
   /fix
 /changelog
   /subsection



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



svn commit: r1577315 - in /tomcat/trunk: java/org/apache/tomcat/util/descriptor/DigesterFactory.java java/org/apache/tomcat/util/descriptor/LocalStrings.properties webapps/docs/changelog.xml

2014-03-13 Thread markt
Author: markt
Date: Thu Mar 13 20:57:01 2014
New Revision: 1577315

URL: http://svn.apache.org/r1577315
Log:
Enable Tomcat to work in a OSGI environment with alternative Servlet and JSP 
API JARs.

Modified:
tomcat/trunk/java/org/apache/tomcat/util/descriptor/DigesterFactory.java
tomcat/trunk/java/org/apache/tomcat/util/descriptor/LocalStrings.properties
tomcat/trunk/webapps/docs/changelog.xml

Modified: 
tomcat/trunk/java/org/apache/tomcat/util/descriptor/DigesterFactory.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/descriptor/DigesterFactory.java?rev=1577315r1=1577314r2=1577315view=diff
==
--- tomcat/trunk/java/org/apache/tomcat/util/descriptor/DigesterFactory.java 
(original)
+++ tomcat/trunk/java/org/apache/tomcat/util/descriptor/DigesterFactory.java 
Thu Mar 13 20:57:01 2014
@@ -16,14 +16,18 @@
  */
 package org.apache.tomcat.util.descriptor;
 
+import java.net.URL;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.Map;
 
 import javax.servlet.ServletContext;
 
+import org.apache.juli.logging.Log;
+import org.apache.juli.logging.LogFactory;
 import org.apache.tomcat.util.digester.Digester;
 import org.apache.tomcat.util.digester.RuleSet;
+import org.apache.tomcat.util.res.StringManager;
 import org.xml.sax.ext.EntityResolver2;
 
 /**
@@ -32,6 +36,25 @@ import org.xml.sax.ext.EntityResolver2;
  */
 public class DigesterFactory {
 
+private static final Log log = LogFactory.getLog(DigesterFactory.class);
+private static final StringManager sm =
+StringManager.getManager(Constants.PACKAGE_NAME);
+
+private static final ClassServletContext CLASS_SERVLET_CONTEXT;
+private static final Class? CLASS_JSP_CONTEXT;
+
+static {
+CLASS_SERVLET_CONTEXT = ServletContext.class;
+Class? jspContext = null;
+try {
+jspContext = Class.forName(javax.servlet.jsp.JspContext);
+} catch (ClassNotFoundException e) {
+// Ignore - JSP API is not present.
+}
+CLASS_JSP_CONTEXT = jspContext;
+}
+
+
 /**
  * Mapping of well-known public IDs used by the Servlet API to the matching
  * local resource.
@@ -49,39 +72,39 @@ public class DigesterFactory {
 MapString, String systemIds = new HashMap();
 
 // W3C
-publicIds.put(XmlIdentifiers.XSD_10_PUBLIC, idFor(XMLSchema.dtd));
-publicIds.put(XmlIdentifiers.DATATYPES_PUBLIC, idFor(datatypes.dtd));
-systemIds.put(XmlIdentifiers.XML_2001_XSD, idFor(xml.xsd));
+add(publicIds, XmlIdentifiers.XSD_10_PUBLIC, 
locationFor(XMLSchema.dtd));
+add(publicIds, XmlIdentifiers.DATATYPES_PUBLIC, 
locationFor(datatypes.dtd));
+add(systemIds, XmlIdentifiers.XML_2001_XSD, locationFor(xml.xsd));
 
 // from J2EE 1.2
-publicIds.put(XmlIdentifiers.WEB_22_PUBLIC, idFor(web-app_2_2.dtd));
-publicIds.put(XmlIdentifiers.TLD_11_PUBLIC, 
idFor(web-jsptaglibrary_1_1.dtd));
+add(publicIds, XmlIdentifiers.WEB_22_PUBLIC, 
locationFor(web-app_2_2.dtd));
+add(publicIds, XmlIdentifiers.TLD_11_PUBLIC, 
locationFor(web-jsptaglibrary_1_1.dtd));
 
 // from J2EE 1.3
-publicIds.put(XmlIdentifiers.WEB_23_PUBLIC, idFor(web-app_2_3.dtd));
-publicIds.put(XmlIdentifiers.TLD_12_PUBLIC, 
idFor(web-jsptaglibrary_1_2.dtd));
+add(publicIds, XmlIdentifiers.WEB_23_PUBLIC, 
locationFor(web-app_2_3.dtd));
+add(publicIds, XmlIdentifiers.TLD_12_PUBLIC, 
locationFor(web-jsptaglibrary_1_2.dtd));
 
 // from J2EE 1.4
-
systemIds.put(http://www.ibm.com/webservices/xsd/j2ee_web_services_1_1.xsd;,
-idFor(j2ee_web_services_1_1.xsd));
-
systemIds.put(http://www.ibm.com/webservices/xsd/j2ee_web_services_client_1_1.xsd;,
-idFor(j2ee_web_services_client_1_1.xsd));
-systemIds.put(XmlIdentifiers.WEB_24_XSD, idFor(web-app_2_4.xsd));
-systemIds.put(XmlIdentifiers.TLD_20_XSD, 
idFor(web-jsptaglibrary_2_0.xsd));
+add(systemIds, 
http://www.ibm.com/webservices/xsd/j2ee_web_services_1_1.xsd;,
+locationFor(j2ee_web_services_1_1.xsd));
+add(systemIds, 
http://www.ibm.com/webservices/xsd/j2ee_web_services_client_1_1.xsd;,
+locationFor(j2ee_web_services_client_1_1.xsd));
+add(systemIds, XmlIdentifiers.WEB_24_XSD, 
locationFor(web-app_2_4.xsd));
+add(systemIds, XmlIdentifiers.TLD_20_XSD, 
locationFor(web-jsptaglibrary_2_0.xsd));
 addSelf(systemIds, j2ee_1_4.xsd);
 addSelf(systemIds, jsp_2_0.xsd);
 
 // from JavaEE 5
-systemIds.put(XmlIdentifiers.WEB_25_XSD, idFor(web-app_2_5.xsd));
-systemIds.put(XmlIdentifiers.TLD_21_XSD, 
idFor(web-jsptaglibrary_2_1.xsd));
+add(systemIds, XmlIdentifiers.WEB_25_XSD, 
locationFor(web-app_2_5.xsd));
+add(systemIds, XmlIdentifiers.TLD_21_XSD, 

Re: svn commit: r1560931 - in /tomcat/tc7.0.x/trunk: build.xml java/org/apache/tomcat/util/descriptor/DigesterFactory.java

2014-03-13 Thread Konstantin Kolinko
2014-03-13 16:28 GMT+04:00 Violeta Georgieva miles...@gmail.com:
 Hi,

 In OSGi world the functionality is separated in different bundles and
 schemes for servlet API is in one bundle and schemes for JSP API in
 another.
 With that change we pack all schemes in servlet-api.jar. Till this changed
 one was able to use whatever servlet api bundle compatible with Tomcat but
 with that change we enforce people to use only the jar provided by Tomcat
 which is not a bundle also.

 Is it possible to return back the check with JSPContext? Something like
 this?


 Till this changed
 one was able to use whatever servlet api bundle compatible with Tomcat

It is container's responsibility to provide the servlet API jar,  and
I think the said jar can have whatever hard ties with container's
internals.

An application can use whatever 3rd party servlet.jar implementation
at compile time, but at run time it has to use the container-provided
one.

For example, Cookie.java relies on certain configuration properties
defined by Tomcat documentation to provide secure and
specification-compliant behaviour.  You cannot swap that
implementation with random other.

Apparently there are a ways to bypass Tomcat's enforcement of
specification compliance wrt. where servlet-api.jar comes from.  E.g.
if one places a rogue jar into $CLASSPATH or into ${catalina.base}/lib
or into endorsed directory, or into JRE. I think it is good that we
can uncover such broken configurations.

E.g.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56236

If you want to break dependency of DigesterFactory on this specific
implementation of ServletContext, it is possible to copy schemas into
the same jar where DigesterFactory.class is. But I see no need for
that, and I think that such a change would make the things worse.

Best regards,
Konstantin Kolinko

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



svn commit: r1577324 - /tomcat/trunk/java/org/apache/tomcat/util/descriptor/DigesterFactory.java

2014-03-13 Thread markt
Author: markt
Date: Thu Mar 13 21:26:40 2014
New Revision: 1577324

URL: http://svn.apache.org/r1577324
Log:
Simplify

Modified:
tomcat/trunk/java/org/apache/tomcat/util/descriptor/DigesterFactory.java

Modified: 
tomcat/trunk/java/org/apache/tomcat/util/descriptor/DigesterFactory.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/descriptor/DigesterFactory.java?rev=1577324r1=1577323r2=1577324view=diff
==
--- tomcat/trunk/java/org/apache/tomcat/util/descriptor/DigesterFactory.java 
(original)
+++ tomcat/trunk/java/org/apache/tomcat/util/descriptor/DigesterFactory.java 
Thu Mar 13 21:26:40 2014
@@ -140,10 +140,8 @@ public class DigesterFactory {
 
 private static String locationFor(String name) {
 URL location = CLASS_SERVLET_CONTEXT.getResource(resources/ + name);
-if (location == null) {
-if (CLASS_JSP_CONTEXT != null) {
-location = CLASS_JSP_CONTEXT.getResource(resources/ + name);
-}
+if (location == null  CLASS_JSP_CONTEXT != null) {
+location = CLASS_JSP_CONTEXT.getResource(resources/ + name);
 }
 if (location == null) {
 return null;



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



svn commit: r1577328 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/tomcat/util/descriptor/DigesterFactory.java java/org/apache/tomcat/util/descriptor/LocalStrings.properties webapps/docs/changelog.xm

2014-03-13 Thread markt
Author: markt
Date: Thu Mar 13 21:33:08 2014
New Revision: 1577328

URL: http://svn.apache.org/r1577328
Log:
Enable Tomcat to work in a OSGI environment with alternative Servlet and JSP 
API JARs.

Modified:
tomcat/tc7.0.x/trunk/   (props changed)

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/descriptor/DigesterFactory.java

tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/descriptor/LocalStrings.properties
tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml

Propchange: tomcat/tc7.0.x/trunk/
--
  Merged /tomcat/trunk:r1577315,1577324

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/descriptor/DigesterFactory.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/descriptor/DigesterFactory.java?rev=1577328r1=1577327r2=1577328view=diff
==
--- 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/descriptor/DigesterFactory.java
 (original)
+++ 
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/descriptor/DigesterFactory.java
 Thu Mar 13 21:33:08 2014
@@ -23,8 +23,11 @@ import java.util.Map;
 
 import javax.servlet.ServletContext;
 
+import org.apache.juli.logging.Log;
+import org.apache.juli.logging.LogFactory;
 import org.apache.tomcat.util.digester.Digester;
 import org.apache.tomcat.util.digester.RuleSet;
+import org.apache.tomcat.util.res.StringManager;
 import org.xml.sax.ext.EntityResolver2;
 
 /**
@@ -33,6 +36,25 @@ import org.xml.sax.ext.EntityResolver2;
  */
 public class DigesterFactory {
 
+private static final Log log = LogFactory.getLog(DigesterFactory.class);
+private static final StringManager sm =
+StringManager.getManager(Constants.PACKAGE_NAME);
+
+private static final ClassServletContext CLASS_SERVLET_CONTEXT;
+private static final Class? CLASS_JSP_CONTEXT;
+
+static {
+CLASS_SERVLET_CONTEXT = ServletContext.class;
+Class? jspContext = null;
+try {
+jspContext = Class.forName(javax.servlet.jsp.JspContext);
+} catch (ClassNotFoundException e) {
+// Ignore - JSP API is not present.
+}
+CLASS_JSP_CONTEXT = jspContext;
+}
+
+
 /**
  * Mapping of well-known public IDs used by the Servlet API to the matching
  * local resource.
@@ -50,39 +72,39 @@ public class DigesterFactory {
 MapString, String systemIds = new HashMapString, String();
 
 // W3C
-publicIds.put(XmlIdentifiers.XSD_10_PUBLIC, idFor(XMLSchema.dtd));
-publicIds.put(XmlIdentifiers.DATATYPES_PUBLIC, idFor(datatypes.dtd));
-systemIds.put(XmlIdentifiers.XML_2001_XSD, idFor(xml.xsd));
+add(publicIds, XmlIdentifiers.XSD_10_PUBLIC, 
locationFor(XMLSchema.dtd));
+add(publicIds, XmlIdentifiers.DATATYPES_PUBLIC, 
locationFor(datatypes.dtd));
+add(systemIds, XmlIdentifiers.XML_2001_XSD, locationFor(xml.xsd));
 
 // from J2EE 1.2
-publicIds.put(XmlIdentifiers.WEB_22_PUBLIC, idFor(web-app_2_2.dtd));
-publicIds.put(XmlIdentifiers.TLD_11_PUBLIC, 
idFor(web-jsptaglibrary_1_1.dtd));
+add(publicIds, XmlIdentifiers.WEB_22_PUBLIC, 
locationFor(web-app_2_2.dtd));
+add(publicIds, XmlIdentifiers.TLD_11_PUBLIC, 
locationFor(web-jsptaglibrary_1_1.dtd));
 
 // from J2EE 1.3
-publicIds.put(XmlIdentifiers.WEB_23_PUBLIC, idFor(web-app_2_3.dtd));
-publicIds.put(XmlIdentifiers.TLD_12_PUBLIC, 
idFor(web-jsptaglibrary_1_2.dtd));
+add(publicIds, XmlIdentifiers.WEB_23_PUBLIC, 
locationFor(web-app_2_3.dtd));
+add(publicIds, XmlIdentifiers.TLD_12_PUBLIC, 
locationFor(web-jsptaglibrary_1_2.dtd));
 
 // from J2EE 1.4
-
systemIds.put(http://www.ibm.com/webservices/xsd/j2ee_web_services_1_1.xsd;,
-idFor(j2ee_web_services_1_1.xsd));
-
systemIds.put(http://www.ibm.com/webservices/xsd/j2ee_web_services_client_1_1.xsd;,
-idFor(j2ee_web_services_client_1_1.xsd));
-systemIds.put(XmlIdentifiers.WEB_24_XSD, idFor(web-app_2_4.xsd));
-systemIds.put(XmlIdentifiers.TLD_20_XSD, 
idFor(web-jsptaglibrary_2_0.xsd));
+add(systemIds, 
http://www.ibm.com/webservices/xsd/j2ee_web_services_1_1.xsd;,
+locationFor(j2ee_web_services_1_1.xsd));
+add(systemIds, 
http://www.ibm.com/webservices/xsd/j2ee_web_services_client_1_1.xsd;,
+locationFor(j2ee_web_services_client_1_1.xsd));
+add(systemIds, XmlIdentifiers.WEB_24_XSD, 
locationFor(web-app_2_4.xsd));
+add(systemIds, XmlIdentifiers.TLD_20_XSD, 
locationFor(web-jsptaglibrary_2_0.xsd));
 addSelf(systemIds, j2ee_1_4.xsd);
 addSelf(systemIds, jsp_2_0.xsd);
 
 // from JavaEE 5
-systemIds.put(XmlIdentifiers.WEB_25_XSD, idFor(web-app_2_5.xsd));
-systemIds.put(XmlIdentifiers.TLD_21_XSD, 

Re: svn commit: r1560931 - in /tomcat/tc7.0.x/trunk: build.xml java/org/apache/tomcat/util/descriptor/DigesterFactory.java

2014-03-13 Thread Mark Thomas
On 13/03/2014 13:41, Violeta Georgieva wrote:
 2014-03-13 15:28 GMT+02:00 Mark Thomas ma...@apache.org:

snip/

 What exactly is it that we want to cover? I can think of a number of
 requirements.

 1. Ensure that Tomcat still works (excluding validation) if using a
 servlet API implementation that does not include the JSP schemas.

 2. Ensure that Tomcat can still validate web.xml files if using a
 Servlet API implementation that does not include JSP schemas along with
 a JSP API implementation that does.

 Any more?
 
 No. These two cover the scenario.

I think my recent changes have addressed this. It would be good if you
could test with 7.0.x trunk and report back.

Mark

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



svn commit: r1577331 - /tomcat/tc6.0.x/trunk/STATUS.txt

2014-03-13 Thread markt
Author: markt
Date: Thu Mar 13 21:38:52 2014
New Revision: 1577331

URL: http://svn.apache.org/r1577331
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=1577331r1=1577330r2=1577331view=diff
==
--- tomcat/tc6.0.x/trunk/STATUS.txt (original)
+++ tomcat/tc6.0.x/trunk/STATUS.txt Thu Mar 13 21:38:52 2014
@@ -65,6 +65,12 @@ PATCHES PROPOSED TO BACKPORT:
   +1: kkolinko, markt
   -1:
 
+* Fix issue with Tomcat running in environments (e.g. OSGI) with alternative
+  Servlet and JSP API implementations that package the XML schemas differently
+  
http://people.apache.org/~markt/patches/2014-03-13-osgi-resources-tc6-v1.patch
+  +1: markt
+  -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



Re: svn commit: r1577328 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/tomcat/util/descriptor/DigesterFactory.java java/org/apache/tomcat/util/descriptor/LocalStrings.properties webapps/docs/changelo

2014-03-13 Thread Konstantin Kolinko
1. addSelf() is odd, does not match with TC8. Bad merge?
2. Both add() and addSelf() should display a warning.
Maybe move log.warn() into locationFor(..) method.
3. What is the point of putting null values into the maps.
4. Message:
 digesterFactory.missingSchema=The XML schema [{0}] could not be found. This 
 is likely to break XML validation if enabled.

It is ambiguous to what if enabled refers to (what is the subject
for that verb).

Overall I do not like motivation behind this change (as I replied in
Violetta's thread),  but technically it does not change behaviour (in
the correct case) and provides a warning message instead of ugly NPE.
Thus it is OK with me.



2014-03-14 1:33 GMT+04:00  ma...@apache.org:
 Author: markt
 Date: Thu Mar 13 21:33:08 2014
 New Revision: 1577328

 URL: http://svn.apache.org/r1577328
 Log:
 Enable Tomcat to work in a OSGI environment with alternative Servlet and JSP 
 API JARs.

 Modified:
 tomcat/tc7.0.x/trunk/   (props changed)
 
 tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/descriptor/DigesterFactory.java
 
 tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/descriptor/LocalStrings.properties
 tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml

 Propchange: tomcat/tc7.0.x/trunk/
 --
   Merged /tomcat/trunk:r1577315,1577324

 Modified: 
 tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/descriptor/DigesterFactory.java
 URL: 
 http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/descriptor/DigesterFactory.java?rev=1577328r1=1577327r2=1577328view=diff
 ==
 --- 
 tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/descriptor/DigesterFactory.java
  (original)
 +++ 
 tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/descriptor/DigesterFactory.java
  Thu Mar 13 21:33:08 2014
 @@ -23,8 +23,11 @@ import java.util.Map;

  import javax.servlet.ServletContext;

 +import org.apache.juli.logging.Log;
 +import org.apache.juli.logging.LogFactory;
  import org.apache.tomcat.util.digester.Digester;
  import org.apache.tomcat.util.digester.RuleSet;
 +import org.apache.tomcat.util.res.StringManager;
  import org.xml.sax.ext.EntityResolver2;

  /**
 @@ -33,6 +36,25 @@ import org.xml.sax.ext.EntityResolver2;
   */
  public class DigesterFactory {

 +private static final Log log = LogFactory.getLog(DigesterFactory.class);
 +private static final StringManager sm =
 +StringManager.getManager(Constants.PACKAGE_NAME);
 +
 +private static final ClassServletContext CLASS_SERVLET_CONTEXT;
 +private static final Class? CLASS_JSP_CONTEXT;
 +
 +static {
 +CLASS_SERVLET_CONTEXT = ServletContext.class;
 +Class? jspContext = null;
 +try {
 +jspContext = Class.forName(javax.servlet.jsp.JspContext);
 +} catch (ClassNotFoundException e) {
 +// Ignore - JSP API is not present.
 +}
 +CLASS_JSP_CONTEXT = jspContext;
 +}
 +
 +
  /**
   * Mapping of well-known public IDs used by the Servlet API to the 
 matching
   * local resource.
 @@ -50,39 +72,39 @@ public class DigesterFactory {
  MapString, String systemIds = new HashMapString, String();

  // W3C
 -publicIds.put(XmlIdentifiers.XSD_10_PUBLIC, idFor(XMLSchema.dtd));
 -publicIds.put(XmlIdentifiers.DATATYPES_PUBLIC, 
 idFor(datatypes.dtd));
 -systemIds.put(XmlIdentifiers.XML_2001_XSD, idFor(xml.xsd));
 +add(publicIds, XmlIdentifiers.XSD_10_PUBLIC, 
 locationFor(XMLSchema.dtd));
 +add(publicIds, XmlIdentifiers.DATATYPES_PUBLIC, 
 locationFor(datatypes.dtd));
 +add(systemIds, XmlIdentifiers.XML_2001_XSD, locationFor(xml.xsd));

  // from J2EE 1.2
 -publicIds.put(XmlIdentifiers.WEB_22_PUBLIC, 
 idFor(web-app_2_2.dtd));
 -publicIds.put(XmlIdentifiers.TLD_11_PUBLIC, 
 idFor(web-jsptaglibrary_1_1.dtd));
 +add(publicIds, XmlIdentifiers.WEB_22_PUBLIC, 
 locationFor(web-app_2_2.dtd));
 +add(publicIds, XmlIdentifiers.TLD_11_PUBLIC, 
 locationFor(web-jsptaglibrary_1_1.dtd));

  // from J2EE 1.3
 -publicIds.put(XmlIdentifiers.WEB_23_PUBLIC, 
 idFor(web-app_2_3.dtd));
 -publicIds.put(XmlIdentifiers.TLD_12_PUBLIC, 
 idFor(web-jsptaglibrary_1_2.dtd));
 +add(publicIds, XmlIdentifiers.WEB_23_PUBLIC, 
 locationFor(web-app_2_3.dtd));
 +add(publicIds, XmlIdentifiers.TLD_12_PUBLIC, 
 locationFor(web-jsptaglibrary_1_2.dtd));

  // from J2EE 1.4
 -
 systemIds.put(http://www.ibm.com/webservices/xsd/j2ee_web_services_1_1.xsd;,
 -idFor(j2ee_web_services_1_1.xsd));
 -
 systemIds.put(http://www.ibm.com/webservices/xsd/j2ee_web_services_client_1_1.xsd;,
 -idFor(j2ee_web_services_client_1_1.xsd));
 -systemIds.put(XmlIdentifiers.WEB_24_XSD, idFor(web-app_2_4.xsd));
 -

svn commit: r1577376 - /tomcat/trunk/java/org/apache/coyote/http11/upgrade/Nio2ServletOutputStream.java

2014-03-13 Thread remm
Author: remm
Date: Thu Mar 13 23:27:12 2014
New Revision: 1577376

URL: http://svn.apache.org/r1577376
Log:
With the writeLock in use in the superclass, remove the useless extra locking 
(after testing).

Modified:

tomcat/trunk/java/org/apache/coyote/http11/upgrade/Nio2ServletOutputStream.java

Modified: 
tomcat/trunk/java/org/apache/coyote/http11/upgrade/Nio2ServletOutputStream.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/upgrade/Nio2ServletOutputStream.java?rev=1577376r1=1577375r2=1577376view=diff
==
--- 
tomcat/trunk/java/org/apache/coyote/http11/upgrade/Nio2ServletOutputStream.java 
(original)
+++ 
tomcat/trunk/java/org/apache/coyote/http11/upgrade/Nio2ServletOutputStream.java 
Thu Mar 13 23:27:12 2014
@@ -49,13 +49,11 @@ public class Nio2ServletOutputStream ext
 this.completionHandler = new CompletionHandlerInteger, 
SocketWrapperNio2Channel() {
 @Override
 public void completed(Integer nBytes, SocketWrapperNio2Channel 
attachment) {
-synchronized (completionHandler) {
-if (nBytes.intValue()  0) {
-failed(new ClosedChannelException(), attachment);
-return;
-}
-writePending.release();
+if (nBytes.intValue()  0) {
+failed(new ClosedChannelException(), attachment);
+return;
 }
+writePending.release();
 if (!Nio2Endpoint.isInline()) {
 try {
 onWritePossible();
@@ -135,15 +133,13 @@ public class Nio2ServletOutputStream ext
 }
 } else {
 if (writePending.tryAcquire()) {
-synchronized (completionHandler) {
-buffer.clear();
-buffer.put(b, off, len);
-buffer.flip();
-Nio2Endpoint.startInline();
-channel.write(buffer, socketWrapper.getTimeout(), 
TimeUnit.MILLISECONDS, socketWrapper, completionHandler);
-Nio2Endpoint.endInline();
-written = len;
-}
+buffer.clear();
+buffer.put(b, off, len);
+buffer.flip();
+Nio2Endpoint.startInline();
+channel.write(buffer, socketWrapper.getTimeout(), 
TimeUnit.MILLISECONDS, socketWrapper, completionHandler);
+Nio2Endpoint.endInline();
+written = len;
 }
 }
 return written;



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