Topics

classloader error

Pete Cressman
 


I upgraded to Java 1.8.0_231 and merged from the master.
After a clean build IO get this error upon launching PanelPro or DecoderPro:

java.lang.NoClassDefFoundError: org/w3c/dom/ElementTraversal

In a branch compiled before the above upgrade/merge, I can launch PanelPro or DecoderPro with no errors.

     [java] 2019-10-16 19:01:23,756 ptionhandler.UncaughtExceptionHandler ERROR - Uncaught Exception caught by jmri.util.exceptionhandler.UncaughtExceptionHandler [main]
     [java] java.lang.NoClassDefFoundError: org/w3c/dom/ElementTraversal
     [java]  at java.lang.ClassLoader.defineClass1(Native Method)
     [java]  at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
     [java]  at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
     [java]  at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
     [java]  at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
     [java]  at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
     [java]  at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
     [java]  at java.security.AccessController.doPrivileged(Native Method)
     [java]  at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
     [java]  at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
     [java]  at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
     [java]  at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
     [java]  at org.apache.xerces.parsers.AbstractDOMParser.startDocument(Unknown Source)
     [java]  at org.apache.xerces.impl.dtd.XMLDTDValidator.startDocument(Unknown Source)
     [java]  at org.apache.xerces.impl.XMLDocumentScannerImpl.startEntity(Unknown Source)
     [java]  at org.apache.xerces.impl.XMLVersionDetector.startDocumentParsing(Unknown Source)
     [java]  at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
     [java]  at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
     [java]  at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
     [java]  at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
     [java]  at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
     [java]  at sun.util.xml.PlatformXmlPropertiesProvider.getLoadingDoc(PlatformXmlPropertiesProvider.java:106)
     [java]  at sun.util.xml.PlatformXmlPropertiesProvider.load(PlatformXmlPropertiesProvider.java:78)
     [java]  at java.util.Properties$XmlSupport.load(Properties.java:1201)
     [java]  at java.util.Properties.loadFromXML(Properties.java:881)
     [java]  at jmri.profile.ProfileManager.readActiveProfile(ProfileManager.java:293)
     [java]  at jmri.profile.ProfileManager.getStartingProfile(ProfileManager.java:906)
     [java]  at jmri.profile.ProfileManagerDialog.getStartingProfile(ProfileManagerDialog.java:318)
     [java]  at apps.Apps.<init>(Apps.java:185)
     [java]  at apps.PanelPro.PanelPro.<init>(PanelPro.java:40)
     [java]  at apps.PanelPro.PanelPro.main(PanelPro.java:120)
     [java] Caused by: java.lang.ClassNotFoundException: org.w3c.dom.ElementTraversal
     [java]  at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
     [java]  at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
     [java]  at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
     [java]  at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
     [java]  ... 31 more

DecoderPro differs only at the bottom of the stack:

     [java]  at jmri.profile.ProfileManagerDialog.getStartingProfile(ProfileManagerDialog.java:318)
     [java]  at apps.gui3.Apps3.configureProfile(Apps3.java:335)
     [java]  at apps.AppsBase.<init>(AppsBase.java:92)
     [java]  at apps.gui3.Apps3.<init>(Apps3.java:93)
     [java]  at apps.gui3.dp3.DecoderPro3.<init>(DecoderPro3.java:27)
     [java]  at apps.gui3.dp3.DecoderPro3.main(DecoderPro3.java:96)
     [java] Caused by: java.lang.ClassNotFoundException: org.w3c.dom.ElementTraversal
     [java]  at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
     [java]  at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
     [java]  at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
     [java]  at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
     [java]  ... 33 more

What might be the problem?  Thanks for any suggestions.
Pete C

danielb987
 

This StackOverflow question might give a clue:
https://stackoverflow.com/questions/17515333/noclassdeffounderror-org-w3c-dom-elementtraversal

Daniel

2019-10-17 04:09 skrev Pete Cressman:

