[Bug 64017] Apache http server 2.4.41 - Issue with transfer-encoding

2020-01-30 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=64017

--- Comment #9 from Vinoth  ---
(In reply to Mark Thomas from comment #7)
> If you can share the data publicly, more of us can help you. Failing that
> send it to me (ma...@apache.org) and I'll share it with other Tomcat
> committers who want to investigate this issue.

Thanks Mark. Was able to identify the issue, looks like has duplicate header on
the request 'Transfer Encoding: Chunked' twice. 

"Header unset Transfer-Encoding" on apache fixed the issue. However further
digging why duplicate header is being generated.

Thanks

-- 
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 64089] Resource paths resolve symlinks

2020-01-30 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=64089

Mark Thomas  changed:

   What|Removed |Added

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

--- Comment #8 from Mark Thomas  ---
${catalina.base}/../../../myentity.txt  works now.

Fixed in:
- master for 10.0.0.0-M1 onwards
- 9.0.x for 9.0.31 onwards
- 8.5.x for 8.5.51 onwards
- 7.0.x for 7.0.100 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



[tomcat] branch 7.0.x updated: Fix BZ 64089 Add ${...} support to XML external entity definitions

2020-01-30 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 7.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/7.0.x by this push:
 new 7c4ebeb  Fix BZ 64089 Add ${...} support to XML external entity 
definitions
7c4ebeb is described below

commit 7c4ebebf8f873df83327ad47a77d38c4e758f473
Author: Mark Thomas 
AuthorDate: Thu Jan 30 21:17:22 2020 +

Fix BZ 64089 Add ${...} support to XML external entity definitions

https://bz.apache.org/bugzilla/show_bug.cgi?id=64089
---
 java/org/apache/tomcat/util/digester/Digester.java | 74 +-
 webapps/docs/changelog.xml |  4 ++
 2 files changed, 76 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/tomcat/util/digester/Digester.java 
b/java/org/apache/tomcat/util/digester/Digester.java
index aee62dc..1d65db7 100644
--- a/java/org/apache/tomcat/util/digester/Digester.java
+++ b/java/org/apache/tomcat/util/digester/Digester.java
@@ -39,6 +39,7 @@ import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 import org.apache.tomcat.util.ExceptionUtils;
 import org.apache.tomcat.util.IntrospectionUtils;
+import org.apache.tomcat.util.IntrospectionUtils.PropertySource;
 import org.apache.tomcat.util.security.PermissionCheck;
 import org.xml.sax.Attributes;
 import org.xml.sax.EntityResolver;
@@ -51,6 +52,7 @@ import org.xml.sax.SAXNotSupportedException;
 import org.xml.sax.SAXParseException;
 import org.xml.sax.XMLReader;
 import org.xml.sax.ext.DefaultHandler2;
+import org.xml.sax.ext.EntityResolver2;
 import org.xml.sax.helpers.AttributesImpl;
 
 
@@ -889,12 +891,20 @@ public class Digester extends DefaultHandler2 {
 reader.setDTDHandler(this);
 reader.setContentHandler(this);
 
+EntityResolver entityResolver = getEntityResolver();
 if (entityResolver == null) {
-reader.setEntityResolver(this);
+entityResolver = this;
+}
+
+// Wrap the resolver so we can perform ${...} property replacement
+if (entityResolver instanceof EntityResolver2) {
+entityResolver = new EntityResolver2Wrapper((EntityResolver2) 
entityResolver, source, classLoader);
 } else {
-reader.setEntityResolver(entityResolver);
+entityResolver = new EntityResolverWrapper(entityResolver, source, 
classLoader);
 }
 
+reader.setEntityResolver(entityResolver);
+
 reader.setProperty("http://xml.org/sax/properties/lexical-handler";, 
this);
 
 reader.setErrorHandler(this);
@@ -2743,4 +2753,64 @@ public class Digester extends DefaultHandler2 {
 return new StringBuilder(out);
 }
 }
