[Simple-support] Simple Xml 2.6.6 on Android device fails
Brought to you by:
niallg
|
From: Mihael S. <msc...@sg...> - 2012-11-21 08:50:19
|
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. KG
Dr.-Max-Ilgner-Straße 17
32339 Espelkamp
Persönlich haftende Gesellschafterin:
Gebäudereinigung Joachim Schulz
Verwaltungsgesellschaft mbH
Telefon: +49 5772 9100 0
Telefax: +49 5772 9100 11
Email: zen...@sg...
Internet: www.sgbs.de
Geschäftsführer: Joachim und Dirk Schulz, Norbert Kosica
Handelsregister Bad Oeynhausen: HRA 5902, HRB 8591
UST-Id-Nr.: DE 125752702
|