MissingResourceException at runtime

I have a great application that started to receive

MissingResourceException: cannot find package for base name sun.text.resources.FormatData, locale en_US

The error comes from my code in

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

This code works until something obscure happens, and we will start to get this exception on every call, here and in other places that load resources.

reloading the application solves the problem for a while until it happens, so this is not a problem with the class path

The application is quite extensive and uses, among other things, sandbox https://sourceforge.net/projects/javasandboxlibrary/ and javax.tools.JavaCompiler to compile user code and run in secure settings, the system is still under development so it’s not hacking attempt, but we have no idea what it could be

While the system is running, many java processes start and close on the same Java installation, maybe this can cause some problems?

any suggestion may be helpful

This is a complete 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)

SymbolsAppender.setLanguageSymbols is my code that has

DecimalFormatSymbols.getInstance(locale)
+4
source share

Source: https://habr.com/ru/post/1692546/


All Articles