Re: [Simple-support] Simple Xml 2.6.6 on Android device fails
Brought to you by:
niallg
|
From: Niall G. <gal...@ya...> - 2012-11-21 10:19:51
|
There is no problem here, ignore the error. It is doing exactly what it is supposed to do StAX does not come with Android, it will failover to XmlPull.
You need to ignore the log. If you think there is a problem you will need to explain what the problem is.
--- On Wed, 21/11/12, Mihael Schmidt <msc...@sg...> wrote:
> From: Mihael Schmidt <msc...@sg...>
> Subject: [Simple-support] Simple Xml 2.6.6 on Android device fails
> To: sim...@li...
> Received: Wednesday, 21 November, 2012, 12:22 AM
>
>
>
>
>
>
> Hi,
>
>
>
> first thanx for the great xml library. Good job.
>
>
>
> But now I am facing a little problem. A REST web service
> returns an
> object (xml) from a POST call. The call succeeds but
> when getting
> the object from the response body I am getting an
> error.
>
>
>
>
> HttpComponentsClientHttpRequestFactory requestFactory =
> createHttpRequestFactory(context);
>
>
> RestTemplate restTemplate = new
> RestTemplate(requestFactory);
>
>
> restTemplate.getMessageConverters().add(new
> SimpleXmlHttpMessageConverter());
>
> try {
>
>
>
> ResponseEntity<Interessent> response =
> restTemplate.postForEntity(new URI(url), prospect,
> Interessent.class);
>
>
>
>
>
>
>
> return response.getBody(); /// <--- here it
> fails
>
> }
>
>
> catch(Exception e) {
>
>
>
> Log.e(ProspectService.class.getName(), "Error on rest
> call. " + e.getClass().getName() + ": "
> +
> e.getLocalizedMessage());
>
>
>
> return null;
>
> }
>
>
>
> Output:
>
>
>
> 11-21 09:09:06.121: I/dalvikvm(27169): Could not find
> method
> javax.xml.stream.XMLInputFactory.newInstance,
> referenced from
> method
> org.simpleframework.xml.stream.StreamProvider.<init>
>
> 11-21 09:09:06.121: W/dalvikvm(27169): VFY: unable to
> resolve
> static method 1021:
> Ljavax/xml/stream/XMLInputFactory;.newInstance
> ()Ljavax/xml/stream/XMLInputFactory;
>
> 11-21 09:09:06.121: D/dalvikvm(27169): VFY: replacing
> opcode 0x71
> at 0x0003
>
> 11-21 09:09:06.121: W/dalvikvm(27169): VFY: unable to
> find class
> referenced in signature
> (Ljavax/xml/stream/XMLEventReader;)
>
> 11-21 09:09:06.125: W/dalvikvm(27169): VFY: unable to
> find class
> referenced in signature
> (Ljavax/xml/stream/XMLEventReader;)
>
> 11-21 09:09:06.125: I/dalvikvm(27169): Could not find
> method
> javax.xml.stream.XMLInputFactory.createXMLEventReader,
> referenced
> from method
> org.simpleframework.xml.stream.StreamProvider.provide
>
> 11-21 09:09:06.125: W/dalvikvm(27169): VFY: unable to
> resolve
> virtual method 1019:
>
> Ljavax/xml/stream/XMLInputFactory;.createXMLEventReader
>
> (Ljava/io/InputStream;)Ljavax/xml/stream/XMLEventReader;
>
> 11-21 09:09:06.125: D/dalvikvm(27169): VFY: replacing
> opcode 0x6e
> at 0x0002
>
> 11-21 09:09:06.125: I/dalvikvm(27169): Could not find
> method
> javax.xml.stream.XMLInputFactory.createXMLEventReader,
> referenced
> from method
> org.simpleframework.xml.stream.StreamProvider.provide
>
> 11-21 09:09:06.125: W/dalvikvm(27169): VFY: unable to
> resolve
> virtual method 1020:
>
> Ljavax/xml/stream/XMLInputFactory;.createXMLEventReader
>
> (Ljava/io/Reader;)Ljavax/xml/stream/XMLEventReader;
>
>
>
> I am using RestTemplate 1.0.0.RC1 and Simple XML 2.6.6.
>
>
>
> The weirdest thing is that it works on the Android
> emulator (tested
> Android 3.2 and 4.2) and it fails on a real smartphone
> (Android
> 4.1.2).
>
>
>
> What is also weird is that if I debug the app I can see
> the correct
> values in the response object.
>
>
>
> Any ideas?
>
>
>
> Thanx in advance.
>
>
>
> Regards
>
>
>
> Mihael
>
>
>
>
>
>
> Schulz Gebäudeservice GmbH & Co.
> KGDr.-Max-Ilgner-Straße
> 1732339
> EspelkampPersönlich haftende
> Gesellschafterin:Gebäudereinigung Joachim
> SchulzVerwaltungsgesellschaft
> mbHTelefon: +49 5772 9100
> 0Telefax: +49
> 5772 9100 11Email: zen...@sg...: www.sgbs.deGeschäftsführer: Joachim und Dirk Schulz,
> Norbert KosicaHandelsregister Bad Oeynhausen: HRA 5902, HRB
> 8591UST-Id-Nr.: DE
> 125752702
> -----Inline Attachment Follows-----
>
> ------------------------------------------------------------------------------
> Monitor your physical, virtual and cloud infrastructure from
> a single
> web console. Get in-depth insight into apps, servers,
> databases, vmware,
> SAP, cloud infrastructure, etc. Download 30-day Free Trial.
> Pricing starts from $795 for 25 servers or applications!
> http://p.sf.net/sfu/zoho_dev2dev_nov
> -----Inline Attachment Follows-----
>
> _______________________________________________
> Simple-support mailing list
> Sim...@li...
> https://lists.sourceforge.net/lists/listinfo/simple-support
>
|