I upgraded to Java 1.8.0_231 and merged from the master.
After a clean build IO get this error upon launching PanelPro or
DecoderPro:
java.lang.NoClassDefFoundError: org/w3c/dom/ElementTraversal
__
In a branch compiled before the above upgrade/merge, I can launch
PanelPro or DecoderPro with no errors.
[java] 2019-10-16 19:01:23,756
ptionhandler.UncaughtExceptionHandler ERROR - Uncaught Exception
caught by jmri.util.exceptionhandler.UncaughtExceptionHandler [main]
[java] java.lang.NoClassDefFoundError:
org/w3c/dom/ElementTraversal
[java] at java.lang.ClassLoader.defineClass1(Native Method)
[java] at
java.lang.ClassLoader.defineClass(ClassLoader.java:763)
[java] at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
[java] at
java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
[java] at
java.net.URLClassLoader.access$100(URLClassLoader.java:73)
[java] at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
[java] at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
[java] at java.security.AccessController.doPrivileged(Native
Method)
[java] at
java.net.URLClassLoader.findClass(URLClassLoader.java:361)
[java] at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
[java] at
sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
[java] at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
[java] at
org.apache.xerces.parsers.AbstractDOMParser.startDocument(Unknown
Source)
[java] at
org.apache.xerces.impl.dtd.XMLDTDValidator.startDocument(Unknown
Source)
[java] at
org.apache.xerces.impl.XMLDocumentScannerImpl.startEntity(Unknown
Source)
[java] at
org.apache.xerces.impl.XMLVersionDetector.startDocumentParsing(Unknown
Source)
[java] at
org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
[java] at
org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
[java] at org.apache.xerces.parsers.XMLParser.parse(Unknown
Source)
[java] at org.apache.xerces.parsers.DOMParser.parse(Unknown
Source)
[java] at
org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
[java] at
sun.util.xml.PlatformXmlPropertiesProvider.getLoadingDoc(PlatformXmlPropertiesProvider.java:106)
[java] at
sun.util.xml.PlatformXmlPropertiesProvider.load(PlatformXmlPropertiesProvider.java:78)
[java] at
java.util.Properties$XmlSupport.load(Properties.java:1201)
[java] at java.util.Properties.loadFromXML(Properties.java:881)
[java] at
jmri.profile.ProfileManager.readActiveProfile(ProfileManager.java:293)
[java] at
jmri.profile.ProfileManager.getStartingProfile(ProfileManager.java:906)
[java] at
jmri.profile.ProfileManagerDialog.getStartingProfile(ProfileManagerDialog.java:318)
[java] at apps.Apps.<init>(Apps.java:185)
[java] at apps.PanelPro.PanelPro.<init>(PanelPro.java:40)
[java] at apps.PanelPro.PanelPro.main(PanelPro.java:120)
[java] Caused by: java.lang.ClassNotFoundException:
org.w3c.dom.ElementTraversal
[java] at
java.net.URLClassLoader.findClass(URLClassLoader.java:381)
[java] at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
[java] at
sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
[java] at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
[java] ... 31 more
DecoderPro differs only at the bottom of the stack:
[java] at
jmri.profile.ProfileManagerDialog.getStartingProfile(ProfileManagerDialog.java:318)
[java] at apps.gui3.Apps3.configureProfile(Apps3.java:335)
[java] at apps.AppsBase.<init>(AppsBase.java:92)
[java] at apps.gui3.Apps3.<init>(Apps3.java:93)
[java] at apps.gui3.dp3.DecoderPro3.<init>(DecoderPro3.java:27)
[java] at apps.gui3.dp3.DecoderPro3.main(DecoderPro3.java:96)
[java] Caused by: java.lang.ClassNotFoundException:
org.w3c.dom.ElementTraversal
[java] at
java.net.URLClassLoader.findClass(URLClassLoader.java:381)
[java] at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
[java] at
sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
[java] at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
[java] ... 33 more
__
What might be the problem? Thanks for any suggestions.
Pete C__
Links:
------
[1] https://jmri-developers.groups.io/g/jmri/message/2093
[2] https://groups.io/mt/34668273/1303822
[3] https://jmri-developers.groups.io/g/jmri/post
[4] https://jmri-developers.groups.io/g/jmri/editsub/1303822
[5] https://jmri-developers.groups.io/g/jmri/leave/defanged

Dave Heap
 

All,

On 17 Oct 2019, at 1:09 PM, Pete Cressman <pete_cressman@...> wrote:

I upgraded to Java 1.8.0_231 and merged from the master.
After a clean build IO get this error upon launching PanelPro or DecoderPro:

java.lang.NoClassDefFoundError: org/w3c/dom/ElementTraversal

In a branch compiled before the above upgrade/merge, I can launch PanelPro or DecoderPro with no errors.

I'm getting a similar error with 'ant decoderpro' on my Mac on my local master up to date with origin master on a clean working tree. Tried Java 1.8.0_211, 1.8.0_221 and 1.8.0_231.

Git Bisect tells me:
27c1a9bed49c5ef8f9fa50a229c41bca7b5d3dd7 is the first bad commit
commit 27c1a9bed49c5ef8f9fa50a229c41bca7b5d3dd7
Author: Randall Wood <randall.h.wood@...>
Date:   Sat Sep 21 10:40:25 2019 -0400

   revert fa110c8a39

   fa110c8a39 demonstrated that there is a problem running Jython 2.7.1 on Windows with JMRI as is. The next step is to figure out what changed between 2.7.0 and 2.7.1 that this only fails on Windows.

:100644 100644 2c49b05d9e8debf6c0bf2f2f5e7347ff3ebfdcf5 25fa05285d2f22b117a0c8178de408769b003509 M    build.xml
:040000 040000 30822ca7c3d90e6ab354d594ec99659bb54f0e27 2cd42e51a12044bf017c66d69706e8f258ac914f M    lib

(Repeated bisect with 'ant real realclean' at each bisect. Same result.)

Typical log:
git status
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean
Trains:jmri heap$ git log -1
commit 293f0e1654f74d3dcc0068ba6472888dee043050 (HEAD -> master, origin/master, origin/HEAD, bisect2)
Merge: 0dd46c9981 cfa1028a24
Author: Paul Bender <paul.bender@...>
Date:   Thu Oct 17 07:33:04 2019 -0700

   Merge pull request #7517 from pabender/master

   Some cleanup.
Trains:jmri heap$ ant realclean
Buildfile: /Users/heap/jmri/build.xml

clean:

clean:

realclean:

BUILD SUCCESSFUL
Total time: 0 seconds
Trains:jmri heap$ ant decoderpro
Buildfile: /Users/heap/jmri/build.xml

init:

copyfiles:
    [copy] Copying 17 files to /Users/heap/jmri/target/classes/resources
    [copy] Copying 1721 files to /Users/heap/jmri/target/classes

jjtree:

javacc:

update-template-code:
    [copy] Copying 1 file to /Users/heap/jmri/java/tmp

compile-generated-source:
   [javac] Compiling 134 source files to /Users/heap/jmri/target/classes
   [javac] warning: Supported source version 'RELEASE_7' from annotation processor 'org.netbeans.modules.openide.util.ServiceProviderProcessor' less than -source '1.8'
   [javac] warning: Supported source version 'RELEASE_7' from annotation processor 'org.netbeans.modules.openide.util.NamedServiceProcessor' less than -source '1.8'
   [javac] 2 warnings
    [copy] Copying 1 file to /Users/heap/jmri/target/classes/jmri

compile:
   [javac] Compiling 4405 source files to /Users/heap/jmri/target/classes
   [javac] warning: Supported source version 'RELEASE_7' from annotation processor 'org.netbeans.modules.openide.util.ServiceProviderProcessor' less than -source '1.8'
   [javac] warning: Supported source version 'RELEASE_7' from annotation processor 'org.netbeans.modules.openide.util.NamedServiceProcessor' less than -source '1.8'
   [javac] 2 warnings

debug:

decoderpro:

runtime-library-selection:
    [echo] arch.lib.path /Users/heap/jmri/lib/macosx/x86_64:/Users/heap/jmri/lib/macosx

-normal-jmri-application:
    [echo] Launch normally (no debugger support)
    [java] 2019-10-18 21:26:49,049 util.Log4JUtil                        INFO  - ****** JMRI log ******* [main]
    [java] 2019-10-18 21:26:50,808 util.Log4JUtil                        INFO  - This log is appended to file: /Users/heap/Library/Preferences/JMRI/log/messages.log [main]
    [java] 2019-10-18 21:26:50,810 util.Log4JUtil                        INFO  - This log is stored in file: /Users/heap/Library/Preferences/JMRI/log/session.log [main]
    [java] 2019-10-18 21:26:50,821 apps.AppsBase                         INFO  - DecoderPro version 4.17.5ish+heap+20191018T1024Z+R293f0e1654 starts under Java 1.8.0_231 on Mac OS X x86_64 v10.10.5 at Fri Oct 18 21:26:50 AEDT 2019 [main]
    [java] 2019-10-18 21:26:51,478 ptionhandler.UncaughtExceptionHandler ERROR - Uncaught Exception caught by jmri.util.exceptionhandler.UncaughtExceptionHandler [main]
    [java] java.lang.NoClassDefFoundError: org/w3c/dom/ElementTraversal
    [java]    at java.lang.ClassLoader.defineClass1(Native Method)
    [java]    at java.lang.ClassLoader.defineClass(ClassLoader.java:756)
    [java]    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    [java]    at java.net.URLClassLoader.defineClass(URLClassLoader.java:468)
    [java]    at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
    [java]    at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
    [java]    at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
    [java]    at java.security.AccessController.doPrivileged(Native Method)
    [java]    at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
    [java]    at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
    [java]    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355)
    [java]    at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
    [java]    at org.apache.xerces.parsers.AbstractDOMParser.startDocument(Unknown Source)
    [java]    at org.apache.xerces.impl.dtd.XMLDTDValidator.startDocument(Unknown Source)
    [java]    at org.apache.xerces.impl.XMLDocumentScannerImpl.startEntity(Unknown Source)
    [java]    at org.apache.xerces.impl.XMLVersionDetector.startDocumentParsing(Unknown Source)
    [java]    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    [java]    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    [java]    at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
    [java]    at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
    [java]    at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
    [java]    at sun.util.xml.PlatformXmlPropertiesProvider.getLoadingDoc(PlatformXmlPropertiesProvider.java:106)
    [java]    at sun.util.xml.PlatformXmlPropertiesProvider.load(PlatformXmlPropertiesProvider.java:78)
    [java]    at java.util.Properties$XmlSupport.load(Properties.java:1201)
    [java]    at java.util.Properties.loadFromXML(Properties.java:881)
    [java]    at jmri.profile.ProfileManager.readActiveProfile(ProfileManager.java:293)
    [java]    at jmri.profile.ProfileManager.getStartingProfile(ProfileManager.java:906)
    [java]    at jmri.profile.ProfileManagerDialog.getStartingProfile(ProfileManagerDialog.java:318)
    [java]    at apps.gui3.Apps3.configureProfile(Apps3.java:335)
    [java]    at apps.AppsBase.<init>(AppsBase.java:92)
    [java]    at apps.gui3.Apps3.<init>(Apps3.java:93)
    [java]    at apps.gui3.dp3.DecoderPro3.<init>(DecoderPro3.java:27)
    [java]    at apps.gui3.dp3.DecoderPro3.main(DecoderPro3.java:96)
    [java] Caused by: java.lang.ClassNotFoundException: org.w3c.dom.ElementTraversal
    [java]    at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
    [java]    at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
    [java]    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355)
    [java]    at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
    [java]    ... 33 more
    [java] Java Result: 126

