2

I just moved my Codenameone Project within Eclipse to a new MacBook. When I start the simulator now there is an error shown in the console of eclipse. As a result, new installed skins will not be stored and are gone at the next start of the simulator.

Here is the stack trace of the error. Do you have any idea, what the reason could be? Maybe there are some pathes stored that don't match on the new MacBook?

java.util.prefs.BackingStoreException: Synchronization failed for node '/com/codename1/impl/javase/'
    at java.util.prefs.MacOSXPreferences.flush(MacOSXPreferences.java:226)
    at com.codename1.impl.javase.JavaSEPort.addSkinName(JavaSEPort.java:3425)
    at com.codename1.impl.javase.JavaSEPort.loadSkinFile(JavaSEPort.java:3517)
    at com.codename1.impl.javase.JavaSEPort.init(JavaSEPort.java:3673)
    at com.codename1.impl.CodenameOneImplementation.initImpl(CodenameOneImplementation.java:169)
    at com.codename1.ui.Display.init(Display.java:478)
    at com.codename1.impl.javase.Executor$1.run(Executor.java:112)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:749)
    at java.awt.EventQueue.access$500(EventQueue.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:702)
    at java.awt.EventQueue$3.run(EventQueue.java:696)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:719)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Klaus Heywinkel
  • 509
  • 3
  • 9

1 Answers1

0

This is an exception from the Java SE preferences API see this Where are Java preferences stored on Mac OS X?

Check that the user on Mac OS has the permissions to access that folder and that the Java SE process has such permissions too. Notice we use user nodes which should always work and never store to system nodes.

Shai Almog
  • 51,749
  • 5
  • 35
  • 65
  • Thanks for your reply :-) This is strange: My User has full access to the directory ~/Library/Preferences/. There is a file named com.codename1.impl.plist, where the skins seems to be stored. But when starting the simulator it searches for the node com.codename1.impl.javase - and there is no file named like this. Even if I run the simulator and load a new skin, the exception is thrown. The file com.codename1.impl.plist is not updated. Do you have any further idea? – Klaus Heywinkel Nov 03 '17 at 09:16
  • I'm not sure. The JavaSE preferences API is horribly broken in multiple OS's and we're looking at throwing it away in the long run but right now I would just suggest trying to create that file manually to verify permissions and maybe trying to use the Preferences API from a Java SE test case. Also make sure this isn't JVM specific so try to check which VM version is running if you have multiple versions installed – Shai Almog Nov 04 '17 at 05:26
  • After several trials - all without effect - I went another way: I reseted my new MacBook and migrated my Data from a TimeMachine Backup in a different way as I did the first time. Now everything works. As one of the non-successfull trials before I deinstalled eclipse and java, removed all hidden directories which can be identified to be part of eclipse, installed java and eclipse again with an new User-account -> no effect :-( – Klaus Heywinkel Nov 05 '17 at 14:33
  • Do you have an older version of the JDK? It seems that this was fixed in later updates of JDK 8 http://bugs.java.com/bugdatabase/view_bug.do?bug_id=7184287 – Shai Almog Nov 06 '17 at 05:07
  • No - I used the current Version of Java 8 (1.8.0 - 151) – Klaus Heywinkel Nov 07 '17 at 05:32
  • Are you sure that's what was picked up? Do you have more than one JDK installed? Notice that Eclipse might be running on a different JVM from the system JVM etc. – Shai Almog Nov 07 '17 at 06:36
  • I‘m not sure: I only installed the JRE 1.8.0 - but maybe there is a different JRE installed by default from Apple (coming with a fresh OS-X installation). – Klaus Heywinkel Nov 08 '17 at 16:30
  • You can open the eclipse ini file and point at a specific JVM see https://wiki.eclipse.org/Eclipse.ini In the command line you should be able to find the path to the JVM's e.g. mine is here `/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home` and it should be a pretty standard path. `java -version` will tell you which is the current VM – Shai Almog Nov 09 '17 at 05:23
  • Another mysterium ... With java - version I get the following: Java(TM) SE Runtime Environment (build 1.8.0_40-b27). But I installed Java 1.8.0 - 151. The Java-Version-Check on the homepage of Oracle confirms the 151. In the path /Library/Java/JavaVirtualMachines/ there is only the JDK 1.8.0_40 installed. I ask myself, where the update to 151 is stored. Very confusing. – Klaus Heywinkel Nov 12 '17 at 11:13
  • Mac OS is very problematic in its treatment of Java it tries to be "clever" but it's really a huge problem. I recently had to uninstall Java 9 because it just kept disrupting all the Java apps I have installed. I would guess something broke with the JDK install process, maybe you have two drives on the machine and it's stored in one of them? – Shai Almog Nov 13 '17 at 05:02
  • No - unfortunately not. I have only one drive ... But as described above: At the moment I cannot reproduce the problem any more after re-installing the MacBook with a TimeMachine Backup. – Klaus Heywinkel Nov 16 '17 at 08:35
  • If it no longer happens I'll chalk this up to a fluke. I don't see something we can fix here – Shai Almog Nov 17 '17 at 05:11
  • Yes - not at the moment. Thnks for your tipps and help! – Klaus Heywinkel Nov 20 '17 at 13:21