Autore Topic: Problema utilizzi libreria java esterna java-wordpress su Android  (Letto 392 volte)

Offline pcg4m3s

  • Nuovo arrivato
  • *
  • Post: 10
  • Respect: 0
    • Mostra profilo
  • Dispositivo Android:
    Samsung Galaxy S3
  • Sistema operativo:
    Windows 7
0
Salve,
nella mia applicazione ho bisogno di postare dei commenti su un blog wordpress, per cui ho trovato la seguente libreria java che mi permette di interfacciarmi in modo molto semplice con wordpress:

 wordpress-java - A Java client library to interact with the xmlrpc interface of wordpress. - Google Project Hosting
 


il problema però è il seguente: se importo la libreria in un normale progetto java funziona alla grande, se invece vado ad importare la libreria in un progetto Android mi va in eccezione. per sicurezza posto tutto il logcat:
Codice (Text): [Seleziona]
06-21 15:23:17.230: D/AbsListView(15546): Get MotionRecognitionManager
06-21 15:23:24.530: D/dalvikvm(15546): GC_CONCURRENT freed 250K, 7% free 12347K/13191K, paused 18ms+12ms, total 99ms
06-21 15:23:24.760: D/dalvikvm(15546): GC_CONCURRENT freed 365K, 8% free 12410K/13383K, paused 12ms+13ms, total 40ms
06-21 15:23:24.810: I/dalvikvm(15546): Total arena pages for JIT: 11
06-21 15:23:24.810: I/dalvikvm(15546): Total arena pages for JIT: 12
06-21 15:23:24.810: I/dalvikvm(15546): Total arena pages for JIT: 13
06-21 15:23:24.815: I/dalvikvm(15546): Total arena pages for JIT: 14
06-21 15:23:24.815: I/dalvikvm(15546): Total arena pages for JIT: 15
06-21 15:23:24.815: I/dalvikvm(15546): Total arena pages for JIT: 16
06-21 15:23:24.815: I/dalvikvm(15546): Total arena pages for JIT: 17
06-21 15:23:24.820: I/dalvikvm(15546): Total arena pages for JIT: 18
06-21 15:23:24.820: I/dalvikvm(15546): Total arena pages for JIT: 19
06-21 15:23:24.820: I/dalvikvm(15546): Total arena pages for JIT: 20
06-21 15:23:24.820: I/dalvikvm(15546): Total arena pages for JIT: 21
06-21 15:23:24.820: I/dalvikvm(15546): Total arena pages for JIT: 22
06-21 15:23:24.825: I/dalvikvm(15546): Total arena pages for JIT: 23
06-21 15:23:24.825: I/dalvikvm(15546): Total arena pages for JIT: 24
06-21 15:23:24.825: I/dalvikvm(15546): Total arena pages for JIT: 25
06-21 15:23:24.825: I/dalvikvm(15546): Total arena pages for JIT: 26
06-21 15:23:24.825: I/dalvikvm(15546): Total arena pages for JIT: 27
06-21 15:23:24.825: I/dalvikvm(15546): Total arena pages for JIT: 28
06-21 15:23:24.825: I/dalvikvm(15546): Total arena pages for JIT: 29
06-21 15:23:24.825: I/dalvikvm(15546): Total arena pages for JIT: 30
06-21 15:23:24.825: I/dalvikvm(15546): Total arena pages for JIT: 31
06-21 15:23:24.825: I/dalvikvm(15546): Total arena pages for JIT: 32
06-21 15:23:24.825: I/dalvikvm(15546): Total arena pages for JIT: 33
06-21 15:23:24.825: I/dalvikvm(15546): Total arena pages for JIT: 34
06-21 15:23:24.825: I/dalvikvm(15546): Total arena pages for JIT: 35
06-21 15:23:24.825: I/dalvikvm(15546): Total arena pages for JIT: 36
06-21 15:23:24.825: I/dalvikvm(15546): Total arena pages for JIT: 37
06-21 15:23:24.825: I/dalvikvm(15546): Total arena pages for JIT: 38
06-21 15:23:24.825: I/dalvikvm(15546): Total arena pages for JIT: 39
06-21 15:23:24.825: I/dalvikvm(15546): Total arena pages for JIT: 40
06-21 15:23:24.930: D/dalvikvm(15546): GC_CONCURRENT freed 390K, 8% free 12443K/13447K, paused 12ms+12ms, total 34ms
06-21 15:23:25.065: D/dalvikvm(15546): GC_CONCURRENT freed 481K, 8% free 12448K/13511K, paused 12ms+11ms, total 42ms
06-21 15:23:25.205: D/dalvikvm(15546): GC_CONCURRENT freed 444K, 8% free 12482K/13511K, paused 1ms+1ms, total 18ms
06-21 15:23:25.320: D/dalvikvm(15546): GC_CONCURRENT freed 474K, 8% free 12491K/13575K, paused 2ms+11ms, total 33ms
06-21 15:23:25.455: D/dalvikvm(15546): GC_CONCURRENT freed 490K, 8% free 12504K/13575K, paused 12ms+12ms, total 44ms
06-21 15:23:25.590: D/dalvikvm(15546): GC_CONCURRENT freed 458K, 9% free 12542K/13639K, paused 2ms+11ms, total 30ms
06-21 15:23:25.725: D/dalvikvm(15546): GC_CONCURRENT freed 483K, 8% free 12561K/13639K, paused 1ms+16ms, total 47ms
06-21 15:23:25.910: D/dalvikvm(15546): GC_CONCURRENT freed 549K, 9% free 12578K/13703K, paused 4ms+1ms, total 37ms
06-21 15:23:25.910: D/dalvikvm(15546): WAIT_FOR_CONCURRENT_GC blocked 5ms
06-21 15:23:26.070: D/dalvikvm(15546): GC_CONCURRENT freed 454K, 9% free 12600K/13703K, paused 12ms+11ms, total 49ms
06-21 15:23:26.345: D/dalvikvm(15546): GC_CONCURRENT freed 330K, 8% free 12683K/13703K, paused 13ms+12ms, total 42ms
06-21 15:23:26.590: D/dalvikvm(15546): GC_FOR_ALLOC freed 242K, 7% free 12815K/13767K, paused 25ms, total 25ms
06-21 15:23:27.810: I/Choreographer(15546): Skipped 77 frames!  The application may be doing too much work on its main thread.
06-21 15:23:31.345: D/dalvikvm(15546): GC_FOR_ALLOC freed 338K, 8% free 12934K/13959K, paused 18ms, total 18ms
06-21 15:23:31.375: D/dalvikvm(15546): GC_CONCURRENT freed 2K, 8% free 12947K/13959K, paused 12ms+2ms, total 27ms
06-21 15:23:31.595: D/dalvikvm(15546): GC_FOR_ALLOC freed <1K, 8% free 12947K/13959K, paused 44ms, total 44ms
06-21 15:23:31.600: I/dalvikvm-heap(15546): Grow heap (frag case) to 14.134MB for 977464-byte allocation
06-21 15:23:31.635: D/dalvikvm(15546): GC_CONCURRENT freed 0K, 7% free 13901K/14919K, paused 12ms+2ms, total 35ms
06-21 15:23:31.635: D/dalvikvm(15546): WAIT_FOR_CONCURRENT_GC blocked 22ms
06-21 15:23:32.400: E/SpannableStringBuilder(15546): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
06-21 15:23:32.400: E/SpannableStringBuilder(15546): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
06-21 15:23:35.755: I/dalvikvm(15546): Could not find method java.beans.Introspector.getBeanInfo, referenced from method redstone.xmlrpc.serializers.IntrospectingSerializer.serialize
06-21 15:23:35.755: W/dalvikvm(15546): VFY: unable to resolve static method 6817: Ljava/beans/Introspector;.getBeanInfo (Ljava/lang/Class;Ljava/lang/Class;)Ljava/beans/BeanInfo;
06-21 15:23:35.755: D/dalvikvm(15546): VFY: replacing opcode 0x71 at 0x0015
06-21 15:23:35.955: D/dalvikvm(15546): GC_CONCURRENT freed 417K, 7% free 14015K/15047K, paused 12ms+3ms, total 29ms
06-21 15:23:36.770: D/AndroidRuntime(15546): Shutting down VM
06-21 15:23:36.770: W/dalvikvm(15546): threadid=1: thread exiting with uncaught exception (group=0x40ed42a0)
06-21 15:23:36.790: E/AndroidRuntime(15546): FATAL EXCEPTION: main
06-21 15:23:36.790: E/AndroidRuntime(15546): java.lang.RuntimeException: Unable to start activity ComponentInfo{rss.activity/rss.activity.CommentaArticolo}: redstone.xmlrpc.XmlRpcException: The response could not be parsed.
06-21 15:23:36.790: E/AndroidRuntime(15546):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2100)
06-21 15:23:36.790: E/AndroidRuntime(15546):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2125)
06-21 15:23:36.790: E/AndroidRuntime(15546):    at android.app.ActivityThread.access$600(ActivityThread.java:140)
06-21 15:23:36.790: E/AndroidRuntime(15546):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1227)
06-21 15:23:36.790: E/AndroidRuntime(15546):    at android.os.Handler.dispatchMessage(Handler.java:99)
06-21 15:23:36.790: E/AndroidRuntime(15546):    at android.os.Looper.loop(Looper.java:137)
06-21 15:23:36.790: E/AndroidRuntime(15546):    at android.app.ActivityThread.main(ActivityThread.java:4898)
06-21 15:23:36.790: E/AndroidRuntime(15546):    at java.lang.reflect.Method.invokeNative(Native Method)
06-21 15:23:36.790: E/AndroidRuntime(15546):    at java.lang.reflect.Method.invoke(Method.java:511)
06-21 15:23:36.790: E/AndroidRuntime(15546):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1006)
06-21 15:23:36.790: E/AndroidRuntime(15546):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:773)
06-21 15:23:36.790: E/AndroidRuntime(15546):    at dalvik.system.NativeStart.main(Native Method)
06-21 15:23:36.790: E/AndroidRuntime(15546): Caused by: redstone.xmlrpc.XmlRpcException: The response could not be parsed.
06-21 15:23:36.790: E/AndroidRuntime(15546):    at redstone.xmlrpc.XmlRpcClient.handleResponse(Unknown Source)
06-21 15:23:36.790: E/AndroidRuntime(15546):    at redstone.xmlrpc.XmlRpcClient.endCall(Unknown Source)
06-21 15:23:36.790: E/AndroidRuntime(15546):    at redstone.xmlrpc.XmlRpcClient.invoke(Unknown Source)
06-21 15:23:36.790: E/AndroidRuntime(15546):    at redstone.xmlrpc.XmlRpcProxy.invoke(Unknown Source)
06-21 15:23:36.790: E/AndroidRuntime(15546):    at net.bican.wordpress.$Proxy1.getRecentPosts(Native Method)
06-21 15:23:36.790: E/AndroidRuntime(15546):    at net.bican.wordpress.Wordpress.getRecentPosts(Wordpress.java:497)
06-21 15:23:36.790: E/AndroidRuntime(15546):    at rss.util.MyWordpress.getPostIDFromURL(MyWordpress.java:33)
06-21 15:23:36.790: E/AndroidRuntime(15546):    at rss.activity.CommentaArticolo.onCreate(CommentaArticolo.java:38)
06-21 15:23:36.790: E/AndroidRuntime(15546):    at android.app.Activity.performCreate(Activity.java:5206)
06-21 15:23:36.790: E/AndroidRuntime(15546):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1083)
06-21 15:23:36.790: E/AndroidRuntime(15546):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2064)
06-21 15:23:36.790: E/AndroidRuntime(15546):    ... 11 more
06-21 15:23:36.790: E/AndroidRuntime(15546): Caused by: redstone.xmlrpc.XmlRpcException: Could not instantiate XMLReader parser
06-21 15:23:36.790: E/AndroidRuntime(15546):    at redstone.xmlrpc.XmlRpcParser.parse(Unknown Source)
06-21 15:23:36.790: E/AndroidRuntime(15546):    ... 22 more
06-21 15:23:36.790: E/AndroidRuntime(15546): Caused by: org.xml.sax.SAXException: Can't create default XMLReader; is system property org.xml.sax.driver set?
06-21 15:23:36.790: E/AndroidRuntime(15546):    at org.xml.sax.helpers.XMLReaderFactory.createXMLReader(XMLReaderFactory.java:156)
06-21 15:23:36.790: E/AndroidRuntime(15546):    ... 23 more
« Ultima modifica: 21 Giugno 2013, 16:26:20 CEST da pcg4m3s »

Offline iceweasel

  • Moderatore globale
  • Utente senior
  • *****
  • Post: 878
  • Respect: +147
    • Mostra profilo
  • Dispositivo Android:
    LGE P990 - Google Nexus 5
  • Sistema operativo:
    Linux Debian Sid
Re:Problema utilizzi libreria java esterna java-wordpress su Android
« Risposta #1 il: 21 Giugno 2013, 16:53:35 CEST »
0
Basta leggere con attenzione il messaggio d'errore, dice esattamente il motivo:

Citazione
...
06-21 15:23:35.755: I/dalvikvm(15546): Could not find method java.beans.Introspector.getBeanInfo, referenced from method redstone.xmlrpc.serializers.IntrospectingSerializer.serialize
06-21 15:23:35.755: W/dalvikvm(15546): VFY: unable to resolve static method 6817: Ljava/beans/Introspector;.getBeanInfo (Ljava/lang/Class;Ljava/lang/Class;)Ljava/beans/BeanInfo;
...

La classe "java.beans.Introspector" non esiste nel API di Android.

Anche se il linguaggio di programmazione è lo stesso un programma scritto per l'ambiente Java di Oracle non è detto che funzioni con API di Android.
adb logcat | tee /tmp/logcat | grep TAG