-debug-jmri-application:

-run-jmri-application:
    [echo] apps.gui3.dp3.DecoderPro3 finished with return code 126

-relaunch-jmri-application:

BUILD SUCCESSFUL
Total time: 2 minutes 9 seconds



Dave in Australia

Randall Wood
 

If `git bisect` is getting you to a commit where Jython 2.7.0 is replaced with Jython 2.7.1, please try replacing Jython 2.7.1 with 2.7.0 and see if that works (running from HEAD of master). If that does work, it suggests that Jython 2.7.0 included some code that we relied on that wasn’t expected.

From HEAD of master, I’m not able to reproduce these errors with JDK 11.0.4, but am able to reproduce them with JDK 1.8.0_222 (both AdoptOpenJDK on macOS 10.15).

Note however, that the problem is in Java itself, not in the JMRI code:
    [java]    at java.util.Properties.loadFromXML(Properties.java:881)
    [java]    at jmri.profile.ProfileManager.readActiveProfile(ProfileManager.java:293)

since the XML parsing code is called by java.util.Properties.loadFromXML (https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html#loadFromXML-java.io.InputStream-)

(Unless we are (or are not) doing something to trigger a specific XML implementation that I’m not aware of, but should be.)

On Oct 18, 2019, at 6:32 AM, Dave Heap <dgheap@...> wrote:

All,

On 17 Oct 2019, at 1:09 PM, Pete Cressman <pete_cressman@...> wrote:

I upgraded to Java 1.8.0_231 and merged from the master.
After a clean build IO get this error upon launching PanelPro or DecoderPro:

java.lang.NoClassDefFoundError: org/w3c/dom/ElementTraversal

In a branch compiled before the above upgrade/merge, I can launch PanelPro or DecoderPro with no errors.

I'm getting a similar error with 'ant decoderpro' on my Mac on my local master up to date with origin master on a clean working tree. Tried Java 1.8.0_211, 1.8.0_221 and 1.8.0_231.

Git Bisect tells me:
27c1a9bed49c5ef8f9fa50a229c41bca7b5d3dd7 is the first bad commit
commit 27c1a9bed49c5ef8f9fa50a229c41bca7b5d3dd7
Author: Randall Wood <randall.h.wood@...>
Date:   Sat Sep 21 10:40:25 2019 -0400

   revert fa110c8a39

   fa110c8a39 demonstrated that there is a problem running Jython 2.7.1 on Windows with JMRI as is. The next step is to figure out what changed between 2.7.0 and 2.7.1 that this only fails on Windows.

:100644 100644 2c49b05d9e8debf6c0bf2f2f5e7347ff3ebfdcf5 25fa05285d2f22b117a0c8178de408769b003509 M    build.xml
:040000 040000 30822ca7c3d90e6ab354d594ec99659bb54f0e27 2cd42e51a12044bf017c66d69706e8f258ac914f M    lib

(Repeated bisect with 'ant real realclean' at each bisect. Same result.)

Typical log:
git status
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean
Trains:jmri heap$ git log -1
commit 293f0e1654f74d3dcc0068ba6472888dee043050 (HEAD -> master, origin/master, origin/HEAD, bisect2)
Merge: 0dd46c9981 cfa1028a24
Author: Paul Bender <paul.bender@...>
Date:   Thu Oct 17 07:33:04 2019 -0700

   Merge pull request #7517 from pabender/master

   Some cleanup.
Trains:jmri heap$ ant realclean
Buildfile: /Users/heap/jmri/build.xml

clean:

clean:

realclean:

BUILD SUCCESSFUL
Total time: 0 seconds
Trains:jmri heap$ ant decoderpro
Buildfile: /Users/heap/jmri/build.xml

init:

copyfiles:
    [copy] Copying 17 files to /Users/heap/jmri/target/classes/resources
    [copy] Copying 1721 files to /Users/heap/jmri/target/classes

jjtree:

javacc:

update-template-code:
    [copy] Copying 1 file to /Users/heap/jmri/java/tmp

compile-generated-source:
   [javac] Compiling 134 source files to /Users/heap/jmri/target/classes
   [javac] warning: Supported source version 'RELEASE_7' from annotation processor 'org.netbeans.modules.openide.util.ServiceProviderProcessor' less than -source '1.8'
   [javac] warning: Supported source version 'RELEASE_7' from annotation processor 'org.netbeans.modules.openide.util.NamedServiceProcessor' less than -source '1.8'
   [javac] 2 warnings
    [copy] Copying 1 file to /Users/heap/jmri/target/classes/jmri

compile:
   [javac] Compiling 4405 source files to /Users/heap/jmri/target/classes
   [javac] warning: Supported source version 'RELEASE_7' from annotation processor 'org.netbeans.modules.openide.util.ServiceProviderProcessor' less than -source '1.8'
   [javac] warning: Supported source version 'RELEASE_7' from annotation processor 'org.netbeans.modules.openide.util.NamedServiceProcessor' less than -source '1.8'
   [javac] 2 warnings

debug:

decoderpro:

runtime-library-selection:
    [echo] arch.lib.path /Users/heap/jmri/lib/macosx/x86_64:/Users/heap/jmri/lib/macosx

-normal-jmri-application:
    [echo] Launch normally (no debugger support)
    [java] 2019-10-18 21:26:49,049 util.Log4JUtil                        INFO  - ****** JMRI log ******* [main]
    [java] 2019-10-18 21:26:50,808 util.Log4JUtil                        INFO  - This log is appended to file: /Users/heap/Library/Preferences/JMRI/log/messages.log [main]
    [java] 2019-10-18 21:26:50,810 util.Log4JUtil                        INFO  - This log is stored in file: /Users/heap/Library/Preferences/JMRI/log/session.log [main]
    [java] 2019-10-18 21:26:50,821 apps.AppsBase                         INFO  - DecoderPro version 4.17.5ish+heap+20191018T1024Z+R293f0e1654 starts under Java 1.8.0_231 on Mac OS X x86_64 v10.10.5 at Fri Oct 18 21:26:50 AEDT 2019 [main]
    [java] 2019-10-18 21:26:51,478 ptionhandler.UncaughtExceptionHandler ERROR - Uncaught Exception caught by jmri.util.exceptionhandler.UncaughtExceptionHandler [main]
    [java] java.lang.NoClassDefFoundError: org/w3c/dom/ElementTraversal
    [java]    at java.lang.ClassLoader.defineClass1(Native Method)
    [java]    at java.lang.ClassLoader.defineClass(ClassLoader.java:756)
    [java]    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    [java]    at java.net.URLClassLoader.defineClass(URLClassLoader.java:468)
    [java]    at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
    [java]    at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
    [java]    at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
    [java]    at java.security.AccessController.doPrivileged(Native Method)
    [java]    at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
    [java]    at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
    [java]    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355)
    [java]    at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
    [java]    at org.apache.xerces.parsers.AbstractDOMParser.startDocument(Unknown Source)
    [java]    at org.apache.xerces.impl.dtd.XMLDTDValidator.startDocument(Unknown Source)
    [java]    at org.apache.xerces.impl.XMLDocumentScannerImpl.startEntity(Unknown Source)
    [java]    at org.apache.xerces.impl.XMLVersionDetector.startDocumentParsing(Unknown Source)
    [java]    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    [java]    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    [java]    at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
    [java]    at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
    [java]    at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
    [java]    at sun.util.xml.PlatformXmlPropertiesProvider.getLoadingDoc(PlatformXmlPropertiesProvider.java:106)
    [java]    at sun.util.xml.PlatformXmlPropertiesProvider.load(PlatformXmlPropertiesProvider.java:78)
    [java]    at java.util.Properties$XmlSupport.load(Properties.java:1201)
    [java]    at java.util.Properties.loadFromXML(Properties.java:881)
    [java]    at jmri.profile.ProfileManager.readActiveProfile(ProfileManager.java:293)
    [java]    at jmri.profile.ProfileManager.getStartingProfile(ProfileManager.java:906)
    [java]    at jmri.profile.ProfileManagerDialog.getStartingProfile(ProfileManagerDialog.java:318)
    [java]    at apps.gui3.Apps3.configureProfile(Apps3.java:335)
    [java]    at apps.AppsBase.<init>(AppsBase.java:92)
    [java]    at apps.gui3.Apps3.<init>(Apps3.java:93)
    [java]    at apps.gui3.dp3.DecoderPro3.<init>(DecoderPro3.java:27)
    [java]    at apps.gui3.dp3.DecoderPro3.main(DecoderPro3.java:96)
    [java] Caused by: java.lang.ClassNotFoundException: org.w3c.dom.ElementTraversal
    [java]    at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
    [java]    at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
    [java]    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355)
    [java]    at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
    [java]    ... 33 more
    [java] Java Result: 126

