From d950164905c4aee11e816949b53329cdb57d07e6 Mon Sep 17 00:00:00 2001 From: Emmanuel Bruno <emmanuel.bruno@univ-tln.fr> Date: Thu, 9 Dec 2021 14:43:30 +0100 Subject: [PATCH] adds a functionnal EAR instead of multiple wars. --- README.md | 10 +++++----- .../bruno/samples/jee91/wsclient/WsClient.java | 2 +- .../main/resources/META-INF/log4j.properties | 17 +++++++++++++++++ 3 files changed, 23 insertions(+), 6 deletions(-) create mode 100644 websocketClient/src/main/resources/META-INF/log4j.properties diff --git a/README.md b/README.md index 78b6167..4935b3e 100644 --- a/README.md +++ b/README.md @@ -4,14 +4,14 @@ 1. COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 docker-compose up --build -d 2. Visit - 1. curl http://localhost:8080/restApp-1.0-SNAPSHOT/resources/sample - 2. curl http://localhost:8080/restApp-1.0-SNAPSHOT/resources/sample/hello - 3. curl http://localhost:8080/restApp-1.0-SNAPSHOT/resources/sample/main - 4. curl http://localhost:8080/restApp-1.0-SNAPSHOT/resources/sample/persons + 1. curl http://localhost:8080/restApp/sample + 2. curl http://localhost:8080/restApp/sample/hello + 3. curl http://localhost:8080/restApp/sample/main + 4. curl http://localhost:8080/restApp/sample/persons 5. curl -H "Content-Type: application/json" \ -X POST \ -d '{"name":"Jeanne"}' \ - http://localhost:8080/restApp-1.0-SNAPSHOT/resources/sample/persons + http://localhost:8080/restApp/sample/persons 6. curl http://localhost:8080/restApp-1.0-SNAPSHOT/resources/sample/persons/843c8236-6c6b-450e-9aa3-211a9b897403 7. curl -H "Accept: text/xml" http://localhost:8080/restApp-1.0-SNAPSHOT/resources/sample/persons ## Import "real" certificate diff --git a/websocketClient/src/main/java/fr/univtln/bruno/samples/jee91/wsclient/WsClient.java b/websocketClient/src/main/java/fr/univtln/bruno/samples/jee91/wsclient/WsClient.java index bf1e350..3ed8607 100644 --- a/websocketClient/src/main/java/fr/univtln/bruno/samples/jee91/wsclient/WsClient.java +++ b/websocketClient/src/main/java/fr/univtln/bruno/samples/jee91/wsclient/WsClient.java @@ -41,7 +41,7 @@ public class WsClient { public static void main(String[] args) { try { - final WsClient clientEndPoint = new WsClient(new URI("ws://localhost:8080/wsApp-1.0-SNAPSHOT/hellows")); + final WsClient clientEndPoint = new WsClient(new URI("ws://localhost:8686/wsApp/hellows")); clientEndPoint.sendMessage("Hello 1 !"); Thread.sleep(5000); clientEndPoint.sendMessage("Hello 2 !"); diff --git a/websocketClient/src/main/resources/META-INF/log4j.properties b/websocketClient/src/main/resources/META-INF/log4j.properties new file mode 100644 index 0000000..c667f1b --- /dev/null +++ b/websocketClient/src/main/resources/META-INF/log4j.properties @@ -0,0 +1,17 @@ +log4j.rootLogger=debug, stdout, R + +log4j.appender.stdout=org.apache.log4j.ConsoleAppender +log4j.appender.stdout.layout=org.apache.log4j.PatternLayout + +# Pattern to output the caller's file name and line number. +log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n + +log4j.appender.R=org.apache.log4j.RollingFileAppender +log4j.appender.R.File=wsClient.log + +log4j.appender.R.MaxFileSize=100KB +# Keep one backup file +log4j.appender.R.MaxBackupIndex=1 + +log4j.appender.R.layout=org.apache.log4j.PatternLayout +log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n \ No newline at end of file -- GitLab