+
+
+private static class EntityResolverWrapper implements EntityResolver {
+
+private final EntityResolver entityResolver;
+private final PropertySource[] source;
+private final ClassLoader classLoader;
+
+public EntityResolverWrapper(EntityResolver entityResolver, 
PropertySource[] source, ClassLoader classLoader) {
+this.entityResolver = entityResolver;
+this.source = source;
+this.classLoader = classLoader;
+}
+
+@Override
+public InputSource resolveEntity(String publicId, String systemId)
+throws SAXException, IOException {
+publicId = replace(publicId);
+systemId = replace(systemId);
+return entityResolver.resolveEntity(publicId, systemId);
+}
+
+protected String replace(String input) {
+try {
+return IntrospectionUtils.replaceProperties(input, null, 
source, classLoader);
+} catch (Exception e) {
+return input;
+}
+}
+}
+
+
+private static class EntityResolver2Wrapper extends EntityResolverWrapper 
implements EntityResolver2 {
+
+private final EntityResolver2 entityResolver2;
+
+public EntityResolver2Wrapper(EntityResolver2 entityResolver, 
PropertySource[] source,
+ClassLoader classLoader) {
+super(entityResolver, source, classLoader);
+this.entityResolver2 = entityResolver;
+}
+
+@Override
+public InputSource getExternalSubset(String name, String baseURI)
+throws SAXException, IOException {
+name = replace(name);
+baseURI = replace(baseURI);
+return entityResolver2.getExternalSubset(name, baseURI);
+}
+
+@Override
+public InputSource resolveEntity(String name, String publicId, String 
baseURI,
+String systemId) throws SAXException, IOException {
+name = replace(name);
+publicId = replace(publicId);
+baseURI = replace(baseURI);
+systemId = replace(systemId);
+return entityResolver2.resolv

[tomcat] branch 8.5.x updated: Fix BZ 64089 Add ${...} support to XML external entity definitions

2020-01-30 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/8.5.x by this push:
 new 13e5dd6  Fix BZ 64089 Add ${...} support to XML external entity 
definitions
13e5dd6 is described below

commit 13e5dd68b28ba421befbd69e5e3b65e8f6a4c277
Author: Mark Thomas 
AuthorDate: Thu Jan 30 21:17:22 2020 +

Fix BZ 64089 Add ${...} support to XML external entity definitions

https://bz.apache.org/bugzilla/show_bug.cgi?id=64089
---
 java/org/apache/tomcat/util/digester/Digester.java | 74 +-
 webapps/docs/changelog.xml |  4 ++
 2 files changed, 76 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/tomcat/util/digester/Digester.java 
b/java/org/apache/tomcat/util/digester/Digester.java
index 8466241..3791d8c 100644
--- a/java/org/apache/tomcat/util/digester/Digester.java
+++ b/java/org/apache/tomcat/util/digester/Digester.java
@@ -41,6 +41,7 @@ import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 import org.apache.tomcat.util.ExceptionUtils;
 import org.apache.tomcat.util.IntrospectionUtils;
+import org.apache.tomcat.util.IntrospectionUtils.PropertySource;
 import org.apache.tomcat.util.buf.B2CConverter;
 import org.apache.tomcat.util.res.StringManager;
 import org.apache.tomcat.util.security.PermissionCheck;
@@ -55,6 +56,7 @@ import org.xml.sax.SAXNotSupportedException;
 import org.xml.sax.SAXParseException;
 import org.xml.sax.XMLReader;
 import org.xml.sax.ext.DefaultHandler2;
+import org.xml.sax.ext.EntityResolver2;
 import org.xml.sax.ext.Locator2;
 import org.xml.sax.helpers.AttributesImpl;
 
@@ -844,12 +846,20 @@ public class Digester extends DefaultHandler2 {
 reader.setDTDHandler(this);
 reader.setContentHandler(this);
 
+EntityResolver entityResolver = getEntityResolver();
 if (entityResolver == null) {
-reader.setEntityResolver(this);
+entityResolver = this;
+}
+
+// Wrap the resolver so we can perform ${...} property replacement
+if (entityResolver instanceof EntityResolver2) {
+entityResolver = new EntityResolver2Wrapper((EntityResolver2) 
entityResolver, source, classLoader);
 } else {
-reader.setEntityResolver(entityResolver);
+entityResolver = new EntityResolverWrapper(entityResolver, source, 
classLoader);
 }
 
+reader.setEntityResolver(entityResolver);
+
 reader.setProperty("http://xml.org/sax/properties/lexical-handler";, 
this);
 
 reader.setErrorHandler(this);
@@ -2023,4 +2033,64 @@ public class Digester extends DefaultHandler2 {
 return new StringBuilder(out);
 }
 }
+
+
+private static class EntityResolverWrapper implements EntityResolver {
+
+private final EntityResolver entityResolver;
+private final PropertySource[] source;
+private final ClassLoader classLoader;
+
+public EntityResolverWrapper(EntityResolver entityResolver, 
PropertySource[] source, ClassLoader classLoader) {
+this.entityResolver = entityResolver;
+this.source = source;
+this.classLoader = classLoader;
+}
+
+@Override
+public InputSource resolveEntity(String publicId, String systemId)
+throws SAXException, IOException {
+publicId = replace(publicId);
+systemId = replace(systemId);
+return entityResolver.resolveEntity(publicId, systemId);
+}
+
+protected String replace(String input) {
+try {
+return IntrospectionUtils.replaceProperties(input, null, 
source, classLoader);
+} catch (Exception e) {
+return input;
+}
+}
+}
+
+
+private static class EntityResolver2Wrapper extends EntityResolverWrapper 
implements EntityResolver2 {
+
+private final EntityResolver2 entityResolver2;
+
+public EntityResolver2Wrapper(EntityResolver2 entityResolver, 
PropertySource[] source,
+ClassLoader classLoader) {
+super(entityResolver, source, classLoader);
+this.entityResolver2 = entityResolver;
+}
+
+@Override
+public InputSource getExternalSubset(String name, String baseURI)
+throws SAXException, IOException {
+name = replace(name);
+baseURI = replace(baseURI);
+return entityResolver2.getExternalSubset(name, baseURI);
+}
+
+@Override
+public InputSource resolveEntity(String name, String publicId, String 
baseURI,
+String systemId) throws SAXException, IOException {
+name = replace(name);
+publicId = replace(publicId);
+baseURI = replace(baseURI);
+systemId 

[tomcat] branch 9.0.x updated: Fix BZ 64089 Add ${...} support to XML external entity definitions

2020-01-30 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/9.0.x by this push:
 new 0dd2b3e  Fix BZ 64089 Add ${...} support to XML external entity 
definitions
0dd2b3e is described below

commit 0dd2b3e078e98cdefc94c00bdba71f5aa22dbea9
Author: Mark Thomas 
AuthorDate: Thu Jan 30 21:17:22 2020 +

Fix BZ 64089 Add ${...} support to XML external entity definitions

https://bz.apache.org/bugzilla/show_bug.cgi?id=64089
---
 java/org/apache/tomcat/util/digester/Digester.java | 74 +-
 webapps/docs/changelog.xml |  4 ++
 2 files changed, 76 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/tomcat/util/digester/Digester.java 
b/java/org/apache/tomcat/util/digester/Digester.java
index 59a347b..a7c1740 100644
--- a/java/org/apache/tomcat/util/digester/Digester.java
+++ b/java/org/apache/tomcat/util/digester/Digester.java
@@ -41,6 +41,7 @@ import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 import org.apache.tomcat.util.ExceptionUtils;
 import org.apache.tomcat.util.IntrospectionUtils;
+import org.apache.tomcat.util.IntrospectionUtils.PropertySource;
 import org.apache.tomcat.util.buf.B2CConverter;
 import org.apache.tomcat.util.res.StringManager;
 import org.apache.tomcat.util.security.PermissionCheck;
@@ -55,6 +56,7 @@ import org.xml.sax.SAXNotSupportedException;
 import org.xml.sax.SAXParseException;
 import org.xml.sax.XMLReader;
 import org.xml.sax.ext.DefaultHandler2;
+import org.xml.sax.ext.EntityResolver2;
 import org.xml.sax.ext.Locator2;
 import org.xml.sax.helpers.AttributesImpl;
 
@@ -815,12 +817,20 @@ public class Digester extends DefaultHandler2 {
 reader.setDTDHandler(this);
 reader.setContentHandler(this);
 
+EntityResolver entityResolver = getEntityResolver();
 if (entityResolver == null) {
-reader.setEntityResolver(this);
+entityResolver = this;
+}
+
+// Wrap the resolver so we can perform ${...} property replacement
+if (entityResolver instanceof EntityResolver2) {
+entityResolver = new EntityResolver2Wrapper((EntityResolver2) 
entityResolver, source, classLoader);
 } else {
-reader.setEntityResolver(entityResolver);
+entityResolver = new EntityResolverWrapper(entityResolver, source, 
classLoader);
 }
 
+reader.setEntityResolver(entityResolver);
+
 reader.setProperty("http://xml.org/sax/properties/lexical-handler";, 
this);
 
 reader.setErrorHandler(this);
@@ -1976,4 +1986,64 @@ public class Digester extends DefaultHandler2 {
 return new StringBuilder(out);
 }
 }
+
+
+private static class EntityResolverWrapper implements EntityResolver {
+
+private final EntityResolver entityResolver;
+private final PropertySource[] source;
+private final ClassLoader classLoader;
+
+public EntityResolverWrapper(EntityResolver entityResolver, 
PropertySource[] source, ClassLoader classLoader) {
+this.entityResolver = entityResolver;
+this.source = source;
+this.classLoader = classLoader;
+}
+
+@Override
+public InputSource resolveEntity(String publicId, String systemId)
+throws SAXException, IOException {
+publicId = replace(publicId);
+systemId = replace(systemId);
+return entityResolver.resolveEntity(publicId, systemId);
+}
+
+protected String replace(String input) {
+try {
+return IntrospectionUtils.replaceProperties(input, null, 
source, classLoader);
+} catch (Exception e) {
+return input;
+}
+}
+}
+
+
+private static class EntityResolver2Wrapper extends EntityResolverWrapper 
implements EntityResolver2 {
+
+private final EntityResolver2 entityResolver2;
+
+public EntityResolver2Wrapper(EntityResolver2 entityResolver, 
PropertySource[] source,
+ClassLoader classLoader) {
+super(entityResolver, source, classLoader);
+this.entityResolver2 = entityResolver;
+}
+
+@Override
+public InputSource getExternalSubset(String name, String baseURI)
+throws SAXException, IOException {
+name = replace(name);
+baseURI = replace(baseURI);
+return entityResolver2.getExternalSubset(name, baseURI);
+}
+
+@Override
+public InputSource resolveEntity(String name, String publicId, String 
baseURI,
+String systemId) throws SAXException, IOException {
+name = replace(name);
+publicId = replace(publicId);
+baseURI = replace(baseURI);
+systemId 

[tomcat] branch master updated (2becffb -> e745cea)

2020-01-30 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git.


from 2becffb  Use generics now they are used in the API
 new 2debbc2  Fix typo
 new e745cea  Fix BZ 64089 Add ${...} support to XML external entity 
definitions

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 java/org/apache/tomcat/util/digester/Digester.java | 74 +-
 webapps/docs/changelog.xml |  2 +-
 2 files changed, 73 insertions(+), 3 deletions(-)


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



[tomcat] 01/02: Fix typo

2020-01-30 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit 2debbc2989cf60ff2773af67adf6b6063eedbfa6
Author: Mark Thomas 
AuthorDate: Thu Jan 30 20:03:27 2020 +

Fix typo
---
 webapps/docs/changelog.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index b9fb35e..4389a7d 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -47,7 +47,7 @@
 
   
 
-  This release contains all of the changes to and including those in
+  This release contains all of the changes upto and including those in
   Apache Tomcat 9.0.31 plus the additional changes listed below. (markt)
 
   


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



[tomcat] 02/02: Fix BZ 64089 Add ${...} support to XML external entity definitions

2020-01-30 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit e745cea2ba1bd3dfde94e8869757df8a6856913a
Author: Mark Thomas 
AuthorDate: Thu Jan 30 21:17:22 2020 +

Fix BZ 64089 Add ${...} support to XML external entity definitions

https://bz.apache.org/bugzilla/show_bug.cgi?id=64089
---
 java/org/apache/tomcat/util/digester/Digester.java | 74 +-
 1 file changed, 72 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/tomcat/util/digester/Digester.java 
b/java/org/apache/tomcat/util/digester/Digester.java
index 59a347b..a7c1740 100644
--- a/java/org/apache/tomcat/util/digester/Digester.java
+++ b/java/org/apache/tomcat/util/digester/Digester.java
@@ -41,6 +41,7 @@ import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 import org.apache.tomcat.util.ExceptionUtils;
 import org.apache.tomcat.util.IntrospectionUtils;
+import org.apache.tomcat.util.IntrospectionUtils.PropertySource;
 import org.apache.tomcat.util.buf.B2CConverter;
 import org.apache.tomcat.util.res.StringManager;
 import org.apache.tomcat.util.security.PermissionCheck;
@@ -55,6 +56,7 @@ import org.xml.sax.SAXNotSupportedException;
 import org.xml.sax.SAXParseException;
 import org.xml.sax.XMLReader;
 import org.xml.sax.ext.DefaultHandler2;
+import org.xml.sax.ext.EntityResolver2;
 import org.xml.sax.ext.Locator2;
 import org.xml.sax.helpers.AttributesImpl;
 
@@ -815,12 +817,20 @@ public class Digester extends DefaultHandler2 {
 reader.setDTDHandler(this);
 reader.setContentHandler(this);
 
+EntityResolver entityResolver = getEntityResolver();
 if (entityResolver == null) {
-reader.setEntityResolver(this);
+entityResolver = this;
+}
+
+// Wrap the resolver so we can perform ${...} property replacement
+if (entityResolver instanceof EntityResolver2) {
+entityResolver = new EntityResolver2Wrapper((EntityResolver2) 
entityResolver, source, classLoader);
 } else {
-reader.setEntityResolver(entityResolver);
+entityResolver = new EntityResolverWrapper(entityResolver, source, 
classLoader);
 }
 
+reader.setEntityResolver(entityResolver);
+
 reader.setProperty("http://xml.org/sax/properties/lexical-handler";, 
this);
 
 reader.setErrorHandler(this);
@@ -1976,4 +1986,64 @@ public class Digester extends DefaultHandler2 {
 return new StringBuilder(out);
 }
 }
+
+
+private static class EntityResolverWrapper implements EntityResolver {
+
+private final EntityResolver entityResolver;
+private final PropertySource[] source;
+private final ClassLoader classLoader;
+
+public EntityResolverWrapper(EntityResolver entityResolver, 
PropertySource[] source, ClassLoader classLoader) {
+this.entityResolver = entityResolver;
+this.source = source;
+this.classLoader = classLoader;
+}
+
+@Override
+public InputSource resolveEntity(String publicId, String systemId)
+throws SAXException, IOException {
+publicId = replace(publicId);
+systemId = replace(systemId);
+return entityResolver.resolveEntity(publicId, systemId);
+}
+
+protected String replace(String input) {
+try {
+return IntrospectionUtils.replaceProperties(input, null, 
source, classLoader);
+} catch (Exception e) {
+return input;
+}
+}
+}
+
+
+private static class EntityResolver2Wrapper extends EntityResolverWrapper 
implements EntityResolver2 {
+
+private final EntityResolver2 entityResolver2;
+
+public EntityResolver2Wrapper(EntityResolver2 entityResolver, 
PropertySource[] source,
+ClassLoader classLoader) {
+super(entityResolver, source, classLoader);
+this.entityResolver2 = entityResolver;
+}
+
+@Override
+public InputSource getExternalSubset(String name, String baseURI)
+throws SAXException, IOException {
+name = replace(name);
+baseURI = replace(baseURI);
+return entityResolver2.getExternalSubset(name, baseURI);
+}
+
+@Override
+public InputSource resolveEntity(String name, String publicId, String 
baseURI,
+String systemId) throws SAXException, IOException {
+name = replace(name);
+publicId = replace(publicId);
+baseURI = replace(baseURI);
+systemId = replace(systemId);
+return entityResolver2.resolveEntity(name, publicId, baseURI, 
systemId);
+}
+}
 }


-
To unsubscribe, e-mail: dev-unsubscr...@tom

[tomcat] branch master updated (d0a2420 -> 2becffb)

2020-01-30 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git.


from d0a2420  Remove leftover debug
 new 3217a7b  Jakarta EL 4.0 will add missing generics
 new 2becffb  Use generics now they are used in the API

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 java/jakarta/el/ELContext.java| 7 ++-
 java/jakarta/el/StandardELContext.java| 6 ++
 java/org/apache/el/lang/EvaluationContext.java| 7 ++-
 java/org/apache/jasper/el/ELContextWrapper.java   | 5 ++---
 java/org/apache/jasper/runtime/JspContextWrapper.java | 4 ++--
 5 files changed, 10 insertions(+), 19 deletions(-)


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



[tomcat] 01/02: Jakarta EL 4.0 will add missing generics

2020-01-30 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit 3217a7b0a664193952a8b8311a125db0ee834310
Author: Mark Thomas 
AuthorDate: Mon Jan 27 21:51:44 2020 +

Jakarta EL 4.0 will add missing generics
---
 java/jakarta/el/ELContext.java | 7 ++-
 java/jakarta/el/StandardELContext.java | 6 ++
 2 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/java/jakarta/el/ELContext.java b/java/jakarta/el/ELContext.java
index aae67a4..8f622b1 100644
--- a/java/jakarta/el/ELContext.java
+++ b/java/jakarta/el/ELContext.java
@@ -64,7 +64,6 @@ public abstract class ELContext {
 return this.resolved;
 }
 
-// Can't use Class because API needs to match specification
 /**
  * Add an object to this EL context under the given key.
  *
@@ -74,8 +73,7 @@ public abstract class ELContext {
  * @throws NullPointerException
  *  If the supplied key or context is null
  */
-public void putContext(@SuppressWarnings("rawtypes") Class key,
-Object contextObject) {
+public void putContext(Class key, Object contextObject) {
 Objects.requireNonNull(key);
 Objects.requireNonNull(contextObject);
 
@@ -86,7 +84,6 @@ public abstract class ELContext {
 this.map.put(key, contextObject);
 }
 
-// Can't use Class because API needs to match specification
 /**
  * Obtain the context object for the given key.
  *
@@ -97,7 +94,7 @@ public abstract class ELContext {
  * @throws NullPointerException
  *  If the supplied key is null
  */
-public Object getContext(@SuppressWarnings("rawtypes") Class key) {
+public Object getContext(Class key) {
 Objects.requireNonNull(key);
 if (this.map == null) {
 return null;
diff --git a/java/jakarta/el/StandardELContext.java 
b/java/jakarta/el/StandardELContext.java
index ae43a73..59bffbf 100644
--- a/java/jakarta/el/StandardELContext.java
+++ b/java/jakarta/el/StandardELContext.java
@@ -73,10 +73,8 @@ public class StandardELContext extends ELContext {
 standardResolver.add(context.getELResolver());
 }
 
-// Can't use Class because API needs to match specification
 @Override
-public void putContext(@SuppressWarnings("rawtypes") Class key,
-Object contextObject) {
+public void putContext(Class key, Object contextObject) {
 if (wrappedContext == null) {
 super.putContext(key, contextObject);
 } else {
@@ -85,7 +83,7 @@ public class StandardELContext extends ELContext {
 }
 
 @Override
-public Object getContext(@SuppressWarnings("rawtypes") Class key) {
+public Object getContext(Class key) {
 if (wrappedContext == null) {
 return super.getContext(key);
 } else {


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



[tomcat] 02/02: Use generics now they are used in the API

2020-01-30 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit 2becffb3d2cc4b27630d16f0351cb1823b971e5b
Author: Mark Thomas 
AuthorDate: Mon Jan 27 21:56:08 2020 +

Use generics now they are used in the API
---
 java/org/apache/el/lang/EvaluationContext.java| 7 ++-
 java/org/apache/jasper/el/ELContextWrapper.java   | 5 ++---
 java/org/apache/jasper/runtime/JspContextWrapper.java | 4 ++--
 3 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/java/org/apache/el/lang/EvaluationContext.java 
b/java/org/apache/el/lang/EvaluationContext.java
index fad4c4f..6f39efc 100644
--- a/java/org/apache/el/lang/EvaluationContext.java
+++ b/java/org/apache/el/lang/EvaluationContext.java
@@ -58,8 +58,7 @@ public final class EvaluationContext extends ELContext {
 }
 
 @Override
-// Can't use Class because API needs to match specification in 
superclass
-public Object getContext(@SuppressWarnings("rawtypes") Class key) {
+public Object getContext(Class key) {
 return elContext.getContext(key);
 }
 
@@ -74,9 +73,7 @@ public final class EvaluationContext extends ELContext {
 }
 
 @Override
-// Can't use Class because API needs to match specification in 
superclass
-public void putContext(@SuppressWarnings("rawtypes") Class key,
-Object contextObject) {
+public void putContext(Class key, Object contextObject) {
 elContext.putContext(key, contextObject);
 }
 
diff --git a/java/org/apache/jasper/el/ELContextWrapper.java 
b/java/org/apache/jasper/el/ELContextWrapper.java
index 7c5abcb..d19dfe8 100644
--- a/java/org/apache/jasper/el/ELContextWrapper.java
+++ b/java/org/apache/jasper/el/ELContextWrapper.java
@@ -55,7 +55,7 @@ public final class ELContextWrapper extends ELContext {
 }
 
 @Override
-public Object getContext(@SuppressWarnings("rawtypes") Class key) {
+public Object getContext(Class key) {
 return this.target.getContext(key);
 }
 
@@ -70,8 +70,7 @@ public final class ELContextWrapper extends ELContext {
 }
 
 @Override
-public void putContext(@SuppressWarnings("rawtypes") Class key,
-Object contextObject) throws NullPointerException {
+public void putContext(Class key, Object contextObject) throws 
NullPointerException {
 this.target.putContext(key, contextObject);
 }
 
diff --git a/java/org/apache/jasper/runtime/JspContextWrapper.java 
b/java/org/apache/jasper/runtime/JspContextWrapper.java
index 0620d56..d7c0956 100644
--- a/java/org/apache/jasper/runtime/JspContextWrapper.java
+++ b/java/org/apache/jasper/runtime/JspContextWrapper.java
@@ -549,12 +549,12 @@ public class JspContextWrapper extends PageContext 
implements VariableResolver {
 }
 
 @Override
-public void putContext(@SuppressWarnings("rawtypes") Class key, Object 
contextObject) {
+public void putContext(Class key, Object contextObject) {
 wrapped.putContext(key, contextObject);
 }
 
 @Override
-public Object getContext(@SuppressWarnings("rawtypes") Class key) {
+public Object getContext(Class key) {
 if (key == JspContext.class) {
 return pageContext;
 }


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



[Bug 64106] Attributes marked as un-used are being used in Tomcat dbcp implementation

2020-01-30 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=64106

Mark Thomas  changed:

   What|Removed |Added

 Resolution|--- |INVALID
 Status|REOPENED|RESOLVED

--- Comment #3 from Mark Thomas  ---
That is the doc for tomcat-jdbc.

The doc states tomcat-jdbc does not use those attributes.

This is correct.

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



[tomcat-jakartaee-migration] branch master updated: Correct typo in interface

2020-01-30 Thread fschumacher
This is an automated email from the ASF dual-hosted git repository.

fschumacher pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat-jakartaee-migration.git


The following commit(s) were added to refs/heads/master by this push:
 new f447383  Correct typo in interface
f447383 is described below

commit f447383746d96c743b1b6fce38f6369d9838c6f9
Author: Felix Schumacher 
AuthorDate: Thu Jan 30 18:56:47 2020 +0100

Correct typo in interface

Although this is a breaking change of a public API, I think
the impact will be rather low, as the project is still very
young.
---
 src/main/java/org/apache/tomcat/jakartaee/ClassConverter.java | 2 +-
 src/main/java/org/apache/tomcat/jakartaee/Converter.java  | 2 +-
 src/main/java/org/apache/tomcat/jakartaee/Migration.java  | 2 +-
 src/main/java/org/apache/tomcat/jakartaee/NoOpConverter.java  | 2 +-
 src/main/java/org/apache/tomcat/jakartaee/TextConverter.java  | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/main/java/org/apache/tomcat/jakartaee/ClassConverter.java 
b/src/main/java/org/apache/tomcat/jakartaee/ClassConverter.java
index 01957af..303b066 100644
--- a/src/main/java/org/apache/tomcat/jakartaee/ClassConverter.java
+++ b/src/main/java/org/apache/tomcat/jakartaee/ClassConverter.java
@@ -28,7 +28,7 @@ import org.apache.bcel.classfile.JavaClass;
 public class ClassConverter implements Converter {
 
 @Override
-public boolean accpets(String filename) {
+public boolean accepts(String filename) {
 String extension = Util.getExtension(filename);
 if (extension == null || extension.length() == 0) {
 return false;
diff --git a/src/main/java/org/apache/tomcat/jakartaee/Converter.java 
b/src/main/java/org/apache/tomcat/jakartaee/Converter.java
index e569636..f3d62ec 100644
--- a/src/main/java/org/apache/tomcat/jakartaee/Converter.java
+++ b/src/main/java/org/apache/tomcat/jakartaee/Converter.java
@@ -22,7 +22,7 @@ import java.io.OutputStream;
 
 public interface Converter {
 
-boolean accpets(String filename);
+boolean accepts(String filename);
 
 void convert(InputStream src, OutputStream dest) throws IOException;
 }
diff --git a/src/main/java/org/apache/tomcat/jakartaee/Migration.java 
b/src/main/java/org/apache/tomcat/jakartaee/Migration.java
index 64f68d5..9870a82 100644
--- a/src/main/java/org/apache/tomcat/jakartaee/Migration.java
+++ b/src/main/java/org/apache/tomcat/jakartaee/Migration.java
@@ -159,7 +159,7 @@ public class Migration {
 } else {
 logger.log(Level.FINE, sm.getString("migration.stream", name));
 for (Converter converter : converters) {
-if (converter.accpets(name)) {
+if (converter.accepts(name)) {
 converter.convert(src, dest);
 break;
 }
diff --git a/src/main/java/org/apache/tomcat/jakartaee/NoOpConverter.java 
b/src/main/java/org/apache/tomcat/jakartaee/NoOpConverter.java
index 2d918a0..cd1152a 100644
--- a/src/main/java/org/apache/tomcat/jakartaee/NoOpConverter.java
+++ b/src/main/java/org/apache/tomcat/jakartaee/NoOpConverter.java
@@ -23,7 +23,7 @@ import java.io.OutputStream;
 public class NoOpConverter implements Converter {
 
 @Override
-public boolean accpets(String filename) {
+public boolean accepts(String filename) {
 // Accepts everything
 return true;
 }
diff --git a/src/main/java/org/apache/tomcat/jakartaee/TextConverter.java 
b/src/main/java/org/apache/tomcat/jakartaee/TextConverter.java
index bec3e7e..7cf2530 100644
--- a/src/main/java/org/apache/tomcat/jakartaee/TextConverter.java
+++ b/src/main/java/org/apache/tomcat/jakartaee/TextConverter.java
@@ -43,7 +43,7 @@ public class TextConverter implements Converter {
 
 
 @Override
-public boolean accpets(String filename) {
+public boolean accepts(String filename) {
 String extension = Util.getExtension(filename);
 if (extension == null || extension.length() == 0) {
 return false;


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



[Bug 64106] Attributes marked as un-used are being used in Tomcat dbcp implementation

2020-01-30 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=64106

tarun.ka...@snapon.com changed:

   What|Removed |Added

 Status|RESOLVED|REOPENED
 Resolution|INVALID |---

--- Comment #2 from tarun.ka...@snapon.com ---
See the "Common Attributes" heading in the documentation link.

It says "These attributes are shared between commons-dbcp and tomcat-jdbc-pool,
in some cases default values are different."

This is clearly talking about dbcp attributes.

-- 
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 64089] Resource paths resolve symlinks

2020-01-30 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=64089

--- Comment #7 from Mark Thomas  ---
Glad we are thinking in the same direction.

The EntityResolver isn't currently configurable. I'll consider that option as
well but adding support for ${...} looks like the simplest solution at the
moment.

-- 
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 64105] SSL socket handling exception

2020-01-30 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=64105

Mark Thomas  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |INVALID

--- Comment #1 from Mark Thomas  ---
Sorry, no. That is a JDK bug. It looks like explicitly disabling TLSv1.3 should
avoid it. If you need TLSv1.3, switch to using OpenSSL for the encryption.

The users mailing list is the place to seek further advice on this issue.

-- 
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: [PROPOSAL] Tomcat 10: rename language bundles

2020-01-30 Thread Konstantin Kolinko
ср, 29 янв. 2020 г. в 00:08, Michael Osipov :
>
> Folks,
>
> I recently worked on some localization issues and noticed that, in my
> opinion, these JARs are incorrectly named:
>
> > tomcat-i18n-cs.jar
> > tomcat-i18n-de.jar
> > tomcat-i18n-es.jar
> > tomcat-i18n-fr.jar
> > tomcat-i18n-ja.jar
> > tomcat-i18n-ko.jar
> > tomcat-i18n-pt-BR.jar
> > tomcat-i18n-ru.jar
> > tomcat-i18n-zh-CN.jar
>
> Most people confuse I18N with L10N -- but they are distinct. According
> to Mozilla [1] Tomcat is internationalized and provides localization
> with those bundles. As far as I understand that, they should be
>
> either tomcat-l10n-.jar or tomcat-nls-.jar
>
> [...]
>
> Comments?

1. Overall, I am not convinced.

I think that for an average foreigner a discussion about what term is
better makes little sense. I know people for whom those words are hard
to pronounce and are a little obscure.

Does changing one "obscure" word with another makes life easier? How?
Does it help to reach some wider audience?

I think that it would be better to keep it simple (KISS) and continue
using the existing historic naming pattern.

I am really proud of 20+ years of history of our project. If there are
some things there that are not proper [American] English, it just
means that there are different people involved with the project, and
it is a good sign.

(Being too strict about language is a barrier that may reject people.)


2. In multi-module projects built with Apache Maven, one widely used
naming convention is to name artifacts produced by the nested modules
as -.

E.g., a discussion:
https://stackoverflow.com/questions/9435460/maven-naming-conventions-for-hierarchical-multiple-module-projects

I mean that the current artifact names of "tomcat-i18n-" can
be interpreted as module "" in a parent project "tomcat-i18n".
It means that those artifacts are part of internationalization effort
in Tomcat.

3. Overall, my vote for this proposal is -0.5.

It is not a veto, but I do not like it.

Best regards,
Konstantin Kolinko

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



[Bug 64106] Attributes marked as un-used are being used in Tomcat dbcp implementation

2020-01-30 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=64106

Mark Thomas  changed:

   What|Removed |Added

 Resolution|--- |INVALID
 Status|NEW |RESOLVED

--- Comment #1 from Mark Thomas  ---
You are mixing up tomcat-jdbc and tomcat-dbcp.

Tomcat JDBC is Tomcat's "home grown" database connection pooling and does not
use poolPreparedStatements

Tomcat DBCP is Tomcat's package renamed fork of Apache Commons DBCP 2.

Tomcat DBCP is used by default.

-- 
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 64107] New: PreparedStatements correctly closed are not returning to pool. Leads to PreparedStatement Pool exhaustion.

2020-01-30 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=64107

Bug ID: 64107
   Summary: PreparedStatements correctly closed are not returning
to pool. Leads to PreparedStatement Pool exhaustion.
   Product: Tomcat Modules
   Version: unspecified
  Hardware: PC
Status: NEW
  Severity: major
  Priority: P2
 Component: jdbc-pool
  Assignee: dev@tomcat.apache.org
  Reporter: tarun.ka...@snapon.com
  Target Milestone: ---

In our code there is a sql statement that is fired multiple times with
different input values. The datasource is configured to use pooling of prepared
statements. The pool runs out of available preparedstatements with even single
user. Below is the error that is thrown.

Cause:
java.util.NoSuchElementException: Pool exhausted
java.sql.SQLException: MaxOpenPreparedStatements limit reached


The statements are being closed correctly and as per documentation should
return to the pool available for next sql execution.

Below is the jdbc resource definition. 



-- 
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 on tomcat-trunk

2020-01-30 Thread buildbot
The Buildbot has detected a restored build on builder tomcat-trunk while 
building tomcat. Full details are available at:
https://ci.apache.org/builders/tomcat-trunk/builds/4901

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

Buildslave for this Build: asf946_ubuntu

Build Reason: The AnyBranchScheduler scheduler named 'on-tomcat-commit' 
triggered this build
Build Source Stamp: [branch master] d0a2420733df3ebdc34f67f9fee322a2fe491e94
Blamelist: remm 

Build succeeded!

Sincerely,
 -The Buildbot




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



Re: Apache Tomcat 10 and Jakarta EE 9 - an update

2020-01-30 Thread Mark Thomas
On 30/01/2020 14:32, Rémy Maucherat wrote:
> On Fri, Jan 24, 2020 at 11:29 AM Mark Thomas  > wrote:
> 
> Hi all,
> 
> There has been a fair amount of progress made both towards a Tomcat 10
> release and Jakarta EE 9 since my State of the Cat talk at ApacheCon EU
> in October. For those of you that haven't seen it is is on YouTube:
> https://www.youtube.com/watch?v=hfgO6R9o5Tw
> 
> In order to update the Tomcat community there will be a webinar next
> week on Thursday 30th at 14.00 UTC. Joining details are below.
> 
> The meeting will be recorded and uploaded to YouTube afterwards. Links
> will be posted once that is done.
> 
> 
> Thanks for the presentation ! I think it's important to have it in YT
> since we may not get any other state of the cat this year.

ACK.

I messed up the recording so I'm going to need to re-record it. At least
that way I get to fix the errors and hopefully avoid the coughing :)

I'll try and get this done tomorrow.

Mark

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



[Bug 64106] Attributes marked as un-used are being used in Tomcat dbcp implementation

2020-01-30 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=64106

tarun.ka...@snapon.com changed:

   What|Removed |Added

 OS||All
URL||https://tomcat.apache.org/t
   ||omcat-9.0-doc/jdbc-pool.htm
   ||l

-- 
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 64106] New: Attributes marked as un-used are being used in Tomcat dbcp implementation

2020-01-30 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=64106

Bug ID: 64106
   Summary: Attributes marked as un-used are being used in Tomcat
dbcp implementation
   Product: Tomcat 9
   Version: 9.0.x
  Hardware: PC
Status: NEW
  Severity: normal
  Priority: P2
 Component: Documentation
  Assignee: dev@tomcat.apache.org
  Reporter: tarun.ka...@snapon.com
  Target Milestone: -

Attribute "poolPreparedStatements" and "maxOpenPreparedStatements" are marked
as un-used but are being used in Tomcat dbcp implementation.

This leads to confusion.

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



[tomcat] branch master updated: Remove leftover debug

2020-01-30 Thread remm
This is an automated email from the ASF dual-hosted git repository.

remm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/master by this push:
 new d0a2420  Remove leftover debug
d0a2420 is described below

commit d0a2420733df3ebdc34f67f9fee322a2fe491e94
Author: remm 
AuthorDate: Thu Jan 30 18:02:43 2020 +0100

Remove leftover debug
---
 java/org/apache/catalina/realm/JNDIRealm.java | 1 -
 1 file changed, 1 deletion(-)

diff --git a/java/org/apache/catalina/realm/JNDIRealm.java 
b/java/org/apache/catalina/realm/JNDIRealm.java
index cdf8924..a4e66bb 100644
--- a/java/org/apache/catalina/realm/JNDIRealm.java
+++ b/java/org/apache/catalina/realm/JNDIRealm.java
@@ -1719,7 +1719,6 @@ System.out.println("getUserBySearch " + username);
 
 // Retrieve values of userRoleName attribute
 ArrayList roles = null;
-System.out.println("userRoleName " + userRoleName + " " + 
attrs.get(userRoleName));
 if (userRoleName != null)
 roles = addAttributeValues(userRoleName, attrs, roles);
 


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



buildbot failure in on tomcat-trunk

2020-01-30 Thread buildbot
The Buildbot has detected a new failure on builder tomcat-trunk while building 
tomcat. Full details are available at:
https://ci.apache.org/builders/tomcat-trunk/builds/4900

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

Buildslave for this Build: asf946_ubuntu

Build Reason: The AnyBranchScheduler scheduler named 'on-tomcat-commit' 
triggered this build
Build Source Stamp: [branch master] 2cf770eb2671cef2a659d960074302e2574f56b3
Blamelist: remm 

BUILD FAILED: failed compile_1

Sincerely,
 -The Buildbot




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



[tomcat] branch master updated: Add connection pool to JNDI realm

2020-01-30 Thread remm
This is an automated email from the ASF dual-hosted git repository.

remm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/master by this push:
 new 2cf770e  Add connection pool to JNDI realm
2cf770e is described below

commit 2cf770eb2671cef2a659d960074302e2574f56b3
Author: remm 
AuthorDate: Thu Jan 30 17:22:51 2020 +0100

Add connection pool to JNDI realm

This implements a TODO from the class javadoc header.
As described in the javadoc, the idea is to use a pool to avoid blocking
on a single connection, which could possibly become a bottleneck in some
cases. The message formats need to be kept along with the connection
since they are not thread safe.
Preserve the default behavior: sync without pooling (using a Lock object
which is more flexible).
I may backport this since this is limited to the JNDI realm, but only
once it is confirmed to be regression free. Tested with ApacheDS but my
LDAP skills are very limited.
---
 java/org/apache/catalina/realm/JNDIRealm.java  | 442 -
 .../apache/catalina/realm/LocalStrings.properties  |   1 +
 test/org/apache/catalina/realm/TestJNDIRealm.java  |   7 +-
 webapps/docs/changelog.xml |   3 +
 webapps/docs/config/realm.xml  |   7 +
 5 files changed, 276 insertions(+), 184 deletions(-)

diff --git a/java/org/apache/catalina/realm/JNDIRealm.java 
b/java/org/apache/catalina/realm/JNDIRealm.java
index b814b00..cdf8924 100644
--- a/java/org/apache/catalina/realm/JNDIRealm.java
+++ b/java/org/apache/catalina/realm/JNDIRealm.java
@@ -32,6 +32,8 @@ import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
 import java.util.Set;
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReentrantLock;
 
 import javax.naming.AuthenticationException;
 import javax.naming.CommunicationException;
@@ -61,6 +63,7 @@ import javax.net.ssl.SSLSession;
 import javax.net.ssl.SSLSocketFactory;
 
 import org.apache.catalina.LifecycleException;
+import org.apache.tomcat.util.collections.SynchronizedStack;
 import org.ietf.jgss.GSSCredential;
 import org.ietf.jgss.GSSName;
 
@@ -166,10 +169,6 @@ import org.ietf.jgss.GSSName;
  * directory server itself.
  * 
  *
- * TODO - Support connection pooling (including message
- * format objects) so that authenticate() does not have to be
- * synchronized.
- *
  * WARNING - There is a reported bug against the Netscape
  * provider code (com.netscape.jndi.ldap.LdapContextFactory) with respect to
  * successfully authenticated a non-existing user. The
@@ -209,12 +208,6 @@ public class JNDIRealm extends RealmBase {
 
 
 /**
- * The directory context linking us to our directory server.
- */
-protected DirContext context = null;
-
-
-/**
  * The JNDI context factory used to acquire our InitialContext.  By
  * default, assumes use of an LDAP server using the standard JNDI LDAP
  * provider.
@@ -283,13 +276,6 @@ public class JNDIRealm extends RealmBase {
 
 
 /**
- * The MessageFormat object associated with the current
- * userSearch.
- */
-protected MessageFormat userSearchFormat = null;
-
-
-/**
  * Should we search the entire subtree for matching users?
  */
 protected boolean userSubtree = false;
@@ -329,32 +315,12 @@ public class JNDIRealm extends RealmBase {
 
 
 /**
- * An array of MessageFormat objects associated with the current
- * userPatternArray.
- */
-protected MessageFormat[] userPatternFormatArray = null;
-
-/**
  * The base element for role searches.
  */
 protected String roleBase = "";
 
 
 /**
- * The MessageFormat object associated with the current
- * roleBase.
- */
-protected MessageFormat roleBaseFormat = null;
-
-
-/**
- * The MessageFormat object associated with the current
- * roleSearch.
- */
-protected MessageFormat roleFormat = null;
-
-
-/**
  * The name of an attribute in the user's entry containing
  * roles for that user
  */
@@ -500,6 +466,30 @@ public class JNDIRealm extends RealmBase {
 private boolean forceDnHexEscape = false;
 
 
+/**
+ * Non pooled connection to our directory server.
+ */
+protected JNDIConnection singleConnection = new JNDIConnection();
+
+
+/**
+ * The lock to ensure single connection thread safety.
+ */
+protected final Lock singleConnectionLock = new ReentrantLock();
+
+
+/**
+ * Connection pool.
+ */
+protected SynchronizedStack connectionPool = null;
+
+
+/**
+ * The pool size limit. If 1, pooling is not used.
+ */
+protected int connectionPoolSize = 1;
+
+
 // - Properties
 
 public boolean getForceDnHexEscape() {
@@ -728,13 +718,8 @@ public class JNDIRea

Re: Apache Tomcat 10 and Jakarta EE 9 - an update

2020-01-30 Thread Rémy Maucherat
On Fri, Jan 24, 2020 at 11:29 AM Mark Thomas  wrote:

> Hi all,
>
> There has been a fair amount of progress made both towards a Tomcat 10
> release and Jakarta EE 9 since my State of the Cat talk at ApacheCon EU
> in October. For those of you that haven't seen it is is on YouTube:
> https://www.youtube.com/watch?v=hfgO6R9o5Tw
>
> In order to update the Tomcat community there will be a webinar next
> week on Thursday 30th at 14.00 UTC. Joining details are below.
>
> The meeting will be recorded and uploaded to YouTube afterwards. Links
> will be posted once that is done.
>

Thanks for the presentation ! I think it's important to have it in YT since
we may not get any other state of the cat this year.

Rémy

>
> Topics planned to be covered include:
>
> - The Tomcat 10 release plan
> - Scope for Jakarta EE 9
> - Schedule for Jakarta EE 9
> - Progress towards Tomcat 10
> - Progress towards Jakarta EE 9 (APIs, spec docs, TCKs)
>
> Hope to see you there.
>
> Mark
>
>
>
> = Webinar Joining Details =
>
> Topic: Apache Tomcat 10 and Jakarta EE 9
> Time: Jan 30, 2020 14:00 London
>
> Join Zoom Meeting
> https://pivotal.zoom.us/j/124753263
>
> Meeting ID: 124 753 263
>
> One tap mobile
> +16699006833,,124753263# US (San Jose)
> +16468769923,,124753263# US (New York)
>
> Dial by your location
> +1 669 900 6833 US (San Jose)
> +1 646 876 9923 US (New York)
> 877 853 5257 US Toll-free
> 855 880 1246 US Toll-free
> Meeting ID: 124 753 263
> Find your local number: https://pivotal.zoom.us/u/ajUQ3fLCY
>
> Join by SIP
> 124753...@zoomcrc.com
>
> Join by H.323
> 162.255.37.11 (US West)
> 162.255.36.11 (US East)
> 221.122.88.195 (China)
> 115.114.131.7 (India Mumbai)
> 115.114.115.7 (India Hyderabad)
> 213.19.144.110 (EMEA)
> 103.122.166.55 (Australia)
> 209.9.211.110 (Hong Kong)
> 64.211.144.160 (Brazil)
> 69.174.57.160 (Canada)
> 207.226.132.110 (Japan)
> Meeting ID: 124 753 263
>
> Join by Skype for Business
> https://pivotal.zoom.us/skype/124753263
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


[Bug 64105] New: SSL socket handling exception

2020-01-30 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=64105

Bug ID: 64105
   Summary: SSL socket handling exception
   Product: Tomcat 9
   Version: 9.0.30
  Hardware: PC
OS: Linux
Status: NEW
  Severity: major
  Priority: P2
 Component: Catalina
  Assignee: dev@tomcat.apache.org
  Reporter: cost...@gmail.com
  Target Milestone: -

Hi,

I see frequent errors like the ones below in my instance. If I understand it
correctly (http://hg.openjdk.java.net/jdk/jdk/rev/01d8eae542ff) it is related
to reusing connections and while the behaviour is slightly different in the
latest JDK it is still not solved. Could this be handled differently on the web
server side?

Thanks and cheers,

.costin

Java 13.0.2 exception:

Jan 30, 2020 10:10:45 AM org.apache.tomcat.util.net.NioEndpoint$SocketProcessor
doRun
SEVERE: Error running socket processor
java.lang.NullPointerException
at java.base/sun.security.ssl.HKDF.extract(HKDF.java:93)
at java.base/sun.security.ssl.HKDF.extract(HKDF.java:119)
at
java.base/sun.security.ssl.ServerHello.setUpPskKD(ServerHello.java:1203)
at
java.base/sun.security.ssl.ServerHello$T13ServerHelloProducer.produce(ServerHello.java:559)
at
java.base/sun.security.ssl.SSLHandshake.produce(SSLHandshake.java:440)
at
java.base/sun.security.ssl.ClientHello$T13ClientHelloConsumer.goServerHello(ClientHello.java:1252)
at
java.base/sun.security.ssl.ClientHello$T13ClientHelloConsumer.consume(ClientHello.java:1188)
at
java.base/sun.security.ssl.ClientHello$ClientHelloConsumer.onClientHello(ClientHello.java:851)
at
java.base/sun.security.ssl.ClientHello$ClientHelloConsumer.consume(ClientHello.java:812)
at
java.base/sun.security.ssl.SSLHandshake.consume(SSLHandshake.java:396)
at
java.base/sun.security.ssl.HandshakeContext.dispatch(HandshakeContext.java:444)
at
java.base/sun.security.ssl.SSLEngineImpl$DelegatedTask$DelegatedAction.run(SSLEngineImpl.java:1260)
at
java.base/sun.security.ssl.SSLEngineImpl$DelegatedTask$DelegatedAction.run(SSLEngineImpl.java:1247)
at
java.base/java.security.AccessController.doPrivileged(AccessController.java:691)
at
java.base/sun.security.ssl.SSLEngineImpl$DelegatedTask.run(SSLEngineImpl.java:1192)
at
org.apache.tomcat.util.net.SecureNioChannel.tasks(SecureNioChannel.java:443)
at
org.apache.tomcat.util.net.SecureNioChannel.handshakeUnwrap(SecureNioChannel.java:507)
at
org.apache.tomcat.util.net.SecureNioChannel.handshake(SecureNioChannel.java:238)
at
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1575)
at
org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.base/java.lang.Thread.run(Thread.java:830)

Java 12.0.2 exception:
Jan 30, 2020 10:06:06 AM org.apache.tomcat.util.net.NioEndpoint$SocketProcessor
doRun
SEVERE: Error running socket processor
java.util.NoSuchElementException: No value present
at java.base/java.util.Optional.get(Optional.java:148)
at
java.base/sun.security.ssl.ServerHello$T13ServerHelloProducer.produce(ServerHello.java:547)
at
java.base/sun.security.ssl.SSLHandshake.produce(SSLHandshake.java:436)
at
java.base/sun.security.ssl.ClientHello$T13ClientHelloConsumer.goServerHello(ClientHello.java:1225)
at
java.base/sun.security.ssl.ClientHello$T13ClientHelloConsumer.consume(ClientHello.java:1161)
at
java.base/sun.security.ssl.ClientHello$ClientHelloConsumer.onClientHello(ClientHello.java:852)
at
java.base/sun.security.ssl.ClientHello$ClientHelloConsumer.consume(ClientHello.java:813)
at
java.base/sun.security.ssl.SSLHandshake.consume(SSLHandshake.java:392)
at
java.base/sun.security.ssl.HandshakeContext.dispatch(HandshakeContext.java:443)
at
java.base/sun.security.ssl.SSLEngineImpl$DelegatedTask$DelegatedAction.run(SSLEngineImpl.java:1074)
at
java.base/sun.security.ssl.SSLEngineImpl$DelegatedTask$DelegatedAction.run(SSLEngineImpl.java:1061)
at
java.base/java.security.AccessController.doPrivileged(AccessController.java:689)
at
java.base/sun.security.ssl.SSLEngineImpl$DelegatedTask.run(SSLEngineImpl.java:1008)
at
org.apache.tomcat.util.net.SecureNioChannel.tasks(SecureNioChannel.java:443)
at
org.apache.tomcat.util.net.SecureNioChannel.handshakeUnwrap(SecureNioChannel.java:507)
at
org.apache.tomcat.util.net.SecureNioChannel.handshake(SecureNioChannel.java:238)
at
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.d