-debug-jmri-application:

-run-jmri-application:
    [echo] apps.gui3.dp3.DecoderPro3 finished with return code 126

-relaunch-jmri-application:

BUILD SUCCESSFUL
Total time: 2 minutes 9 seconds



Dave in Australia

Svata Dedic
 

Please check if Thread.currentThread().getContextClassLoader() does not return something weird (at the time the XML gets parsed), e.g. some leftovers from Jython execution.
Under normal circumstances (no classloader games) the returned value should be null, or the application's classloader.

-Svata

Dne 18. 10. 19 v 14:00 Randall Wood via Groups.Io napsal(a):

since the XML parsing code is called by java.util.Properties.loadFromXML (https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html#loadFromXML-java.io.InputStream-)
(Unless we are (or are not) doing something to trigger a specific XML implementation that I’m not aware of, but should be.)

Randall Wood
 

At the point of the failure, the application hasn’t loaded it’s own preferences to trigger any scripts, and no Jython process has been executed.

Randall

On Oct 18, 2019, at 08:08, Svata Dedic <svatopluk.dedic@...> wrote:

Please check if Thread.currentThread().getContextClassLoader() does not return something weird (at the time the XML gets parsed), e.g. some leftovers from Jython execution.
Under normal circumstances (no classloader games) the returned value should be null, or the application's classloader.

-Svata

Dne 18. 10. 19 v 14:00 Randall Wood via Groups.Io napsal(a):
since the XML parsing code is called by java.util.Properties.loadFromXML (https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html#loadFromXML-java.io.InputStream-)
(Unless we are (or are not) doing something to trigger a specific XML implementation that I’m not aware of, but should be.)

Steve_G
 

Randall, Pete
I had this error this morning after building from master. I switched java to 11 and it went away.
javac was 11. I had not switched java back to 11 after helping a user to debug a problem.
Dont know if a difference between javac and java versions was the root of the problem or not.
Steve G.

Steve_G
 

Randall, Pete
If I compile and run with 1.8 I get the error. Compile with 1.8, run under 11 no error.
Steve G..

Klaus Killinger
 

I had this error today on Windows 7 after a "git pull" from master. Running jdk1.8.0_144. Then I replaced Jython 2.7.1 with Jython 2.7.0 and the error went away.

Klaus

Bob Jacobsen
 

That’s interesting.

Jenkins is running “compile on 11, run alltest on 8” successfully.

Would it make sense to try building a test release with Java 11 as an experiment?

Bob

On Oct 18, 2019, at 6:31 AM, Steve_G <RailRodder@...> wrote:

Randall, Pete
If I compile and run with 1.8 I get the error. Compile with 1.8, run under 11 no error.
Steve G..
--
Bob Jacobsen
@BobJacobsen

Randall Wood
 

I think I need to go through the set of Java 1.8 versions to see if some change in some release of Java 1.8 caused this. It appears (from reading release notes) that Java 1.8 > update 201 selects the XML parser differently than older updates than that.

I also thought the call in question was covered by a test, but I see it isn’t (because the load apps tests specify the profile to use) so that test needs to be added as well.

Randall

On Oct 18, 2019, at 09:47, Bob Jacobsen <@BobJacobsen> wrote:

That’s interesting.

Jenkins is running “compile on 11, run alltest on 8” successfully.

Would it make sense to try building a test release with Java 11 as an experiment?

Bob

On Oct 18, 2019, at 6:31 AM, Steve_G <RailRodder@...> wrote:

Randall, Pete
If I compile and run with 1.8 I get the error. Compile with 1.8, run under 11 no error.
Steve G..
--
Bob Jacobsen
@BobJacobsen





Bob Jacobsen
 

Here’s what I think we know so far:

Dave Heap reports it not working on his Mac v10.10.5 build and run with 1.8.0_211, 1.8.0_221 and 1.8.0_231

My Mac v10.14.6 build and run with 1.8.0_151 fails; build and run with 11+28 succeeds; build with 11+28 run with 8u151 fails.

Randall's Mac 10.15 fine with JDK 11.0.4, fails with JDK 1.8.0_222

Steve G (WIndows?) compile on 1.8(u number unknown), run under 11 no error; compile and run on 1.8 fails

Klaus on Windows 7 fails with 1.8.0_151 (succeeds when Jython 2.7.0 reinstalled)

Bob
--
Bob Jacobsen
@BobJacobsen

Svata Dedic
 

Finally not in the office, so I can work on free projects ...

Apologies for the contextClassLoader() misleading hint; I don't know Xerces 2.11 peculiarities since we still use ancient 2.8.0 in NetBeans and for newer projects basic JAXP in JDK was sufficient ...

It seems that JMRI is missing xml-apis library JAR. Xerces started to implement ElementTraversal (https://www.w3.org/TR/ElementTraversal/) in its version 2.11.
Those classes were for some reason shipped with Jython 2.7.0; when it was replaced for Jython 2.7.1, which still contains some version of Xerces, but seems repackaged to org.python.*

When I added xml-apis.jar to JMRI's runtime classpath, it started on JDK8.

ElementTraversal API is part of JDK 9 and later, that's why it works on JDK11.

-Svata

Dne 18. 10. 19 v 17:03 Randall Wood via Groups.Io napsal(a):

I think I need to go through the set of Java 1.8 versions to see if some change in some release of Java 1.8 caused this. It appears (from reading release notes) that Java 1.8 > update 201 selects the XML parser differently than older updates than that.
I also thought the call in question was covered by a test, but I see it isn’t (because the load apps tests specify the profile to use) so that test needs to be added as well.
Randall
On Oct 18, 2019, at 09:47, Bob Jacobsen <@BobJacobsen> wrote:

That’s interesting.

Jenkins is running “compile on 11, run alltest on 8” successfully.

Would it make sense to try building a test release with Java 11 as an experiment?

Bob

On Oct 18, 2019, at 6:31 AM, Steve_G <RailRodder@...> wrote:

Randall, Pete
If I compile and run with 1.8 I get the error. Compile with 1.8, run under 11 no error.
Steve G..
--
Bob Jacobsen
@BobJacobsen





Klaus Killinger
 

Jython 2.7.1 now works for me under Windows 7 and jdk1.8.0_144.
I followed the hints of Svata and Daniel, picked xml-apis-1.4.01.jar and added the path in build.xml under runtime.class.path.

Klaus

Steve_G
 

Hi Bob
I am using Linux 5.3.6-200.fc30.x86_64,
java-1.8.0-openjdk-1.8.0.222.b10-0.fc30.x86_64 /
java-11-openjdk-11.0.4.11-0.fc30.x86_64
Steve G

---------- Original Message ----------java-1.8.0-openjdk.x86_64
From: Bob Jacobsen <@BobJacobsen>
Date: October 18, 2019 at 12:24 PM


Here’s what I think we know so far:

Dave Heap reports it not working on his Mac v10.10.5 build and run with
1.8.0_211, 1.8.0_221 and 1.8.0_231

My Mac v10.14.6 build and run with 1.8.0_151 fails; build and run with 11+28
succeeds; build with 11+28 run with 8u151 fails.

Randall's Mac 10.15 fine with JDK 11.0.4, fails with JDK 1.8.0_222

Steve G (WIndows?) compile on 1.8(u number unknown), run under 11 no error;
compile and run on 1.8 fails

Klaus on Windows 7 fails with 1.8.0_151 (succeeds when Jython 2.7.0
reinstalled)

Bob
--
Bob Jacobsen
@BobJacobsen





Dave Heap
 

Tried bisect again on a different Mac with different start points,

On 18 Oct 2019, at 9:32 PM, Dave Heap via Groups.Io <dgheap@...> wrote:

I'm getting a similar error with 'ant decoderpro' on my Mac on my local master up to date with origin master on a clean working tree. Tried Java 1.8.0_211, 1.8.0_221 and 1.8.0_231.

Git Bisect tells me:
27c1a9bed49c5ef8f9fa50a229c41bca7b5d3dd7 is the first bad commit
commit 27c1a9bed49c5ef8f9fa50a229c41bca7b5d3dd7
Author: Randall Wood <randall.h.wood@...>
Date:   Sat Sep 21 10:40:25 2019 -0400

  revert fa110c8a39

  fa110c8a39 demonstrated that there is a problem running Jython 2.7.1 on Windows with JMRI as is. The next step is to figure out what changed between 2.7.0 and 2.7.1 that this only fails on Windows.

:100644 100644 2c49b05d9e8debf6c0bf2f2f5e7347ff3ebfdcf5 25fa05285d2f22b117a0c8178de408769b003509 M    build.xml
:040000 040000 30822ca7c3d90e6ab354d594ec99659bb54f0e27 2cd42e51a12044bf017c66d69706e8f258ac914f M    lib

  DecoderPro version 4.17.5ish+heap+20191019T0319Z+R27c1a9bed4 starts under Java 1.8.0_221 on Mac OS X x86_64 v10.12.6 at Sat Oct 19 14:19:13 AEDT 2019 [main]

27c1a9bed49c5ef8f9fa50a229c41bca7b5d3dd7 is the first bad commit
commit 27c1a9bed49c5ef8f9fa50a229c41bca7b5d3dd7
Author: Randall Wood <randall.h.wood@...>
Date:   Sat Sep 21 10:40:25 2019 -0400

   revert fa110c8a39

   fa110c8a39 demonstrated that there is a problem running Jython 2.7.1 on Windows with JMRI as is. The next step is to figure out what changed between 2.7.0 and 2.7.1 that this only fails on Windows.

build.xml                       |   2 +-
lib/jython-standalone-2.7.0.jar | Bin 37021723 -> 0 bytes
2 files changed, 1 insertion(+), 1 deletion(-)
delete mode 100644 lib/jython-standalone-2.7.0.jar

Same commit, rendered slightly differently.

Do you still want me to try this:
On 18 Oct 2019, at 11:00 PM, Randall Wood via Groups.Io <rhwood@...> wrote:

If `git bisect` is getting you to a commit where Jython 2.7.0 is replaced with Jython 2.7.1, please try replacing Jython 2.7.1 with 2.7.0 and see if that works (running from HEAD of master). If that does work, it suggests that Jython 2.7.0 included some code that we relied on that wasn’t expected.

If so, I assume that means:
- Edit build.xml.
- Delete the Jython 2.7.1 jar.
- Reinstate the Jython 2.7.0 jar (what is best way to do this with correct permissions etc.)?

Dave

Randall Wood
 

This is fixed in https://github.com/JMRI/JMRI/pull/7526

The problem is that in 2.7.1 Jython stopped shipping a library that apparently caused class loading conflicts in Java 9, but apparently we relied on earlier versions of Jython to provide for us.

On Oct 18, 2019, at 11:44 PM, Dave Heap <dgheap@...> wrote:

Tried bisect again on a different Mac with different start points,

On 18 Oct 2019, at 9:32 PM, Dave Heap via Groups.Io <dgheap@...> wrote:

I'm getting a similar error with 'ant decoderpro' on my Mac on my local master up to date with origin master on a clean working tree. Tried Java 1.8.0_211, 1.8.0_221 and 1.8.0_231.

Git Bisect tells me:
27c1a9bed49c5ef8f9fa50a229c41bca7b5d3dd7 is the first bad commit
commit 27c1a9bed49c5ef8f9fa50a229c41bca7b5d3dd7
Author: Randall Wood <randall.h.wood@...>
Date:   Sat Sep 21 10:40:25 2019 -0400

  revert fa110c8a39

  fa110c8a39 demonstrated that there is a problem running Jython 2.7.1 on Windows with JMRI as is. The next step is to figure out what changed between 2.7.0 and 2.7.1 that this only fails on Windows.

:100644 100644 2c49b05d9e8debf6c0bf2f2f5e7347ff3ebfdcf5 25fa05285d2f22b117a0c8178de408769b003509 M    build.xml
:040000 040000 30822ca7c3d90e6ab354d594ec99659bb54f0e27 2cd42e51a12044bf017c66d69706e8f258ac914f M    lib

  DecoderPro version 4.17.5ish+heap+20191019T0319Z+R27c1a9bed4 starts under Java 1.8.0_221 on Mac OS X x86_64 v10.12.6 at Sat Oct 19 14:19:13 AEDT 2019 [main]

27c1a9bed49c5ef8f9fa50a229c41bca7b5d3dd7 is the first bad commit
commit 27c1a9bed49c5ef8f9fa50a229c41bca7b5d3dd7
Author: Randall Wood <randall.h.wood@...>
Date:   Sat Sep 21 10:40:25 2019 -0400

   revert fa110c8a39

   fa110c8a39 demonstrated that there is a problem running Jython 2.7.1 on Windows with JMRI as is. The next step is to figure out what changed between 2.7.0 and 2.7.1 that this only fails on Windows.

build.xml                       |   2 +-
lib/jython-standalone-2.7.0.jar | Bin 37021723 -> 0 bytes
2 files changed, 1 insertion(+), 1 deletion(-)
delete mode 100644 lib/jython-standalone-2.7.0.jar

Same commit, rendered slightly differently.

Do you still want me to try this:
On 18 Oct 2019, at 11:00 PM, Randall Wood via Groups.Io <rhwood@...> wrote:

If `git bisect` is getting you to a commit where Jython 2.7.0 is replaced with Jython 2.7.1, please try replacing Jython 2.7.1 with 2.7.0 and see if that works (running from HEAD of master). If that does work, it suggests that Jython 2.7.0 included some code that we relied on that wasn’t expected.

If so, I assume that means:
- Edit build.xml.
- Delete the Jython 2.7.1 jar.
- Reinstate the Jython 2.7.0 jar (what is best way to do this with correct permissions etc.)?

Dave