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

Incompatible API error: java.lang.AbstractMethodError: null #15

Closed
rpatrick00 opened this issue Nov 26, 2015 · 9 comments
Closed

Incompatible API error: java.lang.AbstractMethodError: null #15

rpatrick00 opened this issue Nov 26, 2015 · 9 comments
Assignees
Labels
Milestone

Comments

@rpatrick00
Copy link

I am trying to use the flatten-maven-plugin to flatten the POM for a test Web application and getting an incompatible API method. The plugin configuration is inherited from the project's main POM and other parts of the project are working just fine so I am a bit perplexed as to why this would happen on this particular submodule.

[INFO] --- flatten-maven-plugin:1.0.0-beta-5:flatten (flatten) @ get-listen-addr
ess-app ---
[DEBUG] Configuring mojo org.codehaus.mojo:flatten-maven-plugin:1.0.0-beta-5:fla
tten from plugin realm ClassRealm[plugin>org.codehaus.mojo:flatten-maven-plugin:
1.0.0-beta-5, parent: sun.misc.Launcher$AppClassLoader@70dea4e]
[DEBUG] Configuring mojo 'org.codehaus.mojo:flatten-maven-plugin:1.0.0-beta-5:fl
atten' with basic configurator -->
DEBUG embedBuildProfileDependencies = false
DEBUG flattenedPomFilename = .flattened-pom.xml
DEBUG localRepository = id: local
url: file:///C:/Users/RPATRICK/.m2/repository/
layout: default
snapshots: [enabled => true, update => always]
releases: [enabled => true, update => always]

DEBUG mojoExecution = org.codehaus.mojo:flatten-maven-plugin:1.0.0-beta-
5:flatten {execution: flatten}
DEBUG outputDirectory = C:\rpatrick\work\projects\jcs-las\system-test\ap
ps\get-listen-address-app
DEBUG repositories = flatten
DEBUG pomElements = org.codehaus.mojo.flatten.FlattenDescriptor@6f6a7463

DEBUG project = MavenProject: oracle.jcs.lifecycle:get-listen-address-ap
p:0.2-SNAPSHOT @ C:\rpatrick\work\projects\jcs-las\system-test\apps\get-listen-a
ddress-app\pom.xml
[DEBUG] -- end configuration --
[INFO] Generating flattened POM of project oracle.jcs.lifecycle:get-listen-addre
ss-app:war:0.2-SNAPSHOT...
[DEBUG] Resolving dependencies of oracle.jcs.lifecycle:get-listen-address-app:wa
r:0.2-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.601 s
[INFO] Finished at: 2015-11-25T20:49:36-06:00
[INFO] Final Memory: 73M/876M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:flatten-maven-plugin:1.0.0-beta
-5:flatten (flatten) on project get-listen-address-app: Execution flatten of goa
l org.codehaus.mojo:flatten-maven-plugin:1.0.0-beta-5:flatten failed: An API inc
ompatibility was encountered while executing org.codehaus.mojo:flatten-maven-plu
gin:1.0.0-beta-5:flatten: java.lang.AbstractMethodError: null
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>org.codehaus.mojo:flatten-maven-plugin:1.0.0-beta-5
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/C:/Users/RPATRICK/.m2/repository/org/codehaus/mojo/flatt
en-maven-plugin/1.0.0-beta-5/flatten-maven-plugin-1.0.0-beta-5.jar
[ERROR] urls[1] = file:/C:/Users/RPATRICK/.m2/repository/org/codehaus/plexus/ple
xus-interpolation/1.14/plexus-interpolation-1.14.jar
[ERROR] urls[2] = file:/C:/Users/RPATRICK/.m2/repository/org/codehaus/plexus/ple
xus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.jar
[ERROR] urls[3] = file:/C:/Users/RPATRICK/.m2/repository/org/sonatype/aether/aet
her-util/1.7/aether-util-1.7.jar
[ERROR] urls[4] = file:/C:/Users/RPATRICK/.m2/repository/org/sonatype/sisu/sisu-
inject-bean/1.4.2/sisu-inject-bean-1.4.2.jar
[ERROR] urls[5] = file:/C:/Users/RPATRICK/.m2/repository/org/sonatype/sisu/sisu-
guice/2.1.7/sisu-guice-2.1.7-noaop.jar
[ERROR] urls[6] = file:/C:/Users/RPATRICK/.m2/repository/org/sonatype/plexus/ple
xus-sec-dispatcher/1.3/plexus-sec-dispatcher-1.3.jar
[ERROR] urls[7] = file:/C:/Users/RPATRICK/.m2/repository/org/sonatype/plexus/ple
xus-cipher/1.4/plexus-cipher-1.4.jar
[ERROR] urls[8] = file:/C:/Users/RPATRICK/.m2/repository/org/codehaus/plexus/ple
xus-utils/3.0.17/plexus-utils-3.0.17.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import from realm ClassRealm[maven.api, parent: null]]
[ERROR]
[ERROR] -----------------------------------------------------
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal o
rg.codehaus.mojo:flatten-maven-plugin:1.0.0-beta-5:flatten (flatten) on project
get-listen-address-app: Execution flatten of goal org.codehaus.mojo:flatten-mave
n-plugin:1.0.0-beta-5:flatten failed: An API incompatibility was encountered whi
le executing org.codehaus.mojo:flatten-maven-plugin:1.0.0-beta-5:flatten: java.l

ang.AbstractMethodError: null

realm = plugin>org.codehaus.mojo:flatten-maven-plugin:1.0.0-beta-5
strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
urls[0] = file:/C:/Users/RPATRICK/.m2/repository/org/codehaus/mojo/flatten-maven
-plugin/1.0.0-beta-5/flatten-maven-plugin-1.0.0-beta-5.jar
urls[1] = file:/C:/Users/RPATRICK/.m2/repository/org/codehaus/plexus/plexus-inte
rpolation/1.14/plexus-interpolation-1.14.jar
urls[2] = file:/C:/Users/RPATRICK/.m2/repository/org/codehaus/plexus/plexus-comp
onent-annotations/1.5.5/plexus-component-annotations-1.5.5.jar
urls[3] = file:/C:/Users/RPATRICK/.m2/repository/org/sonatype/aether/aether-util
/1.7/aether-util-1.7.jar
urls[4] = file:/C:/Users/RPATRICK/.m2/repository/org/sonatype/sisu/sisu-inject-b
ean/1.4.2/sisu-inject-bean-1.4.2.jar
urls[5] = file:/C:/Users/RPATRICK/.m2/repository/org/sonatype/sisu/sisu-guice/2.
1.7/sisu-guice-2.1.7-noaop.jar
urls[6] = file:/C:/Users/RPATRICK/.m2/repository/org/sonatype/plexus/plexus-sec-
dispatcher/1.3/plexus-sec-dispatcher-1.3.jar
urls[7] = file:/C:/Users/RPATRICK/.m2/repository/org/sonatype/plexus/plexus-ciph
er/1.4/plexus-cipher-1.4.jar
urls[8] = file:/C:/Users/RPATRICK/.m2/repository/org/codehaus/plexus/plexus-util
s/3.0.17/plexus-utils-3.0.17.jar
Number of foreign imports: 1
import: Entry[import from realm ClassRealm[maven.api, parent: null]]


    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor

.java:224)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje
ct(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje
ct(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThre
adedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Lifecycl
eStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:862)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:197)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Laun
cher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav
a:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La
uncher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:
356)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution flatten o
f goal org.codehaus.mojo:flatten-maven-plugin:1.0.0-beta-5:flatten failed: An AP
I incompatibility was encountered while executing org.codehaus.mojo:flatten-mave

n-plugin:1.0.0-beta-5:flatten: java.lang.AbstractMethodError: null

realm = plugin>org.codehaus.mojo:flatten-maven-plugin:1.0.0-beta-5
strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
urls[0] = file:/C:/Users/RPATRICK/.m2/repository/org/codehaus/mojo/flatten-maven
-plugin/1.0.0-beta-5/flatten-maven-plugin-1.0.0-beta-5.jar
urls[1] = file:/C:/Users/RPATRICK/.m2/repository/org/codehaus/plexus/plexus-inte
rpolation/1.14/plexus-interpolation-1.14.jar
urls[2] = file:/C:/Users/RPATRICK/.m2/repository/org/codehaus/plexus/plexus-comp
onent-annotations/1.5.5/plexus-component-annotations-1.5.5.jar
urls[3] = file:/C:/Users/RPATRICK/.m2/repository/org/sonatype/aether/aether-util
/1.7/aether-util-1.7.jar
urls[4] = file:/C:/Users/RPATRICK/.m2/repository/org/sonatype/sisu/sisu-inject-b
ean/1.4.2/sisu-inject-bean-1.4.2.jar
urls[5] = file:/C:/Users/RPATRICK/.m2/repository/org/sonatype/sisu/sisu-guice/2.
1.7/sisu-guice-2.1.7-noaop.jar
urls[6] = file:/C:/Users/RPATRICK/.m2/repository/org/sonatype/plexus/plexus-sec-
dispatcher/1.3/plexus-sec-dispatcher-1.3.jar
urls[7] = file:/C:/Users/RPATRICK/.m2/repository/org/sonatype/plexus/plexus-ciph
er/1.4/plexus-cipher-1.4.jar
urls[8] = file:/C:/Users/RPATRICK/.m2/repository/org/codehaus/plexus/plexus-util
s/3.0.17/plexus-utils-3.0.17.jar
Number of foreign imports: 1
import: Entry[import from realm ClassRealm[maven.api, parent: null]]


    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(Default

BuildPluginManager.java:183)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:208)
... 20 more
Caused by: org.apache.maven.plugin.PluginContainerException: An API incompatibil
ity was encountered while executing org.codehaus.mojo:flatten-maven-plugin:1.0.0

-beta-5:flatten: java.lang.AbstractMethodError: null

