Corrupt theme.res

251 views
Skip to first unread message

Jeff Crump

unread,
Apr 15, 2014, 3:32:55 PM4/15/14
to codenameone...@googlegroups.com
IDE: NetBeans 8.0
Windows: 8.1 update

I have a corrupted theme.res. When I launch the Codename One Designer the progress indicator is stuck at 11 o'clock and does not change. The Theme section is empty, but the GUI Builder still lists my forms, but can will not render. I think that this is probably do to a problem reading the "Theme" section.

Is there any tool or way to fix this?

Best regards,
Jeff crump

S. Dale Morrey

unread,
Apr 15, 2014, 3:48:38 PM4/15/14
to codenameone...@googlegroups.com
I had this happen to me some time ago as well.
The only thing for it is to git revert the file.  If no source control was present, then you probably need to start over on your project.  It's a killer when that happens.

Jeff Crump

unread,
Apr 15, 2014, 4:28:53 PM4/15/14
to codenameone...@googlegroups.com
I recovered by pulling yesterday's theme.res, but I discovered that I had to erase the existing res folder under src and restore the backup res folder too. Then it was a matter of re-implement today's changes from my notes.

Shai Almog

unread,
Apr 16, 2014, 12:02:13 AM4/16/14
to codenameone...@googlegroups.com
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).

Then look to see if you get an obvious error and post it here.
Then try a few of these:
1. Check the file isn't 0 sized or something of that type.
2. Disable XML team mode.
3. Rename the res directory in the project to see if that helps.

If you have a way to reproduce this we want to know. If you are stuck with a corrupt theme after going thru these post here so we will notice you and send me a private email with the theme.

jeffery.s...@gmail.com

unread,
Apr 16, 2014, 7:45:53 AM4/16/14
to codenameone...@googlegroups.com
This is from the originally corrupted file:

2014-04-16 06:44:47.085:INFO:oejs.Server:jetty-8.0.y.z-SNAPSHOT
2014-04-16 06:44:47.226:INFO:oejs.AbstractConnector:Started SelectChann...@0.0.0.0:9000 STARTING
Apr 16, 2014 6:44:47 AM org.jdesktop.application.LocalStorage getId
WARNING: unspecified resource Application.id using ResourceEditorApp
Apr 16, 2014 6:44:47 AM org.jdesktop.application.LocalStorage getId
WARNING: unspecified resource Application.vendorId using UnknownApplicationVendor
java.lang.IllegalArgumentException: Theme entry for TitleWebPage.bgImage could not be found:
        at com.codename1.ui.util.Resources.getTheme(Resources.java:858)
        at com.codename1.ui.util.EditableResources.getTheme(EditableResources.java:1682)
        at com.codename1.ui.util.EditableResources.save(EditableResources.java:1577)
        at com.codename1.designer.LivePreview$3.run(LivePreview.java:330)
java.lang.IllegalArgumentException: Theme entry for TitleWebPage.bgImage could not be found:
        at com.codename1.ui.util.Resources.getTheme(Resources.java:858)
        at com.codename1.ui.util.EditableResources.getTheme(EditableResources.java:1682)
        at com.codename1.ui.util.EditableResources.save(EditableResources.java:1577)
        at com.codename1.designer.LivePreview$3.run(LivePreview.java:330)


Sent from Windows Mail

--
You received this message because you are subscribed to a topic in the Google Groups "CodenameOne Discussions" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/codenameone-discussions/HwYUUUW3yeI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to codenameone-discu...@googlegroups.com.
Visit this group at http://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit https://groups.google.com/d/msgid/codenameone-discussions/5e977de6-11a0-403a-853c-34c356e24cd7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Shai Almog

unread,
Apr 16, 2014, 3:09:05 PM4/16/14
to codenameone...@googlegroups.com
Do you understand how this maps to an issue in your resource file? Does that give you a hint on how to reproduce the issue?
Did you change the image for the TitleWebPage?

jeffery.s...@gmail.com

unread,
Apr 16, 2014, 3:09:57 PM4/16/14
to codenameone...@googlegroups.com
Yes, I realized that it was fault after I posted this.

Sent from Windows Mail

--
You received this message because you are subscribed to a topic in the Google Groups "CodenameOne Discussions" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/codenameone-discussions/HwYUUUW3yeI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to codenameone-discu...@googlegroups.com.
Visit this group at http://groups.google.com/group/codenameone-discussions.

Everson Badaró

unread,
Mar 31, 2015, 10:21:47 AM3/31/15
to codenameone...@googlegroups.com
Hi.

I'm with the same issue.   My theme.res file is open fine, but the section  theme, to edit my theme is freezed.

I searched in my computer by the file "designer_1.jar"   to execute in command line, but i not able to find this file.  Does it different in  MAC OS ?

