4

I have a large application that started receiving

MissingResourceException: Can't find bundle for base name sun.text.resources.FormatData, locale en_US

The error comes from my code at

java.text.DecimalFormatSymbols.getInstance(Locale.US);

This code works until something unclear happens and we start getting this exception on every call, Here and on other places that loads resources.

resetting the application solves the issue for awhile until in happens so it's not a class path issue

The application is fairly extensive and uses among other things sandbox https://sourceforge.net/projects/javasandboxlibrary/ and javax.tools.JavaCompiler to compile code from the user and run in a safe settings, currently the system is still in development so its not some hacking attempt but we have no idea what it can be

while the system is running numerous java processes are starting and closing on the same java installation, maybe that could cause some issue?

any suggestion could be helpful

This is the full stack trace

java.util.MissingResourceException: Can't find bundle for base name sun.text.resources.FormatData, locale en_US
            at java.util.ResourceBundle.throwMissingResourceException(Unknown Source)
            at java.util.ResourceBundle.getBundleImpl(Unknown Source)
            at java.util.ResourceBundle.getBundle(Unknown Source)
            at sun.util.resources.LocaleData$1.run(Unknown Source)
            at sun.util.resources.LocaleData$1.run(Unknown Source)
            at java.security.AccessController.doPrivileged(Native Method)
            at sun.util.resources.LocaleData.getBundle(Unknown Source)
            at sun.util.resources.LocaleData.getNumberFormatData(Unknown Source)
            at sun.util.locale.provider.LocaleResources.getDecimalFormatSymbolsData(Unknown Source)
            at java.text.DecimalFormatSymbols.initialize(Unknown Source)
            at java.text.DecimalFormatSymbols.<init>(Unknown Source)
            at sun.util.locale.provider.DecimalFormatSymbolsProviderImpl.getInstance(Unknown Source)
            at java.text.DecimalFormatSymbols.getInstance(Unknown Source)
            at queryBuilder.utils.LanguageSymbolsAppender.setLanguageSymbols(LanguageSymbolsAppender.java:16)

LanguageSymbolsAppender.setLanguageSymbols is my code that has

DecimalFormatSymbols.getInstance(locale)
ben or
  • 653
  • 5
  • 17
  • 1
    Hi, could you also post the error stack trace? – kucing_terbang Feb 11 '18 at 09:15
  • Thanks for the stack trace. From cursory reading the source code of `ResourceBundle`. Seems like. It is trying to find a resources file that (in your case) obviously not a resource file. I am curious on how you use the `DecimalFormatSymbols` class. Is it okay if you show me what you're doing in the `queryBuilder.utils.LanguageSymbolsAppender.setLanguageSymbols`? – kucing_terbang Feb 11 '18 at 15:28
  • DecimalFormatSymbols.getInstance(Local.ENGLISH) – ben or Feb 11 '18 at 19:11
  • as far as i found it reads a rt.jar that has a FormatData_en_US.class https://github.com/ojdkbuild/lookaside_java-1.8.0-openjdk/blob/master/jdk/src/share/classes/sun/text/resources/en/FormatData_en_US.java normally every things works, reading the class, running the code inside and getting locale data but at some point things stops working – ben or Feb 11 '18 at 19:20
  • hmmm. If that is the case, I guess would be somebody changed the system locale or replacing (hot swap) a class or resources file from the class path. Could you confirm those assumptions? – kucing_terbang Feb 13 '18 at 07:03
  • i can confirm we don't replace the locale and we don't replace the running code, we do load new code and run it under a sandbox – ben or Feb 13 '18 at 08:43

0 Answers0