java.lang.NullPointerException opening resource file

47 views
Skip to first unread message

itb....@gmail.com

unread,
Jan 15, 2017, 9:14:24 AM1/15/17
to CodenameOne Discussions
I am trying to create a proof of concept using codenameone. After I added a resource bundle under "Localization", the resource file became completely unusable.

Error messages are:

$ java
-jar c:/Users/smoky/.codenameone/designer_1.jar
2017-01-15 14:56:52.769:INFO:oejs.Server:jetty-8.0.y.z-SNAPSHOT
2017-01-15 14:56:52.831:INFO:oejs.AbstractConnector:Started SelectChannelConnector@0.0.0.0:9000 STARTING
Jan 15, 2017 2:56:52 PM org.jdesktop.application.LocalStorage getId
WARNUNG
: unspecified resource Application.id using ResourceEditorApp
Jan 15, 2017 2:56:52 PM org.jdesktop.application.LocalStorage getId
WARNUNG
: unspecified resource Application.vendorId using UnknownApplicationVendor

java
.lang.NullPointerException
 at com
.codename1.ui.util.EditableResources.openFileWithXMLSupport(EditableResources.java:539)
 at com
.codename1.designer.ResourceEditorView$LoadResourceFileAction.exectute(ResourceEditorView.java:4168)
 at com
.codename1.ui.resource.util.BlockingAction.run(BlockingAction.java:88)
 at java
.lang.Thread.run(Unknown Source)


This was the first resource bundle I added.

Restoring a previous version of the .res file from may backup did not fix the problem. Still unable to open it

IDE: NetBeans
OS:  Windows 7
Simulator N/A
Device Android Nexus 6P

theme.res

itb....@gmail.com

unread,
Jan 15, 2017, 9:40:02 AM1/15/17
to CodenameOne Discussions

I managed to open the resrouce file after I removed two empty elements from the resource xml file

       
<lang name="es">
       
</lang>
       
<lang name="de">
       
</lang>

These entries do cause the editor to trap as described above.

Shai Almog

unread,
Jan 16, 2017, 12:57:23 AM1/16/17
to CodenameOne Discussions
Thanks, we'll fix it for the next update. A temporary workaround is also to disable the XML team mode.
Reply all
Reply to author
Forward
0 new messages