Re: Graal and Tomcat Native

2019-07-11 Thread Rainer Jung

Hi Rémy,

for which Java version and distribution is this? The docs for Java 7 and 
8 are much less precise about return codes than the cited docs for Java 
9. So older versions might give a generic error. The used code for 
checking versions is in the HotSpot sources for version 8 inside 
hotspot/src/share/vm/runtime/thread.cpp (functions 
Threads::is_supported_jni_version_including_1_1 and 
Threads::is_supported_jni_version):


jboolean Threads::is_supported_jni_version_including_1_1(jint version) {
  if (version == JNI_VERSION_1_1) return JNI_TRUE;
  return is_supported_jni_version(version);
}

It is called from hotspot/src/share/vm/prims/jni.cpp in jni_GetEnv().

I don't see a code path returning -1 in the version I am looking at 
(outdated Java 8 source code).


What is rather special about that environment w.r.t. platform/JVM/Arch 
or so?


Regards,

Rainer

Am 10.07.2019 um 20:42 schrieb Rémy Maucherat:

Hi,

I'm a bit stumped there, as I'm trying to get native to work in that 
rather special environment.


JNI_OnLoad fails with:
WARNING: The APR based Apache Tomcat Native library failed to load. The 
error reported was [Unsupported JNI version 0x, required by 
bin/libtcnative-1.so.0.2.23]
java.lang.UnsatisfiedLinkError: Unsupported JNI version 0x, 
required by bin/libtcnative-1.so.0.2.23
at 
com.oracle.svm.jni.JNILibraryInitializer.initialize(JNILibraryLoadFeature.java:87)
at 
com.oracle.svm.core.jdk.NativeLibrarySupport.loadLibrary0(NativeLibrarySupport.java:153)
at 
com.oracle.svm.core.jdk.NativeLibrarySupport.loadLibrary(NativeLibrarySupport.java:98)

at java.lang.ClassLoader.loadLibrary(Target_java_lang_ClassLoader.java:126)
at java.lang.Runtime.load0(Runtime.java:809)
at java.lang.Runtime.load(Runtime.java:241)
at java.lang.System.load(System.java:366)
at org.apache.tomcat.jni.Library.(Library.java:42)

