You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by cl...@apache.org on 2016/06/30 17:18:46 UTC
[1/2] activemq-artemis git commit: [ARTEMIS-603] Remove
e.printStackTrace() from code
Repository: activemq-artemis
Updated Branches:
refs/heads/master 57529ac04 -> 3f3a13564
[ARTEMIS-603] Remove e.printStackTrace() from code
Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/2170acc4
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/2170acc4
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/2170acc4
Branch: refs/heads/master
Commit: 2170acc41795b0d87c92edfd5ce99ebbcc6f7cc3
Parents: 57529ac
Author: Dmitrii Tikhomirov <dt...@redhat.com>
Authored: Tue Jun 28 13:29:54 2016 +0200
Committer: Dmitrii Tikhomirov <dt...@redhat.com>
Committed: Thu Jun 30 18:58:09 2016 +0200
----------------------------------------------------------------------
.../java/org/apache/activemq/artemis/ra/ActiveMQRALogger.java | 4 ++++
.../activemq/artemis/ra/inflow/ActiveMQActivationSpec.java | 2 +-
.../artemis/core/remoting/impl/invm/InVMAcceptor.java | 7 +++++--
.../artemis/core/remoting/impl/netty/NettyAcceptor.java | 7 +++++--
.../activemq/artemis/core/server/cluster/ClusterManager.java | 4 ++--
.../artemis/core/server/cluster/ha/ColocatedHAManager.java | 3 +--
.../core/server/cluster/impl/ClusterConnectionImpl.java | 4 ++--
.../activemq/artemis/core/server/impl/ActiveMQServerImpl.java | 2 +-
.../artemis/core/server/impl/ColocatedActivation.java | 6 +++---
.../artemis/core/server/impl/FileLockNodeManager.java | 2 +-
.../activemq/artemis/core/server/impl/InVMNodeManager.java | 3 ++-
.../activemq/artemis/core/server/impl/RefsOperation.java | 2 +-
.../activemq/artemis/core/server/impl/ServerSessionImpl.java | 3 +--
.../core/server/impl/SharedNothingBackupActivation.java | 1 -
.../artemis/core/server/impl/SharedStoreBackupActivation.java | 2 +-
15 files changed, 30 insertions(+), 22 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2170acc4/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRALogger.java
----------------------------------------------------------------------
diff --git a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRALogger.java b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRALogger.java
index 93a7b97..32316f0 100644
--- a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRALogger.java
+++ b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRALogger.java
@@ -109,6 +109,10 @@ public interface ActiveMQRALogger extends BasicLogger {
@Message(id = 152008, value = "Error interrupting handler on endpoint {0} handler = {1}", format = Message.Format.MESSAGE_FORMAT)
void errorInterruptingHandler(String endpoint, String handler, @Cause Throwable cause);
+ @LogMessage(level = Logger.Level.WARN)
+ @Message(id = 152009, value = "Unable to validate properties", format = Message.Format.MESSAGE_FORMAT)
+ void unableToValidateProperties(@Cause Exception e);
+
@LogMessage(level = Logger.Level.ERROR)
@Message(id = 154000, value = "Error while creating object Reference.", format = Message.Format.MESSAGE_FORMAT)
void errorCreatingReference(@Cause Exception e);
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2170acc4/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/inflow/ActiveMQActivationSpec.java
----------------------------------------------------------------------
diff --git a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/inflow/ActiveMQActivationSpec.java b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/inflow/ActiveMQActivationSpec.java
index 3f24300..d9b6954 100644
--- a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/inflow/ActiveMQActivationSpec.java
+++ b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/inflow/ActiveMQActivationSpec.java
@@ -716,7 +716,7 @@ public class ActiveMQActivationSpec extends ConnectionFactoryProperties implemen
}
}
catch (IntrospectionException e) {
- e.printStackTrace();
+ ActiveMQRALogger.LOGGER.unableToValidateProperties(e);
}
if (propsNotSet.size() > 0) {
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2170acc4/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMAcceptor.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMAcceptor.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMAcceptor.java
index 190a5d1..d30b564 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMAcceptor.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMAcceptor.java
@@ -40,6 +40,7 @@ import org.apache.activemq.artemis.utils.ConfigurationHelper;
import org.apache.activemq.artemis.utils.ExecutorFactory;
import org.apache.activemq.artemis.utils.OrderedExecutorFactory;
import org.apache.activemq.artemis.utils.TypedProperties;
+import org.jboss.logging.Logger;
public final class InVMAcceptor extends AbstractAcceptor {
@@ -69,6 +70,9 @@ public final class InVMAcceptor extends AbstractAcceptor {
private final String name;
+ private static final Logger logger = Logger.getLogger(InVMAcceptor.class);
+
+
public InVMAcceptor(final String name,
final ClusterConnection clusterConnection,
final Map<String, Object> configuration,
@@ -164,8 +168,7 @@ public final class InVMAcceptor extends AbstractAcceptor {
notificationService.sendNotification(notification);
}
catch (Exception e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ logger.warn("failed to send notification",e.getMessage(),e);
}
}
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2170acc4/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyAcceptor.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyAcceptor.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyAcceptor.java
index f9484f5..5e04c4a 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyAcceptor.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyAcceptor.java
@@ -77,6 +77,7 @@ import org.apache.activemq.artemis.spi.core.remoting.ServerConnectionLifeCycleLi
import org.apache.activemq.artemis.utils.ActiveMQThreadFactory;
import org.apache.activemq.artemis.utils.ConfigurationHelper;
import org.apache.activemq.artemis.utils.TypedProperties;
+import org.jboss.logging.Logger;
/**
* A Netty TCP Acceptor that is embedding Netty.
@@ -171,6 +172,9 @@ public class NettyAcceptor extends AbstractAcceptor {
private Map<String, Object> extraConfigs;
+ private static final Logger logger = Logger.getLogger(NettyAcceptor.class);
+
+
public NettyAcceptor(final String name,
final ClusterConnection clusterConnection,
final Map<String, Object> configuration,
@@ -520,8 +524,7 @@ public class NettyAcceptor extends AbstractAcceptor {
notificationService.sendNotification(notification);
}
catch (Exception e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ logger.warn("failed to send notification",e.getMessage(),e);
}
}
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2170acc4/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ClusterManager.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ClusterManager.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ClusterManager.java
index ef39ba2..17eaae0 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ClusterManager.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ClusterManager.java
@@ -520,7 +520,7 @@ public final class ClusterManager implements ActiveMQComponent {
manager.stop();
}
catch (Exception e) {
- e.printStackTrace();
+ ActiveMQServerLogger.LOGGER.warn(e.getMessage(), e);
}
}
@@ -562,7 +562,7 @@ public final class ClusterManager implements ActiveMQComponent {
clusterConnection.stop();
}
catch (Exception e) {
- e.printStackTrace();
+ ActiveMQServerLogger.LOGGER.warn(e.getMessage(), e);
}
}
clearClusterConnections();
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2170acc4/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ha/ColocatedHAManager.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ha/ColocatedHAManager.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ha/ColocatedHAManager.java
index 0959f72..c38e186 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ha/ColocatedHAManager.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ha/ColocatedHAManager.java
@@ -70,8 +70,7 @@ public class ColocatedHAManager implements HAManager {
activeMQServer.stop();
}
catch (Exception e) {
- e.printStackTrace();
- //todo
+ ActiveMQServerLogger.LOGGER.warn(e.getMessage(), e);
}
}
backupServers.clear();
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2170acc4/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/ClusterConnectionImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/ClusterConnectionImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/ClusterConnectionImpl.java
index d009e79..800ed5a 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/ClusterConnectionImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/ClusterConnectionImpl.java
@@ -1478,7 +1478,7 @@ public final class ClusterConnectionImpl implements ClusterConnection, AfterConn
}
}
catch (Exception e) {
- e.printStackTrace();
+ ActiveMQServerLogger.LOGGER.warn(e);
}
}
@@ -1492,7 +1492,7 @@ public final class ClusterConnectionImpl implements ClusterConnection, AfterConn
}
}
catch (Exception e) {
- e.printStackTrace();
+ ActiveMQServerLogger.LOGGER.warn(e.getMessage(),e);
}
}
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2170acc4/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
index a5886d5..d2d7783 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
@@ -933,7 +933,7 @@ public class ActiveMQServerImpl implements ActiveMQServer {
serverSession.close(true);
}
catch (Exception e) {
- e.printStackTrace();
+ ActiveMQServerLogger.LOGGER.errorClosingSession(e);
}
}
}
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2170acc4/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ColocatedActivation.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ColocatedActivation.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ColocatedActivation.java
index b81abb7..be2011f 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ColocatedActivation.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ColocatedActivation.java
@@ -29,6 +29,7 @@ import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.BackupRequ
import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.BackupResponseMessage;
import org.apache.activemq.artemis.core.remoting.server.RemotingService;
import org.apache.activemq.artemis.core.replication.ReplicationManager;
+import org.apache.activemq.artemis.core.server.ActiveMQServerLogger;
import org.apache.activemq.artemis.core.server.cluster.ha.ColocatedHAManager;
import org.apache.activemq.artemis.core.server.cluster.ha.ColocatedPolicy;
import org.apache.activemq.artemis.core.server.cluster.ha.HAManager;
@@ -126,7 +127,7 @@ public class ColocatedActivation extends LiveActivation {
started = colocatedHAManager.activateBackup(backupRequestMessage.getBackupSize(), backupRequestMessage.getJournalDirectory(), backupRequestMessage.getBindingsDirectory(), backupRequestMessage.getLargeMessagesDirectory(), backupRequestMessage.getPagingDirectory(), backupRequestMessage.getNodeID());
}
catch (Exception e) {
- e.printStackTrace();
+ ActiveMQServerLogger.LOGGER.warn(e.getMessage(), e);
}
channel.send(new BackupResponseMessage(started));
}
@@ -222,8 +223,7 @@ public class ColocatedActivation extends LiveActivation {
}
}
catch (Exception e) {
- e.printStackTrace();
- //todo
+ ActiveMQServerLogger.LOGGER.warn(e.getMessage(), e);
}
}
else {
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2170acc4/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/FileLockNodeManager.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/FileLockNodeManager.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/FileLockNodeManager.java
index 1992e81..1ebf82c 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/FileLockNodeManager.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/FileLockNodeManager.java
@@ -187,7 +187,7 @@ public class FileLockNodeManager extends NodeManager {
setLive();
}
catch (Exception e) {
- e.printStackTrace();
+ ActiveMQServerLogger.LOGGER.warn(e.getMessage(), e);
}
}
};
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2170acc4/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/InVMNodeManager.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/InVMNodeManager.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/InVMNodeManager.java
index 48f1627..d735852 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/InVMNodeManager.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/InVMNodeManager.java
@@ -23,6 +23,7 @@ import java.util.concurrent.Semaphore;
import org.apache.activemq.artemis.api.core.ActiveMQIllegalStateException;
import org.apache.activemq.artemis.api.core.SimpleString;
import org.apache.activemq.artemis.core.server.ActivateCallback;
+import org.apache.activemq.artemis.core.server.ActiveMQServerLogger;
import org.apache.activemq.artemis.core.server.NodeManager;
import org.apache.activemq.artemis.utils.UUIDGenerator;
@@ -126,7 +127,7 @@ public final class InVMNodeManager extends NodeManager {
state = LIVE;
}
catch (Exception e) {
- e.printStackTrace();
+ ActiveMQServerLogger.LOGGER.warn(e.getMessage(), e);
}
}
};
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2170acc4/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/RefsOperation.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/RefsOperation.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/RefsOperation.java
index 1f5c74c..b90a30e 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/RefsOperation.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/RefsOperation.java
@@ -142,7 +142,7 @@ public class RefsOperation extends TransactionOperationAbstract {
ackedTX.commit(true);
}
catch (Exception e) {
- e.printStackTrace();
+ ActiveMQServerLogger.LOGGER.warn(e.getMessage(), e);
}
}
}
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2170acc4/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerSessionImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerSessionImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerSessionImpl.java
index 16cf238..50ccb50 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerSessionImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerSessionImpl.java
@@ -874,8 +874,7 @@ public class ServerSessionImpl implements ServerSession, FailureListener {
storageManager.deleteHeuristicCompletion(id);
}
catch (Exception e) {
- e.printStackTrace();
-
+ ActiveMQServerLogger.LOGGER.warn(e.getMessage(), e);
throw new ActiveMQXAException(XAException.XAER_RMFAIL);
}
}
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2170acc4/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/SharedNothingBackupActivation.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/SharedNothingBackupActivation.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/SharedNothingBackupActivation.java
index 4ae63ea..e2adc1f 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/SharedNothingBackupActivation.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/SharedNothingBackupActivation.java
@@ -353,7 +353,6 @@ public final class SharedNothingBackupActivation extends Activation {
// do not log these errors if the server is being stopped.
return;
ActiveMQServerLogger.LOGGER.initializationError(e);
- e.printStackTrace();
}
}
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2170acc4/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/SharedStoreBackupActivation.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/SharedStoreBackupActivation.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/SharedStoreBackupActivation.java
index 18a2105..3822fff 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/SharedStoreBackupActivation.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/SharedStoreBackupActivation.java
@@ -238,8 +238,8 @@ public final class SharedStoreBackupActivation extends Activation {
}
}
catch (Exception e) {
+ ActiveMQServerLogger.LOGGER.warn(e.getMessage(),e);
ActiveMQServerLogger.LOGGER.serverRestartWarning();
- e.printStackTrace();
}
}
});
[2/2] activemq-artemis git commit: This closes #612
Posted by cl...@apache.org.
This closes #612
Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/3f3a1356
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/3f3a1356
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/3f3a1356
Branch: refs/heads/master
Commit: 3f3a13564b5c02f240f9442dcb4c639e4fb8093e
Parents: 57529ac 2170acc
Author: Clebert Suconic <cl...@apache.org>
Authored: Thu Jun 30 13:15:12 2016 -0400
Committer: Clebert Suconic <cl...@apache.org>
Committed: Thu Jun 30 13:15:12 2016 -0400
----------------------------------------------------------------------
.../java/org/apache/activemq/artemis/ra/ActiveMQRALogger.java | 4 ++++
.../activemq/artemis/ra/inflow/ActiveMQActivationSpec.java | 2 +-
.../artemis/core/remoting/impl/invm/InVMAcceptor.java | 7 +++++--
.../artemis/core/remoting/impl/netty/NettyAcceptor.java | 7 +++++--
.../activemq/artemis/core/server/cluster/ClusterManager.java | 4 ++--
.../artemis/core/server/cluster/ha/ColocatedHAManager.java | 3 +--
.../core/server/cluster/impl/ClusterConnectionImpl.java | 4 ++--
.../activemq/artemis/core/server/impl/ActiveMQServerImpl.java | 2 +-
.../artemis/core/server/impl/ColocatedActivation.java | 6 +++---
.../artemis/core/server/impl/FileLockNodeManager.java | 2 +-
.../activemq/artemis/core/server/impl/InVMNodeManager.java | 3 ++-
.../activemq/artemis/core/server/impl/RefsOperation.java | 2 +-
.../activemq/artemis/core/server/impl/ServerSessionImpl.java | 3 +--
.../core/server/impl/SharedNothingBackupActivation.java | 1 -
.../artemis/core/server/impl/SharedStoreBackupActivation.java | 2 +-
15 files changed, 30 insertions(+), 22 deletions(-)
----------------------------------------------------------------------