Repository: phoenix Updated Branches: refs/heads/master 03a5d7ef1 -> 3f48938d5
PHOENIX-1613 Allow old commons-collections version Handle an IllegalAccessError while initializing tracing, in order to allow Phoenix to be used (without tracing) together with SquirrelSQL. The IllegalAccessError occurs because SquirrelSQL uses an old (2.x) version of commons-collections, while tracing depends on a 3.x version. Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/3f48938d Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/3f48938d Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/3f48938d Branch: refs/heads/master Commit: 3f48938d5d5a67d59129eb90295894cc76e58508 Parents: 03a5d7e Author: Gabriel Reid <[email protected]> Authored: Sun Feb 1 07:10:24 2015 +0100 Committer: Gabriel Reid <[email protected]> Committed: Sun Feb 1 07:55:12 2015 +0100 ---------------------------------------------------------------------- .../src/main/java/org/apache/phoenix/trace/util/Tracing.java | 6 ++++++ 1 file changed, 6 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/phoenix/blob/3f48938d/phoenix-core/src/main/java/org/apache/phoenix/trace/util/Tracing.java ---------------------------------------------------------------------- diff --git a/phoenix-core/src/main/java/org/apache/phoenix/trace/util/Tracing.java b/phoenix-core/src/main/java/org/apache/phoenix/trace/util/Tracing.java index 7e1df72..a46d4e8 100644 --- a/phoenix-core/src/main/java/org/apache/phoenix/trace/util/Tracing.java +++ b/phoenix-core/src/main/java/org/apache/phoenix/trace/util/Tracing.java @@ -254,6 +254,12 @@ public class Tracing { } catch (RuntimeException e) { LOG.warn("Tracing will outputs will not be written to any metrics sink! No " + "TraceMetricsSink found on the classpath", e); + } catch (IllegalAccessError e) { + // This is an issue when we have a class incompatibility error, such as when running + // within SquirrelSQL which uses an older incompatible version of commons-collections. + // Seeing as this only results in disabling tracing, we swallow this exception and just + // continue on without tracing. + LOG.warn("Class incompatibility while initializing metrics, metrics will be disabled", e); } initialized = true; }
