Skip to content
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

Closed
EdColeman opened this issue Feb 26, 2020 · 6 comments
Projects

Comments

@EdColeman
Copy link
Contributor

EdColeman commented Feb 26, 2020

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

org.apache.ant is the standard groupId used by the Apache Ant project. Please start using it instead of the ant groupId.

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

`

@milleruntime
Copy link
Contributor

I see you are using JDK 12... perhaps this is a change from 11 to 12. I haven't tried running 12 yet.

@ctubbsii
Copy link
Member

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.

@milleruntime
Copy link
Contributor

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, gc.metrics.enabled and general.legacy.metrics. The issue was introduced with the backport of GC_METRICS_ENABLED in the commit 0d7d976. There should be a test for this feature as well.

@milleruntime milleruntime reopened this Feb 27, 2020
@milleruntime milleruntime changed the title Build environment - class not found org/apache/tools/ant/taskdefs/Execute - used by commons-configuration Class not found org/apache/tools/ant/taskdefs/Execute - used by commons-configuration Feb 27, 2020
@milleruntime
Copy link
Contributor

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.

@ctubbsii
Copy link
Member

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.

@ctubbsii ctubbsii added this to To do in 1.10.0 via automation Feb 27, 2020
@asfgit asfgit closed this as completed in 3779cf9 Feb 27, 2020
1.10.0 automation moved this from To do to Done Feb 27, 2020
@ctubbsii
Copy link
Member

Fixed in 3779cf9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
1.10.0
  
Done
Development

No branches or pull requests

3 participants