🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

ListResourceBundle problem

#157
From: George
Date: Thu, 17 Jun 2004 19:20
45 lines
1893 bytes
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: <40d1ee87$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1089d0,3293218431672977,start
X-Google-Attributes: gid1089d0,public
From: "George" <geo_54321@yahoo.com>
Newsgroups: borland.public.jbuilder.java.api
Subject: ListResourceBundle problem
Date: Thu, 17 Jun 2004 15:20:12 -0400
Lines: 47
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: <40d1ee87$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1087499911 63.119.115.129 (17 Jun 2004 12:18:31 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail