(karaf) 01/01: Merge pull request #1834 from jbonofre/KARAF-7822
This is an automated email from the ASF dual-hosted git repository. jbonofre pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/karaf.git commit b4bb75392655c761d923d6229e289a7de27f5126 Merge: 72dfd610a6 ecde04e125 Author: JB Onofré AuthorDate: Thu Mar 28 18:22:13 2024 +0100 Merge pull request #1834 from jbonofre/KARAF-7822 KARAF-7822: Upgrade to Apache POM 31 pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Re: [PR] KARAF-7822: Upgrade to Apache POM 31 [karaf]
jbonofre merged PR #1834: URL: https://github.com/apache/karaf/pull/1834 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@karaf.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
(karaf) branch karaf-4.4.x updated: KARAF-7822: Upgrade to Apache POM 31
This is an automated email from the ASF dual-hosted git repository. jbonofre pushed a commit to branch karaf-4.4.x in repository https://gitbox.apache.org/repos/asf/karaf.git The following commit(s) were added to refs/heads/karaf-4.4.x by this push: new c0c8e0ef7f KARAF-7822: Upgrade to Apache POM 31 c0c8e0ef7f is described below commit c0c8e0ef7f7eb1ab35a56de87926fd73d88002e6 Author: JB Onofré AuthorDate: Thu Mar 28 15:49:43 2024 +0100 KARAF-7822: Upgrade to Apache POM 31 (cherry picked from commit ecde04e125a921628648ea8d5c02a2e35f6899d4) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index f9ea472872..23b7ff26b9 100644 --- a/pom.xml +++ b/pom.xml @@ -24,7 +24,7 @@ org.apache apache -29 +31
(karaf) branch main updated (72dfd610a6 -> b4bb753926)
This is an automated email from the ASF dual-hosted git repository. jbonofre pushed a change to branch main in repository https://gitbox.apache.org/repos/asf/karaf.git from 72dfd610a6 Merge pull request #1717 from diedertimmers/KARAF-7682 add ecde04e125 KARAF-7822: Upgrade to Apache POM 31 new b4bb753926 Merge pull request #1834 from jbonofre/KARAF-7822 The 1 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: pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
[BUILD-FAILURE]: Job 'Karaf/karaf-runtime/main [main] [494]'
BUILD-FAILURE: Job 'Karaf/karaf-runtime/main [main] [494]': Check console output at "https://ci-builds.apache.org/job/Karaf/job/karaf-runtime/job/main/494/;>Karaf/karaf-runtime/main [main] [494]"
[BUILD-STABLE]: Job 'Karaf/karaf-runtime/main [main] [491]'
BUILD-STABLE: Job 'Karaf/karaf-runtime/main [main] [491]': Is back to normal.
[BUILD-STABLE]: Job 'Karaf/karaf-runtime/main [main] [492]'
BUILD-STABLE: Job 'Karaf/karaf-runtime/main [main] [492]': Is back to normal.
[PR] KARAF-7822: Upgrade to Apache POM 31 [karaf]
jbonofre opened a new pull request, #1834: URL: https://github.com/apache/karaf/pull/1834 (no comment) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@karaf.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[PR] KARAF-7813: Upgrade to ASM 9.7 [karaf]
jbonofre opened a new pull request, #1832: URL: https://github.com/apache/karaf/pull/1832 (no comment) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@karaf.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[PR] KARAF-7814: Upgrade to Pax Web 8.0.27/Jetty 9.4.54.v20240208 [karaf]
jbonofre opened a new pull request, #1833: URL: https://github.com/apache/karaf/pull/1833 (no comment) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@karaf.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[PR] KARAF-7816: Upgrade to Pax JDBC 1.5.7 [karaf]
jbonofre opened a new pull request, #1830: URL: https://github.com/apache/karaf/pull/1830 (no comment) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@karaf.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[PR] KARAF-7819: Upgrade to Spring 5.2.25_1 feature [karaf]
jbonofre opened a new pull request, #1828: URL: https://github.com/apache/karaf/pull/1828 (no comment) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@karaf.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
(karaf) 01/01: Merge pull request #1717 from diedertimmers/KARAF-7682
This is an automated email from the ASF dual-hosted git repository. jbonofre pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/karaf.git commit 72dfd610a6b02f404292d9c4fb030f85887cc6b7 Merge: a35713164c 50d92c1a5a Author: JB Onofré AuthorDate: Thu Mar 28 15:06:57 2024 +0100 Merge pull request #1717 from diedertimmers/KARAF-7682 [KARAF-7682] Changed handling of the TCP connection to send the stop command main/src/main/java/org/apache/karaf/main/Stop.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
(karaf) branch main updated (a35713164c -> 72dfd610a6)
This is an automated email from the ASF dual-hosted git repository. jbonofre pushed a change to branch main in repository https://gitbox.apache.org/repos/asf/karaf.git from a35713164c Merge pull request #1826 from pingpingy1/main add 50d92c1a5a Changed handling of the TCP connection to send the stop command and added a EOL character to the stream new 72dfd610a6 Merge pull request #1717 from diedertimmers/KARAF-7682 The 1 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: main/src/main/java/org/apache/karaf/main/Stop.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
Re: [PR] [KARAF-7682] Changed handling of the TCP connection to send the stop command [karaf]
jbonofre merged PR #1717: URL: https://github.com/apache/karaf/pull/1717 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@karaf.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
(karaf) branch karaf-4.4.x updated: Changed handling of the TCP connection to send the stop command and added a EOL character to the stream
This is an automated email from the ASF dual-hosted git repository. jbonofre pushed a commit to branch karaf-4.4.x in repository https://gitbox.apache.org/repos/asf/karaf.git The following commit(s) were added to refs/heads/karaf-4.4.x by this push: new 2cffad038f Changed handling of the TCP connection to send the stop command and added a EOL character to the stream 2cffad038f is described below commit 2cffad038fb7519efc4d25629e79214756eda3e4 Author: Dieder Timmers die...@ratshome.net AuthorDate: Tue Mar 21 14:47:46 2023 +0100 Changed handling of the TCP connection to send the stop command and added a EOL character to the stream (cherry picked from commit 50d92c1a5ae493dec1af7f621fed7523dc407c0f) --- main/src/main/java/org/apache/karaf/main/Stop.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main/src/main/java/org/apache/karaf/main/Stop.java b/main/src/main/java/org/apache/karaf/main/Stop.java index 2609ad6a73..1f231569d0 100644 --- a/main/src/main/java/org/apache/karaf/main/Stop.java +++ b/main/src/main/java/org/apache/karaf/main/Stop.java @@ -56,11 +56,13 @@ public class Stop { if (config.shutdownPort > 0) { try (Socket s = new Socket(config.shutdownHost, config.shutdownPort)) { s.getOutputStream().write(config.shutdownCommand.getBytes()); -System.exit(0); +s.getOutputStream().write('\n'); +s.getOutputStream().flush(); } catch (ConnectException connectException) { System.err.println("Can't connect to the container. The container is not running."); System.exit(1); } +System.exit(0); } else { // using the pid file int pid = getPidFromPidFile(config.pidFile);
(karaf) branch karaf-4.4.x updated: Check for annotation in ActionCommand constructor
This is an automated email from the ASF dual-hosted git repository. jbonofre pushed a commit to branch karaf-4.4.x in repository https://gitbox.apache.org/repos/asf/karaf.git The following commit(s) were added to refs/heads/karaf-4.4.x by this push: new 8df799d77f Check for annotation in ActionCommand constructor 8df799d77f is described below commit 8df799d77f92e1640e0a808d347b2a6ed7214abf Author: pingpingy1 AuthorDate: Mon Mar 18 18:05:38 2024 +0900 Check for annotation in ActionCommand constructor The `ActionCommand` class takes an `actionClass` parameter for its constructor, whose `@Command` annotation accessed in the other methods. Thus, if the provided `actionClass` has no such annotations, then it will throw an NPE at a later, unspecified time. This commit implements a fail-fast guard against this scenarios. (cherry picked from commit 5ad710722c38bd3f1b0487a584c8dfd71d5f7931) --- .../shell/impl/action/command/ActionCommand.java | 4 +++ .../impl/action/command/ActionCommandTest.java | 35 ++ 2 files changed, 39 insertions(+) diff --git a/shell/core/src/main/java/org/apache/karaf/shell/impl/action/command/ActionCommand.java b/shell/core/src/main/java/org/apache/karaf/shell/impl/action/command/ActionCommand.java index 0b815f648e..4126225978 100644 --- a/shell/core/src/main/java/org/apache/karaf/shell/impl/action/command/ActionCommand.java +++ b/shell/core/src/main/java/org/apache/karaf/shell/impl/action/command/ActionCommand.java @@ -35,6 +35,10 @@ public class ActionCommand implements org.apache.karaf.shell.api.console.Command private final Class actionClass; public ActionCommand(ManagerImpl manager, Class actionClass) { +if (actionClass.getAnnotation(Command.class) == null) { +throw new IllegalArgumentException("actionClass must have an @Command annotation."); +} + this.manager = manager; this.actionClass = actionClass; } diff --git a/shell/core/src/test/java/org/apache/karaf/shell/impl/action/command/ActionCommandTest.java b/shell/core/src/test/java/org/apache/karaf/shell/impl/action/command/ActionCommandTest.java new file mode 100644 index 00..9f67c5a23f --- /dev/null +++ b/shell/core/src/test/java/org/apache/karaf/shell/impl/action/command/ActionCommandTest.java @@ -0,0 +1,35 @@ +/* + * 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.karaf.shell.impl.action.command; + +import org.apache.karaf.shell.api.action.Action; + +import org.junit.Test; + +import static org.junit.Assert.assertThrows; + +public class ActionCommandTest { + + abstract static class ExampleClass implements Action {} + + @Test + public void testUnannotatedActionClass() { + assertThrows(IllegalArgumentException.class, () -> new ActionCommand(null, ExampleClass.class)); + } +} \ No newline at end of file
(karaf) branch main updated (ebdb02da26 -> a35713164c)
This is an automated email from the ASF dual-hosted git repository. jbonofre pushed a change to branch main in repository https://gitbox.apache.org/repos/asf/karaf.git from ebdb02da26 Merge pull request #1827 from i-thiemann/KARAF-7691 add 5ad710722c Check for annotation in ActionCommand constructor new a35713164c Merge pull request #1826 from pingpingy1/main The 1 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: .../shell/impl/action/command/ActionCommand.java | 4 .../impl/action/command/ActionCommandTest.java | 26 +++--- 2 files changed, 17 insertions(+), 13 deletions(-) copy tooling/karaf-maven-plugin/src/it/test-commands-generate-help/test-markdown/src/main/java/test/FooCommand.java => shell/core/src/test/java/org/apache/karaf/shell/impl/action/command/ActionCommandTest.java (66%)
(karaf) 01/01: Merge pull request #1826 from pingpingy1/main
This is an automated email from the ASF dual-hosted git repository. jbonofre pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/karaf.git commit a35713164c63b8bc7b040215ca9140034177ce5e Merge: ebdb02da26 5ad710722c Author: JB Onofré AuthorDate: Thu Mar 28 15:03:13 2024 +0100 Merge pull request #1826 from pingpingy1/main Check for annotation in ActionCommand constructor .../shell/impl/action/command/ActionCommand.java | 4 +++ .../impl/action/command/ActionCommandTest.java | 35 ++ 2 files changed, 39 insertions(+)
Re: [PR] Check for annotation in ActionCommand constructor [karaf]
jbonofre merged PR #1826: URL: https://github.com/apache/karaf/pull/1826 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@karaf.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
(karaf) branch karaf-4.4.x updated: KARAF-7691 Prevent exception on status check by terminating ShutdownSocketThread loop before socket closes
This is an automated email from the ASF dual-hosted git repository. jbonofre pushed a commit to branch karaf-4.4.x in repository https://gitbox.apache.org/repos/asf/karaf.git The following commit(s) were added to refs/heads/karaf-4.4.x by this push: new 04a9654087 KARAF-7691 Prevent exception on status check by terminating ShutdownSocketThread loop before socket closes 04a9654087 is described below commit 04a9654087d5253e0ab5f5853f1440f1f4315ccd Author: Ian Thiemann AuthorDate: Tue Mar 19 08:43:08 2024 +0100 KARAF-7691 Prevent exception on status check by terminating ShutdownSocketThread loop before socket closes (cherry picked from commit c7bdb9eea312a8ab4027846dbd57b0ec78f5e690) --- main/src/main/java/org/apache/karaf/main/Status.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/main/src/main/java/org/apache/karaf/main/Status.java b/main/src/main/java/org/apache/karaf/main/Status.java index 58d02f1ae2..f7bf36e5f7 100644 --- a/main/src/main/java/org/apache/karaf/main/Status.java +++ b/main/src/main/java/org/apache/karaf/main/Status.java @@ -58,6 +58,8 @@ public class Status { try (Socket s = new Socket(config.shutdownHost, config.shutdownPort)) { if (s.isBound()) { System.out.println(RUNNING); +//Send control character EOT to break ShutdownSocketThread loop before socket closes +s.getOutputStream().write(04); System.exit(0); } else { System.out.println(NOT_RUNNING);
Re: [PR] KARAF-7691 Prevent SocketException on status check [karaf]
jbonofre merged PR #1827: URL: https://github.com/apache/karaf/pull/1827 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@karaf.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
(karaf) branch main updated (638e3ae8d2 -> ebdb02da26)
This is an automated email from the ASF dual-hosted git repository. jbonofre pushed a change to branch main in repository https://gitbox.apache.org/repos/asf/karaf.git from 638e3ae8d2 Merge pull request #1818 from grgrzybek/KARAF-7799-main add c7bdb9eea3 KARAF-7691 Prevent exception on status check by terminating ShutdownSocketThread loop before socket closes new ebdb02da26 Merge pull request #1827 from i-thiemann/KARAF-7691 The 1 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: main/src/main/java/org/apache/karaf/main/Status.java | 2 ++ 1 file changed, 2 insertions(+)
(karaf) 01/01: Merge pull request #1827 from i-thiemann/KARAF-7691
This is an automated email from the ASF dual-hosted git repository. jbonofre pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/karaf.git commit ebdb02da26cea3de5da6086187917c0a50776bfb Merge: 638e3ae8d2 c7bdb9eea3 Author: JB Onofré AuthorDate: Thu Mar 28 14:55:49 2024 +0100 Merge pull request #1827 from i-thiemann/KARAF-7691 KARAF-7691 Prevent SocketException on status check main/src/main/java/org/apache/karaf/main/Status.java | 2 ++ 1 file changed, 2 insertions(+)
Re: [PR] [KARAF-7799] Allow merging of org.apache.karaf.features.xml definitions [karaf]
jbonofre merged PR #1817: URL: https://github.com/apache/karaf/pull/1817 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@karaf.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
(karaf) branch karaf-4.4.x updated (8c7b2acdc2 -> 6822d75ec4)
This is an automated email from the ASF dual-hosted git repository. jbonofre pushed a change to branch karaf-4.4.x in repository https://gitbox.apache.org/repos/asf/karaf.git from 8c7b2acdc2 KARAF-7804 - provide unique servlet-name when registering http proxy servlets add f84ab0b39a [KARAF-7799] Allow merging of org.apache.karaf.features.xml definitions new 6822d75ec4 Merge pull request #1817 from grgrzybek/KARAF-7799-4.4 The 1 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: .../org/apache/karaf/profile/assembly/Builder.java | 30 -- 1 file changed, 28 insertions(+), 2 deletions(-)
Re: [PR] [KARAF-7799] Allow merging of org.apache.karaf.features.xml definitions [karaf]
jbonofre merged PR #1818: URL: https://github.com/apache/karaf/pull/1818 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@karaf.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
(karaf) 01/01: Merge pull request #1817 from grgrzybek/KARAF-7799-4.4
This is an automated email from the ASF dual-hosted git repository. jbonofre pushed a commit to branch karaf-4.4.x in repository https://gitbox.apache.org/repos/asf/karaf.git commit 6822d75ec4f6d9720d4323069edef358054a0777 Merge: 8c7b2acdc2 f84ab0b39a Author: JB Onofré AuthorDate: Thu Mar 28 14:47:46 2024 +0100 Merge pull request #1817 from grgrzybek/KARAF-7799-4.4 [KARAF-7799] Allow merging of org.apache.karaf.features.xml definitions .../org/apache/karaf/profile/assembly/Builder.java | 30 -- 1 file changed, 28 insertions(+), 2 deletions(-)
(karaf) branch main updated (d111ee4b8b -> 638e3ae8d2)
This is an automated email from the ASF dual-hosted git repository. jbonofre pushed a change to branch main in repository https://gitbox.apache.org/repos/asf/karaf.git from d111ee4b8b Merge pull request #1822 from awrb/KARAF-7804 add 2e417d0889 [KARAF-7799] Allow merging of org.apache.karaf.features.xml definitions new 638e3ae8d2 Merge pull request #1818 from grgrzybek/KARAF-7799-main The 1 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: .../org/apache/karaf/profile/assembly/Builder.java | 30 -- 1 file changed, 28 insertions(+), 2 deletions(-)
(karaf) 01/01: Merge pull request #1818 from grgrzybek/KARAF-7799-main
This is an automated email from the ASF dual-hosted git repository. jbonofre pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/karaf.git commit 638e3ae8d24eb16b6ec76ba9469bd1607f7374e4 Merge: d111ee4b8b 2e417d0889 Author: JB Onofré AuthorDate: Thu Mar 28 14:47:24 2024 +0100 Merge pull request #1818 from grgrzybek/KARAF-7799-main [KARAF-7799] Allow merging of org.apache.karaf.features.xml definitions .../org/apache/karaf/profile/assembly/Builder.java | 30 -- 1 file changed, 28 insertions(+), 2 deletions(-)
Re: [PR] [KARAF-7763] Bump slf4j to 2.0.9 [karaf]
jbonofre closed pull request #1780: [KARAF-7763] Bump slf4j to 2.0.9 URL: https://github.com/apache/karaf/pull/1780 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@karaf.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [PR] [KARAF-7763] Bump slf4j to 2.0.9 [karaf]
jbonofre commented on PR #1780: URL: https://github.com/apache/karaf/pull/1780#issuecomment-2025227935 I will superseed with an updated PR. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@karaf.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
(karaf) branch karaf-4.4.x updated: KARAF-7804 - provide unique servlet-name when registering http proxy servlets
This is an automated email from the ASF dual-hosted git repository. jbonofre pushed a commit to branch karaf-4.4.x in repository https://gitbox.apache.org/repos/asf/karaf.git The following commit(s) were added to refs/heads/karaf-4.4.x by this push: new 8c7b2acdc2 KARAF-7804 - provide unique servlet-name when registering http proxy servlets 8c7b2acdc2 is described below commit 8c7b2acdc2ee02af44e4f0f50212af2698c2eef3 Author: Aleksy Wróblewski AuthorDate: Fri Jan 26 14:12:17 2024 +0100 KARAF-7804 - provide unique servlet-name when registering http proxy servlets (cherry picked from commit c310ce274aab5be7f9cd81c2b549b8e4978ab786) --- .../karaf/http/core/internal/ProxyServiceImpl.java | 20 +++- .../test/java/org/apache/karaf/itests/HttpTest.java | 8 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/http/src/main/java/org/apache/karaf/http/core/internal/ProxyServiceImpl.java b/http/src/main/java/org/apache/karaf/http/core/internal/ProxyServiceImpl.java index 5e86fcffc6..2991e70e81 100644 --- a/http/src/main/java/org/apache/karaf/http/core/internal/ProxyServiceImpl.java +++ b/http/src/main/java/org/apache/karaf/http/core/internal/ProxyServiceImpl.java @@ -101,6 +101,7 @@ public class ProxyServiceImpl implements ProxyService { String[] proxySplit = proxyString.split(" "); if (proxySplit.length == 3) { String url = proxySplit[0].trim(); +validateUrl(url); String proxyTo = proxySplit[1].trim(); String balancingPolicy = proxySplit[2].trim(); if (!proxies.containsKey(url)) { @@ -111,6 +112,9 @@ public class ProxyServiceImpl implements ProxyService { addProxyInternal(proxy); } } +else { +LOG.error("Incorrect configuration line {}", proxyString); +} } } } @@ -131,7 +135,9 @@ public class ProxyServiceImpl implements ProxyService { proxyServlet.setBalancingPolicy(balancingPolicy); } } -httpService.registerServlet(proxy.getUrl(), proxyServlet, new Hashtable(), null); +Hashtable props = new Hashtable<>(); +props.put("servlet-name", getUniqueServletName(proxy)); +httpService.registerServlet(proxy.getUrl(), proxyServlet, props, null); proxies.put(proxy.getUrl(), proxy); } catch (Exception e) { LOG.error("Can't add {} proxy to {}", proxy.getUrl(), proxy.getProxyTo(), e); @@ -160,4 +166,16 @@ public class ProxyServiceImpl implements ProxyService { } } +private void validateUrl(String url) +{ +if (url == null || !url.startsWith("/")) +{ +throw new IllegalArgumentException("Proxy URL does not start with '/': " + url); +} +} + +private String getUniqueServletName(Proxy proxy) +{ +return proxy.getUrl().substring(1); +} } diff --git a/itests/test/src/test/java/org/apache/karaf/itests/HttpTest.java b/itests/test/src/test/java/org/apache/karaf/itests/HttpTest.java index 3374b681e6..69cc2b1ba2 100644 --- a/itests/test/src/test/java/org/apache/karaf/itests/HttpTest.java +++ b/itests/test/src/test/java/org/apache/karaf/itests/HttpTest.java @@ -59,6 +59,7 @@ public class HttpTest extends BaseTest { @Test public void testProxy() throws Exception { executeCommand("http:proxy-add /test1 http://karaf.apache.org;); +executeCommand("http:proxy-add /test2 http://karaf.apache.org;); String output = executeCommand("http:proxy-balancing-list"); System.out.println(output); @@ -68,6 +69,13 @@ public class HttpTest extends BaseTest { output = executeCommand("http:proxy-list"); System.out.println(output); assertContains("/test1", output); +assertContains("/test2", output); } +@Test +public void testIncorrectProxyUrlFails() throws Exception { +executeCommand("http:proxy-add no-slash-prefix http://karaf.apache.org;); +String output = executeCommand("http:proxy-list"); +assertContainsNot("no-slash-prefix", output); +} }
Re: [PR] [KARAF-7773] Upgrade to Pax Web 8.0.24 & Jetty 9.4.53.v20231009 [karaf]
jbonofre commented on PR #1788: URL: https://github.com/apache/karaf/pull/1788#issuecomment-2025225559 I will supersed with an updated PR. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@karaf.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [PR] [KARAF-7773] Upgrade to Pax Web 8.0.24 & Jetty 9.4.53.v20231009 [karaf]
jbonofre closed pull request #1788: [KARAF-7773] Upgrade to Pax Web 8.0.24 & Jetty 9.4.53.v20231009 URL: https://github.com/apache/karaf/pull/1788 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@karaf.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
(karaf) 01/01: Merge pull request #1822 from awrb/KARAF-7804
This is an automated email from the ASF dual-hosted git repository. jbonofre pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/karaf.git commit d111ee4b8b9eee395208bb14e8b48ee00ceb9a07 Merge: 0068a686a4 c310ce274a Author: JB Onofré AuthorDate: Thu Mar 28 14:43:43 2024 +0100 Merge pull request #1822 from awrb/KARAF-7804 KARAF-7804 - provide unique servlet-name when registering http proxy servlets .../karaf/http/core/internal/ProxyServiceImpl.java | 20 +++- .../test/java/org/apache/karaf/itests/HttpTest.java | 8 2 files changed, 27 insertions(+), 1 deletion(-)
(karaf) branch main updated (0068a686a4 -> d111ee4b8b)
This is an automated email from the ASF dual-hosted git repository. jbonofre pushed a change to branch main in repository https://gitbox.apache.org/repos/asf/karaf.git from 0068a686a4 Merge pull request #1825 from pingpingy1/main add c310ce274a KARAF-7804 - provide unique servlet-name when registering http proxy servlets new d111ee4b8b Merge pull request #1822 from awrb/KARAF-7804 The 1 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: .../karaf/http/core/internal/ProxyServiceImpl.java | 20 +++- .../test/java/org/apache/karaf/itests/HttpTest.java | 8 2 files changed, 27 insertions(+), 1 deletion(-)
Re: [PR] KARAF-7804 - provide unique servlet-name when registering http proxy servlets [karaf]
jbonofre merged PR #1822: URL: https://github.com/apache/karaf/pull/1822 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@karaf.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org