Resource Bundle Error

Questions on using RText should go here.

Moderator: robert

Resource Bundle Error

Postby Bob the BlueBerry » Fri Nov 07, 2008 11:49 pm

Hi. I'm trying to get RSyntaxTextArea to work for an application I'm working on, but there is this error I get every time RTextArea initializes.

SEVERE: Exception in thread Thread-3:
java.util.MissingResourceException: Can't find bundle for base name org.fife.ui.rtextarea.RTextArea, locale en_CA
at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1521)
at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1260)
at java.util.ResourceBundle.getBundle(ResourceBundle.java:715)
at org.fife.ui.rtextarea.RTextArea.initActions(RTextArea.java:607)
at org.fife.ui.rtextarea.RTextArea.<init>(RTextArea.java:190)
at org.fife.ui.rsyntaxtextarea.RSyntaxTextArea.<init>(RSyntaxTextArea.java:275)
at org.fife.ui.rsyntaxtextarea.RSyntaxTextArea.<init>(RSyntaxTextArea.java:259)
at org.gcreator.gui.PineDLEditor.<init>(PineDLEditor.java:51)
at org.gcreator.gui.PineDLPlugin.handleEvent(PineDLPlugin.java:62)
at org.gcreator.plugins.EventManager.fireEvent(EventManager.java:113)
at org.gcreator.gui.PineappleGUI$17.run(PineappleGUI.java:629)
Caused by: java.lang.ClassCastException: org.fife.ui.rtextarea.RTextArea cannot be cast to ResourceBundle
at java.util.ResourceBundle$Control.newBundle(ResourceBundle.java:2391)
at java.util.ResourceBundle.loadBundle(ResourceBundle.java:1406)
at java.util.ResourceBundle.findBundle(ResourceBundle.java:1365)
at java.util.ResourceBundle.findBundle(ResourceBundle.java:1292)
at java.util.ResourceBundle.findBundle(ResourceBundle.java:1292)
at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1234)
... 9 more


The error is caused by this:
Code: Select all
ResourceBundle bundle = ResourceBundle.getBundle(RESOURCE_BUNDLE); /* RESOURCE_BUNDLE is "org.fife.ui.rtextarea.RTextArea", this class*/


See how it says that RTextArea can't be cast to ResoureBundle?
Code: Select all
Caused by: java.lang.ClassCastException: org.fife.ui.rtextarea.RTextArea cannot be cast to ResourceBundle


I don't really know what's going on and why it's configured this way, so I can't fix it myself. It seems weird that no one else seems to be getting this sort of error.

If you could help, I'd greatly appreciate it.

- Bob
Bob the BlueBerry
 
Posts: 2
Joined: Fri Nov 07, 2008 11:38 pm

Re: Resource Bundle Error

Postby robert » Sat Nov 08, 2008 4:56 pm

Hi Bob,

You must not have grabbed the i18n folder in the RSyntaxTextArea source. That folder contains all of the localized property files for the text area. If you don't have that, then when your program tries to find localized values for "Cut", "Copy", etc., it can't find them. Java's fallback is to try to find a class named "RTextArea.class" that extends ResourceBundle, but of course in RSyntaxTextArea, that isn't the case, as that is the main text editor class.

Please check whether you have the i18n folder's contents on your classpath when running your app, and let me know if you still have problems.
User avatar
robert
 
Posts: 798
Joined: Sat May 10, 2008 5:16 pm

Re: Resource Bundle Error

Postby Bob the BlueBerry » Sat Nov 08, 2008 5:13 pm

Oh. So that's what the i18n folder is for.
I merged the i18n folder and the source and it works great.

Thanks!
Bob the BlueBerry
 
Posts: 2
Joined: Fri Nov 07, 2008 11:38 pm

Re: Resource Bundle Error

Postby robert » Sun Nov 09, 2008 3:16 pm

No problem. Check out the Java tutorial on localization for more information:

http://java.sun.com/docs/books/tutorial/i18n/index.html
User avatar
robert
 
Posts: 798
Joined: Sat May 10, 2008 5:16 pm

Re: Resource Bundle Error

Postby seiyria » Sun Jan 22, 2012 8:29 am

I just downloaded the 2.0.0beta2 release (just jars) of the autocomplete and rsyntaxarea, and I am getting this issue.
seiyria
 
Posts: 9
Joined: Sun Jan 22, 2012 8:26 am

Re: Resource Bundle Error

Postby robert » Sun Jan 22, 2012 11:48 pm

Hmm, there must be some other problem. The localization files are definitely in the 2.0.0-beta2 jars. Can you post a simple demo application that demonstrates the problem, so I can reproduce it?
User avatar
robert
 
Posts: 798
Joined: Sat May 10, 2008 5:16 pm

Re: Resource Bundle Error

Postby seiyria » Mon Jan 23, 2012 12:28 am

http://pastebin.com/uGARbxnE is the code I can run to test it. I have the two beta jars on my classpath, as well.
[edit]
It requires a script to be alongside it.. so: http://pastebin.com/qXXYq394 would work, saved as aliases.js
seiyria
 
Posts: 9
Joined: Sun Jan 22, 2012 8:26 am

Re: Resource Bundle Error

Postby xlepallec » Sun Jan 29, 2012 8:49 pm

Hi,
I use Eclipse.
I had also this problem with the jar.
So I included the i18n directory (which is however in the jar) in my project and included/referred this directory in "Source folders on build path" (project properties).

This works.

I hope it'll help.

Xavier
xlepallec
 

Re: Resource Bundle Error

Postby seiyria » Sun Jan 29, 2012 9:48 pm

I appreciate the reply, but unfortunately this didn't fix it for me.
seiyria
 
Posts: 9
Joined: Sun Jan 22, 2012 8:26 am

Re: Resource Bundle Error

Postby robert » Sun Jan 29, 2012 11:14 pm

Hmm, that sample in pastebin seems incomplete (missing imports), and is complicated by mixing SWT with Swing (not that that should matter). Can you run this example in your environment and reproduce the problem?

Can you verify the checksum of your jar file to verify the download worked okay? I just downloaded the binary zip for beta2 from SourceForge and get:

Code: Select all
C:\temp>cksum rsyntaxtextarea.jar
2609158006 721249 rsyntaxtextarea.jar
User avatar
robert
 
Posts: 798
Joined: Sat May 10, 2008 5:16 pm

Next

Return to Help

Who is online

Users browsing this forum: No registered users and 1 guest

cron