突然之间,如果没有更改构建环境,gradle文件或任何可以证明这一点的源更改,我的项目就会因以下错误而崩溃:
java.lang.ExceptionInInitializerError
at org.fourthline.cling.transport.impl.AsyncServletStreamServerImpl.createServlet(AsyncServletStreamServerImpl.java:96)
at org.fourthline.cling.transport.impl.AsyncServletStreamServerImpl.init(AsyncServletStreamServerImpl.java:74)
at org.fourthline.cling.transport.RouterImpl.startAddressBasedTransports(RouterImpl.java:434)
at org.fourthline.cling.transport.RouterImpl.enable(RouterImpl.java:132)
at org.fourthline.cling.android.AndroidRouter.enable(AndroidRouter.java:92)
at org.fourthline.cling.UpnpServiceImpl.<init>(UpnpServiceImpl.java:87)
at org.fourthline.cling.android.AndroidUpnpServiceImpl$1.<init>(AndroidUpnpServiceImpl.java:54)
at org.fourthline.cling.android.AndroidUpnpServiceImpl.onCreate(AndroidUpnpServiceImpl.java:54)
at pl.qus.xenoamp.xenoservice.XenoUpnpService.onCreate(XenoUpnpService.java:104)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:2785)
at android.app.ActivityThread.access$1800(ActivityThread.java:149)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1407)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:211)
at android.app.ActivityThread.main(ActivityThread.java:5317)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1016)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:811)
Caused by: java.util.MissingResourceException: Can't find resource for bundle 'javax.servlet.LocalStrings_pl_PL', key ''
at java.util.ResourceBundle.missingResourceException(ResourceBundle.java:238)
at java.util.ResourceBundle.getBundle(ResourceBundle.java:230)
at java.util.ResourceBundle.getBundle(ResourceBundle.java:139)
at javax.servlet.GenericServlet.<clinit>(GenericServlet.java:95)
at org.fourthline.cling.transport.impl.AsyncServletStreamServerImpl.createServlet(AsyncServletStreamServerImpl.java:96)
at org.fourthline.cling.transport.impl.AsyncServletStreamServerImpl.init(AsyncServletStreamServerImpl.java:74)
at org.fourthline.cling.transport.RouterImpl.startAddressBasedTransports(RouterImpl.java:434)
at org.fourthline.cling.transport.RouterImpl.enable(RouterImpl.java:132)
at org.fourthline.cling.android.AndroidRouter.enable(AndroidRouter.java:92)
at org.fourthline.cling.UpnpServiceImpl.<init>(UpnpServiceImpl.java:87)
at org.fourthline.cling.android.AndroidUpnpServiceImpl$1.<init>(AndroidUpnpServiceImpl.java:54)
at org.fourthline.cling.android.AndroidUpnpServiceImpl.onCreate(AndroidUpnpServiceImpl.java:54)
at pl.qus.xenoamp.xenoservice.XenoUpnpService.onCreate(XenoUpnpService.java:104)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:2785)
at android.app.ActivityThread.access$1800(ActivityThread.java:149)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1407)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:211)
at android.app.ActivityThread.main(ActivityThread.java:5317)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1016)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:811)
无法在网上找到很多相关内容,完全依赖javax serverlet禁用构建依赖,抱怨此软件包中的重复文件。
目前我必须禁用我的应用的UPnP功能才能克服此错误。请帮忙!
编辑:有趣的是 - 错误只发生在一个环境中构建的apk上,不会发生在另一个环境中。
答案 0 :(得分:-2)
Android不包含java中的所有内容,对于此实例,它只有javax。*的限制,你根本无法使用它。
编辑:
你可以找到android在这里的软件包列表。