This is an automated email from the ASF dual-hosted git repository.
clebertsuconic pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/artemis.git
The following commit(s) were added to refs/heads/main by this push:
new 5b8b7498d9 ARTEMIS-5852 setLockCoordinator() should consider it null
5b8b7498d9 is described below
commit 5b8b7498d9e45b5a6d29c1a5dee7099a419e8ed0
Author: Clebert Suconic <[email protected]>
AuthorDate: Fri Feb 6 10:54:38 2026 -0500
ARTEMIS-5852 setLockCoordinator() should consider it null
The server is getting the configuration "" and trying to lookup for
the lockCoordinator "" that won't exist
---
.../artemis/api/core/TransportConfiguration.java | 6 +-
.../smoke/simpleStart/DefaultServerSmokeTest.java | 92 ++++++++++++++++++++++
2 files changed, 97 insertions(+), 1 deletion(-)
diff --git
a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/TransportConfiguration.java
b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/TransportConfiguration.java
index 4a85234417..c4c83e112e 100644
---
a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/TransportConfiguration.java
+++
b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/TransportConfiguration.java
@@ -420,7 +420,11 @@ public class TransportConfiguration implements
Serializable {
}
public TransportConfiguration setLockCoordinator(String lockCoordinator) {
- this.lockCoordinator = lockCoordinator;
+ if (String.valueOf(lockCoordinator).trim().equals("")) {
+ this.lockCoordinator = null;
+ } else {
+ this.lockCoordinator = lockCoordinator;
+ }
return this;
}
diff --git
a/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/simpleStart/DefaultServerSmokeTest.java
b/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/simpleStart/DefaultServerSmokeTest.java
new file mode 100644
index 0000000000..9c021c0837
--- /dev/null
+++
b/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/simpleStart/DefaultServerSmokeTest.java
@@ -0,0 +1,92 @@
+/*
+ * 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.activemq.artemis.tests.smoke.simpleStart;
+
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+import java.io.File;
+import java.util.concurrent.TimeUnit;
+
+import org.apache.activemq.artemis.cli.commands.helper.HelperCreate;
+import org.apache.activemq.artemis.tests.smoke.common.SmokeTestBase;
+import org.apache.activemq.artemis.tests.util.CFUtil;
+import org.apache.activemq.artemis.utils.FileUtil;
+import org.apache.activemq.artemis.utils.RandomUtil;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+
+public class DefaultServerSmokeTest extends SmokeTestBase {
+
+ private static final String SERVER_NAME = "default-server";
+ private static File SERVER_LOCATION = getFileServerLocation(SERVER_NAME);
+
+ private final String queueName = "queue" + RandomUtil.randomUUIDString();
+
+ @BeforeEach
+ public void setupServer() throws Exception {
+
+ deleteDirectory(SERVER_LOCATION);
+
+ {
+ HelperCreate cliCreateServer = helperCreate();
+
cliCreateServer.setRole("amq").setUser("admin").setPassword("admin").setAllowAnonymous(true).setNoWeb(false).setArtemisInstance(SERVER_LOCATION);
+ cliCreateServer.addArgs("--queues", queueName);
+ cliCreateServer.createServer();
+ }
+ }
+
+ @Test
+ public void testValidateDefaultConfigurationNoWarning() throws Exception {
+
+ Process process = startServer(SERVER_NAME, 0, 5000);
+
+ ConnectionFactory factory = CFUtil.createConnectionFactory("CORE",
"tcp://localhost:61616");
+
+ try (Connection connection = factory.createConnection()) {
+ Session session = connection.createSession(false,
Session.AUTO_ACKNOWLEDGE);
+ MessageProducer producer =
session.createProducer(session.createQueue(queueName));
+ producer.send(session.createTextMessage("hello"));
+ }
+
+ try (Connection connection = factory.createConnection()) {
+ connection.start();
+ Session session = connection.createSession(false,
Session.AUTO_ACKNOWLEDGE);
+ MessageConsumer c =
session.createConsumer(session.createQueue(queueName));
+ TextMessage message = (TextMessage) c.receive(5000);
+ assertNotNull(message);
+ assertEquals("hello", message.getText());
+ }
+
+ stopServerWithFile(SERVER_LOCATION.getAbsolutePath());
+
+ process.waitFor(1, TimeUnit.SECONDS);
+
+ File log = new File(SERVER_LOCATION, "/log/artemis.log");
+ assertFalse(FileUtil.find(log, l -> l.contains("WARN")));
+
+ }
+
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]