Although this looks weird, this is actually returning -1 and it's normal 
when it fails [it's a bad error message]. Most likely this doesn't work:

     if ((*vm)->GetEnv(vm, &ppe, JNI_VERSION_1_4)) {
         return JNI_ERR;
     }

Any ideas ?

Rémy


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



Re: Graal and Tomcat Native

2019-07-11 Thread Rémy Maucherat
On Thu, Jul 11, 2019 at 9:18 AM Rainer Jung  wrote:

> Hi Rémy,
>
> for which Java version and distribution is this? The docs for Java 7 and
> 8 are much less precise about return codes than the cited docs for Java
> 9. So older versions might give a generic error. The used code for
> checking versions is in the HotSpot sources for version 8 inside
> hotspot/src/share/vm/runtime/thread.cpp (functions
> Threads::is_supported_jni_version_including_1_1 and
> Threads::is_supported_jni_version):
>
> jboolean Threads::is_supported_jni_version_including_1_1(jint version) {
>if (version == JNI_VERSION_1_1) return JNI_TRUE;
>return is_supported_jni_version(version);
> }
>
> It is called from hotspot/src/share/vm/prims/jni.cpp in jni_GetEnv().
>
> I don't see a code path returning -1 in the version I am looking at
> (outdated Java 8 source code).
>
> What is rather special about that environment w.r.t. platform/JVM/Arch
> or so?
>

The environment is a Graal native image, built on the same machine.
https://github.com/oracle/graal/blob/master/substratevm/src/com.oracle.svm.jni/src/com/oracle/svm/jni/JNILibraryLoadFeature.java#L87
So the OnLoad of tomcat-native seems to be invoked successfully, but
returns -1 signifying an error. I have no idea what the error really is.

Overall, I'm having TLS problems: the SunEC library (non) packaging is a
problem, there's no ALPN with JSSE, and tomcat-native doesn't work.
However, the rest works as I expected.

Rémy


>
> Regards,
>
> Rainer
>
> Am 10.07.2019 um 20:42 schrieb Rémy Maucherat:
> > Hi,
> >
> > I'm a bit stumped there, as I'm trying to get native to work in that
> > rather special environment.
> >
> > JNI_OnLoad fails with:
> > WARNING: The APR based Apache Tomcat Native library failed to load. The
> > error reported was [Unsupported JNI version 0x, required by
> > bin/libtcnative-1.so.0.2.23]
> > java.lang.UnsatisfiedLinkError: Unsupported JNI version 0x,
> > required by bin/libtcnative-1.so.0.2.23
> > at
> >
> com.oracle.svm.jni.JNILibraryInitializer.initialize(JNILibraryLoadFeature.java:87)
> > at
> >
> com.oracle.svm.core.jdk.NativeLibrarySupport.loadLibrary0(NativeLibrarySupport.java:153)
> > at
> >
> com.oracle.svm.core.jdk.NativeLibrarySupport.loadLibrary(NativeLibrarySupport.java:98)
> > at
> java.lang.ClassLoader.loadLibrary(Target_java_lang_ClassLoader.java:126)
> > at java.lang.Runtime.load0(Runtime.java:809)
> > at java.lang.Runtime.load(Runtime.java:241)
> > at java.lang.System.load(System.java:366)
> > at org.apache.tomcat.jni.Library.(Library.java:42)
> >
> > Although this looks weird, this is actually returning -1 and it's normal
> > when it fails [it's a bad error message]. Most likely this doesn't work:
> >  if ((*vm)->GetEnv(vm, &ppe, JNI_VERSION_1_4)) {
> >  return JNI_ERR;
> >  }
> >
> > Any ideas ?
> >
> > Rémy
>
> -
> To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: dev-h...@tomcat.apache.org
>
>


[tomcat] branch master updated: Add example Dockerfile for native image

2019-07-11 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 eaf0a84  Add example Dockerfile for native image
eaf0a84 is described below

commit eaf0a846bf1014b24c6b750ee63f1eb9398c12aa
Author: remm 
AuthorDate: Thu Jul 11 11:35:42 2019 +0200

Add example Dockerfile for native image

More importantly, test it.
---
 res/tomcat-maven/DockerfileGraal | 40 
 res/tomcat-maven/README.md   |  4 
 res/tomcat-maven/tomcat.yaml |  2 +-
 3 files changed, 45 insertions(+), 1 deletion(-)

diff --git a/res/tomcat-maven/DockerfileGraal b/res/tomcat-maven/DockerfileGraal
new file mode 100644
index 000..b801aa3
--- /dev/null
+++ b/res/tomcat-maven/DockerfileGraal
@@ -0,0 +1,40 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+FROM busybox:glibc
+
+VOLUME /tmp
+
+USER root
+RUN mkdir -m 777 -p /deployments
+
+ADD tomcat-maven-1.0 /deployments/app
+ADD conf /deployments/conf
+ADD webapps /deployments/webapps
+
+WORKDIR /deployments
+
+ARG namespace=tomcat
+ENV KUBERNETES_NAMESPACE=$namespace
+ARG port=8080
+EXPOSE $port
+
+ENV JAVA_OPTS="-Dcatalina.base=. -Djava.security.egd=file:/dev/urandom"
+
+# Add JULI logging configuration
+ENV JAVA_OPTS="${JAVA_OPTS} 
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager 
-Djava.util.logging.config.file=conf/logging.properties"
+
+ENTRYPOINT [ "sh", "-c", "/deployments/app $JAVA_OPTS" ]
diff --git a/res/tomcat-maven/README.md b/res/tomcat-maven/README.md
index 02ce071..b9e45a7 100644
--- a/res/tomcat-maven/README.md
+++ b/res/tomcat-maven/README.md
@@ -105,3 +105,7 @@ $JAVA_HOME/bin/native-image-configure generate 
--trace-input=$TOMCAT_MAVEN/targe
 $JAVA_HOME/bin/native-image --no-server --allow-incomplete-classpath 
--enable-https 
--initialize-at-build-time=org.eclipse.jdt,org.apache.el.parser.SimpleNode,javax.servlet.jsp.JspFactory,org.apache.jasper.servlet.JasperInitializer,org.apache.jasper.runtime.JspFactoryImpl
 -H:+JNI -H:+ReportUnsupportedElementsAtRuntime -H:+ReportExceptionStackTraces 
-H:EnableURLProtocols=jar -H:ConfigurationFileDirectories=$TOMCAT_MAVEN/target/ 
-H:ReflectionConfigurationFiles=$TOMCAT_MAVEN/tomcat-reflecti [...]
 ./tomcat-maven-1.0 -Djava.library.path=$JAVA_HOME/jre/lib/amd64 
-Dcatalina.base=. -Djava.util.logging.config.file=conf/logging.properties 
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
 ```
+
+Running in a container is possible, an example `DockerfileGraal` is given. To 
use a native image in a container that is not identical to the build platform,
+the `native-image` call will need to use the additional `--static` parameter 
to statically link libraries (this will then require zlib and glibc
+static libraries).
diff --git a/res/tomcat-maven/tomcat.yaml b/res/tomcat-maven/tomcat.yaml
index d890f61..9f115eb 100644
--- a/res/tomcat-maven/tomcat.yaml
+++ b/res/tomcat-maven/tomcat.yaml
@@ -18,7 +18,7 @@ spec:
 spec:
   containers:
   - name: tomcat
-image: apache/tomcat:1.0
+image: apache/tomcat-maven:1.0
 ports:
 - containerPort: 8080
 - containerPort: 8778


-
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: Polish : remove completed TODO

2019-07-11 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 89c530d  Polish : remove completed TODO
89c530d is described below

commit 89c530d5ba789632d3012d42197f2eb84e453f3d
Author: Mark Thomas 
AuthorDate: Thu Jul 11 11:23:18 2019 +0100

Polish : remove completed TODO
---
 java/org/apache/catalina/core/AsyncListenerWrapper.java | 5 -
 1 file changed, 5 deletions(-)

diff --git a/java/org/apache/catalina/core/AsyncListenerWrapper.java 
b/java/org/apache/catalina/core/AsyncListenerWrapper.java
index 242c6ef..5cf2148 100644
--- a/java/org/apache/catalina/core/AsyncListenerWrapper.java
+++ b/java/org/apache/catalina/core/AsyncListenerWrapper.java
@@ -23,11 +23,6 @@ import javax.servlet.AsyncListener;
 import javax.servlet.ServletRequest;
 import javax.servlet.ServletResponse;
 
-/**
- * TODO SERVLET3 - async
- * @author fhanik
- *
- */
 public class AsyncListenerWrapper {
 
 private AsyncListener listener = null;


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



[tomcat] 01/02: Refactor definition of boolean array to reduce code duplication

2019-07-11 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 07bcd15f1715033c6f22901dd8fb12f64c5c258e
Author: Mark Thomas 
AuthorDate: Thu Jul 11 11:30:49 2019 +0100

Refactor definition of boolean array to reduce code duplication
---
 test/javax/servlet/http/TestHttpServletResponseSendError.java | 2 --
 .../apache/catalina/servlets/DefaultServletEncodingBaseTest.java  | 2 --
 test/org/apache/catalina/servlets/TestDefaultServletOptions.java  | 1 -
 test/org/apache/catalina/servlets/TestWebdavServletOptions.java   | 1 -
 test/org/apache/catalina/startup/TomcatBaseTest.java  | 8 ++--
 test/org/apache/coyote/http2/TestAsync.java   | 1 -
 6 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/test/javax/servlet/http/TestHttpServletResponseSendError.java 
b/test/javax/servlet/http/TestHttpServletResponseSendError.java
index 256b536..bfdbf7e 100644
--- a/test/javax/servlet/http/TestHttpServletResponseSendError.java
+++ b/test/javax/servlet/http/TestHttpServletResponseSendError.java
@@ -59,8 +59,6 @@ public class TestHttpServletResponseSendError extends 
TomcatBaseTest {
  * - dispatch
  */
 
-private static final Boolean[] booleans = new Boolean[] { Boolean.FALSE, 
Boolean.TRUE };
-
 private enum AsyncErrorPoint {
 /*
  * Thread A is the container thread the processes the original request.
diff --git 
a/test/org/apache/catalina/servlets/DefaultServletEncodingBaseTest.java 
b/test/org/apache/catalina/servlets/DefaultServletEncodingBaseTest.java
index 6ff4849..6640494 100644
--- a/test/org/apache/catalina/servlets/DefaultServletEncodingBaseTest.java
+++ b/test/org/apache/catalina/servlets/DefaultServletEncodingBaseTest.java
@@ -67,8 +67,6 @@ public abstract class DefaultServletEncodingBaseTest extends 
TomcatBaseTest {
 String[] targetFiles = new String[] {
 "cp1252", "ibm850", "iso-8859-1", "utf-8-bom", "utf-8" };
 
-Boolean[] booleans = new Boolean[] { Boolean.FALSE, Boolean.TRUE };
-
 List parameterSets = new ArrayList<>();
 
 for (String contextResponseEncoding : encodings) {
diff --git a/test/org/apache/catalina/servlets/TestDefaultServletOptions.java 
b/test/org/apache/catalina/servlets/TestDefaultServletOptions.java
index 98e0829..f4e0f55 100644
--- a/test/org/apache/catalina/servlets/TestDefaultServletOptions.java
+++ b/test/org/apache/catalina/servlets/TestDefaultServletOptions.java
@@ -31,7 +31,6 @@ public class TestDefaultServletOptions extends 
ServletOptionsBaseTest {
 
 @Parameters
 public static Collection inputs() {
-Boolean[] booleans = new Boolean[] { Boolean.FALSE, Boolean.TRUE };
 String[] urls = new String[] { COLLECTION_NAME, FILE_NAME, 
UNKNOWN_NAME };
 String[] methods = new String[] { "GET", "POST", "HEAD", "TRACE", 
"PUT", "DELETE" };
 
diff --git a/test/org/apache/catalina/servlets/TestWebdavServletOptions.java 
b/test/org/apache/catalina/servlets/TestWebdavServletOptions.java
index ed8b776..2ccbbb9 100644
--- a/test/org/apache/catalina/servlets/TestWebdavServletOptions.java
+++ b/test/org/apache/catalina/servlets/TestWebdavServletOptions.java
@@ -31,7 +31,6 @@ public class TestWebdavServletOptions extends 
ServletOptionsBaseTest {
 
 @Parameters
 public static Collection inputs() {
-Boolean[] booleans = new Boolean[] { Boolean.FALSE, Boolean.TRUE };
 String[] urls = new String[] { COLLECTION_NAME, FILE_NAME, 
UNKNOWN_NAME };
 String[] methods = new String[] { "GET", "POST", "HEAD", "TRACE", 
"PUT", "DELETE",
 "MKCOL", "LOCK", "UNLOCK", "COPY", "MOVE", "PROPFIND", 
"PROPPATCH" };
diff --git a/test/org/apache/catalina/startup/TomcatBaseTest.java 
b/test/org/apache/catalina/startup/TomcatBaseTest.java
index 0fd2286..b7c5fb4 100644
--- a/test/org/apache/catalina/startup/TomcatBaseTest.java
+++ b/test/org/apache/catalina/startup/TomcatBaseTest.java
@@ -83,12 +83,16 @@ public abstract class TomcatBaseTest extends 
LoggingBaseTest {
 @SuppressWarnings("unused")
 private static final boolean ignored = TesterSupport.OPENSSL_AVAILABLE;
 
-private Tomcat tomcat;
-private boolean accessLogEnabled = false;
+// Used by parameterized tests. Defined here to reduce duplication.
+protected static final Boolean[] booleans = new Boolean[] { Boolean.FALSE, 
Boolean.TRUE };
+
 protected static final int DEFAULT_CLIENT_TIMEOUT_MS = 300_000;
 
 public static final String TEMP_DIR = System.getProperty("java.io.tmpdir");
 
+private Tomcat tomcat;
+private boolean accessLogEnabled = false;
+
 /**
  * Make the Tomcat instance available to sub-classes.
  *
diff --git a/test/org/apache/coyote/http2/TestAsync.java 
b/test/org/apache/coyote/http2/TestAsync.java
index 45333a7..60e7f93 100644
--- a/test/org/apache/coyote/http2/TestAsync.java
+

[tomcat] 02/02: Additional async dispatch tests

2019-07-11 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 451953373e75fa3dac4360383fffab9397e2343d
Author: Mark Thomas 
AuthorDate: Thu Jul 11 14:19:50 2019 +0100

Additional async dispatch tests
---
 .../core/TestAsyncContextImplDispatch.java | 151 +
 1 file changed, 151 insertions(+)

diff --git a/test/org/apache/catalina/core/TestAsyncContextImplDispatch.java 
b/test/org/apache/catalina/core/TestAsyncContextImplDispatch.java
new file mode 100644
index 000..94cb1f1
--- /dev/null
+++ b/test/org/apache/catalina/core/TestAsyncContextImplDispatch.java
@@ -0,0 +1,151 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.catalina.core;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import javax.servlet.AsyncContext;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameter;
+
+import org.apache.catalina.Context;
+import org.apache.catalina.Wrapper;
+import org.apache.catalina.startup.Tomcat;
+import org.apache.catalina.startup.TomcatBaseTest;
+import org.apache.tomcat.util.buf.ByteChunk;
+
+/**
+ * Written for the specific test case of async Servlet, dispatches to sync
+ * Servlet that then tries to call startAsync() but covers all combinations
+ * for completeness.
+ */
+@RunWith(Parameterized.class)
+public class TestAsyncContextImplDispatch extends TomcatBaseTest {
+
+@Parameterized.Parameters(name = "{index}: tgt-sup [{0}], dis-sup [{1}], 
dis-st [{2}]")
+public static Collection parameters() {
+List parameterSets = new ArrayList<>();
+
+for (Boolean targetAsyncSupported : booleans) {
+for (Boolean dispatchAsyncSupported : booleans) {
+for (Boolean dispatchAsyncStart : booleans) {
+Boolean allowed = 
Boolean.valueOf(!dispatchAsyncStart.booleanValue() ||
+targetAsyncSupported.booleanValue() && 
dispatchAsyncSupported.booleanValue() &&
+dispatchAsyncStart.booleanValue());
+
+parameterSets.add(new Object[] { targetAsyncSupported, 
dispatchAsyncSupported, dispatchAsyncStart, allowed} );
+}
+}
+}
+
+return parameterSets;
+}
+
+@Parameter(0)
+public boolean targetAsyncSupported;
+@Parameter(1)
+public boolean dispatchAsyncSupported;
+@Parameter(2)
+public boolean dispatchAsyncStart;
+@Parameter(3)
+public boolean allowed;
+
+
+@Test
+public void testSendError() throws Exception {
+// Setup Tomcat instance
+Tomcat tomcat = getTomcatInstance();
+
+// No file system docBase required
+Context ctx = tomcat.addContext("", null);
+
+Wrapper w1 = Tomcat.addServlet(ctx, "target", new TesterServlet());
+w1.setAsyncSupported(targetAsyncSupported);
+ctx.addServletMappingDecoded("/target", "target");
+
+Wrapper w2 = Tomcat.addServlet(ctx, "dispatch", new 
TesterDispatchServlet(dispatchAsyncStart));
+w2.setAsyncSupported(dispatchAsyncSupported);
+ctx.addServletMappingDecoded("/dispatch", "dispatch");
+
+tomcat.start();
+
+ByteChunk bc = new ByteChunk();
+int rc;
+
+rc = getUrl("http://localhost:"; + getPort() + "/target", bc, null, 
null);
+
+String body = bc.toString();
+
+if (allowed) {
+Assert.assertEquals(200, rc);
+Assert.assertEquals("OK", body);
+} else {
+Assert.assertEquals(500, rc);
+}
+}
+
+
+public static class TesterServlet extends HttpServlet {
+
+private static final long serialVersionUID = 1L;
+
+@Override
+protected void doGet(HttpServletRequest req, HttpServletResponse

[tomcat] branch master updated (eaf0a84 -> 4519533)

2019-07-11 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 eaf0a84  Add example Dockerfile for native image
 new 07bcd15  Refactor definition of boolean array to reduce code 
duplication
 new 4519533  Additional async dispatch tests

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:
 .../http/TestHttpServletResponseSendError.java |   2 -
 .../core/TestAsyncContextImplDispatch.java | 151 +
 .../servlets/DefaultServletEncodingBaseTest.java   |   2 -
 .../servlets/TestDefaultServletOptions.java|   1 -
 .../servlets/TestWebdavServletOptions.java |   1 -
 .../apache/catalina/startup/TomcatBaseTest.java|   8 +-
 test/org/apache/coyote/http2/TestAsync.java|   1 -
 7 files changed, 157 insertions(+), 9 deletions(-)
 create mode 100644 
test/org/apache/catalina/core/TestAsyncContextImplDispatch.java


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



[tomcat] branch 8.5.x updated (cb85254 -> b866eb9)

2019-07-11 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


from cb85254  Ignore more IntelliJ files
 new 33e951c  Refactor definition of boolean array to reduce code 
duplication
 new b866eb9  Additional async dispatch tests

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:
 .../http/TestHttpServletResponseSendError.java |   2 -
 .../core/TestAsyncContextImplDispatch.java | 151 +
 .../servlets/DefaultServletEncodingBaseTest.java   |   2 -
 .../servlets/TestDefaultServletOptions.java|   1 -
 .../servlets/TestWebdavServletOptions.java |   1 -
 .../apache/catalina/startup/TomcatBaseTest.java|   8 +-
 test/org/apache/coyote/http2/TestAsync.java|   1 -
 7 files changed, 157 insertions(+), 9 deletions(-)
 create mode 100644 
test/org/apache/catalina/core/TestAsyncContextImplDispatch.java


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



[tomcat] 01/02: Refactor definition of boolean array to reduce code duplication

2019-07-11 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

commit 33e951c25473d858c1367957c1bfb746c78c8f73
Author: Mark Thomas 
AuthorDate: Thu Jul 11 11:30:49 2019 +0100

Refactor definition of boolean array to reduce code duplication
---
 test/javax/servlet/http/TestHttpServletResponseSendError.java | 2 --
 .../apache/catalina/servlets/DefaultServletEncodingBaseTest.java  | 2 --
 test/org/apache/catalina/servlets/TestDefaultServletOptions.java  | 1 -
 test/org/apache/catalina/servlets/TestWebdavServletOptions.java   | 1 -
 test/org/apache/catalina/startup/TomcatBaseTest.java  | 8 ++--
 test/org/apache/coyote/http2/TestAsync.java   | 1 -
 6 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/test/javax/servlet/http/TestHttpServletResponseSendError.java 
b/test/javax/servlet/http/TestHttpServletResponseSendError.java
index 256b536..bfdbf7e 100644
--- a/test/javax/servlet/http/TestHttpServletResponseSendError.java
+++ b/test/javax/servlet/http/TestHttpServletResponseSendError.java
@@ -59,8 +59,6 @@ public class TestHttpServletResponseSendError extends 
TomcatBaseTest {
  * - dispatch
  */
 
-private static final Boolean[] booleans = new Boolean[] { Boolean.FALSE, 
Boolean.TRUE };
-
 private enum AsyncErrorPoint {
 /*
  * Thread A is the container thread the processes the original request.
diff --git 
a/test/org/apache/catalina/servlets/DefaultServletEncodingBaseTest.java 
b/test/org/apache/catalina/servlets/DefaultServletEncodingBaseTest.java
index 6ff4849..6640494 100644
--- a/test/org/apache/catalina/servlets/DefaultServletEncodingBaseTest.java
+++ b/test/org/apache/catalina/servlets/DefaultServletEncodingBaseTest.java
@@ -67,8 +67,6 @@ public abstract class DefaultServletEncodingBaseTest extends 
TomcatBaseTest {
 String[] targetFiles = new String[] {
 "cp1252", "ibm850", "iso-8859-1", "utf-8-bom", "utf-8" };
 
-Boolean[] booleans = new Boolean[] { Boolean.FALSE, Boolean.TRUE };
-
 List parameterSets = new ArrayList<>();
 
 for (String contextResponseEncoding : encodings) {
diff --git a/test/org/apache/catalina/servlets/TestDefaultServletOptions.java 
b/test/org/apache/catalina/servlets/TestDefaultServletOptions.java
index 98e0829..f4e0f55 100644
--- a/test/org/apache/catalina/servlets/TestDefaultServletOptions.java
+++ b/test/org/apache/catalina/servlets/TestDefaultServletOptions.java
@@ -31,7 +31,6 @@ public class TestDefaultServletOptions extends 
ServletOptionsBaseTest {
 
 @Parameters
 public static Collection inputs() {
-Boolean[] booleans = new Boolean[] { Boolean.FALSE, Boolean.TRUE };
 String[] urls = new String[] { COLLECTION_NAME, FILE_NAME, 
UNKNOWN_NAME };
 String[] methods = new String[] { "GET", "POST", "HEAD", "TRACE", 
"PUT", "DELETE" };
 
diff --git a/test/org/apache/catalina/servlets/TestWebdavServletOptions.java 
b/test/org/apache/catalina/servlets/TestWebdavServletOptions.java
index ed8b776..2ccbbb9 100644
--- a/test/org/apache/catalina/servlets/TestWebdavServletOptions.java
+++ b/test/org/apache/catalina/servlets/TestWebdavServletOptions.java
@@ -31,7 +31,6 @@ public class TestWebdavServletOptions extends 
ServletOptionsBaseTest {
 
 @Parameters
 public static Collection inputs() {
-Boolean[] booleans = new Boolean[] { Boolean.FALSE, Boolean.TRUE };
 String[] urls = new String[] { COLLECTION_NAME, FILE_NAME, 
UNKNOWN_NAME };
 String[] methods = new String[] { "GET", "POST", "HEAD", "TRACE", 
"PUT", "DELETE",
 "MKCOL", "LOCK", "UNLOCK", "COPY", "MOVE", "PROPFIND", 
"PROPPATCH" };
diff --git a/test/org/apache/catalina/startup/TomcatBaseTest.java 
b/test/org/apache/catalina/startup/TomcatBaseTest.java
index 0fd2286..b7c5fb4 100644
--- a/test/org/apache/catalina/startup/TomcatBaseTest.java
+++ b/test/org/apache/catalina/startup/TomcatBaseTest.java
@@ -83,12 +83,16 @@ public abstract class TomcatBaseTest extends 
LoggingBaseTest {
 @SuppressWarnings("unused")
 private static final boolean ignored = TesterSupport.OPENSSL_AVAILABLE;
 
-private Tomcat tomcat;
-private boolean accessLogEnabled = false;
+// Used by parameterized tests. Defined here to reduce duplication.
+protected static final Boolean[] booleans = new Boolean[] { Boolean.FALSE, 
Boolean.TRUE };
+
 protected static final int DEFAULT_CLIENT_TIMEOUT_MS = 300_000;
 
 public static final String TEMP_DIR = System.getProperty("java.io.tmpdir");
 
+private Tomcat tomcat;
+private boolean accessLogEnabled = false;
+
 /**
  * Make the Tomcat instance available to sub-classes.
  *
diff --git a/test/org/apache/coyote/http2/TestAsync.java 
b/test/org/apache/coyote/http2/TestAsync.java
index cc74468..83c46ab 100644
--- a/test/org/apache/coyote/http2/TestAsync.java
++

[tomcat] 02/02: Additional async dispatch tests

2019-07-11 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

commit b866eb9186e3a97778990212d0d8ff1a93e7c768
Author: Mark Thomas 
AuthorDate: Thu Jul 11 14:19:50 2019 +0100

Additional async dispatch tests
---
 .../core/TestAsyncContextImplDispatch.java | 151 +
 1 file changed, 151 insertions(+)

diff --git a/test/org/apache/catalina/core/TestAsyncContextImplDispatch.java 
b/test/org/apache/catalina/core/TestAsyncContextImplDispatch.java
new file mode 100644
index 000..94cb1f1
--- /dev/null
+++ b/test/org/apache/catalina/core/TestAsyncContextImplDispatch.java
@@ -0,0 +1,151 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.catalina.core;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import javax.servlet.AsyncContext;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameter;
+
+import org.apache.catalina.Context;
+import org.apache.catalina.Wrapper;
+import org.apache.catalina.startup.Tomcat;
+import org.apache.catalina.startup.TomcatBaseTest;
+import org.apache.tomcat.util.buf.ByteChunk;
+
+/**
+ * Written for the specific test case of async Servlet, dispatches to sync
+ * Servlet that then tries to call startAsync() but covers all combinations
+ * for completeness.
+ */
+@RunWith(Parameterized.class)
+public class TestAsyncContextImplDispatch extends TomcatBaseTest {
+
+@Parameterized.Parameters(name = "{index}: tgt-sup [{0}], dis-sup [{1}], 
dis-st [{2}]")
+public static Collection parameters() {
+List parameterSets = new ArrayList<>();
+
+for (Boolean targetAsyncSupported : booleans) {
+for (Boolean dispatchAsyncSupported : booleans) {
+for (Boolean dispatchAsyncStart : booleans) {
+Boolean allowed = 
Boolean.valueOf(!dispatchAsyncStart.booleanValue() ||
+targetAsyncSupported.booleanValue() && 
dispatchAsyncSupported.booleanValue() &&
+dispatchAsyncStart.booleanValue());
+
+parameterSets.add(new Object[] { targetAsyncSupported, 
dispatchAsyncSupported, dispatchAsyncStart, allowed} );
+}
+}
+}
+
+return parameterSets;
+}
+
+@Parameter(0)
+public boolean targetAsyncSupported;
+@Parameter(1)
+public boolean dispatchAsyncSupported;
+@Parameter(2)
+public boolean dispatchAsyncStart;
+@Parameter(3)
+public boolean allowed;
+
+
+@Test
+public void testSendError() throws Exception {
+// Setup Tomcat instance
+Tomcat tomcat = getTomcatInstance();
+
+// No file system docBase required
+Context ctx = tomcat.addContext("", null);
+
+Wrapper w1 = Tomcat.addServlet(ctx, "target", new TesterServlet());
+w1.setAsyncSupported(targetAsyncSupported);
+ctx.addServletMappingDecoded("/target", "target");
+
+Wrapper w2 = Tomcat.addServlet(ctx, "dispatch", new 
TesterDispatchServlet(dispatchAsyncStart));
+w2.setAsyncSupported(dispatchAsyncSupported);
+ctx.addServletMappingDecoded("/dispatch", "dispatch");
+
+tomcat.start();
+
+ByteChunk bc = new ByteChunk();
+int rc;
+
+rc = getUrl("http://localhost:"; + getPort() + "/target", bc, null, 
null);
+
+String body = bc.toString();
+
+if (allowed) {
+Assert.assertEquals(200, rc);
+Assert.assertEquals("OK", body);
+} else {
+Assert.assertEquals(500, rc);
+}
+}
+
+
+public static class TesterServlet extends HttpServlet {
+
+private static final long serialVersionUID = 1L;
+
+@Override
+protected void doGet(HttpServletRequest req, HttpServletResponse 

[tomcat] branch 7.0.x updated (89c530d -> 7b37f76)

2019-07-11 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


from 89c530d  Polish : remove completed TODO
 new 9bd2ec0  Align more closely with 8.5.x to ease back-ports
 new d42e567  Refactor definition of boolean array to reduce code 
duplication
 new 7b37f76  Additional async dispatch tests

The 3 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:
 .../http/TestHttpServletResponseSendError.java |   2 -
 .../core/TestAsyncContextImplDispatch.java | 151 +
 .../servlets/TestDefaultServletOptions.java|   1 -
 .../servlets/TestWebdavServletOptions.java |   1 -
 .../apache/catalina/startup/TomcatBaseTest.java|  19 ++-
 5 files changed, 164 insertions(+), 10 deletions(-)
 create mode 100644 
test/org/apache/catalina/core/TestAsyncContextImplDispatch.java


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



[tomcat] 03/03: Additional async dispatch tests

2019-07-11 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

commit 7b37f7679ee47214ac409ea7a8ab012bc54f51f0
Author: Mark Thomas 
AuthorDate: Thu Jul 11 14:19:50 2019 +0100

Additional async dispatch tests
---
 .../core/TestAsyncContextImplDispatch.java | 151 +
 1 file changed, 151 insertions(+)

diff --git a/test/org/apache/catalina/core/TestAsyncContextImplDispatch.java 
b/test/org/apache/catalina/core/TestAsyncContextImplDispatch.java
new file mode 100644
index 000..b98f9d9
--- /dev/null
+++ b/test/org/apache/catalina/core/TestAsyncContextImplDispatch.java
@@ -0,0 +1,151 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.catalina.core;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import javax.servlet.AsyncContext;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameter;
+
+import org.apache.catalina.Context;
+import org.apache.catalina.Wrapper;
+import org.apache.catalina.startup.Tomcat;
+import org.apache.catalina.startup.TomcatBaseTest;
+import org.apache.tomcat.util.buf.ByteChunk;
+
+/**
+ * Written for the specific test case of async Servlet, dispatches to sync
+ * Servlet that then tries to call startAsync() but covers all combinations
+ * for completeness.
+ */
+@RunWith(Parameterized.class)
+public class TestAsyncContextImplDispatch extends TomcatBaseTest {
+
+@Parameterized.Parameters(name = "{index}: tgt-sup [{0}], dis-sup [{1}], 
dis-st [{2}]")
+public static Collection parameters() {
+List parameterSets = new ArrayList();
+
+for (Boolean targetAsyncSupported : booleans) {
+for (Boolean dispatchAsyncSupported : booleans) {
+for (Boolean dispatchAsyncStart : booleans) {
+Boolean allowed = 
Boolean.valueOf(!dispatchAsyncStart.booleanValue() ||
+targetAsyncSupported.booleanValue() && 
dispatchAsyncSupported.booleanValue() &&
+dispatchAsyncStart.booleanValue());
+
+parameterSets.add(new Object[] { targetAsyncSupported, 
dispatchAsyncSupported, dispatchAsyncStart, allowed} );
+}
+}
+}
+
+return parameterSets;
+}
+
+@Parameter(0)
+public boolean targetAsyncSupported;
+@Parameter(1)
+public boolean dispatchAsyncSupported;
+@Parameter(2)
+public boolean dispatchAsyncStart;
+@Parameter(3)
+public boolean allowed;
+
+
+@Test
+public void testSendError() throws Exception {
+// Setup Tomcat instance
+Tomcat tomcat = getTomcatInstance();
+
+// No file system docBase required
+Context ctx = tomcat.addContext("", null);
+
+Wrapper w1 = Tomcat.addServlet(ctx, "target", new TesterServlet());
+w1.setAsyncSupported(targetAsyncSupported);
+ctx.addServletMapping("/target", "target");
+
+Wrapper w2 = Tomcat.addServlet(ctx, "dispatch", new 
TesterDispatchServlet(dispatchAsyncStart));
+w2.setAsyncSupported(dispatchAsyncSupported);
+ctx.addServletMapping("/dispatch", "dispatch");
+
+tomcat.start();
+
+ByteChunk bc = new ByteChunk();
+int rc;
+
+rc = getUrl("http://localhost:"; + getPort() + "/target", bc, null, 
null);
+
+String body = bc.toString();
+
+if (allowed) {
+Assert.assertEquals(200, rc);
+Assert.assertEquals("OK", body);
+} else {
+Assert.assertEquals(500, rc);
+}
+}
+
+
+public static class TesterServlet extends HttpServlet {
+
+private static final long serialVersionUID = 1L;
+
+@Override
+protected void doGet(HttpServletRequest req, HttpServletResponse resp)
+ 

[tomcat] 01/03: Align more closely with 8.5.x to ease back-ports

2019-07-11 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

commit 9bd2ec0967840f4a15004ba5a3fa7c43b487c5fe
Author: Mark Thomas 
AuthorDate: Thu Jul 11 14:31:56 2019 +0100

Align more closely with 8.5.x to ease back-ports
---
 test/org/apache/catalina/startup/TomcatBaseTest.java | 16 ++--
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/test/org/apache/catalina/startup/TomcatBaseTest.java 
b/test/org/apache/catalina/startup/TomcatBaseTest.java
index a4fc307..0b77e9f 100644
--- a/test/org/apache/catalina/startup/TomcatBaseTest.java
+++ b/test/org/apache/catalina/startup/TomcatBaseTest.java
@@ -60,14 +60,18 @@ import org.apache.tomcat.util.buf.ByteChunk;
  * don't have to keep writing the cleanup code.
  */
 public abstract class TomcatBaseTest extends LoggingBaseTest {
-private Tomcat tomcat;
-private boolean accessLogEnabled = false;
+
 protected static final int DEFAULT_CLIENT_TIMEOUT_MS = 30;
 
 public static final String TEMP_DIR = System.getProperty("java.io.tmpdir");
 
+private Tomcat tomcat;
+private boolean accessLogEnabled = false;
+
 /**
- * Make Tomcat instance accessible to sub-classes.
+ * Make the Tomcat instance available to sub-classes.
+ *
+ * @return A Tomcat instance without any pre-configured web applications
  */
 public Tomcat getTomcatInstance() {
 return tomcat;
@@ -80,7 +84,7 @@ public abstract class TomcatBaseTest extends LoggingBaseTest {
 return tomcat.getConnector().getLocalPort();
 }
 
-/**
+/*
  * Sub-classes may want to check, whether an AccessLogValve is active
  */
 public boolean isAccessLogEnabled() {
@@ -407,12 +411,12 @@ public abstract class TomcatBaseTest extends 
LoggingBaseTest {
 StringBuilder value;
 Object attribute;
 
+response.setContentType("text/plain");
+
 ServletContext ctx = this.getServletContext();
 HttpSession session = request.getSession(false);
 PrintWriter out = response.getWriter();
 
-response.setContentType("text/plain");
-
 out.println("CONTEXT-NAME: " + ctx.getServletContextName());
 out.println("CONTEXT-PATH: " + ctx.getContextPath());
 out.println("CONTEXT-MAJOR-VERSION: " + ctx.getMajorVersion());


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



[tomcat] 02/03: Refactor definition of boolean array to reduce code duplication

2019-07-11 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

commit d42e567794f86e409ae43e74a926b00445c82f1b
Author: Mark Thomas 
AuthorDate: Thu Jul 11 11:30:49 2019 +0100

Refactor definition of boolean array to reduce code duplication
---
 test/javax/servlet/http/TestHttpServletResponseSendError.java| 2 --
 test/org/apache/catalina/servlets/TestDefaultServletOptions.java | 1 -
 test/org/apache/catalina/servlets/TestWebdavServletOptions.java  | 1 -
 test/org/apache/catalina/startup/TomcatBaseTest.java | 3 +++
 4 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/test/javax/servlet/http/TestHttpServletResponseSendError.java 
b/test/javax/servlet/http/TestHttpServletResponseSendError.java
index 8e0e89e..b4865e9 100644
--- a/test/javax/servlet/http/TestHttpServletResponseSendError.java
+++ b/test/javax/servlet/http/TestHttpServletResponseSendError.java
@@ -59,8 +59,6 @@ public class TestHttpServletResponseSendError extends 
TomcatBaseTest {
  * - dispatch
  */
 
-private static final Boolean[] booleans = new Boolean[] { Boolean.FALSE, 
Boolean.TRUE };
-
 private enum AsyncErrorPoint {
 /*
  * Thread A is the container thread the processes the original request.
diff --git a/test/org/apache/catalina/servlets/TestDefaultServletOptions.java 
b/test/org/apache/catalina/servlets/TestDefaultServletOptions.java
index 8db6c90..b7708b8 100644
--- a/test/org/apache/catalina/servlets/TestDefaultServletOptions.java
+++ b/test/org/apache/catalina/servlets/TestDefaultServletOptions.java
@@ -31,7 +31,6 @@ public class TestDefaultServletOptions extends 
ServletOptionsBaseTest {
 
 @Parameters
 public static Collection inputs() {
-Boolean[] booleans = new Boolean[] { Boolean.FALSE, Boolean.TRUE };
 String[] urls = new String[] { COLLECTION_NAME, FILE_NAME, 
UNKNOWN_NAME };
 String[] methods = new String[] { "GET", "POST", "HEAD", "TRACE", 
"PUT", "DELETE" };
 
diff --git a/test/org/apache/catalina/servlets/TestWebdavServletOptions.java 
b/test/org/apache/catalina/servlets/TestWebdavServletOptions.java
index e55aeed..4407f6c 100644
--- a/test/org/apache/catalina/servlets/TestWebdavServletOptions.java
+++ b/test/org/apache/catalina/servlets/TestWebdavServletOptions.java
@@ -31,7 +31,6 @@ public class TestWebdavServletOptions extends 
ServletOptionsBaseTest {
 
 @Parameters
 public static Collection inputs() {
-Boolean[] booleans = new Boolean[] { Boolean.FALSE, Boolean.TRUE };
 String[] urls = new String[] { COLLECTION_NAME, FILE_NAME, 
UNKNOWN_NAME };
 String[] methods = new String[] { "GET", "POST", "HEAD", "TRACE", 
"PUT", "DELETE",
 "MKCOL", "LOCK", "UNLOCK", "COPY", "MOVE", "PROPFIND", 
"PROPPATCH" };
diff --git a/test/org/apache/catalina/startup/TomcatBaseTest.java 
b/test/org/apache/catalina/startup/TomcatBaseTest.java
index 0b77e9f..e234d67 100644
--- a/test/org/apache/catalina/startup/TomcatBaseTest.java
+++ b/test/org/apache/catalina/startup/TomcatBaseTest.java
@@ -61,6 +61,9 @@ import org.apache.tomcat.util.buf.ByteChunk;
  */
 public abstract class TomcatBaseTest extends LoggingBaseTest {
 
+// Used by parameterized tests. Defined here to reduce duplication.
+protected static final Boolean[] booleans = new Boolean[] { Boolean.FALSE, 
Boolean.TRUE };
+
 protected static final int DEFAULT_CLIENT_TIMEOUT_MS = 30;
 
 public static final String TEMP_DIR = System.getProperty("java.io.tmpdir");


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



Re: Graal and Tomcat Native

2019-07-11 Thread Rainer Jung
Probably not very helup, but to make sure, the GetEnv is failing, I 
would add a little code to native/src/jnilib.c in JNI_OnLoad() that 
creates an observable side effect while executing int he function. E.g. 
on Unix/Linux you could add something like


#include 

...

FILE *fd = fopen("/tmp/mytrace", "w");
int fputs("At step 1", fd);
int fflush(fd);
...
int fputs("At step 2", fd);
int fflush(fd);
...
int fputs("At step N", fd);
int fflush(fd);
int fclose(fd);

Sure poor man's tacing, but it will show, how for you get through 
JNI_OnLoad() before it is returning.


Sorry for not being more helpful,

Rainer

Am 11.07.2019 um 10:59 schrieb Rémy Maucherat:
On Thu, Jul 11, 2019 at 9:18 AM Rainer Jung > wrote:


Hi Rémy,

for which Java version and distribution is this? The docs for Java 7
and
8 are much less precise about return codes than the cited docs for Java
9. So older versions might give a generic error. The used code for
checking versions is in the HotSpot sources for version 8 inside
hotspot/src/share/vm/runtime/thread.cpp (functions
Threads::is_supported_jni_version_including_1_1 and
Threads::is_supported_jni_version):

jboolean Threads::is_supported_jni_version_including_1_1(jint version) {
    if (version == JNI_VERSION_1_1) return JNI_TRUE;
    return is_supported_jni_version(version);
}

It is called from hotspot/src/share/vm/prims/jni.cpp in jni_GetEnv().

I don't see a code path returning -1 in the version I am looking at
(outdated Java 8 source code).

What is rather special about that environment w.r.t. platform/JVM/Arch
or so?


The environment is a Graal native image, built on the same machine.
https://github.com/oracle/graal/blob/master/substratevm/src/com.oracle.svm.jni/src/com/oracle/svm/jni/JNILibraryLoadFeature.java#L87
So the OnLoad of tomcat-native seems to be invoked successfully, but 
returns -1 signifying an error. I have no idea what the error really is.


Overall, I'm having TLS problems: the SunEC library (non) packaging is a 
problem, there's no ALPN with JSSE, and tomcat-native doesn't work. 
However, the rest works as I expected.


Rémy


Regards,

Rainer

Am 10.07.2019 um 20:42 schrieb Rémy Maucherat:
 > Hi,
 >
 > I'm a bit stumped there, as I'm trying to get native to work in that
 > rather special environment.
 >
 > JNI_OnLoad fails with:
 > WARNING: The APR based Apache Tomcat Native library failed to
load. The
 > error reported was [Unsupported JNI version 0x, required by
 > bin/libtcnative-1.so.0.2.23]
 > java.lang.UnsatisfiedLinkError: Unsupported JNI version 0x,
 > required by bin/libtcnative-1.so.0.2.23
 > at
 >

com.oracle.svm.jni.JNILibraryInitializer.initialize(JNILibraryLoadFeature.java:87)
 > at
 >

com.oracle.svm.core.jdk.NativeLibrarySupport.loadLibrary0(NativeLibrarySupport.java:153)
 > at
 >

com.oracle.svm.core.jdk.NativeLibrarySupport.loadLibrary(NativeLibrarySupport.java:98)
 > at
java.lang.ClassLoader.loadLibrary(Target_java_lang_ClassLoader.java:126)
 > at java.lang.Runtime.load0(Runtime.java:809)
 > at java.lang.Runtime.load(Runtime.java:241)
 > at java.lang.System.load(System.java:366)
 > at org.apache.tomcat.jni.Library.(Library.java:42)
 >
 > Although this looks weird, this is actually returning -1 and it's
normal
 > when it fails [it's a bad error message]. Most likely this
doesn't work:
 >      if ((*vm)->GetEnv(vm, &ppe, JNI_VERSION_1_4)) {
 >          return JNI_ERR;
 >      }
 >
 > Any ideas ?
 >
 > Rémy

-
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



Nexus: Staging Repository Dropped

2019-07-11 Thread Nexus Repository Manager
Message from: https://repository.apache.orgDeployer properties:"userAgent" = "maven-artifact/2.2.1 (Java 1.6.0_45; Windows 8 6.2)""userId" = "violetagg""ip" = "84.242.148.23"Details:The orgapachetomcat-1217 staging repository has been dropped.Action performed by Violeta Georgieva Georgieva (violetagg)

Nexus: Staging Repository Dropped

2019-07-11 Thread Nexus Repository Manager
Message from: https://repository.apache.orgDeployer properties:"userAgent" = "maven-artifact/2.2.1 (Java 1.7.0_80; Windows 8.1 6.3)""userId" = "violetagg""ip" = "84.242.148.23"Details:The orgapachetomcat-1218 staging repository has been dropped.Action performed by Violeta Georgieva Georgieva (violetagg)

Nexus: Staging Repository Dropped

2019-07-11 Thread Nexus Repository Manager
Message from: https://repository.apache.orgDeployer properties:"userAgent" = "maven-artifact/2.2.1 (Java 1.8.0_211; Windows 10 10.0)""userId" = "violetagg""ip" = "84.242.148.23"Details:The orgapachetomcat-1219 staging repository has been dropped.Action performed by Violeta Georgieva Georgieva (violetagg)

Nexus: Staging Repository Dropped

2019-07-11 Thread Nexus Repository Manager
Message from: https://repository.apache.orgDeployer properties:"userAgent" = "maven-artifact/2.2.1 (Java 1.6.0_45; Windows 7 6.1)""userId" = "violetagg""ip" = "84.242.148.23"Details:The orgapachetomcat-1220 staging repository has been dropped.Action performed by Violeta Georgieva Georgieva (violetagg)

Uploading the maven artifacts to the staging repo

2019-07-11 Thread Violeta Georgieva
Hi,

Are there any specifics not mentioned on the link below that I should apply
https://github.com/apache/tomcat/blob/master/res/maven/README.txt

I'm seeing the following error when trying to upload to the staging repo
the Tomcat 7.0.95 artifacts.


[artifact:deploy] An error has occurred while processing the Maven artifact
task
s.
[artifact:deploy]  Diagnosis:
[artifact:deploy]
[artifact:deploy] Error deploying artifact
'org.apache.tomcat:tomcat-annotations
-api:jar': Error installing artifact's metadata: Error while deploying
metadata:
 Error transferring file
[artifact:deploy] Connection refused: connect
[artifact:deploy]



I'm using:

java version "1.8.0_211"
Java(TM) SE Runtime Environment (build 1.8.0_211-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.211-b12, mixed mode)

Thanks,
Violeta


Nexus: Staging Repository Dropped

2019-07-11 Thread Nexus Repository Manager
Message from: https://repository.apache.orgDeployer properties:"userAgent" = "maven-artifact/2.2.1 (Java 1.6.0_45; Windows 7 6.1)""userId" = "violetagg""ip" = "84.242.148.23"Details:The orgapachetomcat-1221 staging repository has been dropped.Action performed by Violeta Georgieva Georgieva (violetagg)

Re: Graal and Tomcat Native

2019-07-11 Thread Rémy Maucherat
On Thu, Jul 11, 2019 at 4:36 PM Rainer Jung  wrote:

> Probably not very helup, but to make sure, the GetEnv is failing, I
> would add a little code to native/src/jnilib.c in JNI_OnLoad() that
> creates an observable side effect while executing int he function. E.g.
> on Unix/Linux you could add something like
>
> #include 
>
> ...
>
> FILE *fd = fopen("/tmp/mytrace", "w");
> int fputs("At step 1", fd);
> int fflush(fd);
> ...
> int fputs("At step 2", fd);
> int fflush(fd);
> ...
> int fputs("At step N", fd);
> int fflush(fd);
> int fclose(fd);
>
> Sure poor man's tacing, but it will show, how for you get through
> JNI_OnLoad() before it is returning.
>
> Sorry for not being more helpful,
>

Good idea. So it's failing on:
TCN_LOAD_CLASS(env, jFinfo_class, TCN_FINFO_CLASS, JNI_ERR);
And I need to define this in the JNI configuration, much like it's done for
Java reflection and dynamic class loading. Only difference I haven't really
been using it yet. The classes are traced but the configure tool which
converts the trace into the config does not work properly [yet].

Rémy


Re: Uploading the maven artifacts to the staging repo

2019-07-11 Thread Mark Thomas
On 11/07/2019 16:48, Violeta Georgieva wrote:
> Hi,
> 
> Are there any specifics not mentioned on the link below that I should
> apply https://github.com/apache/tomcat/blob/master/res/maven/README.txt

I'm not aware of anything changing since the last 7.0.x release.

The instructions in that file look complete to me.

Mark


> 
> I'm seeing the following error when trying to upload to the staging repo
> the Tomcat 7.0.95 artifacts.
> 
> 
> [artifact:deploy] An error has occurred while processing the Maven
> artifact task
> s.
> [artifact:deploy]  Diagnosis:
> [artifact:deploy]
> [artifact:deploy] Error deploying artifact
> 'org.apache.tomcat:tomcat-annotations
> -api:jar': Error installing artifact's metadata: Error while deploying
> metadata:
>  Error transferring file
> [artifact:deploy] Connection refused: connect
> [artifact:deploy]
> 
> 
> 
> I'm using: 
> 
> java version "1.8.0_211"
> Java(TM) SE Runtime Environment (build 1.8.0_211-b12)
> Java HotSpot(TM) 64-Bit Server VM (build 25.211-b12, mixed mode)
> 
> Thanks,
> Violeta


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



Nexus: Staging Repository Dropped

2019-07-11 Thread Nexus Repository Manager
Message from: https://repository.apache.orgDeployer properties:"userAgent" = "maven-artifact/2.2.1 (Java 1.6.0_45; Windows 7 6.1)""userId" = "violetagg""ip" = "84.242.148.23"Details:The orgapachetomcat-1222 staging repository has been dropped.Action performed by Violeta Georgieva Georgieva (violetagg)

Nexus: Staging Completed

2019-07-11 Thread Nexus Repository Manager
Message from: https://repository.apache.orgDescription:Close for voting Tomcat 7.0.95Deployer properties:"userAgent" = "maven-artifact/2.2.1 (Java 1.6.0_45; Windows 7 6.1)""userId" = "violetagg""ip" = "151.251.254.22"Details:The following artifacts have been staged/org/apache/tomcat/tomcat-juli/7.0.95/tomcat-juli-7.0.95.jar(SHA1: 4762d624fd8a6d9f4f1962a2e1db1354638ba5ae)/org/apache/tomcat/tomcat-juli/7.0.95/tomcat-juli-7.0.95-sources.jar(SHA1: fa4fad89694a7756a29f2d9148545ece6513afa0)/org/apache/tomcat/tomcat-juli/7.0.95/tomcat-juli-7.0.95-sources.jar.asc(SHA1: baca385e3919f77df0eac3582f91de8b3d79c21d)/org/apache/tomcat/tomcat-juli/7.0.95/tomcat-juli-7.0.95.pom.asc(SHA1: efd48915328d18b0265f344e70afa6a371687314)/org/apache/tomcat/tomcat-juli/7.0.95/tomcat-juli-7.0.95.jar.asc(SHA1: 7730bc3eef292d51fc9d0d0bea4660e074e3d4ba)/org/apache/tomcat/tomcat-juli/7.0.95/tomcat-juli-7.0.95.pom(SHA1: 6a7fc13aeab5aa20173849007f131eed2e015082)/org/apache/tomcat/tomcat-util/7.0.95/tomcat-util-7.0.95.pom.asc(SHA1: 905498c2946488f2d1fd2186482cfcc366482a48)/org/apache/tomcat/tomcat-util/7.0.95/tomcat-util-7.0.95.jar(SHA1: 67207fc37f5dc5ddc511776d18244d1021ccc2f9)/org/apache/tomcat/tomcat-util/7.0.95/tomcat-util-7.0.95.jar.asc(SHA1: 5253c17acb593046c25aad53eea9601bd5ff3886)/org/apache/tomcat/tomcat-util/7.0.95/tomcat-util-7.0.95.pom(SHA1: 029c1b9e9e0d6907b916f4bce6bc2fb171ad2081)/org/apache/tomcat/tomcat-util/7.0.95/tomcat-util-7.0.95-sources.jar.asc(SHA1: 01048fa02a08b1e89bd126b088f7c5e5e4f89a50)/org/apache/tomcat/tomcat-util/7.0.95/tomcat-util-7.0.95-sources.jar(SHA1: effd9906b142d17249088da582fb21ce35a02abc)/org/apache/tomcat/tomcat-catalina/7.0.95/tomcat-catalina-7.0.95.pom.asc(SHA1: eac2d82d076d7b0a4a45d53316ac7bf20da8fb4d)/org/apache/tomcat/tomcat-catalina/7.0.95/tomcat-catalina-7.0.95-sources.jar(SHA1: 182c6bd4e003171cb4bdb3dbf06c10ece3443db2)/org/apache/tomcat/tomcat-catalina/7.0.95/tomcat-catalina-7.0.95.jar.asc(SHA1: 76cd5784078a8ee9946b1cdb437dfa6419ad2a8a)/org/apache/tomcat/tomcat-catalina/7.0.95/tomcat-catalina-7.0.95.jar(SHA1: 884f1b3c6d8d65c129b5b208365e2c49897f8037)/org/apache/tomcat/tomcat-catalina/7.0.95/tomcat-catalina-7.0.95.pom(SHA1: 67961bbe628fdcc0b3500c4c0ecde1969ae82057)/org/apache/tomcat/tomcat-catalina/7.0.95/tomcat-catalina-7.0.95-sources.jar.asc(SHA1: bdc6a46b0619424298d6180c5058734ae1b89722)/org/apache/tomcat/tomcat-catalina-ws/7.0.95/tomcat-catalina-ws-7.0.95.pom.asc(SHA1: 736efed58fff4ff2e4ddf5626aa1b0612592)/org/apache/tomcat/tomcat-catalina-ws/7.0.95/tomcat-catalina-ws-7.0.95-sources.jar(SHA1: d0c4bd98a608810cd70b8852c5d043506ad00bc5)/org/apache/tomcat/tomcat-catalina-ws/7.0.95/tomcat-catalina-ws-7.0.95-sources.jar.asc(SHA1: b4d4a3088fdd4a858ef2f56e7dadafbab4b670b1)/org/apache/tomcat/tomcat-catalina-ws/7.0.95/tomcat-catalina-ws-7.0.95.pom(SHA1: f0813a834dac0b8171146f85e8708ed95996305c)/org/apache/tomcat/tomcat-catalina-ws/7.0.95/tomcat-catalina-ws-7.0.95.jar.asc(SHA1: 6c5181b3d08ab7a2f57ee16542b499c813657f11)/org/apache/tomcat/tomcat-catalina-ws/7.0.95/tomcat-catalina-ws-7.0.95.jar(SHA1: 1b141aa3131411342ccb88c8c69135c80e2c0cc3)/org/apache/tomcat/tomcat-i18n-fr/7.0.95/tomcat-i18n-fr-7.0.95.pom.asc(SHA1: 7301f8a5adc276f0eb65ea8d2e3cbeb429ecb106)/org/apache/tomcat/tomcat-i18n-fr/7.0.95/tomcat-i18n-fr-7.0.95.pom(SHA1: 9f4bf619c46a1c821d565a301aeb33388442d83c)/org/apache/tomcat/tomcat-i18n-fr/7.0.95/tomcat-i18n-fr-7.0.95.jar.asc(SHA1: 83c15c93f5479b7bf31d2119832d4c94126ec339)/org/apache/tomcat/tomcat-i18n-fr/7.0.95/tomcat-i18n-fr-7.0.95.jar(SHA1: e53eb98346a3cf6162628059e62ec534a1cc95d3)/org/apache/tomcat/tomcat-jdbc/7.0.95/tomcat-jdbc-7.0.95.jar.asc(SHA1: 2673a0c34180d20a6f583df5b317cf55c9f01ca7)/org/apache/tomcat/tomcat-jdbc/7.0.95/tomcat-jdbc-7.0.95.jar(SHA1: 87011a02dd599cbc5e44566c6387b5e0fc889d09)/org/apache/tomcat/tomcat-jdbc/7.0.95/tomcat-jdbc-7.0.95-sources.jar.asc(SHA1: d669f11e05fe18ebe3c03b1b41a2a4ef04eb8851)/org/apache/tomcat/tomcat-jdbc/7.0.95/tomcat-jdbc-7.0.95.pom.asc(SHA1: 03d9bce009c671823083b0fa16970f47caa869c2)/org/apache/tomcat/tomcat-jdbc/7.0.95/tomcat-jdbc-7.0.95.pom(SHA1: d270e4df67e8b697256e01b581c8f52c56ecd9da)/org/apache/tomcat/tomcat-jdbc/7.0.95/tomcat-jdbc-7.0.95-sources.jar(SHA1: c905202e426cfe7c99412cfef348d953f735dd30)/org/apache/tomcat/embed/tomcat-embed-logging-log4j/7.0.95/tomcat-embed-logging-log4j-7.0.95.pom(SHA1: 4e2e29864336dad28975d0a3debd681a53185b1c)/org/apache/tomcat/embed/tomcat-embed-logging-log4j/7.0.95/tomcat-embed-logging-log4j-7.0.95.pom.asc(SHA1: 733f711258dc79fe0b3755452618796e75f471a0)/org/apache/tomcat/embed/tomcat-embed-logging-log4j/7.0.95/tomcat-embed-logging-log4j-7.0.95-sources.jar(SHA1: fc8930ce75edaa20374b31f528403b7e9ce9fc02)/org/apache/tomcat/embed/tomcat-embed-logging-log4j/7.0.95/tomcat-embed-logging-log4j-7.0.95.jar(SHA1: 1a1a3b3dc15236bb19c6a74b64b2da1dc80ba70d)/org/apache/tomcat/embed/tomcat-embed-logging-log4j/7.0.95/tomcat-embed-logging-log4j-7.0.95.jar.asc(SHA1: 96dbeab07f2a1bc2226dd30e0f327edbe01f83ac)/org/apache/tomcat/emb

[VOTE] Release Apache Tomcat 7.0.95

2019-07-11 Thread Violeta Georgieva
The proposed Apache Tomcat 7.0.95 release is now available for voting.

For full details, see the changelog:
https://ci.apache.org/projects/tomcat/tomcat7/docs/changelog.html

It can be obtained from:
https://dist.apache.org/repos/dist/dev/tomcat/tomcat-7/v7.0.95/
The Maven staging repo is:
https://repository.apache.org/content/repositories/orgapachetomcat-1223/
The git tag is:
https://github.com/apache/tomcat/tree/7.0.95
647a7ebfa4922b9fa213fe642e6180395bbfc135

The proposed 7.0.95 release is:
[ ] Broken - do not release
[ ] Stable - go ahead and release as 7.0.95 Stable

Regards,
Violeta


Re: Graal and Tomcat Native

2019-07-11 Thread Rainer Jung

Hi Rémy,

Am 11.07.2019 um 18:35 schrieb Rémy Maucherat:
On Thu, Jul 11, 2019 at 4:36 PM Rainer Jung > wrote:


Probably not very helup, but to make sure, the GetEnv is failing, I
would add a little code to native/src/jnilib.c in JNI_OnLoad() that
creates an observable side effect while executing int he function. E.g.
on Unix/Linux you could add something like

#include 

...

FILE *fd = fopen("/tmp/mytrace", "w");
int fputs("At step 1", fd);
int fflush(fd);
...
int fputs("At step 2", fd);
int fflush(fd);
...
int fputs("At step N", fd);
int fflush(fd);
int fclose(fd);

Sure poor man's tacing, but it will show, how for you get through
JNI_OnLoad() before it is returning.

Sorry for not being more helpful,


Good idea. So it's failing on:
TCN_LOAD_CLASS(env, jFinfo_class, TCN_FINFO_CLASS, JNI_ERR);
And I need to define this in the JNI configuration, much like it's done 
for Java reflection and dynamic class loading. Only difference I haven't 
really been using it yet. The classes are traced but the configure tool 
which converts the trace into the config does not work properly [yet].


When one looks up the macros in native/include/tcn.h, this boils down to 
the following returning null:


(*env)->FindClass(env, "org/apache/tomcat/jni/FileInfo")

So our own FileInfo class can not be found. FindClass docs indicate its 
searched in the CLASSPATH although I'm not sure whether its really the 
classpath or some search paths of a class loader hierarchy.


You might want to add the JVM commandline flag "-verbose:class" for any 
easy way to track class loading.


I didn't really grok what you meant with "define in JNI configuration". 
For normal JVMs the code just works, so what might be special for Graal 
that org.apache.tomcat.jni.FileInfo can't be found?


Regards,

Rainer

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



Re: Uploading the maven artifacts to the staging repo

2019-07-11 Thread Violeta Georgieva
На чт, 11.07.2019 г. в 19:45 ч. Mark Thomas  написа:
>
> On 11/07/2019 16:48, Violeta Georgieva wrote:
> > Hi,
> >
> > Are there any specifics not mentioned on the link below that I should
> > apply https://github.com/apache/tomcat/blob/master/res/maven/README.txt
>
> I'm not aware of anything changing since the last 7.0.x release.
>
> The instructions in that file look complete to me.

It was very bad internet connection

>
> Mark
>
>
> >
> > I'm seeing the following error when trying to upload to the staging repo
> > the Tomcat 7.0.95 artifacts.
> >
> >
> > [artifact:deploy] An error has occurred while processing the Maven
> > artifact task
> > s.
> > [artifact:deploy]  Diagnosis:
> > [artifact:deploy]
> > [artifact:deploy] Error deploying artifact
> > 'org.apache.tomcat:tomcat-annotations
> > -api:jar': Error installing artifact's metadata: Error while deploying
> > metadata:
> >  Error transferring file
> > [artifact:deploy] Connection refused: connect
> > [artifact:deploy]
> >
> >
> >
> > I'm using:
> >
> > java version "1.8.0_211"
> > Java(TM) SE Runtime Environment (build 1.8.0_211-b12)
> > Java HotSpot(TM) 64-Bit Server VM (build 25.211-b12, mixed mode)
> >
> > Thanks,
> > Violeta
>
>
> -
> To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: dev-h...@tomcat.apache.org


Re: [VOTE] Release Apache Tomcat 7.0.95

2019-07-11 Thread Michael Osipov

Am 2019-07-11 um 20:39 schrieb Violeta Georgieva:

The proposed Apache Tomcat 7.0.95 release is now available for voting.

For full details, see the changelog:
https://ci.apache.org/projects/tomcat/tomcat7/docs/changelog.html


That's confusing. I do not see my entry for BZ 63556 from 
633950059c04f869d645553540b8ffe825891608.


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



Re: [VOTE] Release Apache Tomcat 7.0.95

2019-07-11 Thread Rainer Jung

Am 11.07.2019 um 20:54 schrieb Michael Osipov:

Am 2019-07-11 um 20:39 schrieb Violeta Georgieva:

The proposed Apache Tomcat 7.0.95 release is now available for voting.

For full details, see the changelog:
https://ci.apache.org/projects/tomcat/tomcat7/docs/changelog.html


That's confusing. I do not see my entry for BZ 63556 from 
633950059c04f869d645553540b8ffe825891608.


It really is confusing. The change and its changelog entry seem to be in 
the tag. But the CI docs site has a version string "Version 7.0.95-dev, 
Jun 26 2019", so it's likely it is outdated.


Regards,

Rainer


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



Re: [VOTE] Release Apache Tomcat 7.0.95

2019-07-11 Thread Violeta Georgieva
На чт, 11.07.2019 г. в 21:54 ч. Michael Osipov  написа:
>
> Am 2019-07-11 um 20:39 schrieb Violeta Georgieva:
> > The proposed Apache Tomcat 7.0.95 release is now available for voting.
> >
> > For full details, see the changelog:
> > https://ci.apache.org/projects/tomcat/tomcat7/docs/changelog.html
>
> That's confusing. I do not see my entry for BZ 63556 from
> 633950059c04f869d645553540b8ffe825891608.

It is definitely in the tag
https://github.com/apache/tomcat/blob/7.0.95/webapps/docs/changelog.xml

I'll check the CI


Re: [VOTE] Release Apache Tomcat 7.0.95

2019-07-11 Thread Violeta Georgieva
На чт, 11.07.2019 г. в 22:08 ч. Rainer Jung 
написа:
>
> Am 11.07.2019 um 20:54 schrieb Michael Osipov:
> > Am 2019-07-11 um 20:39 schrieb Violeta Georgieva:
> >> The proposed Apache Tomcat 7.0.95 release is now available for voting.
> >>
> >> For full details, see the changelog:
> >> https://ci.apache.org/projects/tomcat/tomcat7/docs/changelog.html
> >
> > That's confusing. I do not see my entry for BZ 63556 from
> > 633950059c04f869d645553540b8ffe825891608.
>
> It really is confusing. The change and its changelog entry seem to be in
> the tag. But the CI docs site has a version string "Version 7.0.95-dev,
> Jun 26 2019", so it's likely it is outdated.

The buildbot is kind of not running

https://ci.apache.org/builders/tomcat-7-trunk



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


Re: [VOTE] Release Apache Tomcat 7.0.95

2019-07-11 Thread Mark Thomas
On 11/07/2019 20:15, Violeta Georgieva wrote:
> 
> 
> На чт, 11.07.2019 г. в 22:08 ч. Rainer Jung  > написа:
>>
>> Am 11.07.2019 um 20:54 schrieb Michael Osipov:
>> > Am 2019-07-11 um 20:39 schrieb Violeta Georgieva:
>> >> The proposed Apache Tomcat 7.0.95 release is now available for voting.
>> >>
>> >> For full details, see the changelog:
>> >> https://ci.apache.org/projects/tomcat/tomcat7/docs/changelog.html
>> >
>> > That's confusing. I do not see my entry for BZ 63556 from
>> > 633950059c04f869d645553540b8ffe825891608.
>>
>> It really is confusing. The change and its changelog entry seem to be in
>> the tag. But the CI docs site has a version string "Version 7.0.95-dev,
>> Jun 26 2019", so it's likely it is outdated.
> 
> The buildbot is kind of not running
> 
> https://ci.apache.org/builders/tomcat-7-trunk

Our builder has been down for a couple of weeks due to some issues with
renaming it (it is hosted externally and not under infra's direct control).

Mark

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



Re: Graal and Tomcat Native

2019-07-11 Thread Rémy Maucherat
On Thu, Jul 11, 2019 at 8:42 PM Rainer Jung  wrote:

> Hi Rémy,
>
> Am 11.07.2019 um 18:35 schrieb Rémy Maucherat:
> > On Thu, Jul 11, 2019 at 4:36 PM Rainer Jung  > > wrote:
> >
> > Probably not very helup, but to make sure, the GetEnv is failing, I
> > would add a little code to native/src/jnilib.c in JNI_OnLoad() that
> > creates an observable side effect while executing int he function.
> E.g.
> > on Unix/Linux you could add something like
> >
> > #include 
> >
> > ...
> >
> > FILE *fd = fopen("/tmp/mytrace", "w");
> > int fputs("At step 1", fd);
> > int fflush(fd);
> > ...
> > int fputs("At step 2", fd);
> > int fflush(fd);
> > ...
> > int fputs("At step N", fd);
> > int fflush(fd);
> > int fclose(fd);
> >
> > Sure poor man's tacing, but it will show, how for you get through
> > JNI_OnLoad() before it is returning.
> >
> > Sorry for not being more helpful,
> >
> >
> > Good idea. So it's failing on:
> > TCN_LOAD_CLASS(env, jFinfo_class, TCN_FINFO_CLASS, JNI_ERR);
> > And I need to define this in the JNI configuration, much like it's done
> > for Java reflection and dynamic class loading. Only difference I haven't
> > really been using it yet. The classes are traced but the configure tool
> > which converts the trace into the config does not work properly [yet].
>
> When one looks up the macros in native/include/tcn.h, this boils down to
> the following returning null:
>
> (*env)->FindClass(env, "org/apache/tomcat/jni/FileInfo")
>
> So our own FileInfo class can not be found. FindClass docs indicate its
> searched in the CLASSPATH although I'm not sure whether its really the
> classpath or some search paths of a class loader hierarchy.
>
> You might want to add the JVM commandline flag "-verbose:class" for any
> easy way to track class loading.
>
> I didn't really grok what you meant with "define in JNI configuration".
> For normal JVMs the code just works, so what might be special for Graal
> that org.apache.tomcat.jni.FileInfo can't be found?
>

A Graal native image is indeed not a normal JVM and does not support any
kind of dynamic class loading, it has to be declared first in these
configuration files.
So I am adding this to the jni one:
{ "name":"org.apache.tomcat.jni.FileInfo" },
{ "name":"org.apache.tomcat.jni.Sockaddr" },
{ "name":"org.apache.tomcat.jni.FileInfo" },
{ "name":"java.lang.String", "methods" :
[{"name":"","parameterTypes":["byte[]"]},{"name":"getBytes","parameterTypes":[]}]
}
And loading now works.
Jul 11, 2019 9:39:28 PM org.apache.catalina.core.AprLifecycleListener
lifecycleEvent
INFO: Loaded APR based Apache Tomcat Native library [1.2.23] using APR
version [1.6.5].
Jul 11, 2019 9:39:28 PM org.apache.catalina.core.AprLifecycleListener
lifecycleEvent
INFO: APR capabilities: IPv6 [true], sendfile [true], accept filters
[false], random [true].
Jul 11, 2019 9:39:28 PM org.apache.catalina.core.AprLifecycleListener
lifecycleEvent
INFO: APR/OpenSSL configuration: useAprConnector [false], useOpenSSL [true]
Jul 11, 2019 9:39:28 PM org.apache.catalina.core.AprLifecycleListener
initializeSSL
INFO: OpenSSL successfully initialized [OpenSSL 1.1.1c FIPS  28 May 2019]

However when trying to actually connect I got:
Segmentation fault (core dumped)

Oops.

Rémy


> Regards,
>
> Rainer
>
> -
> 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: Prep for next version

2019-07-11 Thread violetagg
This is an automated email from the ASF dual-hosted git repository.

violetagg 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 13d07f4  Prep for next version
13d07f4 is described below

commit 13d07f45b14e0a96f2f84c63c196b94f7a14e90b
Author: Violeta Georgieva 
AuthorDate: Thu Jul 11 23:17:58 2019 +0300

Prep for next version
---
 build.properties.default | 2 +-
 res/maven/mvn.properties.default | 2 +-
 webapps/docs/changelog.xml   | 2 ++
 3 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/build.properties.default b/build.properties.default
index 4a30427..68bfa21 100644
--- a/build.properties.default
+++ b/build.properties.default
@@ -25,7 +25,7 @@
 # - Version Control Flags -
 version.major=7
 version.minor=0
-version.build=95
+version.build=96
 version.patch=0
 version.suffix=-dev
 
diff --git a/res/maven/mvn.properties.default b/res/maven/mvn.properties.default
index 3250b7a..2c6c9de 100644
--- a/res/maven/mvn.properties.default
+++ b/res/maven/mvn.properties.default
@@ -35,7 +35,7 @@ 
maven.asf.release.repo.url=https://repository.apache.org/service/local/staging/d
 maven.asf.release.repo.repositoryId=apache.releases
 
 # Release version info
-maven.asf.release.deploy.version=7.0.95
+maven.asf.release.deploy.version=7.0.96
 
 #Where do we load the libraries from
 tomcat.lib.path=../../output/build/lib
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 5fed093..d9ea3e3 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -59,6 +59,8 @@
   They eventually become mixed with the numbered issues (i.e., numbered
   issues do not "pop up" wrt. others).
 -->
+
+
 
   
 


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



Re: Graal and Tomcat Native

2019-07-11 Thread Rainer Jung

Am 11.07.2019 um 22:10 schrieb Rémy Maucherat:
On Thu, Jul 11, 2019 at 8:42 PM Rainer Jung > wrote:


Hi Rémy,

When one looks up the macros in native/include/tcn.h, this boils
down to
the following returning null:

(*env)->FindClass(env, "org/apache/tomcat/jni/FileInfo")

So our own FileInfo class can not be found. FindClass docs indicate its
searched in the CLASSPATH although I'm not sure whether its really the
classpath or some search paths of a class loader hierarchy.

You might want to add the JVM commandline flag "-verbose:class" for any
easy way to track class loading.

I didn't really grok what you meant with "define in JNI configuration".
For normal JVMs the code just works, so what might be special for Graal
that org.apache.tomcat.jni.FileInfo can't be found?


A Graal native image is indeed not a normal JVM and does not support any 
kind of dynamic class loading, it has to be declared first in these 
configuration files.


Ah OK.


So I am adding this to the jni one:
{ "name":"org.apache.tomcat.jni.FileInfo" },
{ "name":"org.apache.tomcat.jni.Sockaddr" },
{ "name":"org.apache.tomcat.jni.FileInfo" },


Again FileInfo? I think instead "org.apache.tomcat.jni.Error" should be 
the third one.


{ "name":"java.lang.String", "methods" : 
[{"name":"","parameterTypes":["byte[]"]},{"name":"getBytes","parameterTypes":[]}] 
}

And loading now works.
Jul 11, 2019 9:39:28 PM org.apache.catalina.core.AprLifecycleListener 
lifecycleEvent
INFO: Loaded APR based Apache Tomcat Native library [1.2.23] using APR 
version [1.6.5].
Jul 11, 2019 9:39:28 PM org.apache.catalina.core.AprLifecycleListener 
lifecycleEvent
INFO: APR capabilities: IPv6 [true], sendfile [true], accept filters 
[false], random [true].
Jul 11, 2019 9:39:28 PM org.apache.catalina.core.AprLifecycleListener 
lifecycleEvent

INFO: APR/OpenSSL configuration: useAprConnector [false], useOpenSSL [true]
Jul 11, 2019 9:39:28 PM org.apache.catalina.core.AprLifecycleListener 
initializeSSL

INFO: OpenSSL successfully initialized [OpenSSL 1.1.1c FIPS  28 May 2019]

However when trying to actually connect I got:
Segmentation fault (core dumped)

Oops.


If the above duplicate class was just a copy and paste typo, but you had 
it right in your actual work, the next one could try, would be 
activating writing core dumps in the underlying OS. The resulting core 
should be inspectable depending on OS via gdb or similar tools. The 
simplest gdb invocation would be


gdb /path/to/my/bin/java /path/to/my/corefile

and then at the gdb prompt the command

  bt

or

  bt full

or

  thread apply all bt

or

  thread apply all bt full

That way we should at least see, in which function the crash happens. 
Depending on symbols etc. you might even get line numbers.


Regards,

Rainer

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