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

mvn compile ends up in mapping error #31

Closed
skinkie opened this issue Jul 13, 2013 · 9 comments
Closed

mvn compile ends up in mapping error #31

skinkie opened this issue Jul 13, 2013 · 9 comments

Comments

@skinkie
Copy link

skinkie commented Jul 13, 2013

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project onebusaway-gtfs: Compilation failure
[ERROR] /home/skinkie/dev/onebusaway-gtfs-modules/onebusaway-gtfs/src/main/java/org/onebusaway/gtfs/impl/GtfsRelationalDaoImpl.java:[325,31] incompatible types; no instance(s) of type variable(s) C exist so that java.util.Map<K,C> conforms to java.util.Map<K,java.util.List>
[ERROR] found : java.util.Map<K,C>
[ERROR] required: java.util.Map<K,java.util.List>
[ERROR] -> [Help 1]

@skinkie
Copy link
Author

skinkie commented Jul 13, 2013

org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project onebusaway-gtfs: Compilation failure
/home/skinkie/dev/onebusaway-gtfs-modules/onebusaway-gtfs/src/main/java/org/onebusaway/gtfs/impl/GtfsRelationalDaoImpl.java:[325,31] incompatible types; no instance(s) of type variable(s) C exist so that java.util.Map<K,C> conforms to java.util.Map<K,java.util.List>
found : java.util.Map<K,C>
required: java.util.Map<K,java.util.List>

    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
    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.buildProject(LifecycleModuleBuilder.java:84)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:616)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)

Caused by: org.apache.maven.plugin.CompilationFailureException: Compilation failure
/home/skinkie/dev/onebusaway-gtfs-modules/onebusaway-gtfs/src/main/java/org/onebusaway/gtfs/impl/GtfsRelationalDaoImpl.java:[325,31] incompatible types; no instance(s) of type variable(s) C exist so that java.util.Map<K,C> conforms to java.util.Map<K,java.util.List>
found : java.util.Map<K,C>
required: java.util.Map<K,java.util.List>

    at org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:656)
    at org.apache.maven.plugin.CompilerMojo.execute(CompilerMojo.java:128)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
    ... 19 more

@bdferris
Copy link
Member

Are you still seeing this error? What OS + JDK + version of Maven are you using?

@skinkie
Copy link
Author

skinkie commented Jul 14, 2013

I am:
java version "1.6.0_24"
OpenJDK Runtime Environment (IcedTea6 1.11.4) (Gentoo build 1.6.0_24-b24)
OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)

Apache Maven 3.0.4 (r1232337; 2012-01-17 09:44:56+0100)
Maven home: /usr/share/maven-bin-3.0
Java version: 1.6.0_24, vendor: Sun Microsystems Inc.
Java home: /opt/icedtea-bin-6.1.11.4/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.4.9-gentoo", arch: "amd64", family: "unix"

@bdferris
Copy link
Member

Based on some Googling on the subject, it sounds like it might be a type-inference bug in OpenJDK6?

https://bugs.openjdk.java.net/show_bug.cgi?id=100167

I'm guessing it won't be fixed since Java 6 is EOL. Any chance you'd consider upgrading to OpenJDK7 (where this has apparently been fixed)?

If we can find some Java generics magic to get this compiling for you under OpenJDK6, I'm not opposed to changing the OBA code. That said, I don't really have a machine I can test this on. If you can play with it, I'd definitely accept a patch.

@skinkie
Copy link
Author

skinkie commented Jul 14, 2013

If it is a Java 6 bug, I'll just close this ticket.

@skinkie skinkie closed this as completed Jul 14, 2013
@duliu1990
Copy link

i have the same question , can you help me how to solve it?
Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.

@bdferris
Copy link
Member

bdferris commented Apr 1, 2014

duliu1990, Are you running Java 6?

@duliu1990
Copy link

yes java jdk version 1.6.20

------------------ 原始邮件 ------------------
发件人: "Brian Ferris";notifications@github.com;
发送时间: 2014年4月1日(星期二) 晚上10:41
收件人: "OneBusAway/onebusaway-gtfs-modules"onebusaway-gtfs-modules@noreply.github.com;
抄送: "飘落的树叶"492062702@qq.com;
主题: Re: [onebusaway-gtfs-modules] mvn compile ends up in mapping error(#31)

duliu1990, Are you running Java 6?


Reply to this email directly or view it on GitHub.

@bdferris
Copy link
Member

bdferris commented Apr 1, 2014

Since this was a bug in the JDK, your best bet is to upgrade to the latest 1.6 (since you are many versions behind at this point) or, even better, upgrade to 1.7 (since 1.6 is end-of-lifed anyway).

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

No branches or pull requests

3 participants