My environment :  Netbeans, jdk 1.8,  Mac OS V. 10.10.2

Regards.

Shai Almog

unread,
Mar 31, 2015, 10:59:49 AM3/31/15
to codenameone...@googlegroups.com
Hi,
in mac OS its under the same location which is  ~/.codenameone/designer_1.jar
Spotlight doesn't fine a lot of useful things...

Everson Badaró

unread,
Mar 31, 2015, 12:39:26 PM3/31/15
to codenameone...@googlegroups.com
Yess...  is there,  I will never trust again at Spotlight.

Thanks Shai.

Everson Badaró

unread,
Mar 31, 2015, 1:31:57 PM3/31/15
to codenameone...@googlegroups.com
With me also was problem with  WebBrowser component.

iMac-EversonBadaro:.codenameone EversonBadaro$ java -jar designer_1.jar
2015-03-31 13:48:35.189:INFO:oejs.Server:jetty-8.0.y.z-SNAPSHOT
mar 31, 2015 1:48:35 PM org.jdesktop.application.LocalStorage getId
ADVERTÊNCIA: unspecified resource Application.id using ResourceEditorApp
2015-03-31 13:48:37.012:INFO:oejs.AbstractConnector:Started SelectChann...@0.0.0.0:9000 STARTING
java.lang.IllegalArgumentException: create image failed for the given image data of length: 0
    at com.codename1.ui.Image.createImage(Image.java:632)
    at com.codename1.ui.EncodedImage.getInternal(EncodedImage.java:327)
    at com.codename1.ui.EncodedImage.getInternalImpl(EncodedImage.java:302)
    at com.codename1.ui.EncodedImage.getWidth(EncodedImage.java:470)
    at com.codename1.ui.util.EditableResources.readMultiImage(EditableResources.java:2421)
    at com.codename1.ui.util.Resources.readMultiImage(Resources.java:1049)
    at com.codename1.ui.util.Resources.createImage(Resources.java:1031)
    at com.codename1.ui.util.EditableResources.createImage(EditableResources.java:2454)
    at com.codename1.ui.util.Resources.createImage(Resources.java:941)
    at com.codename1.ui.util.EditableResources.createImage(EditableResources.java:2443)
    at com.codename1.ui.util.Resources.openFileImpl(Resources.java:290)
    at com.codename1.ui.util.Resources.openFile(Resources.java:254)
    at com.codename1.ui.util.EditableResources.openFile(EditableResources.java:1335)
    at com.codename1.ui.util.EditableResources.openFileWithXMLSupport(EditableResources.java:789)
    at com.codename1.designer.ResourceEditorView$LoadResourceFileAction.exectute(ResourceEditorView.java:4132)
    at com.codename1.ui.resource.util.BlockingAction.run(BlockingAction.java:88)
    at java.lang.Thread.run(Thread.java:745)
java.lang.NullPointerException
    at com.codename1.ui.Container.insertComponentAt(Container.java:451)
    at com.codename1.ui.Container.addComponent(Container.java:431)
    at com.codename1.ui.BrowserComponent.<init>(BrowserComponent.java:90)
    at com.codename1.components.WebBrowser.<init>(WebBrowser.java:68)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:408)
    at java.lang.Class.newInstance(Class.java:433)


I removed all WebBrowser component  and the section theme came back  to work fine.

After change my theme, I will return the components.

Regards,
Everson Badaró

Shai Almog

unread,
Mar 31, 2015, 11:29:57 PM3/31/15
to codenameone...@googlegroups.com
Try updating the plugin, we had a regression with the previous update that should hopefully be fixed with the latest.

Everson Badaró

unread,
Jun 10, 2015, 2:33:31 PM6/10/15
to codenameone...@googlegroups.com
Hi Shai.

Today I needed change my theme again, and the same issue happened with  WebBrowser component.

Then the section  "theme" in the designer stoped to work.   I will remove again all my webbrowser componente to try change my theme.

Only for you information...

My plugins are updated.

Thanks.
Everson Badaro

tarsal...@gmail.com

unread,
Jun 25, 2015, 3:31:28 AM6/25/15
to codenameone...@googlegroups.com
I had this problem earlier with an app I was developing and I couldn't get it working. I then decided to restart the app so I created a brand new project and after I created a theme and a custom label and added to the code I tried to run the app and I get the exact same error. I re created a new project AGAIN and I actually got pretty far until I got to my second label and the same thing happened. I have no idea what could be wrong. Please help me here Shai. It might be something to do with having multiple projects open??? or perhaps I try to run my app without saving my theme.res as I am coding my components manually and creating the themes in the theme.res... 
Reply all
Reply to author
Forward
0 new messages