码迷,mamicode.com
首页 > 其他好文 > 详细

properties导致空指针的问题

时间:2015-05-20 16:23:39      阅读:119      评论:0      收藏:0      [点我收藏+]

标签:properties   nullpointerexception   

在接入某视频SDK的过程中,properties发生空指针错误,一开始的方向是以为properties错误或SDK代码错误。

java.lang.ExceptionInInitializerError
            at java.lang.Class.newInstanceImpl(Native Method)
            at java.lang.Class.newInstance(Class.java:1319)
            at android.app.ActivityThread.installProvider(ActivityThread.java:4807)
            at android.app.ActivityThread.installContentProviders(ActivityThread.java:4432)
            at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4372)
            at android.app.ActivityThread.access$1300(ActivityThread.java:141)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1294)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:137)
            at android.app.ActivityThread.main(ActivityThread.java:5041)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:511)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
            at dalvik.system.NativeStart.main(Native Method)
     Caused by: java.lang.NullPointerException: in == null
            at java.util.Properties.load(Properties.java:246)
            at com.letv.datastatistics.db.StatisContentProvider.<clinit>(StatisContentProvider.java:24)
            at java.lang.Class.newInstanceImpl(Native Method)
            at java.lang.Class.newInstance(Class.java:1319)
            at android.app.ActivityThread.installProvider(ActivityThread.java:4807)
            at android.app.ActivityThread.installContentProviders(ActivityThread.java:4432)
            at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4372)
            at android.app.ActivityThread.access$1300(ActivityThread.java:141)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1294)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:137)
            at android.app.ActivityThread.main(ActivityThread.java:5041)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:511)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
            at dalvik.system.NativeStart.main(Native Method)


解决方案:
        把properties放在(或新建在)src文件夹下面。


properties导致空指针的问题

标签:properties   nullpointerexception   

原文地址:http://blog.csdn.net/djcken/article/details/45871805

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!