You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by fh...@apache.org on 2020/05/11 17:20:26 UTC
[tomcat] branch master updated: Ensure that the WsContextListener
can be added and that reflection works
This is an automated email from the ASF dual-hosted git repository.
fhanik 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 b5dc2dd Ensure that the WsContextListener can be added and that reflection works
b5dc2dd is described below
commit b5dc2dd2396c6cdeaf5a8d422cd659812d0734e7
Author: Filip Hanik <fh...@pivotal.io>
AuthorDate: Mon May 11 09:49:03 2020 -0700
Ensure that the WsContextListener can be added and that reflection works
---
res/graal/build-tomcat-native-image.sh | 4 +++-
.../native-image/tomcat-reflection.json | 12 ++++++------
test/org/apache/catalina/startup/EmbeddedTomcat.java | 2 ++
3 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/res/graal/build-tomcat-native-image.sh b/res/graal/build-tomcat-native-image.sh
index fc0f26d..cbc0db1 100755
--- a/res/graal/build-tomcat-native-image.sh
+++ b/res/graal/build-tomcat-native-image.sh
@@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+set -e
+
CURDIR=`pwd`
# resolve links - $0 may be a softlink
@@ -53,7 +55,7 @@ native-image \
-H:+ReportExceptionStackTraces \
--allow-incomplete-classpath \
--no-fallback \
--cp ../embed/tomcat-embed-core.jar:../embed/tomcat-embed-websocket.jar:../embed/tomcat-embed-el.jar:tomcat-embedded-sample.jar \
+-cp ../embed/tomcat-embed-core.jar:../embed/tomcat-embed-websocket.jar:../embed/tomcat-embed-el.jar:tomcat-embedded-sample.jar:../embed/annotations-api.jar \
org.apache.catalina.startup.EmbeddedTomcat
cd $CURDIR
\ No newline at end of file
diff --git a/res/graal/tomcat-embed-websocket/native-image/tomcat-reflection.json b/res/graal/tomcat-embed-websocket/native-image/tomcat-reflection.json
index 5907375..3df91d6 100644
--- a/res/graal/tomcat-embed-websocket/native-image/tomcat-reflection.json
+++ b/res/graal/tomcat-embed-websocket/native-image/tomcat-reflection.json
@@ -1,8 +1,8 @@
[
-{ "name":"org.apache.tomcat.websocket.server.WsHttpUpgradeHandler", "methods" : [{"name": "<init>","parameterTypes":[] }] },
-{ "name":"org.apache.tomcat.websocket.pojo.PojoEndpointBase", "allDeclaredMethods":true },
-{ "name":"org.apache.tomcat.websocket.pojo.PojoEndpointServer", "allDeclaredMethods":true },
-{ "name":"org.apache.tomcat.websocket.server.WsContextListener", "allDeclaredMethods":true },
-{ "name":"org.apache.tomcat.websocket.server.WsFilter", "allDeclaredMethods":true },
-{ "name":"org.apache.tomcat.websocket.server.WsHttpUpgradeHandler", "methods":[{"name":"<init>","parameterTypes":[] }] }
+{ "name":"org.apache.tomcat.websocket.server.WsHttpUpgradeHandler", "allDeclaredConstructors" : true, "allPublicConstructors" : true, "allDeclaredMethods" : true, "allPublicMethods" : true },
+{ "name":"org.apache.tomcat.websocket.pojo.PojoEndpointBase", "allDeclaredConstructors" : true, "allPublicConstructors" : true, "allDeclaredMethods" : true, "allPublicMethods" : true },
+{ "name":"org.apache.tomcat.websocket.pojo.PojoEndpointServer", "allDeclaredConstructors" : true, "allPublicConstructors" : true, "allDeclaredMethods" : true, "allPublicMethods" : true },
+{ "name":"org.apache.tomcat.websocket.server.WsContextListener", "allDeclaredConstructors" : true, "allPublicConstructors" : true, "allDeclaredMethods" : true, "allPublicMethods" : true },
+{ "name":"org.apache.tomcat.websocket.server.WsFilter", "allDeclaredConstructors" : true, "allPublicConstructors" : true, "allDeclaredMethods" : true, "allPublicMethods" : true },
+{ "name":"org.apache.tomcat.websocket.server.WsHttpUpgradeHandler", "allDeclaredConstructors" : true, "allPublicConstructors" : true, "allDeclaredMethods" : true, "allPublicMethods" : true }
]
diff --git a/test/org/apache/catalina/startup/EmbeddedTomcat.java b/test/org/apache/catalina/startup/EmbeddedTomcat.java
index 869b707..5658291 100644
--- a/test/org/apache/catalina/startup/EmbeddedTomcat.java
+++ b/test/org/apache/catalina/startup/EmbeddedTomcat.java
@@ -35,6 +35,7 @@ import org.apache.catalina.connector.Connector;
import org.apache.juli.logging.LogFactory;
import org.apache.tomcat.util.scan.StandardJarScanFilter;
import org.apache.tomcat.util.scan.StandardJarScanner;
+import org.apache.tomcat.websocket.server.WsContextListener;
@Ignore
public class EmbeddedTomcat {
@@ -66,6 +67,7 @@ public class EmbeddedTomcat {
CounterServlet counterServlet = new CounterServlet();
Tomcat.addServlet(ctx, "counterServlet", counterServlet);
ctx.addServletMappingDecoded("/", "counterServlet");
+ ctx.addApplicationListener(WsContextListener.class.getName());
tomcat.start();
Thread.sleep(60*1000);
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org