realm = plugin>org.codehaus.mojo:flatten-maven-plugin:1.0.0-beta-5
strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
urls[0] = file:/C:/Users/RPATRICK/.m2/repository/org/codehaus/mojo/flatten-maven
-plugin/1.0.0-beta-5/flatten-maven-plugin-1.0.0-beta-5.jar
urls[1] = file:/C:/Users/RPATRICK/.m2/repository/org/codehaus/plexus/plexus-inte
rpolation/1.14/plexus-interpolation-1.14.jar
urls[2] = file:/C:/Users/RPATRICK/.m2/repository/org/codehaus/plexus/plexus-comp
onent-annotations/1.5.5/plexus-component-annotations-1.5.5.jar
urls[3] = file:/C:/Users/RPATRICK/.m2/repository/org/sonatype/aether/aether-util
/1.7/aether-util-1.7.jar
urls[4] = file:/C:/Users/RPATRICK/.m2/repository/org/sonatype/sisu/sisu-inject-b
ean/1.4.2/sisu-inject-bean-1.4.2.jar
urls[5] = file:/C:/Users/RPATRICK/.m2/repository/org/sonatype/sisu/sisu-guice/2.
1.7/sisu-guice-2.1.7-noaop.jar
urls[6] = file:/C:/Users/RPATRICK/.m2/repository/org/sonatype/plexus/plexus-sec-
dispatcher/1.3/plexus-sec-dispatcher-1.3.jar
urls[7] = file:/C:/Users/RPATRICK/.m2/repository/org/sonatype/plexus/plexus-ciph
er/1.4/plexus-cipher-1.4.jar
urls[8] = file:/C:/Users/RPATRICK/.m2/repository/org/codehaus/plexus/plexus-util
s/3.0.17/plexus-utils-3.0.17.jar
Number of foreign imports: 1
import: Entry[import from realm ClassRealm[maven.api, parent: null]]


    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(Default

BuildPluginManager.java:181)
... 21 more
Caused by: java.lang.AbstractMethodError
at org.apache.maven.model.interpolation.ProblemDetectingValueSource.getV
alue(ProblemDetectingValueSource.java:68)
at org.codehaus.plexus.interpolation.StringSearchInterpolator.interpolat
e(StringSearchInterpolator.java:198)
at org.codehaus.plexus.interpolation.StringSearchInterpolator.interpolat
e(StringSearchInterpolator.java:122)
at org.apache.maven.model.interpolation.AbstractStringBasedModelInterpol
ator.interpolateInternal(AbstractStringBasedModelInterpolator.java:227)
at org.apache.maven.model.interpolation.StringSearchModelInterpolator$In
terpolateObjectAction.interpolate(StringSearchModelInterpolator.java:141)
at org.apache.maven.model.interpolation.StringSearchModelInterpolator$In
terpolateObjectAction.access$300(StringSearchModelInterpolator.java:95)
at org.apache.maven.model.interpolation.StringSearchModelInterpolator$In
terpolateObjectAction$StringField.doInterpolate(StringSearchModelInterpolator.ja
va:349)
at org.apache.maven.model.interpolation.StringSearchModelInterpolator$In
terpolateObjectAction$CacheField.interpolate(StringSearchModelInterpolator.java:
301)
at org.apache.maven.model.interpolation.StringSearchModelInterpolator$In
terpolateObjectAction$CacheItem.interpolate(StringSearchModelInterpolator.java:2
74)
at org.apache.maven.model.interpolation.StringSearchModelInterpolator$In
terpolateObjectAction.traverseObjectWithParents(StringSearchModelInterpolator.ja
va:158)
at org.apache.maven.model.interpolation.StringSearchModelInterpolator$In
terpolateObjectAction.run(StringSearchModelInterpolator.java:132)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.maven.model.interpolation.StringSearchModelInterpolator.in
terpolateObject(StringSearchModelInterpolator.java:78)
at org.apache.maven.model.interpolation.StringSearchModelInterpolator.in
terpolateModel(StringSearchModelInterpolator.java:61)
at org.codehaus.mojo.flatten.FlattenMojo.createResolvedPom(FlattenMojo.j
ava:439)
at org.codehaus.mojo.flatten.FlattenMojo.createFlattenedPom(FlattenMojo.
java:417)
at org.codehaus.mojo.flatten.FlattenMojo.execute(FlattenMojo.java:265)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(Default
BuildPluginManager.java:134)
... 21 more
[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginContaine
rException

@hohwille hohwille added the bug label Nov 27, 2015
@hohwille
Copy link
Member

What version of JDK are you using?
What version of maven are you using?
Please prove the output of "mvn -v".

@hohwille
Copy link
Member

This is the most important part:

Caused by: java.lang.AbstractMethodError
at org.apache.maven.model.interpolation.ProblemDetectingValueSource.getValue(ProblemDetectingValueSource.java:68)
at org.codehaus.plexus.interpolation.StringSearchInterpolator.interpolat
e(StringSearchInterpolator.java:198)

So ProblemDetectingValueSource is from maven-model-builder-3.0.jar at compile time.
Line 68 is this:

        return value;

As this line can IMHO not cause an abstract method error I assume that for some reason in your build a different version of the code is used for some reason.

@hohwille
Copy link
Member

It would be awesome if you could find a minimal setup how to reproduce the bug. I am not able to reproduce this at the moment.

@rpatrick00
Copy link
Author

I am using JDK 1.8.0_60.

It appears the problem is triggered by the following configuration element that one of my developers added to the POM.

        <finalName>${artifactId}</finalName>

When I change this to the following, the problem goes away.

        <finalName>${project.artifactId}</finalName>

@rpatrick00
Copy link
Author

Probably not worth fixing this so feel free to close this...

@hohwille
Copy link
Member

Thanks for the feedback. Still strange... Maybe omitting the project. prefix has been dropped in a more revent maven version... I will do some testing and see if I can reproduce and fix or if I close as wontfix.

@hohwille hohwille self-assigned this Nov 28, 2015
@rpatrick00
Copy link
Author

The Maven build does complain at the start about the ${artifact} being deprecated and that it should be replaced with $project.artifactId} but the build does work properly if the flatten plugin is omitted. Like I said, personally I wouldn't waste much time with this since it is clearly not something that Maven wants to support and the workaround is simple and has no negative side-effects.

hohwille added a commit that referenced this issue Dec 1, 2015
@hohwille
Copy link
Member

hohwille commented Dec 1, 2015

I also consider this as low prio but as long as maven supports these legacy properties it would be nice if flatten-maven-plugin would also do it. If this is easy to fix, we should go for it. Otherwise we have an easy workaround and it is always good to tidy up your POMs.

@hohwille
Copy link
Member

hohwille commented Dec 2, 2015

fixed with #19.

@hohwille hohwille closed this as completed Dec 2, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants