Re: Issue trying to use CORBA classes from javac
On 08/06/2016 10:16, Michael Musgrove wrote: I have followed your (and Andrew's) advice and patched the java.corba module and updated my maven poms to use the patch and made good progress as a result, so thanks for your help here. I do have another potential blocker: this time I (or rather the sun orb) need access to the inner class: ClassNotFoundException: sun.reflect.ReflectionFactory$GetReflectionFactoryAction which has been removed from the jdk.unsupported module. I am unable to use the ReflectionFactory.getReflectionFactory() workaround suggested elsewhere because this usage is coming from the sun orb: The Bridge code in the JDK ORB was changed some time ago to replace this usage. Is the "sun orb" code that you are using from an older JDK version? -Alan
Re: Issue trying to use CORBA classes from javac
On 23/05/2016 15:52, Andrew Dinn wrote: : Thanks to you and Sanders for the advice. The relevant packages now appear. Could you explain how the disabled status of this module is arrived at in the final build? Is it excluded from the standard visible set by virtue of being listed in UPGRADEABLE_MODULES? I couldn't find anywhere else where any different treatment might be applied. The section entitled "Root modules" in JEP 261 is the section to read. It's essentially that the java.se rather than java.se.ee is resolved by default when compiling code in the unnamed module or running and the initial class is loaded from the class path. : Hmm, perhaps -XaddExports requires a check to see that it does not add any exports unless the module has also been added. javac and java behave slightly differently for this case, it's something we need to fix. : However, we do interoperate with 2 other orbs and in those cases we currently provide the relevant CORBA classes via the classpath using -Xbootclasspath:p (which I have explained is no longer going to work). I think that this command line option was adopted merely in order to pre-empt the SE Corba classes in rt.jar. So, I am hoping that if we omit -addmod java.corba and add the alternatrive ORB jar to the system classpath then we will actually be safe. If you have reason to believe otherwise please let me know. Meanwhile, I'll get back to you if and when this turns into a packed lunch problem. Thanks for the help. If you have complete replacement/upgrade for the java.corba module then you can deploy on it on the class path and it should work. Alternatively you can deploy it on the upgrade module path to upgrade/override the module in the JDK (`-upgrademodulepath mycorba.jar -addmods java.corba`). On the other hand, if you adding to the JDK java.corba module then you'll need to use -Xpatch to augment or override what is in the JDK (`-Xpatch:java.corba=mycorbapatch.jar -addmods java.corba`). -Alan.
Re: Issue trying to use CORBA classes from javac
Hi Alan, On 23/05/16 14:27, Alan Bateman wrote: > As Sander said, compiling with `-addmods java.corba` will ensure that > the java.corba module is resolved. Thanks to you and Sanders for the advice. The relevant packages now appear. Could you explain how the disabled status of this module is arrived at in the final build? Is it excluded from the standard visible set by virtue of being listed in UPGRADEABLE_MODULES? I couldn't find anywhere else where any different treatment might be applied. > That said, I'm puzzled as to why -XaddExports makes a difference here, > also by some of the types mentioned in the compilation messages as they > aren't types in the JDK java.corba module. Hmm, perhaps -XaddExports requires a check to see that it does not add any exports unless the module has also been added. > It would help if you or Michael could summarize what org.omg.** classes > are in the environment. We've had problems off-list with another app > server in this area too. In that case, it was augmenting the CORBA > version in the JDK with additional classes as part of adding support for > OMG APIs that the JDK version doesn't support. I don't know if we've got > something similar here. If so, then bring a packed lunch as it will be a > long day :-) Mike is currently checking this -- his tweaking of the maven poms during testing may actually be responsible for some of the problems you noticed. So, he is checking that before he can be sure that this resolves the problems using the SE-provided orb. Essentially, for this build, where we are using the SE ORB, there should be no other org.omg.** classes in the env. However, we do interoperate with 2 other orbs and in those cases we currently provide the relevant CORBA classes via the classpath using -Xbootclasspath:p (which I have explained is no longer going to work). I think that this command line option was adopted merely in order to pre-empt the SE Corba classes in rt.jar. So, I am hoping that if we omit -addmod java.corba and add the alternatrive ORB jar to the system classpath then we will actually be safe. If you have reason to believe otherwise please let me know. Meanwhile, I'll get back to you if and when this turns into a packed lunch problem. Thanks for the help. 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
Re: Issue trying to use CORBA classes from javac
On 23/05/2016 13:51, Andrew Dinn 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: -XaddExports:java.corba/org.omg.CORBA=ALL-UNNAMED 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. As Sander said, compiling with `-addmods java.corba` will ensure that the java.corba module is resolved. That said, I'm puzzled as to why -XaddExports makes a difference here, also by some of the types mentioned in the compilation messages as they aren't types in the JDK java.corba module. It would help if you or Michael could summarize what org.omg.** classes are in the environment. We've had problems off-list with another app server in this area too. In that case, it was augmenting the CORBA version in the JDK with additional classes as part of adding support for OMG APIs that the JDK version doesn't support. I don't know if we've got something similar here. If so, then bring a packed lunch as it will be a long day :-) -Alan
Re: Issue trying to use CORBA classes from javac
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> 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: -XaddExports:java.corba/org.omg.CORBA=ALL-UNNAMED 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]
Issue trying to use CORBA classes from javac
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: -XaddExports:java.corba/org.omg.CORBA=ALL-UNNAMED 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]