Bug 817516

Summary: Maven stop working after upgrade to Fedora 17
Product: [Fedora] Fedora Reporter: Pavel Alexeev <pahan>
Component: java-1.7.0-openjdkAssignee: Deepak Bhole <dbhole>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 17CC: akurtako, dbhole, java-sig-commits, jvanek, lopes.carlosmiguel, omajid, patrickm, sochotni
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: java-1.7.0-openjdk-1.7.0.3-2.1.fc17.6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-05-08 04:23:46 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Pavel Alexeev 2012-04-30 11:27:24 UTC
Description of problem:
$ mvn
/usr/lib/jvm/java
---------------------------------------------------
constituent[0]: file:/usr/share/maven/lib/ext/xml-commons-apis.jar
constituent[1]: file:/usr/share/maven/lib/plexus_containers-component-annotations.jar
constituent[2]: file:/usr/share/maven/lib/maven-core.jar
constituent[3]: file:/usr/share/maven/lib/maven-compat.jar
constituent[4]: file:/usr/share/maven/lib/maven-wagon_provider-api.jar
constituent[5]: file:/usr/share/maven/lib/maven-model.jar
constituent[6]: file:/usr/share/maven/lib/aether_connector-wagon.jar
constituent[7]: file:/usr/share/maven/lib/maven-repository-metadata.jar
constituent[8]: file:/usr/share/maven/lib/plexus_utils.jar
constituent[9]: file:/usr/share/maven/lib/sisu_sisu-inject-bean.jar
constituent[10]: file:/usr/share/maven/lib/aether_spi.jar
constituent[11]: file:/usr/share/maven/lib/maven-settings-builder.jar
constituent[12]: file:/usr/share/maven/lib/atinject.jar
constituent[13]: file:/usr/share/maven/lib/nekohtml.jar
constituent[14]: file:/usr/share/maven/lib/maven-artifact.jar
constituent[15]: file:/usr/share/maven/lib/sisu_sisu-inject-plexus.jar
constituent[16]: file:/usr/share/maven/lib/guava.jar
constituent[17]: file:/usr/share/maven/lib/maven-wagon_http-shared.jar
constituent[18]: file:/usr/share/maven/lib/plexus_plexus-cipher.jar
constituent[19]: file:/usr/share/maven/lib/aether_api.jar
constituent[20]: file:/usr/share/maven/lib/maven-aether-provider.jar
constituent[21]: file:/usr/share/maven/lib/xerces-j2.jar
constituent[22]: file:/usr/share/maven/lib/maven-wagon_file.jar
constituent[23]: file:/usr/share/maven/lib/google-guice.jar
constituent[24]: file:/usr/share/maven/lib/maven-settings.jar
constituent[25]: file:/usr/share/maven/lib/maven-wagon_http-lightweight.jar
constituent[26]: file:/usr/share/maven/lib/commons-cli.jar
constituent[27]: file:/usr/share/maven/lib/plexus_plexus-sec-dispatcher.jar
constituent[28]: file:/usr/share/maven/lib/maven-model-builder.jar
constituent[29]: file:/usr/share/maven/lib/maven-plugin-api.jar
constituent[30]: file:/usr/share/maven/lib/maven-embedder.jar
constituent[31]: file:/usr/share/maven/lib/plexus_interpolation.jar
constituent[32]: file:/usr/share/maven/lib/aether_util.jar
constituent[33]: file:/usr/share/maven/lib/aether_impl.jar
constituent[34]: file:/usr/share/maven/lib/xbean_xbean-reflect.jar
---------------------------------------------------
Exception in thread "main" java.lang.UnsupportedClassVersionError: javax/inject/Provider : Unsupported major.minor version 51.0
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:634)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)
        at java.net.URLClassLoader.access$000(URLClassLoader.java:73)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:212)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
        at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClassFromSelf(ClassRealm.java:386)
        at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:42)
        at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:244)
        at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:230)
        at org.apache.maven.cli.MavenCli.container(MavenCli.java:375)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:191)
        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)

Version-Release number of selected component (if applicable):
$ rpm -qf `which mvn`
maven-3.0.4-2.fc17.x86_64

How reproducible:
Always

Comment 1 Andrew Overholt 2012-04-30 13:16:01 UTC
(In reply to comment #0)
> Exception in thread "main" java.lang.UnsupportedClassVersionError:
> javax/inject/Provider : Unsupported major.minor version 51.0

Are you perhaps not running with Java 7?  OpenJDK 7 should be the only OpenJDK installation available in F-17 IIRC.

Comment 2 Pavel Alexeev 2012-05-01 17:51:54 UTC
Yes, you are right it was 6. It was not removed in upgrade process and was still marked as default (via alternatives).

It works under OpenJDK 1.7.

Comment 3 Stanislav Ochotnicky 2012-05-02 08:39:31 UTC
I am reassigning to openjdk component. I believe it is missing "Obsoletes: java-1.6.0-openjdk" in the spec. Without it 1.6.x JDK will not be uninstalled on upgrade to F17 unless I am missing something.

Comment 4 Fedora Update System 2012-05-03 14:10:28 UTC
java-1.7.0-openjdk-1.7.0.3-2.1.fc17.6 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/java-1.7.0-openjdk-1.7.0.3-2.1.fc17.6

Comment 5 Fedora Update System 2012-05-04 03:11:33 UTC
Package java-1.7.0-openjdk-1.7.0.3-2.1.fc17.6:
* should fix your issue,
* was pushed to the Fedora 17 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing java-1.7.0-openjdk-1.7.0.3-2.1.fc17.6'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-7277/java-1.7.0-openjdk-1.7.0.3-2.1.fc17.6
then log in and leave karma (feedback).

Comment 6 Pavel Alexeev 2012-05-07 16:27:30 UTC
It is not what intend to be by my report. But thanks.

Comment 7 Fedora Update System 2012-05-08 04:23:46 UTC
java-1.7.0-openjdk-1.7.0.3-2.1.fc17.6 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 8 Stanislav Ochotnicky 2012-05-09 08:16:57 UTC
Well the "not working" problem was caused by JDK6, which was not originally removed during updates. New JDK7 will obsolete (and thus replace) even JDK6 so your problem should not exist anymore

Comment 9 Carlos Lopes 2012-08-14 09:50:13 UTC
Maven on Fedora 17 should work with JDK's other that 1.7.
Maven 3.0.4 system requirements is JDK 1.5 or greater, so it should work with JDK 1.6.

Comment 10 Alexander Kurtakov 2012-08-14 11:12:04 UTC
(In reply to comment #9)
> Maven on Fedora 17 should work with JDK's other that 1.7.
> Maven 3.0.4 system requirements is JDK 1.5 or greater, so it should work
> with JDK 1.6.

In ideal world you would have been right - in the real world things are not that easy. Many Java developers do not set their bytecode level in the build scripts resulting in our builds using the bytecode of the jvm built with (openjdk 1.7 in our case). Maven on the other side has hundreds of dependencies so it's not possible to set the correct bytecode level for every package (at least not with the current workforce. I'm closing the bug as won't fix and strongly recommend people that want to see things changing to step in provide patches fixing the problems for them. 
As a member of the  Fedora Java SIG I can clearly state that we are dedicated to supporting only the JVM shipped as part of Fedora itself but we would happily apply patches from others that test and run against other JVMs.