java.util.MissingResourceException:找不到基本名称javax.servlet.LocalStrings的包 [英] java.util.MissingResourceException: Can't find bundle for base name javax.servlet.LocalStrings

查看:1233
本文介绍了java.util.MissingResourceException:找不到基本名称javax.servlet.LocalStrings的包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用multidex的Android应用。它已发布,每月用户数十万。我经常会在Crashlytics上遇到 ExceptionInInitializerError 崩溃。我从来没有能够重现它们。

I have an Android app that uses multidex. It is released and has monthly users in the hundreds of thousands. Every so often I will get ExceptionInInitializerError crashes on Crashlytics. I've never been able to reproduce them.

我读到这可能是由于multidex而且有 multiDexKeepFile文件('multidex-config.txt')在我的配置上有一个类列表会有所帮助,但它似乎没有帮助,至少不是这个资源。这是我的 multidex-config.txt 上的内容:

I read that this can be due to multidex and that have multiDexKeepFile file('multidex-config.txt') on my config with a list of classes would help, but it doesn't seem to help, at least not for this resource. This is the content on my multidex-config.txt:

org.eclipse.jetty.http.MimeTypes
org.eclipse.jetty.server.Server
javax.servlet.LocalStrings

这些都是我过去曾经崩溃的类。我还在等着看其中一些是否已修复,但下面的内容肯定会回来:

Those are all classes for which I've had crashes like this in the past. I'm still waiting to see if some of those are fixed but this one below keeps coming back for sure:

Fatal Exception: java.lang.ExceptionInInitializerError
       at myapp.run(myclass.java:986)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
       at java.lang.Thread.run(Thread.java:761)
Caused by java.util.MissingResourceException: Can't find bundle for base name javax.servlet.LocalStrings, locale it_IT
       at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1501)
       at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1324)
       at java.util.ResourceBundle.getBundle(ResourceBundle.java:723)
       at javax.servlet.GenericServlet.(GenericServlet.java)

那我怎么解决这个问题呢?在这种情况下,它似乎正在寻找意大利文件,情况并非总是这样,我在意大利有很多用户,所以我不确定为什么它只会崩溃一些。 Android Studio上用于 LocalStrings 的资源包仅显示默认值,法语和日语。

So how can I fix this? In this case it seems to be looking for the Italian file, this isn't always the case and I have a lot of users in Italy so I'm not sure why it is only crashing for a few. The resource bundle on Android Studio for LocalStrings only shows a default one, French and Japanese.

谢谢。

推荐答案

确保您不会错过添加servlet-api依赖项。

Make sure you are not missing to add the servlet-api dependency.

如果你正在使用maven,请确保这个依赖项在你的项目中:

If you're using maven make sure this dependency is in your project:

<dependency>
  <groupId>javax.servlet</groupId>
  <artifactId>javax.servlet-api</artifactId>
  <version>3.1.0</version>
</dependency>

这篇关于java.util.MissingResourceException:找不到基本名称javax.servlet.LocalStrings的包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