Good evening,
I have written a java library using JAXB (javax.xml.bind:jaxb-api:2.1), which works just fine in my desktop-application.
Now I want to use this library on android, but when I try to create the JAXBContext:
JAXBContext context =
JAXBContext.newInstance(ObjectFactory.class.getPackage().getName(),
this.getClass().getClassLoader());
I get this error (see stacktrace below).
I would appreciate any hint in which direction I have to look.
Thanks in advance!!
Stacktrace:
W/System.err: java.util.MissingResourceException: Can't find bundle for base name javax.xml.bind.Messages, locale de_DE
W/System.err: 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.xml.bind.Messages.format(Messages.java:71)
at javax.xml.bind.Messages.format(Messages.java:56)
at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:148)
at javax.xml.bind.ContextFinder.find(ContextFinder.java:371)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:446)
W/System.err: at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:409)
at org.foo.mylibraryapi.persistence.adapter.ModelReader.readDocument(ModelReader.java:67)
at org.foo.mylibraryapi.persistence.adapter.ModelReader.readDocument(ModelReader.java:30)
at org.foo.mylibrary.ui.FileLoader.load(FileLoader.java:14)
at org.foo.ambitusapp.MainActivity.onActivityResult(MainActivity.java:180)
at android.app.Activity.dispatchActivityResult(Activity.java:6946)
at android.app.ActivityThread.deliverResults(ActivityThread.java:4126)
at android.app.ActivityThread.handleSendResult(ActivityThread.java:4173)
at android.app.ActivityThread.-wrap20(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1546)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6165)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:888)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:778)
W/System.err: Caused by: java.lang.ClassCastException: javax.xml.bind.Messages cannot be cast to ResourceBundle
at java.util.ResourceBundle$Control.newBundle(ResourceBundle.java:2576)
at java.util.ResourceBundle.loadBundle(ResourceBundle.java:1438)
at java.util.ResourceBundle.findBundle(ResourceBundle.java:1402)
at java.util.ResourceBundle.findBundle(ResourceBundle.java:1356)
at java.util.ResourceBundle.findBundle(ResourceBundle.java:1356)
at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1298)
... 22 more
Related
I'm having serios issues with facebook log in using a real device. I'm getting this error
-10-29 15:23:28.622 21689-21689/apps.vanilla.edvin.myapplication W/System.err: CONNECTION_FAILURE: TigonError(3): GraphQLHttpFailureDomain(401) HTTP Error
at com.facebook.login.LoginManager.onActivityResult(LoginManager.java:219)
at com.facebook.login.LoginManager$1.onActivityResult(LoginManager.java:174)
at com.facebook.internal.CallbackManagerImpl.onActivityResult(CallbackManagerImpl.java:92)
at com.vanillapps.caietvirtual.Start.Autentication.LoginFragment.onActivityResult(LoginFragment.java:269)
at android.support.v4.app.FragmentActivity.onActivityResult(FragmentActivity.java:160)
at android.app.Activity.dispatchActivityResult(Activity.java:7289)
at android.app.ActivityThread.deliverResults(ActivityThread.java:4516)
at android.app.ActivityThread.handleSendResult(ActivityThread.java:4563)
at android.app.ActivityThread.-wrap22(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1698)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6776)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1496)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1386)
Using the emulator, login works without issues.
Any suggestions regarding my issue? Thanks.
recently (past few weeks maybe) most of the android 6 users of my app started to suffer from crashes. UnityPlayerActivity failed to start with exception logged: android.app.Fragment$InstantiationException.
Stack trace:
java.lang.RuntimeException:
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2450)
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2510)
android.app.ActivityThread.-wrap11(ActivityThread.java:0)
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1363)
android.os.Handler.dispatchMessage(Handler.java:102)
android.os.Looper.loop(Looper.java:148)
android.app.ActivityThread.main(ActivityThread.java:5461)
java.lang.reflect.Method.invoke(Native Method:0)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by: android.app.Fragment$InstantiationException:
android.app.Fragment.instantiate(Fragment.java:628)
android.app.FragmentState.instantiate(Fragment.java:106)
android.app.FragmentManagerImpl.restoreAllState(FragmentManager.java:1858)
android.app.FragmentController.restoreAllState(FragmentController.java:122)
android.app.Activity.onCreate(Activity.java:918)
com.unity3d.player.UnityPlayerActivity.onCreate(Unknown Source:0)
android.app.Activity.performCreate(Activity.java:6251)
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1108)
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2403)
Initially my first thought was permissions problem but I can't reproduce this error on any of my android 6 devices even if I deny permission (WRITE_EXTERNAL_STORAGE).
Is there is any workaround for this problem(if this problem is a common for Unity on Android 6)?
Thanks in advance!
PS:
Unity version 5.5.0f3,
Android version from crush reports 6.0
I'm trying to read the contents of an ePub file using the library epublib and this example demonstrates that.
For me, an exception is thrown when loading the book from the input stream
// Load Book from inputStream
Book book = (new EpubReader()).readEpub(epubInputStream);
Not sure why the code isn't working and the exception is thrown for me? It has worked for other users of the StackOverflow.
Full Stack trace is shared below:
W/System.err: java.io.EOFException
W/System.err: at libcore.io.Streams.readFully(Streams.java:83)
W/System.err: at java.util.zip.ZipInputStream.getNextEntry(ZipInputStream.java:235)
W/System.err: at nl.siegmann.epublib.epub.EpubReader.readResources(EpubReader.java:184)
W/System.err: at nl.siegmann.epublib.epub.EpubReader.readEpub(EpubReader.java:94)
W/System.err: at nl.siegmann.epublib.epub.EpubReader.readEpub(EpubReader.java:53)
W/System.err: at nl.siegmann.epublib.epub.EpubReader.readEpub(EpubReader.java:37)
W/System.err: at com.blogspot.gsrikar.ePubViewerActivity.readEPubContents(ePubViewerActivity.java:102)
W/System.err: at com.blogspot.gsrikar.ePubViewerActivity.onCreate(ePubViewerActivity.java:88)
W/System.err: at android.app.Activity.performCreate(Activity.java:6904)
W/System.err: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1136)
W/System.err: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3266)
W/System.err: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3415)
W/System.err: at android.app.ActivityThread.-wrap17(ActivityThread.java)
W/System.err: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1821)
W/System.err: at android.os.Handler.dispatchMessage(Handler.java:102)
W/System.err: at android.os.Looper.loop(Looper.java:148)
W/System.err: at android.app.ActivityThread.main(ActivityThread.java:7325)
W/System.err: at java.lang.reflect.Method.invoke(Native Method)
W/System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
EOFException is thrown:
if there is no data in a stream but you are trying to read.. eg read
methods of chain streams like DataInputStream, ObjectInputStream
throw EOFException if they are trying to read from FileInputStream
but the FileInputStream is empty or
if the formats are not matching...eg if int is present and you are
using readFloat() of DataInputStream
You should try calling below method before passing it to readEpub.
Java Doc link : http://docs.oracle.com/javase/7/docs/api/java/io/InputStream.html#available()
//assuming the above variables are already declared.
if(epubInputStream.available() > 0)
Book book = (new EpubReader()).readEpub(epubInputStream);
else
System.out.println("no data to read");
I am a newcomer who want to learn android.My friend suggested me to read the code of that player,but when I imported the project and compiled it,it crashed...
12-22 20:58:07.755 4870-4870/com.example.android.uamp
E/AndroidRuntime: FATAL EXCEPTION: main Process:
com.example.android.uamp, PID: 4870 java.lang.RuntimeException: Unable
to start activity
ComponentInfo{com.example.android.uamp/com.example.android.uamp.ui.MusicPlayerActivity}:
java.lang.RuntimeException: com.google.android.gms.internal.zzsb$zza:
No acceptable module found. Local version is 0 and remote version is
0. at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2448)
at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2510)
at android.app.ActivityThread.access$1200(ActivityThread.java:163) at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1371)
at android.os.Handler.dispatchMessage(Handler.java:102) at
android.os.Looper.loop(Looper.java:135) at
android.app.ActivityThread.main(ActivityThread.java:5595) 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:960)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755) Caused
by: java.lang.RuntimeException:
com.google.android.gms.internal.zzsb$zza: No acceptable module found.
Local version is 0 and remote version is 0. at
com.google.android.gms.internal.zzni.zzbg(Unknown Source) at
com.google.android.gms.internal.zzni.zza(Unknown Source) at
com.google.android.gms.cast.framework.CastContext.(Unknown
Source) at
com.google.android.gms.cast.framework.CastContext.getSharedInstance(Unknown
Source) at
com.example.android.uamp.ui.ActionBarCastActivity.onCreate(ActionBarCastActivity.java:141)
at
com.example.android.uamp.ui.BaseActivity.onCreate(BaseActivity.java:49)
at
com.example.android.uamp.ui.MusicPlayerActivity.onCreate(MusicPlayerActivity.java:57)
at android.app.Activity.performCreate(Activity.java:6100) at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1109)
at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2401)
at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2510)
at android.app.ActivityThread.access$1200(ActivityThread.java:163) at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1371)
at android.os.Handler.dispatchMessage(Handler.java:102) at
android.os.Looper.loop(Looper.java:135) at
android.app.ActivityThread.main(ActivityThread.java:5595) 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:960)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
Caused by: com.google.android.gms.internal.zzsb$zza: No acceptable
module found. Local version is 0 and remote version is 0. at
com.google.android.gms.internal.zzsb.zza(Unknown Source) at
com.google.android.gms.internal.zzni.zzbg(Unknown Source) at
com.google.android.gms.internal.zzni.zza(Unknown Source) at
com.google.android.gms.cast.framework.CastContext.(Unknown
Source) at
com.google.android.gms.cast.framework.CastContext.getSharedInstance(Unknown
Source) at
com.example.android.uamp.ui.ActionBarCastActivity.onCreate(ActionBarCastActivity.java:141)
at
com.example.android.uamp.ui.BaseActivity.onCreate(BaseActivity.java:49)
at
com.example.android.uamp.ui.MusicPlayerActivity.onCreate(MusicPlayerActivity.java:57)
at android.app.Activity.performCreate(Activity.java:6100) at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1109)
at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2401)
at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2510)
at android.app.ActivityThread.access$1200(ActivityThread.java:163) at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1371)
at android.os.Handler.dispatchMessage(Handler.java:102) at
android.os.Looper.loop(Looper.java:135) at
android.app.ActivityThread.main(ActivityThread.java:5595) 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:960)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
Well,when I searched for answers,the responses were not useful...
And if you have some wonderful open source project to recommend ,hope you can tell me.Thx.
Sorry for my poor english...
You need to update your google play service of device.
You can see this Bug report which already has been addressed
and possibility you will have to update your gcm dependency then appropriate modifications of code will also required mean the deprecated methods will be needed to replaced with new one in the project for e.g GoogleApiAvailability to register token etc so also make sure you are using the latest gcm dependency in your project
App is working fine prior to Marshmallow. Here is the logcat.
E/PjService: We have a problem with the current stack.... NOT YET Implemented
java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "BN_nist_mod_521" referenced by "/data/app/xx.xx-1/lib/arm/libsip.so"...
at java.lang.Runtime.loadLibrary(Runtime.java:372)
at java.lang.System.loadLibrary(System.java:1076)
at xx.xx.xx.PjSipService.tryToLoadStack(PjSipService.java:99)
at xx.xx.xx.SipService.loadStack(SipService.java:1050)
at xx.xx.xx.SipService.onStart(SipService.java:1011)
at android.app.Service.onStartCommand(Service.java:459)
at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3010)
at android.app.ActivityThread.-wrap17(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1442)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
AND
E/art: No implementation found for void org.pjsip.pjsua.pjsuaJNI.swig_module_init() (tried Java_org_pjsip_pjsua_pjsuaJNI_swig_1module_1init and Java_org_pjsip_pjsua_pjsuaJNI_swig_1module_1init__)
Can anyone guide me what to do?