Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ptp-dev] PTP java.lang.ClassNotFoundException: for com.sun.xml.internal.bind.v2.ContextFactory

Dave,

Can you use the update site [1]? I’ve simplified the build process so we’re not generating the zip file any more.

I tried installing Eclipse in /opt and also running it from the disk image and it seems to work. I’m not sure what happened when I tried this previously but it seems to be working now. I’ve updated the bug but if you run into any problems let me know.

Regards,
Greg

[1] https://download.eclipse.org/tools/ptp/builds/photon/milestones/

On Jun 6, 2019, at 3:34 PM, David Wootton <dwootton@xxxxxxxxxx> wrote:

Greg
I didn't have the plugin in my workspace. I imported it and both Java 8 and Java 12 runtime instances work.
I do get this popup when I start a runtime instance with Java 8, but I think it's harmless.
<14297540.gif>
Is there an update site zip file with this fix anywhere I can download? I want to verify my plugin works correctly with this fix.

I did see the note in bug 541264 about this fix not working if Eclipse is installed in a read-only directory. Serban says we have users who install Eclipse in /opt or /usr, etc.

Do you have any thoughts about why this fix doesn't work in a read-only directory? My experience is that I can install Eclipse in a read-only directory, and then install new plugins, which end up going into a hidden directory in my home directory, .dropins, I think.
Is there something else going on that prevents this fix from working in this setup?

Dave

<graycol.gif>Greg Watson ---06/06/2019 09:42:16 AM---Hi Dave, I’m glad the package worked. I hadn’t tested with Java 12 so it is good to know that works.

From: Greg Watson <g.watson@xxxxxxxxxxxx>
To: Parallel Tools Platform general developers <ptp-dev@xxxxxxxxxxx>
Date: 06/06/2019 09:42 AM
Subject: [EXTERNAL] Re: [ptp-dev] PTP java.lang.ClassNotFoundException: for com.sun.xml.internal.bind.v2.ContextFactory
Sent by: ptp-dev-bounces@xxxxxxxxxxx





Hi Dave,

I’m glad the package worked. I hadn’t tested with Java 12 so it is good to know that works.

Can you check that you have the new org.eclipse.ptp.rm.jaxb.java11 plugin in your workspace and you have it enabled when you launch Eclipse? That may be causing the problem you are seeing.

