diff --git a/qserv/pom.xml b/qserv/pom.xml
index 785d36d..d756d7f 100644
--- a/qserv/pom.xml
+++ b/qserv/pom.xml
@@ -43,15 +43,8 @@
org.apache.activemq
- activemq-all
- 5.18.1
- provided
-
-
- org.apache.geronimo.specs
- geronimo-jms_1.1_spec
- 1.1.1
- provided
+ activemq-client
+ 5.17.5
diff --git a/qserv/src/main/java/de/hsadmin/core/qserv/QueueServer.java b/qserv/src/main/java/de/hsadmin/core/qserv/QueueServer.java
index f98596e..34660d4 100644
--- a/qserv/src/main/java/de/hsadmin/core/qserv/QueueServer.java
+++ b/qserv/src/main/java/de/hsadmin/core/qserv/QueueServer.java
@@ -164,9 +164,11 @@ public class QueueServer implements MessageListener, ExceptionListener {
protected void sendStatus(TaskTransfer queueMessage) {
final ActiveMQConnectionFactory mqConnectionFactory = new ActiveMQConnectionFactory(jmsUrl);
mqConnectionFactory.setTrustAllPackages(true);
+ QueueConnection queueConnection = null;
MessageProducer producer = null;
QueueSession session = null;
- try (QueueConnection queueConnection = mqConnectionFactory.createQueueConnection(jmsUsername, jmsPassword)) {
+ try {
+ queueConnection = mqConnectionFactory.createQueueConnection(jmsUsername, jmsPassword);
queueConnection.setExceptionListener(this);
session = queueConnection.createQueueSession(false, QueueSession.CLIENT_ACKNOWLEDGE);
final Queue queue = session.createQueue(jmsStatusQueue);
@@ -177,6 +179,10 @@ public class QueueServer implements MessageListener, ExceptionListener {
producer.send(statusMessage);
} catch (Exception statusException) {
logger.log(Level.SEVERE, statusException.getMessage(), statusException);
+ } finally {
+ if (producer != null) try { producer.close(); } catch (Exception e) { }
+ if (session != null) try { session.close(); } catch (Exception e) { }
+ if (queueConnection != null) try { queueConnection.close(); } catch (Exception e) { }
}
}