Hi Stian,

Stian Soiland-Reyes wrote:

>> [ERROR] Failed to execute goal on project commons-vfs2: Could not resolve
>> dependencies for project org.apache.commons:commons-vfs2:jar:2.1: Could
>> not find artifact jdk.tools:jdk.tools:jar:1.6 at specified path
>> /opt/oracle-jdk- bin-1.9.0.0_beta116/../lib/tools.jar -> [Help 1]
>> [ERROR]
>> [ERROR] To see the full stack trace of the errors, re-run Maven with the
>> [-e
>> switch.
>> [ERROR] Re-run Maven using the -X switch to enable full debug logging.
>> [ERROR]
>> [ERROR] For more information about the errors and possible solutions,
>> [please
>> read the following articles:
>> [ERROR] [Help 1]
>> 
http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
>> [ERROR]
>> [ERROR] After correcting the problems, you can resume the build with the
>> command
>> [ERROR]   mvn <goals> -rf :commons-vfs2
>> ========================= %< ======================
>>
>> The reason is an invalid (transitive) system dependency on tools.jar of
>> Hadoop which is no longer present in Java 9.
> 
> hadoop-common:test-jar pulls in:
> 
> http://central.maven.org/maven2/org/apache/hadoop/hadoop-annotations/2.6.0/hadoop-annotations-2.6.0.pom
> 
> With two different profiles, the os.linux profile activates for me as
> well, as the activation here is "Not a mac".
> 
> 
> The newer Hadoop 2.7.1 seems to have fixed to these activations.
> 
> http://central.maven.org/maven2/org/apache/hadoop/hadoop-annotations/2.7.1/hadoop-annotations-2.7.1.pom
> 
> (Hadoop 2.7 presumably no longer works on JDK6)
> 
> 
> Could you try changing all the Hadoop 2.6.0 dependencies in pom.xml to
> 2.7.1 and see if JDK9 is happy then?
> 
> (We can always exclude it tools.jar in the test dependency, I don't
> see how it's needed for our tests)

After finally upgrading all four (!) Hadoop versions in the parent (we 
should introduce a property for the Hadoop version), Oracle JDK 8 passes 
again. However, Java 9 fails still with the jar plugin (and an ignored 
ClassCastExceptions in the tests caused by Jetty):

======================== %< =============================
$ mvn -version
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 
2015-11-10T17:41:47+01:00)
Maven home: /usr/share/maven-bin-3.3
Java version: 9-ea, vendor: Oracle Corporation
Java home: /opt/oracle-jdk-bin-1.9.0.0_beta116
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.4.6-gentoo", arch: "amd64", family: "unix"
======================== %< =============================
Tests run: 84, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 30.141 sec 
- in org.apache.commons.vfs2.provider.ftps.test.FtpsProviderExplicitTestCase
Running org.apache.commons.vfs2.provider.webdav.test.WebdavProviderTestCase
2016-05-05 12:37:16,660 [main] ERROR: unavailable
java.lang.ClassCastException: 
jdk.internal.loader.ClassLoaders$AppClassLoader (in module: java.base) 
cannot be cast to java.net.URLClassLoader (in module: java.base)
        at 
org.apache.jasper.compiler.JspRuntimeContext.<init>(JspRuntimeContext.java:174)
        at org.apache.jasper.servlet.JspServlet.init(JspServlet.java:150)
        at 
org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:431)
        at 
org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:263)
        at 
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
        at 
org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:643)
        at org.mortbay.jetty.servlet.Context.startContext(Context.java:140)
        at 
org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1234)
        at 
org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
        at 
org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:460)
        at 
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
        at 
org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
        at 
org.mortbay.jetty.handler.RequestLogHandler.doStart(RequestLogHandler.java:115)
        at 
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
        at 
org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
        at org.mortbay.jetty.Server.doStart(Server.java:222)
        at 
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
        at 
org.apache.commons.vfs2.provider.webdav.test.JackrabbitMain.run(JackrabbitMain.java:264)
        at 
org.apache.commons.vfs2.provider.webdav.test.WebdavProviderTestCase.startJackrabbit(WebdavProviderTestCase.java:270)
        at 
org.apache.commons.vfs2.provider.webdav.test.WebdavProviderTestCase.setUpClass(WebdavProviderTestCase.java:247)
        at 
org.apache.commons.vfs2.provider.webdav.test.WebdavProviderTestCase.access$100(WebdavProviderTestCase.java:55)
        at 
org.apache.commons.vfs2.provider.webdav.test.WebdavProviderTestCase$1.setUp(WebdavProviderTestCase.java:282)
        at 
org.apache.commons.vfs2.test.AbstractTestSuite$1.protect(AbstractTestSuite.java:148)
        at junit.framework.TestResult.runProtected(TestResult.java:142)
        at 
org.apache.commons.vfs2.test.AbstractTestSuite.run(AbstractTestSuite.java:154)
        at 
org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:86)
        at 
org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:367)
        at 
org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:274)
        at 
org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:238)
        at 
org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:161)
        at 
org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:290)
        at 
org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:242)
        at 
org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:121)
VfsClassLoaderTests no layered .jar provider, skipping.
[snip]
[INFO] --- maven-jar-plugin:2.6:jar (default-jar) @ commons-vfs2 ---
[WARNING] Error injecting: org.codehaus.plexus.archiver.jar.JarArchiver
java.lang.ExceptionInInitializerError
        at 
jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(java.base@9-
ea/Native Method)
        at 
jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(java.base@9-
ea/NativeConstructorAccessorImpl.java:62)
        at 
jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(java.base@9-
ea/DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(java.base@9-
ea/Constructor.java:453)
        at 
com.google.inject.internal.DefaultConstructionProxyFactory$1.newInstance(DefaultConstructionProxyFactory.java
[snip]
Caused by: java.lang.ArrayIndexOutOfBoundsException: 1
        at 
org.codehaus.plexus.archiver.zip.AbstractZipArchiver.<clinit>(AbstractZipArchiver.java:116)
        ... 89 more
======================== %< =============================

BTW; I get same results if I keep the Hadoop version and simply exclude 
jdk.tools:jdk.tools from the test-jar artifact of Hadoop. So it seems that 
VFS 2.1 can basically run on Java 9.

Cheers,
Jörg




---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org

Reply via email to