jclouds-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mathieu Tortuyaux (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (JCLOUDS-1402) openjdk9 - An illegal reflective access operation has occurred
Date Thu, 05 Apr 2018 16:14:00 GMT

    [ https://issues.apache.org/jira/browse/JCLOUDS-1402?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16427177#comment-16427177
] 

Mathieu Tortuyaux commented on JCLOUDS-1402:
--------------------------------------------

Thanks for your quick update. I didn't know that jclouds doesn't officially support java 9
:) 

I'm not able to run unit tests with Guice 4.2. I could take a look deeper to see if we have
to perform or not a mass refactoring. 

We have this kind of error: 

{noformat}
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.17:test
(default-test) on project jclouds-core: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.17:test
failed: There was an error in the forked process
org.testng.TestNGException: 
Cannot instantiate class org.jclouds.http.handlers.RedirectionRetryHandlerTest
	at org.testng.internal.ObjectFactoryImpl.newInstance(ObjectFactoryImpl.java:38)
	at org.testng.internal.ClassHelper.createInstance1(ClassHelper.java:380)
	at org.testng.internal.ClassHelper.createInstance(ClassHelper.java:293)
	at org.testng.internal.ClassImpl.getDefaultInstance(ClassImpl.java:115)
	at org.testng.internal.ClassImpl.getInstances(ClassImpl.java:200)
	at org.testng.internal.TestNGClassFinder.<init>(TestNGClassFinder.java:120)
	at org.testng.TestRunner.initMethods(TestRunner.java:409)
	at org.testng.TestRunner.init(TestRunner.java:235)
	at org.testng.TestRunner.init(TestRunner.java:205)
	at org.testng.TestRunner.<init>(TestRunner.java:153)
	at org.testng.SuiteRunner$DefaultTestRunnerFactory.newTestRunner(SuiteRunner.java:536)
	at org.testng.SuiteRunner.init(SuiteRunner.java:159)
	at org.testng.SuiteRunner.<init>(SuiteRunner.java:113)
	at org.testng.TestNG.createSuiteRunner(TestNG.java:1299)
	at org.testng.TestNG.createSuiteRunners(TestNG.java:1286)
	at org.testng.TestNG.runSuitesLocally(TestNG.java:1140)
	at org.testng.TestNG.run(TestNG.java:1057)
	at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:115)
	at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.executeMulti(TestNGDirectoryTestSuite.java:204)
	at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(TestNGDirectoryTestSuite.java:107)
	at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:112)
	at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:200)
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
Caused by: java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at org.testng.internal.ObjectFactoryImpl.newInstance(ObjectFactoryImpl.java:29)
	... 23 more
Caused by: java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkArgument(ZLjava/lang/String;Ljava/lang/Object;)V
	at com.google.inject.Key.ensureRetainedAtRuntime(Key.java:341)
	at com.google.inject.Key.strategyFor(Key.java:317)
	at com.google.inject.Key.get(Key.java:255)
	at com.google.inject.internal.AbstractBindingBuilder.annotatedWithInternal(AbstractBindingBuilder.java:84)
	at com.google.inject.internal.BindingBuilder.annotatedWith(BindingBuilder.java:57)
	at com.google.inject.internal.BindingBuilder.annotatedWith(BindingBuilder.java:42)
	at org.jclouds.rest.internal.BaseRestApiTest$MockModule.configure(BaseRestApiTest.java:80)
	at com.google.inject.AbstractModule.configure(AbstractModule.java:61)
	at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:344)
	at com.google.inject.spi.Elements.getElements(Elements.java:103)
	at com.google.inject.internal.InjectorShell$Builder.build(InjectorShell.java:137)
	at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:103)
	at com.google.inject.Guice.createInjector(Guice.java:87)
	at org.jclouds.ContextBuilder.buildInjector(ContextBuilder.java:405)
	at org.jclouds.ContextBuilder.buildInjector(ContextBuilder.java:328)
	at org.jclouds.http.handlers.RedirectionRetryHandlerTest.<init>(RedirectionRetryHandlerTest.java:45)
	... 28 more
{noformat}

I was not able to build jclouds with java 9 but now, I know why. 

Thanks !

> openjdk9 - An illegal reflective access operation has occurred
> --------------------------------------------------------------
>
>                 Key: JCLOUDS-1402
>                 URL: https://issues.apache.org/jira/browse/JCLOUDS-1402
>             Project: jclouds
>          Issue Type: Bug
>          Components: jclouds-core
>    Affects Versions: 2.1.0
>         Environment: $ uname -r
> 4.15.14-1-ARCH
> $ archlinux-java status
> Available Java environments:
>   java-9-openjdk (default)
>            Reporter: Mathieu Tortuyaux
>            Priority: Major
>
> Hi ! 
> While trying to run [this example|https://github.com/jclouds/jclouds-examples/blob/master/google-lb/src/main/java/org/jclouds/examples/google/lb/MainApp.java],
I got the following warning: 
> {noformat}
> WARNING: An illegal reflective access operation has occurred
> WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$2
(file:/home/mathieu/Desktop/lab/jclouds-optel/test/target/cloud-scheduler-1.0-SNAPSHOT-shaded.jar)
to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
> WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$2
> WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access
operations
> WARNING: All illegal access operations will be denied in a future release
> {noformat}
> After a few searches, I found that this is a known issue caused by Google/Guice and one
one his dependency: cglib. It has been fixed in Google/Guice release 4.2. But jclouds-core
is using Google/Guice release 3.0
> {noformat}
> $ mvn dependency:tree | grep guice -B 2
> [INFO] |  |  \- org.apache.jclouds:jclouds-core:jar:2.1.0:compile
> [INFO] |  |     +- javax.ws.rs:javax.ws.rs-api:jar:2.0.1:compile
> [INFO] |  |     +- com.google.inject.extensions:guice-assistedinject:jar:3.0:compile
> [INFO] |  |     +- com.google.inject:guice:jar:3.0:compile
> {noformat}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message