Issue trying to use CORBA classes from javac

Sander Mak sander.mak at luminis.eu
Mon May 23 13:14:42 UTC 2016


Hi Andrew, Michael,

It's come up several times recently on this list, but this should clear up the issue: http://mail.openjdk.java.net/pipermail/jdk9-dev/2016-May/004309.html

In short: use `-addmods java.corba` when compiling as of 9-ea-b119.


Sander

On 23 May 2016, at 14:51, Andrew Dinn <adinn at redhat.com<mailto:adinn at redhat.com>> wrote:

Hi All,

Red Hat's Transactions developers are having problems compiling their
Corba-based code using the latest early access release of JDK9
(9-ea-b119). When the maven compiler plugin executes javac the compile
fails because various corba packages are not visible. These are /not/
classes belonging to concealed packages.

Some of the relevant error messages are shown in the first listing
following my sig.

Indeed, what is more strange is that we found that we could remedy the
first of these errors by adding an explicit addExports for the relevant
package to the javac arguments configured in the maven pom:

 <compilerArgs>
   <arg>-XaddExports:java.corba/org.omg.CORBA=ALL-UNNAMED</arg>
 </compilerArgs>

The second listing shows the difference this makes. Note that package
org.omg.CORBA is now recognised.


No doubt the same sort of fix would apply to remove the other errors but
I don't understand why the use of addExports is necessary. When I run
jmod describe on the java.corba module it tells me that org.omg.CORBA
etc are already exported. So, java.corba does not seem to be a special
sort of package different to all the others in the jmod dir.

Is there some hidden switch which disables exports for this module? If
so then is there a switch (equally as well hidden :-) which allows me to
re-instate them? If not then does anyone have any idea why are we seeing
these missing package errors?

n.b. please keep Mike Musgrove in the cc for any replies as he is not
subscribed to this list.

regards,


Andrew Dinn
-----------
Senior Principal Software Engineer
Red Hat UK Ltd
Registered in England and Wales under Company Registration No. 03798903
Directors: Michael Cunningham, Michael ("Mike") O'Neill, Eric Shander

Errors with no compiler X args:
-------------------------------

[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR]
/home/mmusgrov/source/forks/narayana/master/ArjunaJTS/orbportability/classes/com/arjuna/orbportability/internal/orbspecific/ibmorb/oa/implementations/ibmorb_7_1.java:[32,21]
package org.omg.CORBA does not exist
[ERROR]
/home/mmusgrov/source/forks/narayana/master/ArjunaJTS/orbportability/classes/com/arjuna/orbportability/internal/orbspecific/ibmorb/oa/implementations/ibmorb_7_1.java:[33,21]
package org.omg.CORBA does not exist
[ERROR]
/home/mmusgrov/source/forks/narayana/master/ArjunaJTS/orbportability/classes/com/arjuna/orbportability/internal/orbspecific/ibmorb/oa/implementations/ibmorb_7_1.java:[34,30]
package org.omg.PortableServer does not exist
[ERROR]
/home/mmusgrov/source/forks/narayana/master/ArjunaJTS/orbportability/classes/com/arjuna/orbportability/internal/orbspecific/ibmorb/oa/implementations/ibmorb_7_1.java:[35,48]
package org.omg.PortableServer.POAManagerPackage does not exist
[ERROR]
/home/mmusgrov/source/forks/narayana/master/ArjunaJTS/orbportability/classes/com/arjuna/orbportability/internal/orbspecific/ibmorb/oa/implementations/ibmorb_7_1.java:[36,41]
package org.omg.PortableServer.POAPackage does not exist

. . .


Errors after using -XaddExports:java.corba/org.omg.CORBA=ALL-UNNAMED
--------------------------------------------------------------------

[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR]
/home/mmusgrov/source/forks/narayana/master/ArjunaJTS/orbportability/classes/com/arjuna/orbportability/internal/orbspecific/ibmorb/oa/implementations/ibmorb_7_1.java:[34,30]
package org.omg.PortableServer does not exist
[ERROR]
/home/mmusgrov/source/forks/narayana/master/ArjunaJTS/orbportability/classes/com/arjuna/orbportability/internal/orbspecific/ibmorb/oa/implementations/ibmorb_7_1.java:[35,48]
package org.omg.PortableServer.POAManagerPackage does not exist
[ERROR]
/home/mmusgrov/source/forks/narayana/master/ArjunaJTS/orbportability/classes/com/arjuna/orbportability/internal/orbspecific/ibmorb/oa/implementations/ibmorb_7_1.java:[36,41]
package org.omg.PortableServer.POAPackage does not exist
[ERROR]
/home/mmusgrov/source/forks/narayana/master/ArjunaJTS/orbportability/classes/com/arjuna/orbportability/internal/orbspecific/ibmorb/oa/implementations/ibmorb_7_1.java:[37,41]
package org.omg.PortableServer.POAPackage does not exist
[ERROR]
/home/mmusgrov/source/forks/narayana/master/ArjunaJTS/orbportability/classes/com/arjuna/orbportability/internal/orbspecific/oa/implementations/POABase.java:[39,32]
org.omg.CORBA.ORBPackage.InvalidName is not visible because package
org.omg.CORBA.ORBPackage is not visible
[ERROR]
/home/mmusgrov/source/forks/narayana/master/ArjunaJTS/orbportability/classes/com/arjuna/orbportability/internal/orbspecific/oa/implementations/POABase.java:[40,30]
package org.omg.PortableServer does not exist
[ERROR]
/home/mmusgrov/source/forks/narayana/master/ArjunaJTS/orbportability/classes/com/arjuna/orbportability/internal/orbspecific/oa/implementations/POABase.java:[41,48]
package org.omg.PortableServer.POAManagerPackage does not exist
[ERROR]
/home/mmusgrov/source/forks/narayana/master/ArjunaJTS/orbportability/classes/com/arjuna/orbportability/oa/core/POAImple.java:[36,32]
org.omg.CORBA.ORBPackage.InvalidName is not visible because package
org.omg.CORBA.ORBPackage is not visible

. . .



More information about the jigsaw-dev mailing list