Regards,
Greg
      On Jun 6, 2019, at 8:21 AM, David Wootton <dwootton@xxxxxxxxxx> wrote:

      Greg
      I issued a pull in my workspace to get the updated code. Then I ran using Java 8 and the run configuration dialog worked correctly. I then switch to Java 12, first as a Java 11 execution environment and then as a Java 12 JRE. In both cases I got the exception for the missing ContextFactory class.


      Then I downloaded the parallel package. That worked with Java 8 which is the default Java. I added a -vm parameter to eclipse.ini to specify the path to the Java 12 javaw executable and the run configuration dialog worked correctly. I did verify that I had the right format for the eclipse.ini by using an invalid path to javaw, so I'm sure I was running with Java 12.


      I guess something is wrong with my workspace, but since it works in the parallel package, I guess that's proof this is fixed.


      Thanks for fixing this.


      Dave


      <graycol.gif>Greg Watson ---06/05/2019 08:33:19 PM---Hi Dave, There should be a new build you can try now. This should work for both Java 8 and Java 11.

      From:
      Greg Watson <g.watson@xxxxxxxxxxxx>
      To:
      Parallel Tools Platform general developers <ptp-dev@xxxxxxxxxxx>
      Date:
      06/05/2019 08:33 PM
      Subject:
      [EXTERNAL] Re: [ptp-dev] PTP java.lang.ClassNotFoundException: for com.sun.xml.internal.bind.v2.ContextFactory
      Sent by:
      ptp-dev-bounces@xxxxxxxxxxx






      Hi Dave,

      There should be a new build you can try now. This should work for both Java 8 and Java 11. If you like, you can also try the Parallel Package from here: https://ci.eclipse.org/packaging/job/simrel.epp-tycho-build/451/artifact/org.eclipse.epp.packages/archive/

      Regards,
      Greg
              On Jun 5, 2019, at 12:38 PM, Greg Watson <g.watson@xxxxxxxxxxxx> wrote:

              Dave,

              My goal was trying to get it to work on Java 11/12. I thought it might be broken on Java 8. I’m going to try to use a fragment to handle Java 11 so Java 8 should not be affected. I’ll let you know when it’s ready to test.

              Regarding the version of Java used to build PTP. I believe it shouldn’t matter as each plugin includes a Bundle-RequiredExecutionEnvironment that specifies the minimum Java version required to execute the plugin. The build process is supposed to adhere to this requirement so that API changes do not cause problems. In any case, it will be built with Java 8 by the Eclipse CI server.

              Regards,
              Greg
                      On Jun 5, 2019, at 10:59 AM, David Wootton <dwootton@xxxxxxxxxx> wrote:

                      I'm not sure that the Java version was used to build PTP matters.

                      I did not rebuild PTP when switching between Java 8 and Java 12. I just switch Java JRE and run environment in the run configuration dialog that starts the PTP runtime instance.

                      Anyway, as far as I know I am building PTP only with Java 8 since that is the only Java in my Windows PATH. I downloaded the Java 12 code as a zip file and manually unpacked it to keep anything in the Java install process from changing my environment. So I think the only thing my Eclipse IDE knows about my Java 12 installation is that it is an additional JRE (set as the default in the Installed JRE in the IDE preferences)
                      Dave

                      <graycol.gif>
                      "Serban Maerean" ---06/05/2019 09:54:09 AM---If PTP was built for Java 11/12, I doubt it will run smoothly on Java8, as interfaces may have chan

                      From:
                      "Serban Maerean" <serban@xxxxxxxxxx>
                      To:
                      Parallel Tools Platform general developers <ptp-dev@xxxxxxxxxxx>
                      Date:
                      06/05/2019 09:54 AM
                      Subject:
                      [EXTERNAL] Re: [ptp-dev] Fw: PTP java.lang.ClassNotFoundException: for com.sun.xml.internal.bind.v2.ContextFactory
                      Sent by:
                      ptp-dev-bounces@xxxxxxxxxxx






                      If PTP was built for Java 11/12, I doubt it will run smoothly on Java8, as interfaces may have changed. We know the other way around is not true, although that shouldn't be the case.

                      Also, is it possible to check the Java RTE version at runtime and do things differently for each version?

                      Or maybe we can do that with some magic and use different PTP plugin versions in hpctView, depending on the Java RTE version?!?

                      One thing is for sure, PTP needs to support Java >=11. What do other plugins that use JAXB do?


                      Serban Maerean
                      HPC Tools
                      T/L: 293-9770, Tel.: 845-433-9770

                      E-mail: serban@xxxxxxxxxx



                      From:
                      "David Wootton" <dwootton@xxxxxxxxxx>
                      To:
                      Parallel Tools Platform general developers <ptp-dev@xxxxxxxxxxx>
                      Date:
                      06/05/2019 08:37 AM
                      Subject:
                      [EXTERNAL] Re: [ptp-dev] Fw: PTP java.lang.ClassNotFoundException: for com.sun.xml.internal.bind.v2.ContextFactory
                      Sent by:
                      ptp-dev-bounces@xxxxxxxxxxx




                      Greg
                      The original problem with a missing ContextFactory class when running with a Java 12 JRE seems to be fixed. I can open a run configuration dialog, select a target system configuration and a remote connection and have the resources tab fill in proiperly.
                      I noticed this warning when I created a synchronized project. I'm not sure if it means anything or not, and don't know if this is due to something in PTP code. I created a second synchronized project using a Java 8 runtime and did not see this. When I created a third synchronized project while running as a Java 12 JRE I did not see this warning.

                      WARNING: An illegal reflective access operation has occurred
                      WARNING: Illegal reflective access by org.bouncycastle.jcajce.provider.drbg.DRBG (file:/C:/Eclipse_Workspaces/Eclipse-PTP-Java12/.metadata/.plugins/org.eclipse.pde.core/.bundle_pool/plugins/org.bouncycastle.bcprov_1.60.0.v20181210-2057.jar) to constructor sun.security.provider.Sun()
                      WARNING: Please consider reporting this to the maintainers of org.bouncycastle.jcajce.provider.drbg.DRBG
                      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

                      I tried running with a Java 8 JRE and and ran into problems when trying to open the run configuration dialog.

                      First, I get this popup when I start the runtime instance

                      <17599189.gif>

                      When I opened the profile configuration dialog, I got this popup, but then the dialog opens

                      <17183327.gif>
                      If I try to select a connection I get the same popup and can't select a connection.

                      Dave

                      <graycol.gif>Greg Watson ---06/04/2019 07:17:20 PM---Dave, I submitted a change to master that fixes the problem for me. Can you see if it fixes it for y

                      From:
                      Greg Watson <g.watson@xxxxxxxxxxxx>
                      To:
                      Parallel Tools Platform general developers <ptp-dev@xxxxxxxxxxx>
                      Date:
                      06/04/2019 07:17 PM
                      Subject:
                      [EXTERNAL] Re: [ptp-dev] Fw: PTP java.lang.ClassNotFoundException: for com.sun.xml.internal.bind.v2.ContextFactory
                      Sent by:
                      ptp-dev-bounces@xxxxxxxxxxx




                      Dave,

                      I submitted a change to master that fixes the problem for me. Can you see if it fixes it for you also?

                      Thanks,
                      Greg
                      On Jun 4, 2019, at 1:45 PM, David Wootton <
                      dwootton@xxxxxxxxxx> wrote:
                      Greg
                      If I don't change anything, I get this popup when starting the PTP runtime instance with a Java 8 runtime

                      <19143201.gif>
                      and I get this exception logged,

                      org.osgi.framework.BundleException
                      : Could not resolve module: com.sun.xml.bind.jaxb-osgi [9]
                      Unresolved requirement: Import-Package: javax.xml.bind.annotation; version="2.3.0"
                      -> Export-Package: javax.xml.bind.annotation; bundle-symbolic-name="jaxb-api"; bundle-version="2.4.0.b1808300359"; version="2.3.0"; uses:="javax.xml.bind,javax.xml.parsers,javax.xml.transform,javax.xml.transform.dom,org.w3c.dom"
                      jaxb-api [20]
                      Unresolved requirement: Require-Capability: osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=9.0))"
                      Unresolved requirement: Import-Package: javax.xml.bind; version="2.3.0"
                      -> Export-Package: javax.xml.bind; bundle-symbolic-name="jaxb-api"; bundle-version="2.4.0.b1808300359"; version="2.3.0"; uses:="javax.xml.bind.annotation.adapters,javax.xml.bind.attachment,javax.xml.namespace,javax.xml.stream,javax.xml.transform,javax.xml.validation,org.w3c.dom,org.xml.sax"

                      The runtime instance starts and the run configuration dialog resources tab fills in properly when I select a connection name. I don't have either OpenMPI or MPICH on my test system so I specified the application as /bin/ls and clicked run. That generated output to the console and I didn't see any further errors logged.

                      If I change the MANIFEST.MF file in org.eclipse.ptp.rm.jaxb.core and use the Java 8 runtime I get the same behavior including the popup and exception.

                      Dave



                      <graycol.gif>
                      Greg Watson ---06/04/2019 11:50:32 AM---Unfortunately this is the problem. Projects hosted on Eclipse can’t be built using arbitrary compone

                      From:
                      Greg Watson <g.watson@xxxxxxxxxxxx>
                      To:
                      Parallel Tools Platform general developers <ptp-dev@xxxxxxxxxxx>
                      Date:
                      06/04/2019 11:50 AM
                      Subject:
                      [EXTERNAL] Re: [ptp-dev] Fw: PTP java.lang.ClassNotFoundException: for com.sun.xml.internal.bind.v2.ContextFactory
                      Sent by:
                      ptp-dev-bounces@xxxxxxxxxxx




                      Unfortunately this is the problem. Projects hosted on Eclipse can’t be built using arbitrary components from a maven repository. Everything has to be obtained from Eclipse repositories, and from what I’ve been able to determine, the latest jaxb version is 2.2.0 which doesn’t seem to work. I’ve been looking at using Eclipselink but haven’t been able to get that to work either.

                      Also, it would be worth checking that Dave’s solution works for Java 8 as well as Java 11/12. Whatever the solution is, it also needs to work with both versions.

                      Regards,
                      Greg
                      On Jun 4, 2019, at 11:34 AM, Serban Maerean <
                      serban@xxxxxxxxxx> wrote:

                      Dave, is it possible that Greg didn't copy the three plugins to a local directory and instead tried to reference them directly from the server?

                      Greg, with Dave's approach, will you need to package those plugins with PTP?


                      Serban Maerean
                      HPC Tools
                      T/L: 293-9770, Tel.: 845-433-9770
                      E-mail:
                      serban@xxxxxxxxxx



                      From:
                      "David Wootton" <dwootton@xxxxxxxxxx>
                      To:
                      Parallel Tools Platform general developers <ptp-dev@xxxxxxxxxxx>
                      Date:
                      06/04/2019 11:22 AM
                      Subject:
                      [EXTERNAL] Re: [ptp-dev] Fw: PTP java.lang.ClassNotFoundException: for com.sun.xml.internal.bind.v2.ContextFactory
                      Sent by:
                      ptp-dev-bounces@xxxxxxxxxxx




                      Greg
                      I'm not sure what's different. I have a Java 12 runtime. I downloaded the java-activation-1.2.0,jar, jaxb-api-2.4.0-b-180830.0359.jar and jaxb-osgi-180830.0438.jar from the maven repository files into a local directory, added that directory as a local repoistory in the photon.target file, and changed the import for com.sun.xml.bin in the org.eclipse.ptp.rm.jaxb.core MANIFEST.MF file to com.sun.xml.bind.v2. Then I reloaded the target definition file and started a PTP runtime instance.
                      I was able to open the run configuration dialog, pick any target system configuration and pick a remote connection name. Then the resources page would fill in properly.

                      If I backed out those changes and ran again using the Java 12 runtime, I got the error for the missing class.
                      Dave
                      <Mail Attachment.gif>
                      Greg Watson ---06/04/2019 09:20:45 AM---Hi Dave, Yes, I’ve spent the better part of a week on it and I’m still no closer… I’ve tried everyt

                      From:
                      Greg Watson <g.watson@xxxxxxxxxxxx>
                      To:
                      Parallel Tools Platform general developers <ptp-dev@xxxxxxxxxxx>
                      Date:
                      06/04/2019 09:20 AM
                      Subject:
                      [EXTERNAL] Re: [ptp-dev] Fw: PTP java.lang.ClassNotFoundException: for com.sun.xml.internal.bind.v2.ContextFactory
                      Sent by:
                      ptp-dev-bounces@xxxxxxxxxxx




                      Hi Dave,

                      Yes, I’ve spent the better part of a week on it and I’m still no closer… I’ve tried everything, including creating a fragment with the dependencies but I’m still getting the error.

                      Greg
                      On Jun 4, 2019, at 9:03 AM, David Wootton <
                      dwootton@xxxxxxxxxx> wrote:
                      Greg
                      Have you had a chance to look at this?
                      Dave

                      <graycol.gif>
                      Greg Watson ---05/21/2019 10:02:02 AM---Hi Dave, Thanks for looking into this. I'll try to take a look later this week.

                      From:
                      Greg Watson <g.watson@xxxxxxxxxxxx>
                      To:
                      Parallel Tools Platform general developers <ptp-dev@xxxxxxxxxxx>
                      Date:
                      05/21/2019 10:02 AM
                      Subject:
                      [EXTERNAL] Re: [ptp-dev] Fw: PTP java.lang.ClassNotFoundException: for com.sun.xml.internal.bind.v2.ContextFactory
                      Sent by:
                      ptp-dev-bounces@xxxxxxxxxxx




                      Hi Dave,

                      Thanks for looking into this. I'll try to take a look later this week.

                      Greg
                      On May 21, 2019, at 7:41 AM, David Wootton <
                      dwootton@xxxxxxxxxx> wrote:
                      I realized I left out the link to the page that suggested using com.sun.xml.bind:jaxb-osgi (
                      http://www.descher.at/descher-vu/2019/01/java-11-jaxb-and-osgi/)to get the missing JAXB code.
                      Dave

                      ----- Forwarded by David Wootton/Poughkeepsie/Contr/IBM on 05/21/2019 07:38 AM -----


                      From:
                      David Wootton/Poughkeepsie/Contr/IBM
                      To:
                      Parallel Tools Platform general developers <ptp-dev@xxxxxxxxxxx>
                      Date:
                      05/16/2019 05:07 PM
                      Subject:
                      Re: [EXTERNAL] [ptp-dev] PTP java.lang.ClassNotFoundException: for com.sun.xml.internal.bind.v2.ContextFactory




                      Looking at this further, it seems that CDT has solved this or a similar problem

                      https://www.eclipse.org/lists/cdt-dev/msg33366.html
                      https://bugs.eclipse.org/bugs/show_bug.cgi?id=542644

                      I also found this, which suggests using com.sun.xml.bind:jaxb-osgi to get the missing JAXB code, where I found
                      https://mvnrepository.com/artifact/com.sun.xml.bind/jaxb-osgithat seems to point to the location to get it from.
                      I don't know if this helps or is even possible to use in an
                      eclipse.org-hosted project
                      Dave

                      <graycol.gif>
                      "David Wootton" ---05/15/2019 05:53:23 PM---I'm looking at this problem since it affects my plugin once Java 8 is no longer supported. I'm not s

                      From:
                      "David Wootton" <dwootton@xxxxxxxxxx>
                      To:
                      "Parallel Tools Platform general developers" <ptp-dev@xxxxxxxxxxx>
                      Date:
                      05/15/2019 05:53 PM
                      Subject:
                      [EXTERNAL] [ptp-dev] PTP java.lang.ClassNotFoundException: for com.sun.xml.internal.bind.v2.ContextFactory
                      Sent by:
                      ptp-dev-bounces@xxxxxxxxxxx




                      I'm looking at this problem since it affects my plugin once Java 8 is no longer supported. I'm not sure I'm anywhere near on the right track to figure this out. I found quite a few references to this problem within the past year by Google search using the words ContextFactory and Eclipse, a number of which refer to PTP bug 541264

                      My understanding of the solutions suggested are to use versions 2.2.0 of the com.sun.xml.bind and javax.xml.bind, which I think means I need to find repositories that have these versions of the packages.

                      I tried updating the photon.target target definition file to use a later Orbit repository, I20190320195810 which seems to have these, but that did not help. I also found
                      https://www.jesperdj.com/2018/09/30/jaxb-on-java-9-10-11-and-beyond/which explains how to specify a dependency for a maven build, but I'm not sure where this gets specified.

                      Am I anywhere near the right track to figure this out?
                      Dave
                      _______________________________________________
                      ptp-dev mailing list

                      ptp-dev@xxxxxxxxxxx
                      To change your delivery options, retrieve your password, or unsubscribe from this list, visit

                      https://www.eclipse.org/mailman/listinfo/ptp-dev



                      _______________________________________________
                      ptp-dev mailing list

                      ptp-dev@xxxxxxxxxxx
                      To change your delivery options, retrieve your password, or unsubscribe from this list, visit

                      https://www.eclipse.org/mailman/listinfo/ptp-dev
                      _______________________________________________
                      ptp-dev mailing list

                      ptp-dev@xxxxxxxxxxx
                      To change your delivery options, retrieve your password, or unsubscribe from this list, visit

                      https://www.eclipse.org/mailman/listinfo/ptp-dev


                      _______________________________________________
                      ptp-dev mailing list

                      ptp-dev@xxxxxxxxxxx
                      To change your delivery options, retrieve your password, or unsubscribe from this list, visit

                      https://www.eclipse.org/mailman/listinfo/ptp-dev
                      _______________________________________________
                      ptp-dev mailing list

                      ptp-dev@xxxxxxxxxxx
                      To change your delivery options, retrieve your password, or unsubscribe from this list, visit

                      https://www.eclipse.org/mailman/listinfo/ptp-dev

                      _______________________________________________
                      ptp-dev mailing list

                      ptp-dev@xxxxxxxxxxx
                      To change your delivery options, retrieve your password, or unsubscribe from this list, visit

                      https://www.eclipse.org/mailman/listinfo/ptp-dev


                      _______________________________________________
                      ptp-dev mailing list

                      ptp-dev@xxxxxxxxxxx
                      To change your delivery options, retrieve your password, or unsubscribe from this list, visit

                      https://www.eclipse.org/mailman/listinfo/ptp-dev
                      _______________________________________________
                      ptp-dev mailing list

                      ptp-dev@xxxxxxxxxxx
                      To change your delivery options, retrieve your password, or unsubscribe from this list, visit

                      https://www.eclipse.org/mailman/listinfo/ptp-dev


                      _______________________________________________
                      ptp-dev mailing list

                      ptp-dev@xxxxxxxxxxx
                      To change your delivery options, retrieve your password, or unsubscribe from this list, visit

                      https://www.eclipse.org/mailman/listinfo/ptp-dev
                      _______________________________________________
                      ptp-dev mailing list

                      ptp-dev@xxxxxxxxxxx
                      To change your delivery options, retrieve your password, or unsubscribe from this list, visit

                      https://www.eclipse.org/mailman/listinfo/ptp-dev

                      _______________________________________________
                      ptp-dev mailing list

                      ptp-dev@xxxxxxxxxxx
                      To change your delivery options, retrieve your password, or unsubscribe from this list, visit

                      https://www.eclipse.org/mailman/listinfo/ptp-dev

                      _______________________________________________
                      ptp-dev mailing list

                      ptp-dev@xxxxxxxxxxx
                      To change your delivery options, retrieve your password, or unsubscribe from this list, visit

                      https://www.eclipse.org/mailman/listinfo/ptp-dev


                      _______________________________________________
                      ptp-dev mailing list

                      ptp-dev@xxxxxxxxxxx
                      To change your delivery options, retrieve your password, or unsubscribe from this list, visit

                      https://www.eclipse.org/mailman/listinfo/ptp-dev

              _______________________________________________
              ptp-dev mailing list
              ptp-dev@xxxxxxxxxxx
              To change your delivery options, retrieve your password, or unsubscribe from this list, visit
              https://www.eclipse.org/mailman/listinfo/ptp-dev
      _______________________________________________
      ptp-dev mailing list

      ptp-dev@xxxxxxxxxxx
      To change your delivery options, retrieve your password, or unsubscribe from this list, visit

      https://www.eclipse.org/mailman/listinfo/ptp-dev


      _______________________________________________
      ptp-dev mailing list
      ptp-dev@xxxxxxxxxxx
      To change your delivery options, retrieve your password, or unsubscribe from this list, visit
      https://www.eclipse.org/mailman/listinfo/ptp-dev
_______________________________________________
ptp-dev mailing list
ptp-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/ptp-dev


_______________________________________________
ptp-dev mailing list
ptp-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/ptp-dev


Back to the top