Corrupt theme.res-file or corrupt project?

59 views
Skip to first unread message

cyru...@gmail.com

unread,
Sep 30, 2014, 11:23:13 AM9/30/14
to codenameone...@googlegroups.com
IDE: NetBeans 8.0.1
Desktop OS: Windows 8.1

I've read several posts about corrupt theme-res files and followed the necessary steps to restore the state of the designer tool but nothing seems to work. My problem is that when double clicking on a form in the tool, the form doesn't appear. Here's what's strange though: when opening the generated themes.res from the build/classes-folder everything seems to work as normal but when copying the same file into the src-folder the problem of the forms not appearing in the tool is still there.

0. The thing to do in these cases is to launch the designer from command line with java -jar ~/.codenameone/designer_1.jar 
(~ is the home directory).

Done! The designer launches correctly without any exceptions with no forms. Here's the output
2014-09-30 17:02:29.375:INFO:oejs.Server:jetty-8.0.y.z-SNAPSHOT
2014-09-30 17:02:29.417:INFO:oejs.AbstractConnector:Started SelectChann...@0.0.0.0:9000 STARTING
sep 30, 2014 5:02:29 EM org.jdesktop.application.LocalStorage getId
WARNING: unspecified resource Application.id using ResourceEditorApp
sep 30, 2014 5:02:29 EM org.jdesktop.application.LocalStorage getId
WARNING: unspecified resource Application.vendorId using UnknownApplicationVendor

1. Check the file isn't 0 sized or something of that type.
The res-file is 32007 bytes.

2. Disable XML team mode.
Done

3. Rename the res directory in the project to see if that helps.
Removed the res-directory entirely

4. Remove files in the override-folder
Removed the override-folder entirely

Great platform by the way. I hope the community gets bigger and bigger.

PS!
I'm not using any libraries nor have I bridged any native code. I'm merely evaluating CN1 on behalf of our company for a possible application project later on.
theme.res

Shai Almog

unread,
Sep 30, 2014, 11:49:10 PM9/30/14
to codenameone...@googlegroups.com, cyru...@gmail.com
Hi,
thanks.
I just opened it and it worked for me just fine. Make sure team xml mode is unchecked select file->open and select the .res file.
Worst case scenario you can just delete the res directory completely which should solve the issue.

cyru...@gmail.com

unread,
Oct 1, 2014, 4:00:27 AM10/1/14
to codenameone...@googlegroups.com, cyru...@gmail.com
Hi,

Like I stated in my original post I have turned off XML-mode but this time I did the obvious (which wasn't clear to me when I read previous posts) and loaded the res-file through after starting the designer from the terminal, and got this response when attempting to open one of the forms:

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
        at com.codename1.designer.UserInterfaceEditor.validateLoadedStateMachineCode(UserInterfaceEditor.java:459)
        at com.codename1.designer.UserInterfaceEditor.<init>(UserInterfaceEditor.java:474)
        at com.codename1.ui.util.EditableResources.getResourceEditor(EditableResources.java:3085)
        at com.codename1.designer.ResourceEditorView.setSelectedResource(ResourceEditorView.java:614)
        at com.codename1.designer.HorizontalList$1.actionPerformed(HorizontalList.java:117)
        at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
        at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
        at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
        at javax.swing.JToggleButton$ToggleButtonModel.setPressed(Unknown Source)
        at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
        at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
        at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
        at java.awt.Component.processMouseEvent(Unknown Source)
        at javax.swing.JComponent.processMouseEvent(Unknown Source)
        at java.awt.Component.processEvent(Unknown Source)
        at java.awt.Container.processEvent(Unknown Source)
        at java.awt.Component.dispatchEventImpl(Unknown Source)
        at java.awt.Container.dispatchEventImpl(Unknown Source)
        at java.awt.Component.dispatchEvent(Unknown Source)
        at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
        at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
        at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
        at java.awt.Container.dispatchEventImpl(Unknown Source)
        at java.awt.Window.dispatchEventImpl(Unknown Source)
        at java.awt.Component.dispatchEvent(Unknown Source)
        at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
        at java.awt.EventQueue.access$200(Unknown Source)
        at java.awt.EventQueue$3.run(Unknown Source)
        at java.awt.EventQueue$3.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
        at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
        at java.awt.EventQueue$4.run(Unknown Source)
        at java.awt.EventQueue$4.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
        at java.awt.EventQueue.dispatchEvent(Unknown Source)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.run(Unknown Source)

But the strangest part is that it opens the form correctly when I instead open it from the /build/classes-folder i.e. the designer is looking into the surroundings of the res-file.

I'm not sure what you mean by removing the res-directory, I don't have that directory in my project. I am attaching the source-folder for you to see whether it's caused by the location of the various classes.

Thanks in advance!
ssrs-src-folder.zip

Shai Almog

unread,
Oct 1, 2014, 8:01:27 AM10/1/14
to codenameone...@googlegroups.com, cyru...@gmail.com
Hi,
did you move your state machine java file to a different location or change its name?
Did you change the entry in the properties file indicating its name?
The problem seems to be that the designer can't find the state machine java source file so it can highlight the things overriden in the source.

cyru...@gmail.com

unread,
Oct 1, 2014, 8:21:04 AM10/1/14
to codenameone...@googlegroups.com, cyru...@gmail.com
It's correct. I did change the package name of the StateMachine-class and noticed there are two entries in the codenameone_settings.properties-file that points to this class. After manually changing these two entries (userClassAbs and userClass), the designer is correctly showing the forms again.

Thanks for your help!
Reply all
Reply to author
Forward
0 new messages