New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Class not found org/apache/tools/ant/taskdefs/Execute - used by commons-configuration #1532
Comments
I see you are using JDK 12... perhaps this is a change from 11 to 12. I haven't tried running 12 yet. |
In the 1.9 branch, we have a dependency on commons-configuration 1.6. That dependency's pom.xml declares an optional dependency on an older version of ant: <dependency>
<groupId>ant</groupId>
<artifactId>ant</artifactId>
<version>1.6.5</version>
<optional>true</optional>
</dependency> It appears that your IDE is trying to include that dependency, but it is unavailable on your IDE's class path. I do not know enough about IntelliJ to know why it's even trying to include this dependency at all, but it is most certainly a problem specific to your environment, and not necessarily one for Accumulo. |
This isn't a build environment issue. I was able to reproduce this error on the command line running the GcMetricsIT and enabling the two properties, |
If this a conflict with the legacy metrics and the GC metrics, we may have to drop the support for legacy metrics if it is polluting the classpath with really old commons-configuration. |
I see. Since we've already dropped support for the legacy metrics in 2.x and upgraded to commons-configuration2, it kind of feels like this backport might be more trouble than it's worth... causing us to revisit already solved issues. If backporting these GC metrics to 1.x is going to cause significant problems that can't easily be worked around, I'm inclined to just revert those changes in 1.x and make people wait until they upgrade to get the new GC metrics if they need them. If it's an easy fix, though... without breaking the legacy metrics in 1.x, that's preferred, of course (best of both worlds, and all that). Is it possible to just throw ant on the class path ourselves (as optional) to fix the problem? And, if that works, we can just tell people they might need ant on their class path to get the feature in 1.x. |
Fixed in 3779cf9 |
This is likely something in my environment / tooling but wanted to document what I am seeing in case this is a more general issue with dependencies / java runtime version.
Environment:
Accumulo: current 1.9 branch (1.9.3+)
java: openjdk full version "12.0.1+12"
IntelliJ: IntelliJ IDEA 2019.3.3 Build #IU-193.6494.35, built on February 10, 2020
macOS 10.15.3
Trying to run IT tests with legacy metrics enabled causes the master to die with the stack trace below.
This happens with the commons-configuration in the pom left at 1.6. Changing the version to 1.10, the tests can be launched / run with the IntelliJ IDE without issue.
The release notes for commons-configuration 1.7 references https://issues.apache.org/jira/browse/CONFIGURATION-436 to change the group id for Apache Ant
Full stack track from the mini Master log:
`
java.lang.NoClassDefFoundError: org/apache/tools/ant/taskdefs/Execute
at org.apache.commons.configuration.EnvironmentConfiguration.extractProperties14(EnvironmentConfiguration.java:160)
at org.apache.commons.configuration.EnvironmentConfiguration.(EnvironmentConfiguration.java:77)
at org.apache.accumulo.server.metrics.MetricsConfiguration.getEnvironmentConfiguration(MetricsConfiguration.java:114)
at org.apache.accumulo.server.metrics.MetricsConfiguration.loadConfiguration(MetricsConfiguration.java:155)
at org.apache.accumulo.server.metrics.MetricsConfiguration.getMetricsConfiguration(MetricsConfiguration.java:145)
at org.apache.accumulo.server.metrics.MetricsConfiguration.(MetricsConfiguration.java:108)
at org.apache.accumulo.server.metrics.AbstractMetricsImpl.(AbstractMetricsImpl.java:118)
at org.apache.accumulo.server.metrics.ThriftMetrics.(ThriftMetrics.java:30)
at org.apache.accumulo.server.metrics.MetricsFactory.createThriftMetrics(MetricsFactory.java:46)
at org.apache.accumulo.server.rpc.TimedProcessor.(TimedProcessor.java:47)
at org.apache.accumulo.server.rpc.TimedProcessor.(TimedProcessor.java:41)
at org.apache.accumulo.server.rpc.TServerUtils.startServer(TServerUtils.java:152)
at org.apache.accumulo.master.Master.run(Master.java:1382)
at org.apache.accumulo.master.Master.main(Master.java:1664)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:567)
at org.apache.accumulo.start.Main$2.run(Main.java:170)
at java.base/java.lang.Thread.run(Thread.java:835)
Caused by: java.lang.ClassNotFoundException: org.apache.tools.ant.taskdefs.Execute
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
... 20 more
`
The text was updated successfully, but these errors were encountered: