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

Can't build v3.7.1 with jdk16-headless and maven 3.6.3 #201

Closed
rogerta opened this issue Jul 3, 2021 · 7 comments
Closed

Can't build v3.7.1 with jdk16-headless and maven 3.6.3 #201

rogerta opened this issue Jul 3, 2021 · 7 comments

Comments

@rogerta
Copy link

rogerta commented Jul 3, 2021

Describe the bug
I am trying to build following the instructions at https://nroduit.github.io/en/getting-started/building-weasis/

However at the mvn clean install step I get an error:

$ mvn clean install
[ERROR] Error executing Maven.
[ERROR] java.lang.IllegalStateException: Unable to load cache item
[ERROR] Caused by: Unable to load cache item
[ERROR] Caused by: Could not initialize class com.google.inject.internal.cglib.core.$MethodWrapper

I seem to have the correct dependencies installed:

$ mvn --version
Apache Maven 3.6.3
Maven home: /usr/share/maven
Java version: 16.0.1, vendor: Private Build, runtime: /usr/lib/jvm/java-16-openjdk-amd64
Default locale: en_CA, platform encoding: UTF-8
OS name: "linux", version: "5.8.0-59-generic", arch: "amd64", family: "unix"

To Reproduce
Steps to reproduce the behavior:

  1. git clone https://github.com/nroduit/Weasis.git
  2. cd Weasis
  3. git checkout v3.7.1
  4. mvn clean install

Expected behavior
A successful build.

Desktop (please complete the following information):

  • OS: Linux
  • Java Rutime: openjdk 16.0.1 2021-04-20
  • Weasis Version: 3.7.1

Additional context
No firewall, no network issues, no anti-virus.
I did install a headless version of the JDK.

Traces

$ mvn -X install clean
Apache Maven 3.6.3
Maven home: /usr/share/maven
Java version: 16.0.1, vendor: Private Build, runtime: /usr/lib/jvm/java-16-openjdk-amd64
Default locale: en_CA, platform encoding: UTF-8
OS name: "linux", version: "5.8.0-59-generic", arch: "amd64", family: "unix"
[ERROR] Error executing Maven.
com.google.common.util.concurrent.UncheckedExecutionException: java.lang.IllegalStateException: Unable to load cache item
    at com.google.common.cache.LocalCache$Segment.get (LocalCache.java:2051)
    at com.google.common.cache.LocalCache.get (LocalCache.java:3951)
    at com.google.common.cache.LocalCache.getOrLoad (LocalCache.java:3974)
    at com.google.common.cache.LocalCache$LocalLoadingCache.get (LocalCache.java:4958)
    at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked (LocalCache.java:4964)
    at com.google.inject.internal.FailableCache.get (FailableCache.java:54)
    at com.google.inject.internal.ConstructorInjectorStore.get (ConstructorInjectorStore.java:49)
    at com.google.inject.internal.ConstructorBindingImpl.initialize (ConstructorBindingImpl.java:155)
    at com.google.inject.internal.InjectorImpl.initializeBinding (InjectorImpl.java:592)
    at com.google.inject.internal.AbstractBindingProcessor$Processor.initializeBinding (AbstractBindingProcessor.java:173)
    at com.google.inject.internal.AbstractBindingProcessor$Processor.lambda$scheduleInitialization$0 (AbstractBindingProcessor.java:160)
    at com.google.inject.internal.ProcessedBindingData.initializeBindings (ProcessedBindingData.java:49)
    at com.google.inject.internal.InternalInjectorCreator.initializeStatically (InternalInjectorCreator.java:124)
    at com.google.inject.internal.InternalInjectorCreator.build (InternalInjectorCreator.java:108)
    at com.google.inject.Guice.createInjector (Guice.java:87)
    at com.google.inject.Guice.createInjector (Guice.java:69)
    at com.google.inject.Guice.createInjector (Guice.java:59)
    at org.codehaus.plexus.DefaultPlexusContainer.addPlexusInjector (DefaultPlexusContainer.java:481)
    at org.codehaus.plexus.DefaultPlexusContainer.<init> (DefaultPlexusContainer.java:206)
    at org.apache.maven.cli.MavenCli.container (MavenCli.java:636)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:282)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:78)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:567)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: java.lang.IllegalStateException: Unable to load cache item
    at com.google.inject.internal.cglib.core.internal.$LoadingCache.createEntry (LoadingCache.java:79)
    at com.google.inject.internal.cglib.core.internal.$LoadingCache.get (LoadingCache.java:34)
    at com.google.inject.internal.cglib.core.$AbstractClassGenerator$ClassLoaderData.get (AbstractClassGenerator.java:119)
    at com.google.inject.internal.cglib.core.$AbstractClassGenerator.create (AbstractClassGenerator.java:294)
    at com.google.inject.internal.cglib.reflect.$FastClass$Generator.create (FastClass.java:65)
    at com.google.inject.internal.BytecodeGen.newFastClassForMember (BytecodeGen.java:258)
    at com.google.inject.internal.BytecodeGen.newFastClassForMember (BytecodeGen.java:207)
    at com.google.inject.internal.DefaultConstructionProxyFactory.create (DefaultConstructionProxyFactory.java:49)
    at com.google.inject.internal.ProxyFactory.create (ProxyFactory.java:156)
    at com.google.inject.internal.ConstructorInjectorStore.createConstructor (ConstructorInjectorStore.java:94)
    at com.google.inject.internal.ConstructorInjectorStore.access$000 (ConstructorInjectorStore.java:30)
    at com.google.inject.internal.ConstructorInjectorStore$1.create (ConstructorInjectorStore.java:38)
    at com.google.inject.internal.ConstructorInjectorStore$1.create (ConstructorInjectorStore.java:34)
    at com.google.inject.internal.FailableCache$1.load (FailableCache.java:43)
    at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture (LocalCache.java:3529)
    at com.google.common.cache.LocalCache$Segment.loadSync (LocalCache.java:2278)
    at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad (LocalCache.java:2155)
    at com.google.common.cache.LocalCache$Segment.get (LocalCache.java:2045)
    at com.google.common.cache.LocalCache.get (LocalCache.java:3951)
    at com.google.common.cache.LocalCache.getOrLoad (LocalCache.java:3974)
    at com.google.common.cache.LocalCache$LocalLoadingCache.get (LocalCache.java:4958)
    at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked (LocalCache.java:4964)
    at com.google.inject.internal.FailableCache.get (FailableCache.java:54)
    at com.google.inject.internal.ConstructorInjectorStore.get (ConstructorInjectorStore.java:49)
    at com.google.inject.internal.ConstructorBindingImpl.initialize (ConstructorBindingImpl.java:155)
    at com.google.inject.internal.InjectorImpl.initializeBinding (InjectorImpl.java:592)
    at com.google.inject.internal.AbstractBindingProcessor$Processor.initializeBinding (AbstractBindingProcessor.java:173)
    at com.google.inject.internal.AbstractBindingProcessor$Processor.lambda$scheduleInitialization$0 (AbstractBindingProcessor.java:160)
    at com.google.inject.internal.ProcessedBindingData.initializeBindings (ProcessedBindingData.java:49)
    at com.google.inject.internal.InternalInjectorCreator.initializeStatically (InternalInjectorCreator.java:124)
    at com.google.inject.internal.InternalInjectorCreator.build (InternalInjectorCreator.java:108)
    at com.google.inject.Guice.createInjector (Guice.java:87)
    at com.google.inject.Guice.createInjector (Guice.java:69)
    at com.google.inject.Guice.createInjector (Guice.java:59)
    at org.codehaus.plexus.DefaultPlexusContainer.addPlexusInjector (DefaultPlexusContainer.java:481)
    at org.codehaus.plexus.DefaultPlexusContainer.<init> (DefaultPlexusContainer.java:206)
    at org.apache.maven.cli.MavenCli.container (MavenCli.java:636)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:282)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:78)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:567)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.google.inject.internal.cglib.core.$MethodWrapper
    at com.google.inject.internal.cglib.core.$DuplicatesPredicate.evaluate (DuplicatesPredicate.java:104)
    at com.google.inject.internal.cglib.core.$CollectionUtils.filter (CollectionUtils.java:52)
    at com.google.inject.internal.cglib.reflect.$FastClassEmitter.<init> (FastClassEmitter.java:69)
    at com.google.inject.internal.cglib.reflect.$FastClass$Generator.generateClass (FastClass.java:77)
    at com.google.inject.internal.cglib.core.$DefaultGeneratorStrategy.generate (DefaultGeneratorStrategy.java:25)
    at com.google.inject.internal.cglib.core.$AbstractClassGenerator.generate (AbstractClassGenerator.java:332)
    at com.google.inject.internal.cglib.core.$AbstractClassGenerator$ClassLoaderData$3.apply (AbstractClassGenerator.java:96)
    at com.google.inject.internal.cglib.core.$AbstractClassGenerator$ClassLoaderData$3.apply (AbstractClassGenerator.java:94)
    at com.google.inject.internal.cglib.core.internal.$LoadingCache$2.call (LoadingCache.java:54)
    at java.util.concurrent.FutureTask.run (FutureTask.java:264)
    at com.google.inject.internal.cglib.core.internal.$LoadingCache.createEntry (LoadingCache.java:61)
    at com.google.inject.internal.cglib.core.internal.$LoadingCache.get (LoadingCache.java:34)
    at com.google.inject.internal.cglib.core.$AbstractClassGenerator$ClassLoaderData.get (AbstractClassGenerator.java:119)
    at com.google.inject.internal.cglib.core.$AbstractClassGenerator.create (AbstractClassGenerator.java:294)
    at com.google.inject.internal.cglib.reflect.$FastClass$Generator.create (FastClass.java:65)
    at com.google.inject.internal.BytecodeGen.newFastClassForMember (BytecodeGen.java:258)
    at com.google.inject.internal.BytecodeGen.newFastClassForMember (BytecodeGen.java:207)
    at com.google.inject.internal.DefaultConstructionProxyFactory.create (DefaultConstructionProxyFactory.java:49)
    at com.google.inject.internal.ProxyFactory.create (ProxyFactory.java:156)
    at com.google.inject.internal.ConstructorInjectorStore.createConstructor (ConstructorInjectorStore.java:94)
    at com.google.inject.internal.ConstructorInjectorStore.access$000 (ConstructorInjectorStore.java:30)
    at com.google.inject.internal.ConstructorInjectorStore$1.create (ConstructorInjectorStore.java:38)
    at com.google.inject.internal.ConstructorInjectorStore$1.create (ConstructorInjectorStore.java:34)
    at com.google.inject.internal.FailableCache$1.load (FailableCache.java:43)
    at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture (LocalCache.java:3529)
    at com.google.common.cache.LocalCache$Segment.loadSync (LocalCache.java:2278)
    at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad (LocalCache.java:2155)
    at com.google.common.cache.LocalCache$Segment.get (LocalCache.java:2045)
    at com.google.common.cache.LocalCache.get (LocalCache.java:3951)
    at com.google.common.cache.LocalCache.getOrLoad (LocalCache.java:3974)
    at com.google.common.cache.LocalCache$LocalLoadingCache.get (LocalCache.java:4958)
    at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked (LocalCache.java:4964)
    at com.google.inject.internal.FailableCache.get (FailableCache.java:54)
    at com.google.inject.internal.ConstructorInjectorStore.get (ConstructorInjectorStore.java:49)
    at com.google.inject.internal.ConstructorBindingImpl.initialize (ConstructorBindingImpl.java:155)
    at com.google.inject.internal.InjectorImpl.initializeBinding (InjectorImpl.java:592)
    at com.google.inject.internal.AbstractBindingProcessor$Processor.initializeBinding (AbstractBindingProcessor.java:173)
    at com.google.inject.internal.AbstractBindingProcessor$Processor.lambda$scheduleInitialization$0 (AbstractBindingProcessor.java:160)
    at com.google.inject.internal.ProcessedBindingData.initializeBindings (ProcessedBindingData.java:49)
    at com.google.inject.internal.InternalInjectorCreator.initializeStatically (InternalInjectorCreator.java:124)
    at com.google.inject.internal.InternalInjectorCreator.build (InternalInjectorCreator.java:108)
    at com.google.inject.Guice.createInjector (Guice.java:87)
    at com.google.inject.Guice.createInjector (Guice.java:69)
    at com.google.inject.Guice.createInjector (Guice.java:59)
    at org.codehaus.plexus.DefaultPlexusContainer.addPlexusInjector (DefaultPlexusContainer.java:481)
    at org.codehaus.plexus.DefaultPlexusContainer.<init> (DefaultPlexusContainer.java:206)
    at org.apache.maven.cli.MavenCli.container (MavenCli.java:636)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:282)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:78)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:567)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
@nroduit
Copy link
Owner

nroduit commented Jul 3, 2021

This is Maven bug, see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=980467

@rogerta
Copy link
Author

rogerta commented Jul 4, 2021

Thanks Nicolas! It seems my OS package manager is still serving 3.6.3 while the bug you link says that as of 19 Jan 2021 this is fixed in 3.6.3-2. I can download Maven directly from https://maven.apache.org/download.cgi (3.8.1 as of today) and give it a try, but I always dislike installing s/w from outside the package manager.

I think there is still a bug on https://nroduit.github.io/en/getting-started/building-weasis/ that is worth fixing. That page says the requirements are:

  1. JDK 11 or higher
  2. Maven 3.5.3 or higher

which is not accurate. I think it needs to say something along the lines of:

  1. JDK 11-15 and Maven 3.5.3 or higher
  2. JDK 16 and Maven 3.6.3-2 or higher

(Assuming it's the combination of JDK16 and Maven 3.6.3 that is broken, but you likely know better that I do what exactly is broken)

@rogerta
Copy link
Author

rogerta commented Jul 4, 2021

FYI, I uninstalled JDK16 and installed JDK15 from the OS package manager and that seemed to fix the problem. So JDK15 + Maven 3.6.3 seems to work.

@nroduit
Copy link
Owner

nroduit commented Jul 4, 2021

It is also possible to update Maven to use JDK-16.

@githubMichaelYang
Copy link

It is also possible to update Maven to use JDK-16.

resolved my issue in WSL2, thanks!

@bruce2233
Copy link

never use jdk17 and maven at the same time, downgrade to jdk11, problem will be solved

@dlee6210
Copy link

#1. cd /home/ubuntu2004/programs/
#2. wget https://dlcdn.apache.org/maven/maven-3/3.8.5/binaries/apache-maven-3.8.5-bin.tar.gz
#3. tar -zxvf apache-maven-3.8.5-bin.tar.gz
#4. gedit ~/.bashrc, add:
export MAVEN_HOME="/home/ubuntu2004/programs/apache-maven-3.8.5/bin"
export PATH="$PATH:$MAVEN_HOME"
#5. mvn -v

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

No branches or pull requests

5 participants