From ad5284e792950446696bca0cfc2af2c9ba9eb4dd Mon Sep 17 00:00:00 2001 From: Kalin Chan Date: Wed, 4 May 2022 14:20:11 +0100 Subject: [PATCH 1/3] FISH-6263 Upgrade Smack to version 4.3.4 --- nucleus/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nucleus/pom.xml b/nucleus/pom.xml index b42bf5f2a1b..9cdfeb085f3 100644 --- a/nucleus/pom.xml +++ b/nucleus/pom.xml @@ -237,7 +237,7 @@ 1.6.2.payara-p1 1.2 3.11.1 - 4.1.9 + 4.3.4 0.4.2 1.1.4c_7 2.5.3-payara.p1 From 9877053d153729ce92f91534d27d2ca5cf13e284 Mon Sep 17 00:00:00 2001 From: Kalin Chan Date: Fri, 6 May 2022 11:09:39 +0100 Subject: [PATCH 2/3] FISH-6263 Fix compilation errors --- .../payara/notification/xmpp/TestXmppNotifier.java | 4 ++-- .../notification/xmpp/XmppNotificationRunnable.java | 11 +++++++---- .../payara/notification/xmpp/XmppNotifierService.java | 4 +++- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/appserver/payara-appserver-modules/notification-xmpp-core/src/main/java/fish/payara/notification/xmpp/TestXmppNotifier.java b/appserver/payara-appserver-modules/notification-xmpp-core/src/main/java/fish/payara/notification/xmpp/TestXmppNotifier.java index 1d1dee3e7e0..235b8060124 100644 --- a/appserver/payara-appserver-modules/notification-xmpp-core/src/main/java/fish/payara/notification/xmpp/TestXmppNotifier.java +++ b/appserver/payara-appserver-modules/notification-xmpp-core/src/main/java/fish/payara/notification/xmpp/TestXmppNotifier.java @@ -170,7 +170,7 @@ public void execute(AdminCommandContext context) { .setSecurityMode(options.getSecurityDisabled() ? ConnectionConfiguration.SecurityMode.disabled : ConnectionConfiguration.SecurityMode.required) - .setServiceName(options.getServiceName()) + .setXmppDomain(options.getServiceName()) .setHost(options.getHost()) .setPort(options.getPort()) .build(); @@ -181,7 +181,7 @@ public void execute(AdminCommandContext context) { } else { connection.login(); } - } catch (SmackException | IOException | XMPPException ex) { + } catch (SmackException | IOException | XMPPException | InterruptedException ex) { actionReport.setMessage(ex.getMessage()); actionReport.setActionExitCode(ActionReport.ExitCode.FAILURE); queue.resetQueue(); diff --git a/appserver/payara-appserver-modules/notification-xmpp-core/src/main/java/fish/payara/notification/xmpp/XmppNotificationRunnable.java b/appserver/payara-appserver-modules/notification-xmpp-core/src/main/java/fish/payara/notification/xmpp/XmppNotificationRunnable.java index e980dccacd0..4cf8ece1035 100644 --- a/appserver/payara-appserver-modules/notification-xmpp-core/src/main/java/fish/payara/notification/xmpp/XmppNotificationRunnable.java +++ b/appserver/payara-appserver-modules/notification-xmpp-core/src/main/java/fish/payara/notification/xmpp/XmppNotificationRunnable.java @@ -1,7 +1,7 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright (c) [2016-2017] Payara Foundation and/or its affiliates. All rights reserved. + * Copyright (c) [2016-2022] Payara Foundation and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development @@ -46,6 +46,9 @@ import org.jivesoftware.smack.tcp.XMPPTCPConnection; import org.jivesoftware.smackx.muc.MultiUserChat; import org.jivesoftware.smackx.muc.MultiUserChatManager; +import org.jxmpp.jid.impl.JidCreate; +import org.jxmpp.jid.parts.Resourcepart; +import org.jxmpp.stringprep.XmppStringprepException; import java.util.logging.Level; import java.util.logging.Logger; @@ -70,10 +73,10 @@ public void run() { try { XmppMessage xmppMessage = queue.getMessage(); MultiUserChatManager manager = MultiUserChatManager.getInstanceFor(connection); - MultiUserChat multiUserChat = manager.getMultiUserChat(executionOptions.getRoomId() + "@" + executionOptions.getServiceName()); + MultiUserChat multiUserChat = manager.getMultiUserChat(JidCreate.entityBareFrom(executionOptions.getRoomId() + "@" + executionOptions.getServiceName())); if (multiUserChat != null) { if (!multiUserChat.isJoined()) { - multiUserChat.join(executionOptions.getUsername(), executionOptions.getPassword()); + multiUserChat.join(Resourcepart.from(executionOptions.getUsername()), executionOptions.getPassword()); } Message message = new Message(); @@ -84,7 +87,7 @@ public void run() { } logger.log(Level.FINE, "Message sent successfully"); } - catch (XMPPException | SmackException e) { + catch (XMPPException | SmackException | XmppStringprepException | InterruptedException e) { logger.log(Level.SEVERE, "Error occurred while sending message to room", e); } } diff --git a/appserver/payara-appserver-modules/notification-xmpp-core/src/main/java/fish/payara/notification/xmpp/XmppNotifierService.java b/appserver/payara-appserver-modules/notification-xmpp-core/src/main/java/fish/payara/notification/xmpp/XmppNotifierService.java index d0cafc968be..6c3e6385dae 100644 --- a/appserver/payara-appserver-modules/notification-xmpp-core/src/main/java/fish/payara/notification/xmpp/XmppNotifierService.java +++ b/appserver/payara-appserver-modules/notification-xmpp-core/src/main/java/fish/payara/notification/xmpp/XmppNotifierService.java @@ -89,7 +89,7 @@ public void bootstrap() { .setSecurityMode(executionOptions.getSecurityDisabled() ? ConnectionConfiguration.SecurityMode.disabled : ConnectionConfiguration.SecurityMode.required) - .setServiceName(executionOptions.getServiceName()) + .setXmppDomain(executionOptions.getServiceName()) .setHost(executionOptions.getHost()) .setPort(executionOptions.getPort()) .build(); @@ -111,6 +111,8 @@ public void bootstrap() { } catch (IOException e) { logger.log(Level.SEVERE, "IO Error occurred while connecting host", e); + } catch (InterruptedException e) { + logger.log(Level.SEVERE, "InterruptedException occurred while connecting host", e); } } From 8aa5243b0dcee282588d558a38519866cd95168f Mon Sep 17 00:00:00 2001 From: Kalin Chan Date: Fri, 13 May 2022 12:19:06 +0100 Subject: [PATCH 3/3] FISH-6263 Resolve OSGi errors --- appserver/packager/notification-xmpp/pom.xml | 10 ++++++++++ nucleus/pom.xml | 3 ++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/appserver/packager/notification-xmpp/pom.xml b/appserver/packager/notification-xmpp/pom.xml index 14322237c1e..fbb50447a56 100644 --- a/appserver/packager/notification-xmpp/pom.xml +++ b/appserver/packager/notification-xmpp/pom.xml @@ -155,6 +155,16 @@ org.apache.servicemix.bundles.xpp3 ${xpp3.version} + + org.jxmpp + jxmpp-jid + ${jxmpp.version} + + + org.minidns + minidns-core + ${minidns.version} + diff --git a/nucleus/pom.xml b/nucleus/pom.xml index 9cdfeb085f3..2b687b55876 100644 --- a/nucleus/pom.xml +++ b/nucleus/pom.xml @@ -238,7 +238,8 @@ 1.2 3.11.1 4.3.4 - 0.4.2 + 0.6.4 + 0.3.4 1.1.4c_7 2.5.3-payara.p1 2.2.6