🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.api
Article #158

Re: ListResourceBundle problem

#158
From: George
Date: Fri, 18 Jun 2004 13:24
52 lines
2232 bytes
OK, never mind, forgot to include package name in specifying the class.

"George" <geo_54321@yahoo.com> wrote in message
news:40d1ee87$1@newsgroups.borland.com...
> Just started out with internalization.  I am getting a
> MissingResourceException with the following code.  Any help will be
> appreciated.
>
> package filemanager;
> import java.util.*;
> public class TestI18N {
>   public TestI18N() {
>   }
>
>   public static void main(String [] args) {
>     ResourceBundle rb = ResourceBundle.getBundle("TestResources",
> Locale.getDefault());
>   }
>
>   private class TestResources extends ListResourceBundle {
>     protected Object[][] getContents() {
>       return contents;
>     }
>
>     private final Object[][] contents = {
>             {"PROPERTY_1", "PROPERTY_1"},
>             {"PROPERTY_2", "PROPERTY_2"},
>         };
>
>   }
> }
>
>
> This is the stack trace
>
> java.util.MissingResourceException: Can't find bundle for base name
> TestResources, locale en_US
>
>  at
>
java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:8
> 04)
>
>  at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:773)
>
>  at java.util.ResourceBundle.getBundle(ResourceBundle.java:538)
>
>  at filemanager.TestI18N.main(TestI18N.java:19)
>
> Exception in thread "main"
>
>
Technical Details
Message-ID: <40d2ecbb$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <40d1ee87$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1089d0,3293218431672977
X-Google-Attributes: gid1089d0,public
From: "George" <geo_54321@yahoo.com>
Newsgroups: borland.public.jbuilder.java.api
References: <40d1ee87$1@newsgroups.borland.com>
Subject: Re: ListResourceBundle problem
Date: Fri, 18 Jun 2004 09:24:45 -0400
Lines: 54
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 63.119.115.129
Message-ID: <40d2ecbb$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1087564987 63.119.115.129 (18 Jun 2004 06:23:07 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail