¿ªÔÆÌåÓý

Locked CATS opens but not Designer #cats


 

Hi,
I have a working JMRI system and have copied the CATS files into c:\program files (x86)\jmri. ? I have also placed log4j.jar into the same directory.
Both 32 & 64 bit versions of java have been installed and I have tried configuring designer.bat to use either version (not at the same time).? Using java 8 update 241.

I am able to open CAT using cats.bat but I get the following error when starting designer. ? I'm starting this from the directory itself rather than from an icon on the desktop.? I have checked the cats and designer documents but may have missed something. ? If anyone could assist, it would be appreciated.? Thank you

C:\Program Files (x86)\JMRI>designer
C:\Program Files (x86)\JMRI>java -Djava.ext.dirs=lib -Dsun.java2d.noddraw -cp designer.jar designer.gui.Ctc
Exception in thread "main" java.lang.NoClassDefFoundError: org/jdom/Content
??????? at designer.gui.Ctc.<init>(Ctc.java:151)
??????? at designer.gui.Ctc.main(Ctc.java:439)
Caused by: java.lang.ClassNotFoundException: org.jdom.Content
??????? at java.net.URLClassLoader.findClass(Unknown Source)
??????? at java.lang.ClassLoader.loadClass(Unknown Source)
??????? at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
??????? at java.lang.ClassLoader.loadClass(Unknown Source)
??????? ... 2 more
C:\Program Files (x86)\JMRI>"C:\Program Files (x86)\JMRI\LaunchJMRI.exe" designer.gui.Ctc
C:\Program Files (x86)\JMRI>

Designer.bat file

:: This bat file has 5 different commands for launching designer.? Only those without
:: the comment annotation (::) will be executed.? To select one, edit out the
:: comment annotation (::) and add it to any lines without it.
:: Use the following line if Windows knows about Java
java -Djava.ext.dirs=lib -Dsun.java2d.noddraw -cp designer.jar designer.gui.Ctc
:: Use the following line if Windows does not know about Java and it is Java 8
:: on a 32 bit Windows system
:: "C:\Program Files (x86)\Java\jre1.8.0_241\bin\java.exe" -Djava.ext.dirs=lib -Dsun.java2d.noddraw -cp designer.jar designer.gui.Ctc
:: Use the following line if Windows does not know about Java and it is Java 8
:: on a 64 bit Windows system
:: "C:\Program Files\Java\jre1.8.0_241\bin\java.exe" -Djava.ext.dirs=lib -Dsun.java2d.noddraw -cp designer.jar designer.gui.Ctc
:: This works for Windows 32 bit
"C:\Program Files (x86)\JMRI\LaunchJMRI.exe" designer.gui.Ctc
:: This works for Windows 64 bit
:: "C:\Program Files\JMRI\LaunchJMRI.exe" designer.gui.Ctc

Regards

Scott Rose



 

This probably indicates one or more .jar file that Designer needs is missing.

There are several versions of the JDOM tool. JMRI currently uses version 2, but it used to use version 1. This looks like Designer is looking for version 1.

The current file is lib/jdom2-2.0.6.jar

Designer might be looking for lib/jdom.jar

If that¡¯s the case, you can find a copy on this page:

Bob



On Feb 6, 2020, at 9:52 PM, scott.rose@... wrote:

C:\Program Files (x86)\JMRI>designer
C:\Program Files (x86)\JMRI>java -Djava.ext.dirs=lib -Dsun.java2d.noddraw -cp designer.jar designer.gui.Ctc
Exception in thread "main" java.lang.NoClassDefFoundError: org/jdom/Content
at designer.gui.Ctc.<init>(Ctc.java:151)
at designer.gui.Ctc.main(Ctc.java:439)
Caused by: java.lang.ClassNotFoundException: org.jdom.Content
--
Bob Jacobsen
rgj1927@...


 

Scott,

What version of Windows are you using?? It should not matter (because designer does not use JMRI), but what version of JMRI are you using?

designer needs only 2 libraries outside of the standard Java libraries - jdom and log4j.? It appears that Java is not finding the jdom libraries, which exist because JMRI runs.? I have seen this a few times and don't know the cause.? On a Windows 7 Pro system, I got around the problem by creating a folder and added the designer .jar, .bat, and a sub-folder, named lib, containing the jdom and log4j .jar files from the JMRI lib folder.? I eventually expanded the jdom file by renaming it .zip and extracted the contents (via a right click and extract).? That worked.? I don't know the root cause, but I suspect it had something to do with the Windows settings on the files or folders - perhaps permissions.

The .bat file that you posted tries to run designer twice - once by invoking Java directly and the second by going through the JMRI launcher, using designer.jar as the main file.? Since JMRI runs, the latter should also run, except it may not get the chance because the first failed.? Be sure you have commented out the first with the ::.

Rodney


 

Thank you Bob, Just what the Doctor ordered.

Have copied the jdom.jar to jmri/lib and everything works perfectly.

Regards

Scott Rose


 

Hi Rodney,

I'm using Windows 10 and JMRI 4.19.2.? The issue has been resolved by Bobs suggestion above of copying the jdom.jar file to jmri/lb.

Thanks for your response.

Regards

Scott Rose


Randall Wood
 

Note that Bob¡¯s suggested fix will need to be redone every time you upgrade JMRI. A better fix may be to keep jdom.jar outside of lib and add ¡®--cp:p=¡°C:\path\to\jdom.jar¡±¡¯ to the launcher for Designer since this will survive upgrades of JMRI. See for more information on that.