English 中文(简体)
只有一些用户报告“ 未找到资源” 错误。 这是否合理?
原标题:Only some users reporting "Resource Not Found" error. Does this make sense?

我看到我出版的Android App 出现了几个错误,

0   java.io.IOException: Resource not found: "org/joda/time/tz/data/ZoneInfoMap" ClassLoader: dalvik.system.PathClassLoader@45908320
1    at org.joda.time.tz.ZoneInfoProvider.openResource(ZoneInfoProvider.java:211)
2    at org.joda.time.tz.ZoneInfoProvider.<init>(ZoneInfoProvider.java:123)
3    at org.joda.time.tz.ZoneInfoProvider.<init>(ZoneInfoProvider.java:82)
4    at org.joda.time.DateTimeZone.getDefaultProvider(DateTimeZone.java:462)
5    at org.joda.time.DateTimeZone.setProvider0(DateTimeZone.java:416)
6    at org.joda.time.DateTimeZone.<clinit>(DateTimeZone.java:115)
7    at org.joda.time.chrono.GregorianChronology.<clinit>(GregorianChronology.java:71)
8    at org.joda.time.chrono.ISOChronology.<clinit>(ISOChronology.java:66)
9    at org.joda.time.base.BaseDateTime.<init>(BaseDateTime.java:61)
10   at org.joda.time.DateTime.<init>(DateTime.java:155)

搜索显示这通常是一个编译问题( 很显然, Joda Time 图书馆没有加入建设路径 ), 但是为什么在几千个用户中只有4个会看到这个错误?

我唯一的猜测是,有人试图拆解应用程序来盗用它(这是一个相当流行的付费应用程序 ), 当他们错误地重组时会看到错误。 在这种情况下,我很高兴他们看到错误,我不需要担心。

另一个奇怪的是, 造成问题的代码 被一个试捕/抓获, 似乎没有抓住它:

try {
    DateTime dt = new DateTime();
    DateTimeFormatter fmt = ISODateTimeFormat.dateTime();
    return fmt.print(dt);
} catch (Exception e) {
    //Report issue to Analytics service
} 

对我来说,这个错误似乎更不可能出现在催泪症上,因为它应该已经被抓住。 有人能解释一下吗?

最佳回答

若您错过初始化, 可能会发生这种情况 :

JodaTimeAndroid.init(this);
问题回答

Not crash but in Unit test, I see the same error message java.io.IOException: Resource not found: "org/joda/time/tz/data/ZoneInfoMap" when call to DateTimeFormatter class with joda-time-android

添加 < a href=> "https://github.com/JodaOrg/joda-time" rel="不跟随 noreferrer" >joda-time java依赖测试源集将修正单位测试中的错误

测试安装“joda-time:joda-time:$latestVersion”

我看到了来自一个受欢迎的免费应用程序的类似、不常见的报告。 我至今还没有转载它。 http:// joda- interest.219941. n2. n2. nabble.com/java- io- IOExpendion- resource- not- found- quot- org-joda-time-tz- data- ZoneInfoMap- td7572448. html" rel= “ no follow” >@unible < a href="https://community.oracle.com/thread/1314018? start=0" rel="rel="nofol" > 引用这个“ href="http://sourtforge.net/p/joda-time/discussion/ 337835//thread/2798a578” rel=“ nofolpolt > > problem sweddddddd.

一条线索:ZoneInfoMap是原始罐子中的资源文件,而不是阶级文件。因此,如果各种应用市场中的任何一种正在剥离非阶级信息(比如说 unjar 然后重罐 ), ZoneInfoMap 将是一个候选者。 同样,如果任何级载荷工具在安全或愚蠢方面有问题,如果有非阶级资源,ZoneInfoMap 将是候选者。

另一个角度:有问题的运行时环境能否在更早的病原体有其自身的joda-time jar, 一个缺乏/数据/段的病原体?

底线:似乎这是安卓尔德西部的又一个例子, 我学会忽略它, 直到我找到一个反球。

我也有同样的问题,在对谷歌进行大量搜索后,我发现了。ZoneInfoMap文件是用“ZoneInfoCompiler”和“ZoneInfoCompiler”的论据创建的:

    -dst srcorgjoda	ime	zdata srcorgjoda	ime	zsrcafrica 
srcorgjoda	ime	zsrcantarctica srcorgjoda	ime	zsrcasia 
srcorgjoda	ime	zsrcaustralasia srcorgjoda	ime	zsrcackward 
srcorgjoda	ime	zsrcetcetera srcorgjoda	ime	zsrceurope 
srcorgjoda	ime	zsrc
orthamerica srcorgjoda	ime	zsrcpacificnew 
srcorgjoda	ime	zsrcsouthamerica srcorgjoda	ime	zsrcsystemv

这将增加所有的时间区到 jodaTimer, 你可以创造更多的时间区区 我相信,如果你知道如何也, 而且如果你不需要所有的时间区, 你不必包括所有的时间区。

为什么它会误差是因为它正在寻找一个不存在的文件。 不知道为什么尝试抓捕不起作用, 但我怀疑它与约达·蒂姆勒是一个 JAR 图书馆(至少地雷是)有关?

不知道这是应该如何完成的, 或者是否有更好的解决方案, 但这就是我做了什么,

我希望这能帮上忙





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签