Repository: phoenix Updated Branches: refs/heads/4.0 3ed36106b -> 7e6441b8b
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/7e6441b8 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/7e6441b8 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/7e6441b8 Branch: refs/heads/4.0 Commit: 7e6441b8b96f4452ee88a00ac24ec68ebff68765 Parents: 3ed3610 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:00 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/7e6441b8/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; }
