You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bu...@apache.org on 2016/07/15 06:03:18 UTC

[Bug 59860] New: org.apache.tools.ant.taskdefs.RmicAdvancedTest failed with JDK 9 changes for modularization

https://bz.apache.org/bugzilla/show_bug.cgi?id=59860

            Bug ID: 59860
           Summary: org.apache.tools.ant.taskdefs.RmicAdvancedTest failed
                    with JDK 9 changes for modularization
           Product: Ant
           Version: 1.9.7
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Core tasks
          Assignee: notifications@ant.apache.org
          Reporter: felix.yang@oracle.com

org.apache.tools.ant.taskdefs.rmic.SunRmic.java tries to instance
sun.rmi.rmic.Main. But because of JDK 9 changes for modularization (project
Jigsaw), sun.rmi.rmic.Main is not visible by default. It has been refactored
into a system module named jdk.rmic and package sun.rmi.rmic is not exported.

See
http://hg.openjdk.java.net/jdk9/dev/jdk/file/4729dcda8ea8/src/jdk.rmic/share/classes/module-info.java

So tests in RmicAdvancedTest will fail with ClassNotFoundException. This can be
workaround by specify following arguments to java
"-addmods jdk.rmic -XaddExports:jdk.rmic/sun.rmi.rmic=ALL-UNNAMED"
or 
"-addmods ALL-SYSTEM -XaddExports:jdk.rmic/sun.rmi.rmic=ALL-UNNAMED"

These Jigsaw changes are not finalized. The workaround above can be changed
later.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 59860] org.apache.tools.ant.taskdefs.RmicAdvancedTest failed with JDK 9 changes for modularization

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=59860

--- Comment #4 from Felix Yang <fe...@oracle.com> ---
For the issue of "rmic -Xnew", please refer to following two bugs:
1. https://bugs.openjdk.java.net/browse/JDK-8129341
It commented "The -Xnew option was never documented and was never supported.
Any dependencies on -Xnew should be removed. Closing this as Not an Issue."

2. Remove rmic -Xnew, https://bugs.openjdk.java.net/browse/JDK-8146299

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 59860] org.apache.tools.ant.taskdefs.RmicAdvancedTest failed with JDK 9 changes for modularization

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=59860

--- Comment #2 from Stefan Bodewig <bo...@apache.org> ---
Felix, is there some special handling of com.sun.tools.javac.Main expected or
will <javac> be broken soon as well?

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 59860] org.apache.tools.ant.taskdefs.RmicAdvancedTest failed with JDK 9 changes for modularization

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=59860

Stefan Bodewig <bo...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |1.9.8
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #3 from Stefan Bodewig <bo...@apache.org> ---
Fixed with git commit fdfebe8

note that rmic -Xnew causes strange error messages and still fails (I'm sure
I've reported this every time I tested any jdk9 build).

I'm worried about "com.sun.tools.javac.Main" used in <javac> and
"com.sun.tools.javah.oldjavah.Main" used in <javah> - in particular since we
don't seem to have a decent test coverage for the later.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 59860] org.apache.tools.ant.taskdefs.RmicAdvancedTest failed with JDK 9 changes for modularization

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=59860

--- Comment #5 from Stefan Bodewig <bo...@apache.org> ---
Thank you Felix, I've opened Bug 59906 to track this.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 59860] org.apache.tools.ant.taskdefs.RmicAdvancedTest failed with JDK 9 changes for modularization

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=59860

Stefan Bodewig <bo...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 OS|                            |All

--- Comment #1 from Stefan Bodewig <bo...@apache.org> ---
The test failing is only a symptom, the rmic task itself won't work unless you
add the workarounds when starting Ant.

Apart from skipping the test when running on JDK9+ the proper fix probably is
to make "forking" the default implementation on JDK9+ and document that "sun"
won't work for JDK9+. And probably detect a constellation like this at runtime
and provide a useful error message.

-- 
You are receiving this mail because:
You are the assignee for the bug.