simple-support Mailing List for Simple (Page 34)
Brought to you by:
niallg
You can subscribe to this list here.
| 2007 |
Jan
|
Feb
(2) |
Mar
(2) |
Apr
(13) |
May
(13) |
Jun
(27) |
Jul
(4) |
Aug
(14) |
Sep
(7) |
Oct
|
Nov
(6) |
Dec
(24) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2008 |
Jan
|
Feb
(21) |
Mar
(10) |
Apr
(15) |
May
(24) |
Jun
(24) |
Jul
(30) |
Aug
(5) |
Sep
(19) |
Oct
(27) |
Nov
(16) |
Dec
(24) |
| 2009 |
Jan
(34) |
Feb
(24) |
Mar
(35) |
Apr
(26) |
May
(8) |
Jun
(17) |
Jul
(28) |
Aug
(31) |
Sep
(36) |
Oct
(35) |
Nov
(20) |
Dec
(16) |
| 2010 |
Jan
(40) |
Feb
(21) |
Mar
(47) |
Apr
(45) |
May
(34) |
Jun
(68) |
Jul
(46) |
Aug
(39) |
Sep
(47) |
Oct
(20) |
Nov
(42) |
Dec
(13) |
| 2011 |
Jan
(41) |
Feb
(16) |
Mar
(32) |
Apr
(44) |
May
(28) |
Jun
(35) |
Jul
(37) |
Aug
(33) |
Sep
(60) |
Oct
(20) |
Nov
(35) |
Dec
(23) |
| 2012 |
Jan
(34) |
Feb
(23) |
Mar
(34) |
Apr
(21) |
May
(48) |
Jun
(24) |
Jul
(31) |
Aug
(39) |
Sep
(25) |
Oct
(10) |
Nov
(27) |
Dec
(28) |
| 2013 |
Jan
(32) |
Feb
(24) |
Mar
(24) |
Apr
(9) |
May
(4) |
Jun
(6) |
Jul
(2) |
Aug
(5) |
Sep
|
Oct
(5) |
Nov
(1) |
Dec
(12) |
| 2014 |
Jan
(14) |
Feb
(16) |
Mar
(5) |
Apr
(3) |
May
(2) |
Jun
(8) |
Jul
(2) |
Aug
|
Sep
(6) |
Oct
|
Nov
(6) |
Dec
|
| 2015 |
Jan
(3) |
Feb
(15) |
Mar
(7) |
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
(1) |
| 2016 |
Jan
|
Feb
(6) |
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2018 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2019 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Alex C. <Ale...@so...> - 2011-04-29 09:45:17
|
Hello,
first of all, thanks for the great framework!
In your samples you did not specify the case like this:
-------------------------- properties.xml ------------------
<?xml version="1.0" encoding="UTF-8"?>
<propertyList>
<name>example1</name>
<name>example2</name>
<name>example3</name>
<entry key="one">
<value>first value</value>
</entry>
<entry key="two">
<value>second value</value>
</entry>
<entry key="three">
<value>third value</value>
</entry>
</propertyList>
-----------------------------------------------------
the case is I need to dig thru two lists within one parent element - how this can be done?
the code below is not working (neither with inline=true or not)
------------------------ Entry.java -------------------
@Root
public class Entry {
@Attribute
protected String key;
@Element
protected String value;
public String getKey() {
return key;
}
}
// ------------------------ PropertyList.java -------------------
@Root
public class PropertyList {
@ElementList(inline=true)
private List<String> name;
@ElementList(inline=true)
private List<Entry> list;
public List<String> getName() {
return name;
}
public List getList() {
return list;
}
}
thanks in advance!
Alex.
|
|
From: Dirk D. <dir...@vm...> - 2011-04-28 12:39:45
|
Hello SimpleXML Users !, Just started with SimpleXML on Android, since I have to consume a XML defined by my customer from an android app. I have problems to get the "Gesamt" attribute from the <Stellen> Element deserialized, as shown in the XML example below <?xml version="1.0" encoding="UTF-8"?> <Result xsi:noNamespaceSchemaLocation=" http://services.odav.de/lehrstellenradar/result.xsd" xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance"> <Content> <*Stellen Gesamt="30">* <Stelle> <id>74_4911</id> <Typ>Lehrstelle</Typ> <Anzahl>1</Anzahl> <Beruf>Fahrzeuglackierer/in</Beruf> <Fachrichtung>Keine Fachrichtung</Fachrichtung> <Beginn>01.09.10</Beginn> <Featured>0</Featured> <Link> http://www.hwk-muenchen.de/74,0,jobboarddetail.html?lcj_id=xxx</Link> </Stelle> <Stelle> <id>74_4910</id> <Typ>Lehrstelle</Typ> <Anzahl>1</Anzahl> <Beruf>Karosserie- und Fahrzeugbaumechaniker/in</Beruf> <Fachrichtung>Keine Fachrichtung</Fachrichtung> <Beginn>01.09.10</Beginn> <Featured>0</Featured> <Link> http://www.hwk-muenchen.de/74,0,jobboarddetail.html?lcj_id=xxx</Link> </Stelle> </Stellen> </Content> </Result> I have defined the following classes to deserialize the result package de.vmapit.dto; @Root(strict=false) public class GetRecentJobListResult { @Element(name="Content") public Stellen content; } @Element(name="Stellen") public class Stellen implements Serializable { @ElementList(name="Stellen") public List<Stelle> stellen; @Attribute(name="Gesamt") public String gesamt; } If I execute GetRecentJobListResult res = serializer.read(GetRecentJobListResult.class, new File("stellen.xml"), false); the following execption gets thrown: org.simpleframework.xml.core.ValueRequiredException: Unable to satisfy @org.simpleframework.xml.Attribute(name=Gesamt, empty=, required=true) on field 'gesamt' public java.lang.String de.vmapit.dto.Stellen.gesamt for class de.vmapit.dto.Stellen at line 3 Can anyone tell me, what I do wrong ? Regards, Dirk |
|
From: Niall G. <gal...@ya...> - 2011-04-28 09:46:08
|
Hi, Yes, I have done the same. Also check out this http://massaioli.homelinux.com/wordpress/2011/04/21/simple-xml-in-android-1-5-and-up/ it uses Simple 2.5.2 and works from Android 1.5 and up. --- On Wed, 27/4/11, Alec Plumb <al...@et...> wrote: From: Alec Plumb <al...@et...> Subject: Re: [Simple-support] java.lang.VerifyError on Android To: sim...@li... Received: Wednesday, 27 April, 2011, 2:18 PM I see that you are getting your error within a junit test case. I've had the same kind of problem testing projects with external libraries. If this is the same problem, then what you need to do is remove the library from your test project, then go to your main project, Project->Properties->Java Build Path->Order and Export, and export the simple library. I'm trying to use Simple XML on Android and although I have seen many say that it works on Android I have not been able to get the basic example from the tutorial working. -----Inline Attachment Follows----- ------------------------------------------------------------------------------ WhatsUp Gold - Download Free Network Management Software The most intuitive, comprehensive, and cost-effective network management toolset available today. Delivers lowest initial acquisition cost and overall TCO of any competing solution. http://p.sf.net/sfu/whatsupgold-sd -----Inline Attachment Follows----- _______________________________________________ Simple-support mailing list Sim...@li... https://lists.sourceforge.net/lists/listinfo/simple-support |
|
From: Alec P. <al...@et...> - 2011-04-27 21:18:23
|
I see that you are getting your error within a junit test case. I've had the same kind of problem testing projects with external libraries. If this is the same problem, then what you need to do is remove the library from your test project, then go to your main project, Project->Properties->Java Build Path->Order and Export, and export the simple library. I'm trying to use Simple XML on Android and although I have seen many say that it works on Android I have not been able to get the basic example from the tutorial working. |
|
From: Niall G. <gal...@ya...> - 2011-04-26 07:12:48
|
I have run it on Android version 2.2, with Simple 2.5.2, it works fine. I noticed on your stack trace that there is some instrumentation, this may be causing an issue. Try running it without using this test runner.
--- On Thu, 21/4/11, James Oltmans <Jam...@ip...> wrote:
> From: James Oltmans <Jam...@ip...>
> Subject: RE: [Simple-support] java.lang.VerifyError on Android
> To: "Niall Gallagher" <gal...@ya...>, "sim...@li..." <sim...@li...>
> Received: Thursday, 21 April, 2011, 3:47 PM
> Android 8 (2.2)
>
> -----Original Message-----
> From: Niall Gallagher [mailto:gal...@ya...]
>
> Sent: Thursday, April 21, 2011 4:14 PM
> To: sim...@li...;
> James Oltmans
> Subject: RE: [Simple-support] java.lang.VerifyError on
> Android
>
> Hi,
>
> I will take a look, which version of android are you
> using?
>
> Thanks,
> Niall
>
> --- On Thu, 21/4/11, James Oltmans <Jam...@ip...>
> wrote:
>
> > From: James Oltmans <Jam...@ip...>
> > Subject: RE: [Simple-support] java.lang.VerifyError on
> Android
> > To: "Niall Gallagher" <gal...@ya...>,
>
> > "sim...@li..."
>
> > <sim...@li...>
> > Received: Thursday, 21 April, 2011, 2:02 PM This is
> all it would tell
> > me
> >
> > Stack Trace:
> > 04-19 12:30:21.454: INFO/TestRunner(5184): failed:
> >
> testSerialize(com.iphase3.android.concert.test.SimpleXmlTest)
> > 04-19 12:30:21.454: INFO/TestRunner(5184): ----- begin
> exception -----
> > 04-19 12:30:21.534: INFO/TestRunner(5184):
> > java.lang.VerifyError:
> > org.simpleframework.xml.core.StructureBuilder
> > 04-19 12:30:21.534: INFO/TestRunner(5184):
> > at
> >
> org.simpleframework.xml.core.Scanner.<init>(Scanner.java:89)
> > 04-19 12:30:21.534: INFO/TestRunner(5184):
> > at
> >
> org.simpleframework.xml.core.ScannerFactory.getInstance(ScannerFactory
> > .java:66)
> > 04-19 12:30:21.534: INFO/TestRunner(5184):
> > at
> >
> org.simpleframework.xml.core.Support.getScanner(Support.java:170)
> > 04-19 12:30:21.534: INFO/TestRunner(5184):
> > at
> >
> org.simpleframework.xml.core.Support.getName(Support.java:232)
> > 04-19 12:30:21.534: INFO/TestRunner(5184):
> > at
> >
> org.simpleframework.xml.core.Source.getName(Source.java:250)
> > 04-19 12:30:21.534: INFO/TestRunner(5184):
> > at
> >
> org.simpleframework.xml.core.Traverser.getName(Traverser.java:284)
> > 04-19 12:30:21.534: INFO/TestRunner(5184):
> > at
> >
> org.simpleframework.xml.core.Traverser.write(Traverser.java:203)
> > 04-19 12:30:21.534: INFO/TestRunner(5184):
> > at
> >
> org.simpleframework.xml.core.Traverser.write(Traverser.java:186)
> > 04-19 12:30:21.534: INFO/TestRunner(5184):
> > at
> >
> org.simpleframework.xml.core.Persister.write(Persister.java:1187)
> > 04-19 12:30:21.534: INFO/TestRunner(5184):
> > at
> >
> org.simpleframework.xml.core.Persister.write(Persister.java:1169)
> > 04-19 12:30:21.534: INFO/TestRunner(5184):
> > at
> >
> org.simpleframework.xml.core.Persister.write(Persister.java:1147)
> > 04-19 12:30:21.534: INFO/TestRunner(5184):
> > at
> >
> org.simpleframework.xml.core.Persister.write(Persister.java:1266)
> > 04-19 12:30:21.534: INFO/TestRunner(5184):
> > at
> >
> org.simpleframework.xml.core.Persister.write(Persister.java:1248)
> > 04-19 12:30:21.534: INFO/TestRunner(5184):
> > at
> >
> org.simpleframework.xml.core.Persister.write(Persister.java:1229)
> > 04-19 12:30:21.534: INFO/TestRunner(5184):
> > at
> >
> org.simpleframework.xml.core.Persister.write(Persister.java:1208)
> > 04-19 12:30:21.534: INFO/TestRunner(5184):
> > at
> >
> com.iphase3.android.concert.test.SimpleXmlTest.testSerialize(SimpleXml
> > Test.java:32)
> > 04-19 12:30:21.534: INFO/TestRunner(5184):
> > at
> > java.lang.reflect.Method.invokeNative(Native Method)
> > 04-19 12:30:21.534: INFO/TestRunner(5184):
> > at
> > java.lang.reflect.Method.invoke(Method.java:521)
> > 04-19 12:30:21.534: INFO/TestRunner(5184):
> > at
> > junit.framework.TestCase.runTest(TestCase.java:154)
> > 04-19 12:30:21.534: INFO/TestRunner(5184):
> > at
> > junit.framework.TestCase.runBare(TestCase.java:127)
> > 04-19 12:30:21.534: INFO/TestRunner(5184):
> > at
> >
> junit.framework.TestResult$1.protect(TestResult.java:106)
> > 04-19 12:30:21.534: INFO/TestRunner(5184):
> > at
> >
> junit.framework.TestResult.runProtected(TestResult.java:124)
> > 04-19 12:30:21.534: INFO/TestRunner(5184):
> > at
> > junit.framework.TestResult.run(TestResult.java:109)
> > 04-19 12:30:21.534: INFO/TestRunner(5184):
> > at
> > junit.framework.TestCase.run(TestCase.java:118)
> > 04-19 12:30:21.534: INFO/TestRunner(5184):
> > at
> >
> android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:169)
> > 04-19 12:30:21.534: INFO/TestRunner(5184):
> > at
> >
> android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:154)
> > 04-19 12:30:21.534: INFO/TestRunner(5184):
> > at
> >
> android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunn
> > er.java:520)
> > 04-19 12:30:21.534: INFO/TestRunner(5184):
> > at
> >
> android.app.Instrumentation$InstrumentationThread.run(Instrumentation.
> > java:1606)
> > 04-19 12:30:21.534: INFO/TestRunner(5184): ----- end
> exception -----
> >
> > Code:
> > Here’s the code (the error occurs on
> > “serializer.write(example, result);” according to
> the stack trace):
> > import java.io.File;
> >
> > import android.os.Environment;
> > import android.test.AndroidTestCase;
> > import android.test.AssertionFailedError;
> >
> > import org.simpleframework.xml.Serializer;
> > import org.simpleframework.xml.core.Persister;
> >
> > public class SimpleXmlTest extends AndroidTestCase {
> >
> > public static final String TEST_DIR =
> "ConcertTestDir";
> > public void testSerialize() {
> > Serializer serializer = new
> > Persister();
> > Example example = new
> > Example("Example message", 123);
> > final File baseDir = new File(
> > Environment.getExternalStorageDirectory() +
> File.separator + TEST_DIR
> > + File.separator );
> > File result = new
> > File(baseDir.getAbsolutePath()+"example.xml");
> > try {
> >
> > serializer.write(example, result);
> > } catch ( Exception e ) {
> >
> > System.out.println("Exception thrown of type:
> > "+e.getClass().getName());
> >
> > e.printStackTrace();
> > throw new
> > AssertionFailedError("Serializer failed with: "+e);
> > }
> > result.delete();
> > }
> > }
> >
> > -----Original Message-----
> > From: Niall Gallagher [mailto:gal...@ya...]
> >
> > Sent: Thursday, April 21, 2011 2:54 PM
> > To: sim...@li...;
> > James Oltmans
> > Subject: RE: [Simple-support] java.lang.VerifyError on
> Android
> >
> > What was the problem with 2.5.2? The VerifyError in
> the
> > StructureBuilder was fixed in 2.5.2.
> >
> >
>
|
|
From: Niall G. <gal...@ya...> - 2011-04-26 07:02:56
|
Hi, I would copy the cycle strategy and modify it for your own needs. The code is open source so you can just hack your own version in your own package. It should be easy to do. Niall --- On Fri, 22/4/11, Atkins, Brian <Bri...@ne...> wrote: From: Atkins, Brian <Bri...@ne...> Subject: [Simple-support] Using attribute as object ref? To: sim...@li... Received: Friday, 22 April, 2011, 8:45 AM I have a list of objects I declare in a config file that I need to reference elsewhere in the config file. I know I can use the CycleStrategy to do object references, but what I want is to be able to use an attribute as the identity and the reference. For example <config> <site> <site name=”SFO”> <elementA>value</elementA> … etc. </site> </sites> <system name=”hostA”> <site ref=”SFO”/> </system></config From what I can tell, the ID and REF values used in the CycleStrategy are not accessible after deserialization. Is there a way to do this, perhaps with a different strategy? My alternative is to use a different element, <SiteRef name=”SFO”/>, but I’m hoping to use the same element name for clarity. Thanks!Brian Atkins Rapid Response EngineeringNetApp 919-476-5845 Direct ab...@ne... www.netapp.com -----Inline Attachment Follows----- ------------------------------------------------------------------------------ Fulfilling the Lean Software Promise Lean software platforms are now widely adopted and the benefits have been demonstrated beyond question. Learn why your peers are replacing JEE containers with lightweight application servers - and what you can gain from the move. http://p.sf.net/sfu/vmware-sfemails -----Inline Attachment Follows----- _______________________________________________ Simple-support mailing list Sim...@li... https://lists.sourceforge.net/lists/listinfo/simple-support |
|
From: Christopher K. <ki...@na...> - 2011-04-23 03:30:55
|
I'm trying to use UnionList to persist a list of mixed-class elements, where the list may also be empty. I can replicate the tutorial example just fine when there are items in the list. But if I try with an empty list, I get: <task name="setup"> <delete/> </task> Is it possible to set the list as not required? I would like to see output as: <task name="setup"> </task> Thanks, Chris |
|
From: Jason <bu...@ya...> - 2011-04-23 00:31:25
|
Hi, I was reading that simple xml supports android, but I am having a problem with the apk building and installing via maven. I get the core-library warning that I've seen in other emails about android.Unfortunately, I haven't figured out how to solve it. The current maven plugin doesn't seem to properly support the -core-library flag,I was wondering if it was possible in maven to somehow exclude the Stax library as it has been indicated simple can run without it. I've also used simple on another project and it works very well. Thank you this, it was so much easier to read/use than jaxp. Thanks again. |
|
From: James O. <Jam...@ip...> - 2011-04-21 22:47:59
|
Android 8 (2.2)
-----Original Message-----
From: Niall Gallagher [mailto:gal...@ya...]
Sent: Thursday, April 21, 2011 4:14 PM
To: sim...@li...; James Oltmans
Subject: RE: [Simple-support] java.lang.VerifyError on Android
Hi,
I will take a look, which version of android are you using?
Thanks,
Niall
--- On Thu, 21/4/11, James Oltmans <Jam...@ip...> wrote:
> From: James Oltmans <Jam...@ip...>
> Subject: RE: [Simple-support] java.lang.VerifyError on Android
> To: "Niall Gallagher" <gal...@ya...>,
> "sim...@li..."
> <sim...@li...>
> Received: Thursday, 21 April, 2011, 2:02 PM This is all it would tell
> me
>
> Stack Trace:
> 04-19 12:30:21.454: INFO/TestRunner(5184): failed:
> testSerialize(com.iphase3.android.concert.test.SimpleXmlTest)
> 04-19 12:30:21.454: INFO/TestRunner(5184): ----- begin exception -----
> 04-19 12:30:21.534: INFO/TestRunner(5184):
> java.lang.VerifyError:
> org.simpleframework.xml.core.StructureBuilder
> 04-19 12:30:21.534: INFO/TestRunner(5184):
> at
> org.simpleframework.xml.core.Scanner.<init>(Scanner.java:89)
> 04-19 12:30:21.534: INFO/TestRunner(5184):
> at
> org.simpleframework.xml.core.ScannerFactory.getInstance(ScannerFactory
> .java:66)
> 04-19 12:30:21.534: INFO/TestRunner(5184):
> at
> org.simpleframework.xml.core.Support.getScanner(Support.java:170)
> 04-19 12:30:21.534: INFO/TestRunner(5184):
> at
> org.simpleframework.xml.core.Support.getName(Support.java:232)
> 04-19 12:30:21.534: INFO/TestRunner(5184):
> at
> org.simpleframework.xml.core.Source.getName(Source.java:250)
> 04-19 12:30:21.534: INFO/TestRunner(5184):
> at
> org.simpleframework.xml.core.Traverser.getName(Traverser.java:284)
> 04-19 12:30:21.534: INFO/TestRunner(5184):
> at
> org.simpleframework.xml.core.Traverser.write(Traverser.java:203)
> 04-19 12:30:21.534: INFO/TestRunner(5184):
> at
> org.simpleframework.xml.core.Traverser.write(Traverser.java:186)
> 04-19 12:30:21.534: INFO/TestRunner(5184):
> at
> org.simpleframework.xml.core.Persister.write(Persister.java:1187)
> 04-19 12:30:21.534: INFO/TestRunner(5184):
> at
> org.simpleframework.xml.core.Persister.write(Persister.java:1169)
> 04-19 12:30:21.534: INFO/TestRunner(5184):
> at
> org.simpleframework.xml.core.Persister.write(Persister.java:1147)
> 04-19 12:30:21.534: INFO/TestRunner(5184):
> at
> org.simpleframework.xml.core.Persister.write(Persister.java:1266)
> 04-19 12:30:21.534: INFO/TestRunner(5184):
> at
> org.simpleframework.xml.core.Persister.write(Persister.java:1248)
> 04-19 12:30:21.534: INFO/TestRunner(5184):
> at
> org.simpleframework.xml.core.Persister.write(Persister.java:1229)
> 04-19 12:30:21.534: INFO/TestRunner(5184):
> at
> org.simpleframework.xml.core.Persister.write(Persister.java:1208)
> 04-19 12:30:21.534: INFO/TestRunner(5184):
> at
> com.iphase3.android.concert.test.SimpleXmlTest.testSerialize(SimpleXml
> Test.java:32)
> 04-19 12:30:21.534: INFO/TestRunner(5184):
> at
> java.lang.reflect.Method.invokeNative(Native Method)
> 04-19 12:30:21.534: INFO/TestRunner(5184):
> at
> java.lang.reflect.Method.invoke(Method.java:521)
> 04-19 12:30:21.534: INFO/TestRunner(5184):
> at
> junit.framework.TestCase.runTest(TestCase.java:154)
> 04-19 12:30:21.534: INFO/TestRunner(5184):
> at
> junit.framework.TestCase.runBare(TestCase.java:127)
> 04-19 12:30:21.534: INFO/TestRunner(5184):
> at
> junit.framework.TestResult$1.protect(TestResult.java:106)
> 04-19 12:30:21.534: INFO/TestRunner(5184):
> at
> junit.framework.TestResult.runProtected(TestResult.java:124)
> 04-19 12:30:21.534: INFO/TestRunner(5184):
> at
> junit.framework.TestResult.run(TestResult.java:109)
> 04-19 12:30:21.534: INFO/TestRunner(5184):
> at
> junit.framework.TestCase.run(TestCase.java:118)
> 04-19 12:30:21.534: INFO/TestRunner(5184):
> at
> android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:169)
> 04-19 12:30:21.534: INFO/TestRunner(5184):
> at
> android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:154)
> 04-19 12:30:21.534: INFO/TestRunner(5184):
> at
> android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunn
> er.java:520)
> 04-19 12:30:21.534: INFO/TestRunner(5184):
> at
> android.app.Instrumentation$InstrumentationThread.run(Instrumentation.
> java:1606)
> 04-19 12:30:21.534: INFO/TestRunner(5184): ----- end exception -----
>
> Code:
> Here’s the code (the error occurs on
> “serializer.write(example, result);” according to the stack trace):
> import java.io.File;
>
> import android.os.Environment;
> import android.test.AndroidTestCase;
> import android.test.AssertionFailedError;
>
> import org.simpleframework.xml.Serializer;
> import org.simpleframework.xml.core.Persister;
>
> public class SimpleXmlTest extends AndroidTestCase {
>
> public static final String TEST_DIR = "ConcertTestDir";
> public void testSerialize() {
> Serializer serializer = new
> Persister();
> Example example = new
> Example("Example message", 123);
> final File baseDir = new File(
> Environment.getExternalStorageDirectory() + File.separator + TEST_DIR
> + File.separator );
> File result = new
> File(baseDir.getAbsolutePath()+"example.xml");
> try {
>
> serializer.write(example, result);
> } catch ( Exception e ) {
>
> System.out.println("Exception thrown of type:
> "+e.getClass().getName());
>
> e.printStackTrace();
> throw new
> AssertionFailedError("Serializer failed with: "+e);
> }
> result.delete();
> }
> }
>
> -----Original Message-----
> From: Niall Gallagher [mailto:gal...@ya...]
>
> Sent: Thursday, April 21, 2011 2:54 PM
> To: sim...@li...;
> James Oltmans
> Subject: RE: [Simple-support] java.lang.VerifyError on Android
>
> What was the problem with 2.5.2? The VerifyError in the
> StructureBuilder was fixed in 2.5.2.
>
>
|
|
From: Niall G. <gal...@ya...> - 2011-04-21 22:14:24
|
Hi,
I will take a look, which version of android are you using?
Thanks,
Niall
--- On Thu, 21/4/11, James Oltmans <Jam...@ip...> wrote:
> From: James Oltmans <Jam...@ip...>
> Subject: RE: [Simple-support] java.lang.VerifyError on Android
> To: "Niall Gallagher" <gal...@ya...>, "sim...@li..." <sim...@li...>
> Received: Thursday, 21 April, 2011, 2:02 PM
> This is all it would tell me
>
> Stack Trace:
> 04-19 12:30:21.454: INFO/TestRunner(5184): failed:
> testSerialize(com.iphase3.android.concert.test.SimpleXmlTest)
> 04-19 12:30:21.454: INFO/TestRunner(5184): ----- begin
> exception -----
> 04-19 12:30:21.534: INFO/TestRunner(5184):
> java.lang.VerifyError:
> org.simpleframework.xml.core.StructureBuilder
> 04-19 12:30:21.534: INFO/TestRunner(5184):
> at
> org.simpleframework.xml.core.Scanner.<init>(Scanner.java:89)
> 04-19 12:30:21.534: INFO/TestRunner(5184):
> at
> org.simpleframework.xml.core.ScannerFactory.getInstance(ScannerFactory.java:66)
> 04-19 12:30:21.534: INFO/TestRunner(5184):
> at
> org.simpleframework.xml.core.Support.getScanner(Support.java:170)
> 04-19 12:30:21.534: INFO/TestRunner(5184):
> at
> org.simpleframework.xml.core.Support.getName(Support.java:232)
> 04-19 12:30:21.534: INFO/TestRunner(5184):
> at
> org.simpleframework.xml.core.Source.getName(Source.java:250)
> 04-19 12:30:21.534: INFO/TestRunner(5184):
> at
> org.simpleframework.xml.core.Traverser.getName(Traverser.java:284)
> 04-19 12:30:21.534: INFO/TestRunner(5184):
> at
> org.simpleframework.xml.core.Traverser.write(Traverser.java:203)
> 04-19 12:30:21.534: INFO/TestRunner(5184):
> at
> org.simpleframework.xml.core.Traverser.write(Traverser.java:186)
> 04-19 12:30:21.534: INFO/TestRunner(5184):
> at
> org.simpleframework.xml.core.Persister.write(Persister.java:1187)
> 04-19 12:30:21.534: INFO/TestRunner(5184):
> at
> org.simpleframework.xml.core.Persister.write(Persister.java:1169)
> 04-19 12:30:21.534: INFO/TestRunner(5184):
> at
> org.simpleframework.xml.core.Persister.write(Persister.java:1147)
> 04-19 12:30:21.534: INFO/TestRunner(5184):
> at
> org.simpleframework.xml.core.Persister.write(Persister.java:1266)
> 04-19 12:30:21.534: INFO/TestRunner(5184):
> at
> org.simpleframework.xml.core.Persister.write(Persister.java:1248)
> 04-19 12:30:21.534: INFO/TestRunner(5184):
> at
> org.simpleframework.xml.core.Persister.write(Persister.java:1229)
> 04-19 12:30:21.534: INFO/TestRunner(5184):
> at
> org.simpleframework.xml.core.Persister.write(Persister.java:1208)
> 04-19 12:30:21.534: INFO/TestRunner(5184):
> at
> com.iphase3.android.concert.test.SimpleXmlTest.testSerialize(SimpleXmlTest.java:32)
> 04-19 12:30:21.534: INFO/TestRunner(5184):
> at
> java.lang.reflect.Method.invokeNative(Native Method)
> 04-19 12:30:21.534: INFO/TestRunner(5184):
> at
> java.lang.reflect.Method.invoke(Method.java:521)
> 04-19 12:30:21.534: INFO/TestRunner(5184):
> at
> junit.framework.TestCase.runTest(TestCase.java:154)
> 04-19 12:30:21.534: INFO/TestRunner(5184):
> at
> junit.framework.TestCase.runBare(TestCase.java:127)
> 04-19 12:30:21.534: INFO/TestRunner(5184):
> at
> junit.framework.TestResult$1.protect(TestResult.java:106)
> 04-19 12:30:21.534: INFO/TestRunner(5184):
> at
> junit.framework.TestResult.runProtected(TestResult.java:124)
> 04-19 12:30:21.534: INFO/TestRunner(5184):
> at
> junit.framework.TestResult.run(TestResult.java:109)
> 04-19 12:30:21.534: INFO/TestRunner(5184):
> at
> junit.framework.TestCase.run(TestCase.java:118)
> 04-19 12:30:21.534: INFO/TestRunner(5184):
> at
> android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:169)
> 04-19 12:30:21.534: INFO/TestRunner(5184):
> at
> android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:154)
> 04-19 12:30:21.534: INFO/TestRunner(5184):
> at
> android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:520)
> 04-19 12:30:21.534: INFO/TestRunner(5184):
> at
> android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1606)
> 04-19 12:30:21.534: INFO/TestRunner(5184): ----- end
> exception -----
>
> Code:
> Here’s the code (the error occurs on
> “serializer.write(example, result);” according to the
> stack trace):
> import java.io.File;
>
> import android.os.Environment;
> import android.test.AndroidTestCase;
> import android.test.AssertionFailedError;
>
> import org.simpleframework.xml.Serializer;
> import org.simpleframework.xml.core.Persister;
>
> public class SimpleXmlTest extends AndroidTestCase
> {
>
> public static final String TEST_DIR =
> "ConcertTestDir";
> public void testSerialize() {
> Serializer serializer = new
> Persister();
> Example example = new
> Example("Example message", 123);
> final File baseDir = new File(
> Environment.getExternalStorageDirectory() + File.separator +
> TEST_DIR + File.separator );
> File result = new
> File(baseDir.getAbsolutePath()+"example.xml");
> try {
>
> serializer.write(example, result);
> } catch ( Exception e ) {
>
> System.out.println("Exception thrown of type:
> "+e.getClass().getName());
>
> e.printStackTrace();
> throw new
> AssertionFailedError("Serializer failed with: "+e);
> }
> result.delete();
> }
> }
>
> -----Original Message-----
> From: Niall Gallagher [mailto:gal...@ya...]
>
> Sent: Thursday, April 21, 2011 2:54 PM
> To: sim...@li...;
> James Oltmans
> Subject: RE: [Simple-support] java.lang.VerifyError on
> Android
>
> What was the problem with 2.5.2? The VerifyError in the
> StructureBuilder was fixed in 2.5.2.
>
>
|
|
From: James O. <Jam...@ip...> - 2011-04-21 21:02:42
|
This is all it would tell me
Stack Trace:
04-19 12:30:21.454: INFO/TestRunner(5184): failed: testSerialize(com.iphase3.android.concert.test.SimpleXmlTest)
04-19 12:30:21.454: INFO/TestRunner(5184): ----- begin exception -----
04-19 12:30:21.534: INFO/TestRunner(5184): java.lang.VerifyError: org.simpleframework.xml.core.StructureBuilder
04-19 12:30:21.534: INFO/TestRunner(5184): at org.simpleframework.xml.core.Scanner.<init>(Scanner.java:89)
04-19 12:30:21.534: INFO/TestRunner(5184): at org.simpleframework.xml.core.ScannerFactory.getInstance(ScannerFactory.java:66)
04-19 12:30:21.534: INFO/TestRunner(5184): at org.simpleframework.xml.core.Support.getScanner(Support.java:170)
04-19 12:30:21.534: INFO/TestRunner(5184): at org.simpleframework.xml.core.Support.getName(Support.java:232)
04-19 12:30:21.534: INFO/TestRunner(5184): at org.simpleframework.xml.core.Source.getName(Source.java:250)
04-19 12:30:21.534: INFO/TestRunner(5184): at org.simpleframework.xml.core.Traverser.getName(Traverser.java:284)
04-19 12:30:21.534: INFO/TestRunner(5184): at org.simpleframework.xml.core.Traverser.write(Traverser.java:203)
04-19 12:30:21.534: INFO/TestRunner(5184): at org.simpleframework.xml.core.Traverser.write(Traverser.java:186)
04-19 12:30:21.534: INFO/TestRunner(5184): at org.simpleframework.xml.core.Persister.write(Persister.java:1187)
04-19 12:30:21.534: INFO/TestRunner(5184): at org.simpleframework.xml.core.Persister.write(Persister.java:1169)
04-19 12:30:21.534: INFO/TestRunner(5184): at org.simpleframework.xml.core.Persister.write(Persister.java:1147)
04-19 12:30:21.534: INFO/TestRunner(5184): at org.simpleframework.xml.core.Persister.write(Persister.java:1266)
04-19 12:30:21.534: INFO/TestRunner(5184): at org.simpleframework.xml.core.Persister.write(Persister.java:1248)
04-19 12:30:21.534: INFO/TestRunner(5184): at org.simpleframework.xml.core.Persister.write(Persister.java:1229)
04-19 12:30:21.534: INFO/TestRunner(5184): at org.simpleframework.xml.core.Persister.write(Persister.java:1208)
04-19 12:30:21.534: INFO/TestRunner(5184): at com.iphase3.android.concert.test.SimpleXmlTest.testSerialize(SimpleXmlTest.java:32)
04-19 12:30:21.534: INFO/TestRunner(5184): at java.lang.reflect.Method.invokeNative(Native Method)
04-19 12:30:21.534: INFO/TestRunner(5184): at java.lang.reflect.Method.invoke(Method.java:521)
04-19 12:30:21.534: INFO/TestRunner(5184): at junit.framework.TestCase.runTest(TestCase.java:154)
04-19 12:30:21.534: INFO/TestRunner(5184): at junit.framework.TestCase.runBare(TestCase.java:127)
04-19 12:30:21.534: INFO/TestRunner(5184): at junit.framework.TestResult$1.protect(TestResult.java:106)
04-19 12:30:21.534: INFO/TestRunner(5184): at junit.framework.TestResult.runProtected(TestResult.java:124)
04-19 12:30:21.534: INFO/TestRunner(5184): at junit.framework.TestResult.run(TestResult.java:109)
04-19 12:30:21.534: INFO/TestRunner(5184): at junit.framework.TestCase.run(TestCase.java:118)
04-19 12:30:21.534: INFO/TestRunner(5184): at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:169)
04-19 12:30:21.534: INFO/TestRunner(5184): at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:154)
04-19 12:30:21.534: INFO/TestRunner(5184): at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:520)
04-19 12:30:21.534: INFO/TestRunner(5184): at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1606)
04-19 12:30:21.534: INFO/TestRunner(5184): ----- end exception -----
Code:
Here’s the code (the error occurs on “serializer.write(example, result);” according to the stack trace):
import java.io.File;
import android.os.Environment;
import android.test.AndroidTestCase;
import android.test.AssertionFailedError;
import org.simpleframework.xml.Serializer;
import org.simpleframework.xml.core.Persister;
public class SimpleXmlTest extends AndroidTestCase
{
public static final String TEST_DIR = "ConcertTestDir";
public void testSerialize() {
Serializer serializer = new Persister();
Example example = new Example("Example message", 123);
final File baseDir = new File( Environment.getExternalStorageDirectory() + File.separator + TEST_DIR + File.separator );
File result = new File(baseDir.getAbsolutePath()+"example.xml");
try {
serializer.write(example, result);
} catch ( Exception e ) {
System.out.println("Exception thrown of type: "+e.getClass().getName());
e.printStackTrace();
throw new AssertionFailedError("Serializer failed with: "+e);
}
result.delete();
}
}
-----Original Message-----
From: Niall Gallagher [mailto:gal...@ya...]
Sent: Thursday, April 21, 2011 2:54 PM
To: sim...@li...; James Oltmans
Subject: RE: [Simple-support] java.lang.VerifyError on Android
What was the problem with 2.5.2? The VerifyError in the StructureBuilder was fixed in 2.5.2.
|
|
From: Niall G. <gal...@ya...> - 2011-04-21 20:54:32
|
What was the problem with 2.5.2? The VerifyError in the StructureBuilder was fixed in 2.5.2.
--- On Thu, 21/4/11, James Oltmans <Jam...@ip...> wrote:
> From: James Oltmans <Jam...@ip...>
> Subject: RE: [Simple-support] java.lang.VerifyError on Android
> To: "Niall Gallagher" <gal...@ya...>, "sim...@li..." <sim...@li...>
> Received: Thursday, 21 April, 2011, 10:21 AM
> No, I could not get 2.5.2 to work.
> Meanwhile 2.3.2 is working for me.
>
> From: Niall Gallagher [mailto:gal...@ya...]
>
> Sent: Thursday, April 21, 2011 12:15 AM
> To: sim...@li...;
> James Oltmans
> Subject: Re: [Simple-support] java.lang.VerifyError on
> Android
>
> You need to download 2.5.2 to fix this.
>
> --- On Tue, 19/4/11, James Oltmans <Jam...@ip...>
> wrote:
>
> From: James Oltmans <Jam...@ip...>
> Subject: [Simple-support] java.lang.VerifyError on Android
> To: "sim...@li..."
> <sim...@li...>
> Received: Tuesday, 19 April, 2011, 11:36 AM
> I’m trying to use Simple XML on Android and although I
> have seen many say that it works on Android I have not been
> able to get the basic example from the tutorial working.
>
> Here’s the code (the error occurs on
> “serializer.write(example, result);” according to the
> stack trace):
> import java.io.File;
>
> import android.os.Environment;
> import android.test.AndroidTestCase;
> import android.test.AssertionFailedError;
>
> import org.simpleframework.xml.Serializer;
> import org.simpleframework.xml.core.Persister;
>
> public class SimpleXmlTest extends AndroidTestCase
> {
>
> public static final String TEST_DIR =
> "ConcertTestDir";
> public void testSerialize() {
> Serializer serializer = new Persister();
> Example example = new Example("Example
> message", 123);
> final File baseDir = new File(
> Environment.getExternalStorageDirectory() + File.separator +
> TEST_DIR + File.separator );
> File result = new
> File(baseDir.getAbsolutePath()+"example.xml");
> try {
> serializer.write(example, result);
> } catch ( Exception e ) {
> System.out.println("Exception thrown
> of type: "+e.getClass().getName());
> e.printStackTrace();
> throw new
> AssertionFailedError("Serializer failed with: "+e);
> }
> result.delete();
> }
> }
>
> Here’s the error I get:
>
> 04-19 12:30:19.544: DEBUG/concert.concertApp(5184):
> Starting up
> 04-19 12:30:19.544: INFO/System.out(5184): Sending WAIT
> chunk
> 04-19 12:30:19.554: INFO/dalvikvm(5184): Debugger is
> active
> 04-19 12:30:19.745: INFO/System.out(5184): Debugger has
> connected
> 04-19 12:30:19.745: INFO/System.out(5184): waiting for
> debugger to settle...
> 04-19 12:30:19.954: INFO/System.out(5184): waiting for
> debugger to settle...
> 04-19 12:30:20.154: INFO/System.out(5184): waiting for
> debugger to settle...
> 04-19 12:30:20.355: INFO/System.out(5184): waiting for
> debugger to settle...
> 04-19 12:30:20.556: INFO/System.out(5184): waiting for
> debugger to settle...
> 04-19 12:30:20.757: INFO/System.out(5184): waiting for
> debugger to settle...
> 04-19 12:30:20.954: INFO/System.out(5184): waiting for
> debugger to settle...
> 04-19 12:30:21.158: INFO/System.out(5184): debugger has
> settled (1341)
> 04-19 12:30:21.174: INFO/TestRunner(5184): started:
> testSerialize(com.iphase3.android.concert.test.SimpleXmlTest)
> 04-19 12:30:21.254: INFO/dalvikvm(5184): Could not find
> method javax.xml.stream.XMLInputFactory.newInstance,
> referenced from method
> org.simpleframework.xml.stream.StreamProvider.<init>
> 04-19 12:30:21.264: WARN/dalvikvm(5184): VFY: unable to
> resolve static method 323:
> Ljavax/xml/stream/XMLInputFactory;.newInstance
> ()Ljavax/xml/stream/XMLInputFactory;
> 04-19 12:30:21.264: DEBUG/dalvikvm(5184): VFY: replacing
> opcode 0x71 at 0x0003
> 04-19 12:30:21.264: DEBUG/dalvikvm(5184): VFY: dead code
> 0x0006-0009 in
> Lorg/simpleframework/xml/stream/StreamProvider;.<init>
> ()V
> 04-19 12:30:21.264: WARN/dalvikvm(5184): VFY: unable to
> find class referenced in signature
> (Ljavax/xml/stream/XMLEventReader;)
> 04-19 12:30:21.264: WARN/dalvikvm(5184): VFY: unable to
> find class referenced in signature
> (Ljavax/xml/stream/XMLEventReader;)
> 04-19 12:30:21.274: INFO/dalvikvm(5184): Could not find
> method
> javax.xml.stream.XMLInputFactory.createXMLEventReader,
> referenced from method
> org.simpleframework.xml.stream.StreamProvider.provide
> 04-19 12:30:21.274: WARN/dalvikvm(5184): VFY: unable to
> resolve virtual method 321:
> Ljavax/xml/stream/XMLInputFactory;.createXMLEventReader
> (Ljava/io/InputStream;)Ljavax/xml/stream/XMLEventReader;
> 04-19 12:30:21.274: DEBUG/dalvikvm(5184): VFY: replacing
> opcode 0x6e at 0x0002
> 04-19 12:30:21.274: DEBUG/dalvikvm(5184): VFY: dead code
> 0x0005-000a in
> Lorg/simpleframework/xml/stream/StreamProvider;.provide
> (Ljava/io/InputStream;)Lorg/simpleframework/xml/stream/EventReader;
> 04-19 12:30:21.274: INFO/dalvikvm(5184): Could not find
> method
> javax.xml.stream.XMLInputFactory.createXMLEventReader,
> referenced from method
> org.simpleframework.xml.stream.StreamProvider.provide
> 04-19 12:30:21.274: WARN/dalvikvm(5184): VFY: unable to
> resolve virtual method 322:
> Ljavax/xml/stream/XMLInputFactory;.createXMLEventReader
> (Ljava/io/Reader;)Ljavax/xml/stream/XMLEventReader;
> 04-19 12:30:21.274: DEBUG/dalvikvm(5184): VFY: replacing
> opcode 0x6e at 0x0002
> 04-19 12:30:21.274: DEBUG/dalvikvm(5184): VFY: dead code
> 0x0005-000a in
> Lorg/simpleframework/xml/stream/StreamProvider;.provide
> (Ljava/io/Reader;)Lorg/simpleframework/xml/stream/EventReader;
> 04-19 12:30:21.304: INFO/global(5184): Default buffer size
> used in BufferedWriter constructor. It would be better to be
> explicit if an 8k-char buffer is required.
> 04-19 12:30:21.374: WARN/dalvikvm(5184): VFY: returning
> [Ljava/lang/Object; (cl=0x0), declared
> [Ljava/lang/annotation/Annotation; (cl=0x0)
> 04-19 12:30:21.374: WARN/dalvikvm(5184): VFY: rejecting
> opcode 0x11 at 0x0010
> 04-19 12:30:21.374: WARN/dalvikvm(5184): VFY: rejected
> Lorg/simpleframework/xml/core/StructureBuilder;.extract
> (Ljava/lang/annotation/Annotation;)[Ljava/lang/annotation/Annotation;
> 04-19 12:30:21.374: WARN/dalvikvm(5184): Verifier rejected
> class Lorg/simpleframework/xml/core/StructureBuilder;
> 04-19 12:30:21.454: INFO/TestRunner(5184): failed:
> testSerialize(com.iphase3.android.concert.test.SimpleXmlTest)
> 04-19 12:30:21.454: INFO/TestRunner(5184): ----- begin
> exception -----
> 04-19 12:30:21.534: INFO/TestRunner(5184):
> java.lang.VerifyError:
> org.simpleframework.xml.core.StructureBuilder
> 04-19 12:30:21.534: INFO/TestRunner(5184): at
> org.simpleframework.xml.core.Scanner.<init>(Scanner.java:89)
> 04-19 12:30:21.534: INFO/TestRunner(5184): at
> org.simpleframework.xml.core.ScannerFactory.getInstance(ScannerFactory.java:66)
> 04-19 12:30:21.534: INFO/TestRunner(5184): at
> org.simpleframework.xml.core.Support.getScanner(Support.java:170)
> 04-19 12:30:21.534: INFO/TestRunner(5184): at
> org.simpleframework.xml.core.Support.getName(Support.java:232)
> 04-19 12:30:21.534: INFO/TestRunner(5184): at
> org.simpleframework.xml.core.Source.getName(Source.java:250)
> 04-19 12:30:21.534: INFO/TestRunner(5184): at
> org.simpleframework.xml.core.Traverser.getName(Traverser.java:284)
> 04-19 12:30:21.534: INFO/TestRunner(5184): at
> org.simpleframework.xml.core.Traverser.write(Traverser.java:203)
> 04-19 12:30:21.534: INFO/TestRunner(5184): at
> org.simpleframework.xml.core.Traverser.write(Traverser.java:186)
> 04-19 12:30:21.534: INFO/TestRunner(5184): at
> org.simpleframework.xml.core.Persister.write(Persister.java:1187)
> 04-19 12:30:21.534: INFO/TestRunner(5184): at
> org.simpleframework.xml.core.Persister.write(Persister.java:1169)
> 04-19 12:30:21.534: INFO/TestRunner(5184): at
> org.simpleframework.xml.core.Persister.write(Persister.java:1147)
> 04-19 12:30:21.534: INFO/TestRunner(5184): at
> org.simpleframework.xml.core.Persister.write(Persister.java:1266)
> 04-19 12:30:21.534: INFO/TestRunner(5184): at
> org.simpleframework.xml.core.Persister.write(Persister.java:1248)
> 04-19 12:30:21.534: INFO/TestRunner(5184): at
> org.simpleframework.xml.core.Persister.write(Persister.java:1229)
> 04-19 12:30:21.534: INFO/TestRunner(5184): at
> org.simpleframework.xml.core.Persister.write(Persister.java:1208)
> 04-19 12:30:21.534: INFO/TestRunner(5184): at
> com.iphase3.android.concert.test.SimpleXmlTest.testSerialize(SimpleXmlTest.java:32)
> 04-19 12:30:21.534: INFO/TestRunner(5184): at
> java.lang.reflect.Method.invokeNative(Native Method)
> 04-19 12:30:21.534: INFO/TestRunner(5184): at
> java.lang.reflect.Method.invoke(Method.java:521)
> 04-19 12:30:21.534: INFO/TestRunner(5184): at
> junit.framework.TestCase.runTest(TestCase.java:154)
> 04-19 12:30:21.534: INFO/TestRunner(5184): at
> junit.framework.TestCase.runBare(TestCase.java:127)
> 04-19 12:30:21.534: INFO/TestRunner(5184): at
> junit.framework.TestResult$1.protect(TestResult.java:106)
> 04-19 12:30:21.534: INFO/TestRunner(5184): at
> junit.framework.TestResult.runProtected(TestResult.java:124)
> 04-19 12:30:21.534: INFO/TestRunner(5184): at
> junit.framework.TestResult.run(TestResult.java:109)
> 04-19 12:30:21.534: INFO/TestRunner(5184): at
> junit.framework.TestCase.run(TestCase.java:118)
> 04-19 12:30:21.534: INFO/TestRunner(5184): at
> android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:169)
> 04-19 12:30:21.534: INFO/TestRunner(5184): at
> android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:154)
> 04-19 12:30:21.534: INFO/TestRunner(5184): at
> android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:520)
> 04-19 12:30:21.534: INFO/TestRunner(5184): at
> android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1606)
> 04-19 12:30:21.534: INFO/TestRunner(5184): ----- end
> exception -----
> 04-19 12:30:21.654: DEBUG/dalvikvm(5184): GC_FOR_MALLOC
> freed 4473 objects / 422056 bytes in 31ms
> 04-19 12:30:21.654: INFO/TestRunner(5184): finished:
> testSerialize(com.iphase3.android.concert.test.SimpleXmlTest)
> 04-19 12:30:21.664: INFO/TestRunner(5184): started:
> testAndroidTestCaseSetupProperly(com.iphase3.android.concert.test.SimpleXmlTest)
> 04-19 12:30:21.684: INFO/TestRunner(5184): finished:
> testAndroidTestCaseSetupProperly(com.iphase3.android.concert.test.SimpleXmlTest)
> 04-19 12:30:21.684: INFO/TestRunner(5184): passed:
> testAndroidTestCaseSetupProperly(com.iphase3.android.concert.test.SimpleXmlTest)
>
> I’m using Eclipse on Windows to develop.
>
> Thank you!
>
> -----Inline Attachment Follows-----
> ------------------------------------------------------------------------------
> Benefiting from Server Virtualization: Beyond Initial
> Workload
> Consolidation -- Increasing the use of server
> virtualization is a top
> priority.Virtualization can reduce costs, simplify
> management, and improve
> application availability and disaster protection. Learn
> more about boosting
> the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
>
> -----Inline Attachment Follows-----
> _______________________________________________
> Simple-support mailing list
> Sim...@li...
> https://lists.sourceforge.net/lists/listinfo/simple-support
>
>
|
|
From: James O. <Jam...@ip...> - 2011-04-21 17:21:52
|
No, I could not get 2.5.2 to work. Meanwhile 2.3.2 is working for me.
From: Niall Gallagher [mailto:gal...@ya...]
Sent: Thursday, April 21, 2011 12:15 AM
To: sim...@li...; James Oltmans
Subject: Re: [Simple-support] java.lang.VerifyError on Android
You need to download 2.5.2 to fix this.
--- On Tue, 19/4/11, James Oltmans <Jam...@ip...> wrote:
From: James Oltmans <Jam...@ip...>
Subject: [Simple-support] java.lang.VerifyError on Android
To: "sim...@li..." <sim...@li...>
Received: Tuesday, 19 April, 2011, 11:36 AM
I’m trying to use Simple XML on Android and although I have seen many say that it works on Android I have not been able to get the basic example from the tutorial working.
Here’s the code (the error occurs on “serializer.write(example, result);” according to the stack trace):
import java.io.File;
import android.os.Environment;
import android.test.AndroidTestCase;
import android.test.AssertionFailedError;
import org.simpleframework.xml.Serializer;
import org.simpleframework.xml.core.Persister;
public class SimpleXmlTest extends AndroidTestCase
{
public static final String TEST_DIR = "ConcertTestDir";
public void testSerialize() {
Serializer serializer = new Persister();
Example example = new Example("Example message", 123);
final File baseDir = new File( Environment.getExternalStorageDirectory() + File.separator + TEST_DIR + File.separator );
File result = new File(baseDir.getAbsolutePath()+"example.xml");
try {
serializer.write(example, result);
} catch ( Exception e ) {
System.out.println("Exception thrown of type: "+e.getClass().getName());
e.printStackTrace();
throw new AssertionFailedError("Serializer failed with: "+e);
}
result.delete();
}
}
Here’s the error I get:
04-19 12:30:19.544: DEBUG/concert.concertApp(5184): Starting up
04-19 12:30:19.544: INFO/System.out(5184): Sending WAIT chunk
04-19 12:30:19.554: INFO/dalvikvm(5184): Debugger is active
04-19 12:30:19.745: INFO/System.out(5184): Debugger has connected
04-19 12:30:19.745: INFO/System.out(5184): waiting for debugger to settle...
04-19 12:30:19.954: INFO/System.out(5184): waiting for debugger to settle...
04-19 12:30:20.154: INFO/System.out(5184): waiting for debugger to settle...
04-19 12:30:20.355: INFO/System.out(5184): waiting for debugger to settle...
04-19 12:30:20.556: INFO/System.out(5184): waiting for debugger to settle...
04-19 12:30:20.757: INFO/System.out(5184): waiting for debugger to settle...
04-19 12:30:20.954: INFO/System.out(5184): waiting for debugger to settle...
04-19 12:30:21.158: INFO/System.out(5184): debugger has settled (1341)
04-19 12:30:21.174: INFO/TestRunner(5184): started: testSerialize(com.iphase3.android.concert.test.SimpleXmlTest)
04-19 12:30:21.254: INFO/dalvikvm(5184): Could not find method javax.xml.stream.XMLInputFactory.newInstance, referenced from method org.simpleframework.xml.stream.StreamProvider.<init>
04-19 12:30:21.264: WARN/dalvikvm(5184): VFY: unable to resolve static method 323: Ljavax/xml/stream/XMLInputFactory;.newInstance ()Ljavax/xml/stream/XMLInputFactory;
04-19 12:30:21.264: DEBUG/dalvikvm(5184): VFY: replacing opcode 0x71 at 0x0003
04-19 12:30:21.264: DEBUG/dalvikvm(5184): VFY: dead code 0x0006-0009 in Lorg/simpleframework/xml/stream/StreamProvider;.<init> ()V
04-19 12:30:21.264: WARN/dalvikvm(5184): VFY: unable to find class referenced in signature (Ljavax/xml/stream/XMLEventReader;)
04-19 12:30:21.264: WARN/dalvikvm(5184): VFY: unable to find class referenced in signature (Ljavax/xml/stream/XMLEventReader;)
04-19 12:30:21.274: INFO/dalvikvm(5184): Could not find method javax.xml.stream.XMLInputFactory.createXMLEventReader, referenced from method org.simpleframework.xml.stream.StreamProvider.provide
04-19 12:30:21.274: WARN/dalvikvm(5184): VFY: unable to resolve virtual method 321: Ljavax/xml/stream/XMLInputFactory;.createXMLEventReader (Ljava/io/InputStream;)Ljavax/xml/stream/XMLEventReader;
04-19 12:30:21.274: DEBUG/dalvikvm(5184): VFY: replacing opcode 0x6e at 0x0002
04-19 12:30:21.274: DEBUG/dalvikvm(5184): VFY: dead code 0x0005-000a in Lorg/simpleframework/xml/stream/StreamProvider;.provide (Ljava/io/InputStream;)Lorg/simpleframework/xml/stream/EventReader;
04-19 12:30:21.274: INFO/dalvikvm(5184): Could not find method javax.xml.stream.XMLInputFactory.createXMLEventReader, referenced from method org.simpleframework.xml.stream.StreamProvider.provide
04-19 12:30:21.274: WARN/dalvikvm(5184): VFY: unable to resolve virtual method 322: Ljavax/xml/stream/XMLInputFactory;.createXMLEventReader (Ljava/io/Reader;)Ljavax/xml/stream/XMLEventReader;
04-19 12:30:21.274: DEBUG/dalvikvm(5184): VFY: replacing opcode 0x6e at 0x0002
04-19 12:30:21.274: DEBUG/dalvikvm(5184): VFY: dead code 0x0005-000a in Lorg/simpleframework/xml/stream/StreamProvider;.provide (Ljava/io/Reader;)Lorg/simpleframework/xml/stream/EventReader;
04-19 12:30:21.304: INFO/global(5184): Default buffer size used in BufferedWriter constructor. It would be better to be explicit if an 8k-char buffer is required.
04-19 12:30:21.374: WARN/dalvikvm(5184): VFY: returning [Ljava/lang/Object; (cl=0x0), declared [Ljava/lang/annotation/Annotation; (cl=0x0)
04-19 12:30:21.374: WARN/dalvikvm(5184): VFY: rejecting opcode 0x11 at 0x0010
04-19 12:30:21.374: WARN/dalvikvm(5184): VFY: rejected Lorg/simpleframework/xml/core/StructureBuilder;.extract (Ljava/lang/annotation/Annotation;)[Ljava/lang/annotation/Annotation;
04-19 12:30:21.374: WARN/dalvikvm(5184): Verifier rejected class Lorg/simpleframework/xml/core/StructureBuilder;
04-19 12:30:21.454: INFO/TestRunner(5184): failed: testSerialize(com.iphase3.android.concert.test.SimpleXmlTest)
04-19 12:30:21.454: INFO/TestRunner(5184): ----- begin exception -----
04-19 12:30:21.534: INFO/TestRunner(5184): java.lang.VerifyError: org.simpleframework.xml.core.StructureBuilder
04-19 12:30:21.534: INFO/TestRunner(5184): at org.simpleframework.xml.core.Scanner.<init>(Scanner.java:89)
04-19 12:30:21.534: INFO/TestRunner(5184): at org.simpleframework.xml.core.ScannerFactory.getInstance(ScannerFactory.java:66)
04-19 12:30:21.534: INFO/TestRunner(5184): at org.simpleframework.xml.core.Support.getScanner(Support.java:170)
04-19 12:30:21.534: INFO/TestRunner(5184): at org.simpleframework.xml.core.Support.getName(Support.java:232)
04-19 12:30:21.534: INFO/TestRunner(5184): at org.simpleframework.xml.core.Source.getName(Source.java:250)
04-19 12:30:21.534: INFO/TestRunner(5184): at org.simpleframework.xml.core.Traverser.getName(Traverser.java:284)
04-19 12:30:21.534: INFO/TestRunner(5184): at org.simpleframework.xml.core.Traverser.write(Traverser.java:203)
04-19 12:30:21.534: INFO/TestRunner(5184): at org.simpleframework.xml.core.Traverser.write(Traverser.java:186)
04-19 12:30:21.534: INFO/TestRunner(5184): at org.simpleframework.xml.core.Persister.write(Persister.java:1187)
04-19 12:30:21.534: INFO/TestRunner(5184): at org.simpleframework.xml.core.Persister.write(Persister.java:1169)
04-19 12:30:21.534: INFO/TestRunner(5184): at org.simpleframework.xml.core.Persister.write(Persister.java:1147)
04-19 12:30:21.534: INFO/TestRunner(5184): at org.simpleframework.xml.core.Persister.write(Persister.java:1266)
04-19 12:30:21.534: INFO/TestRunner(5184): at org.simpleframework.xml.core.Persister.write(Persister.java:1248)
04-19 12:30:21.534: INFO/TestRunner(5184): at org.simpleframework.xml.core.Persister.write(Persister.java:1229)
04-19 12:30:21.534: INFO/TestRunner(5184): at org.simpleframework.xml.core.Persister.write(Persister.java:1208)
04-19 12:30:21.534: INFO/TestRunner(5184): at com.iphase3.android.concert.test.SimpleXmlTest.testSerialize(SimpleXmlTest.java:32)
04-19 12:30:21.534: INFO/TestRunner(5184): at java.lang.reflect.Method.invokeNative(Native Method)
04-19 12:30:21.534: INFO/TestRunner(5184): at java.lang.reflect.Method.invoke(Method.java:521)
04-19 12:30:21.534: INFO/TestRunner(5184): at junit.framework.TestCase.runTest(TestCase.java:154)
04-19 12:30:21.534: INFO/TestRunner(5184): at junit.framework.TestCase.runBare(TestCase.java:127)
04-19 12:30:21.534: INFO/TestRunner(5184): at junit.framework.TestResult$1.protect(TestResult.java:106)
04-19 12:30:21.534: INFO/TestRunner(5184): at junit.framework.TestResult.runProtected(TestResult.java:124)
04-19 12:30:21.534: INFO/TestRunner(5184): at junit.framework.TestResult.run(TestResult.java:109)
04-19 12:30:21.534: INFO/TestRunner(5184): at junit.framework.TestCase.run(TestCase.java:118)
04-19 12:30:21.534: INFO/TestRunner(5184): at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:169)
04-19 12:30:21.534: INFO/TestRunner(5184): at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:154)
04-19 12:30:21.534: INFO/TestRunner(5184): at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:520)
04-19 12:30:21.534: INFO/TestRunner(5184): at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1606)
04-19 12:30:21.534: INFO/TestRunner(5184): ----- end exception -----
04-19 12:30:21.654: DEBUG/dalvikvm(5184): GC_FOR_MALLOC freed 4473 objects / 422056 bytes in 31ms
04-19 12:30:21.654: INFO/TestRunner(5184): finished: testSerialize(com.iphase3.android.concert.test.SimpleXmlTest)
04-19 12:30:21.664: INFO/TestRunner(5184): started: testAndroidTestCaseSetupProperly(com.iphase3.android.concert.test.SimpleXmlTest)
04-19 12:30:21.684: INFO/TestRunner(5184): finished: testAndroidTestCaseSetupProperly(com.iphase3.android.concert.test.SimpleXmlTest)
04-19 12:30:21.684: INFO/TestRunner(5184): passed: testAndroidTestCaseSetupProperly(com.iphase3.android.concert.test.SimpleXmlTest)
I’m using Eclipse on Windows to develop.
Thank you!
-----Inline Attachment Follows-----
------------------------------------------------------------------------------
Benefiting from Server Virtualization: Beyond Initial Workload
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve
application availability and disaster protection. Learn more about boosting
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
-----Inline Attachment Follows-----
_______________________________________________
Simple-support mailing list
Sim...@li...
https://lists.sourceforge.net/lists/listinfo/simple-support
|
|
From: Niall G. <gal...@ya...> - 2011-04-21 06:15:18
|
You need to download 2.5.2 to fix this.
--- On Tue, 19/4/11, James Oltmans <Jam...@ip...> wrote:
From: James Oltmans <Jam...@ip...>
Subject: [Simple-support] java.lang.VerifyError on Android
To: "sim...@li..." <sim...@li...>
Received: Tuesday, 19 April, 2011, 11:36 AM
I’m trying to use Simple XML on Android and although I have seen many say that it works on Android I have not been able to get the basic example from the tutorial working. Here’s the code (the error occurs on “serializer.write(example, result);” according to the stack trace):import java.io.File; import android.os.Environment;import android.test.AndroidTestCase;import android.test.AssertionFailedError; import org.simpleframework.xml.Serializer;import org.simpleframework.xml.core.Persister; public class SimpleXmlTest extends AndroidTestCase{ public static final String TEST_DIR = "ConcertTestDir"; public void testSerialize() { Serializer serializer = new Persister(); Example example = new Example("Example message", 123); final File baseDir = new File( Environment.getExternalStorageDirectory() + File.separator + TEST_DIR + File.separator ); File result = new
File(baseDir.getAbsolutePath()+"example.xml"); try { serializer.write(example, result); } catch ( Exception e ) { System.out.println("Exception thrown of type: "+e.getClass().getName()); e.printStackTrace(); throw new AssertionFailedError("Serializer failed with: "+e); } result.delete(); }} Here’s the error I get: 04-19 12:30:19.544: DEBUG/concert.concertApp(5184): Starting up04-19 12:30:19.544: INFO/System.out(5184): Sending WAIT chunk04-19 12:30:19.554: INFO/dalvikvm(5184): Debugger is active04-19 12:30:19.745: INFO/System.out(5184): Debugger has connected04-19 12:30:19.745: INFO/System.out(5184): waiting for debugger to settle...04-19 12:30:19.954: INFO/System.out(5184): waiting for debugger to settle...04-19 12:30:20.154: INFO/System.out(5184): waiting for debugger to settle...04-19 12:30:20.355:
INFO/System.out(5184): waiting for debugger to settle...04-19 12:30:20.556: INFO/System.out(5184): waiting for debugger to settle...04-19 12:30:20.757: INFO/System.out(5184): waiting for debugger to settle...04-19 12:30:20.954: INFO/System.out(5184): waiting for debugger to settle...04-19 12:30:21.158: INFO/System.out(5184): debugger has settled (1341)04-19 12:30:21.174: INFO/TestRunner(5184): started: testSerialize(com.iphase3.android.concert.test.SimpleXmlTest)04-19 12:30:21.254: INFO/dalvikvm(5184): Could not find method javax.xml.stream.XMLInputFactory.newInstance, referenced from method org.simpleframework.xml.stream.StreamProvider.<init>04-19 12:30:21.264: WARN/dalvikvm(5184): VFY: unable to resolve static method 323: Ljavax/xml/stream/XMLInputFactory;.newInstance ()Ljavax/xml/stream/XMLInputFactory;04-19 12:30:21.264: DEBUG/dalvikvm(5184): VFY: replacing opcode 0x71 at 0x000304-19 12:30:21.264: DEBUG/dalvikvm(5184): VFY: dead code 0x0006-0009 in
Lorg/simpleframework/xml/stream/StreamProvider;.<init> ()V04-19 12:30:21.264: WARN/dalvikvm(5184): VFY: unable to find class referenced in signature (Ljavax/xml/stream/XMLEventReader;)04-19 12:30:21.264: WARN/dalvikvm(5184): VFY: unable to find class referenced in signature (Ljavax/xml/stream/XMLEventReader;)04-19 12:30:21.274: INFO/dalvikvm(5184): Could not find method javax.xml.stream.XMLInputFactory.createXMLEventReader, referenced from method org.simpleframework.xml.stream.StreamProvider.provide04-19 12:30:21.274: WARN/dalvikvm(5184): VFY: unable to resolve virtual method 321: Ljavax/xml/stream/XMLInputFactory;.createXMLEventReader (Ljava/io/InputStream;)Ljavax/xml/stream/XMLEventReader;04-19 12:30:21.274: DEBUG/dalvikvm(5184): VFY: replacing opcode 0x6e at 0x000204-19 12:30:21.274: DEBUG/dalvikvm(5184): VFY: dead code 0x0005-000a in Lorg/simpleframework/xml/stream/StreamProvider;.provide
(Ljava/io/InputStream;)Lorg/simpleframework/xml/stream/EventReader;04-19 12:30:21.274: INFO/dalvikvm(5184): Could not find method javax.xml.stream.XMLInputFactory.createXMLEventReader, referenced from method org.simpleframework.xml.stream.StreamProvider.provide04-19 12:30:21.274: WARN/dalvikvm(5184): VFY: unable to resolve virtual method 322: Ljavax/xml/stream/XMLInputFactory;.createXMLEventReader (Ljava/io/Reader;)Ljavax/xml/stream/XMLEventReader;04-19 12:30:21.274: DEBUG/dalvikvm(5184): VFY: replacing opcode 0x6e at 0x000204-19 12:30:21.274: DEBUG/dalvikvm(5184): VFY: dead code 0x0005-000a in Lorg/simpleframework/xml/stream/StreamProvider;.provide (Ljava/io/Reader;)Lorg/simpleframework/xml/stream/EventReader;04-19 12:30:21.304: INFO/global(5184): Default buffer size used in BufferedWriter constructor. It would be better to be explicit if an 8k-char buffer is required.04-19 12:30:21.374: WARN/dalvikvm(5184): VFY: returning [Ljava/lang/Object; (cl=0x0),
declared [Ljava/lang/annotation/Annotation; (cl=0x0)04-19 12:30:21.374: WARN/dalvikvm(5184): VFY: rejecting opcode 0x11 at 0x001004-19 12:30:21.374: WARN/dalvikvm(5184): VFY: rejected Lorg/simpleframework/xml/core/StructureBuilder;.extract (Ljava/lang/annotation/Annotation;)[Ljava/lang/annotation/Annotation;04-19 12:30:21.374: WARN/dalvikvm(5184): Verifier rejected class Lorg/simpleframework/xml/core/StructureBuilder;04-19 12:30:21.454: INFO/TestRunner(5184): failed: testSerialize(com.iphase3.android.concert.test.SimpleXmlTest)04-19 12:30:21.454: INFO/TestRunner(5184): ----- begin exception -----04-19 12:30:21.534: INFO/TestRunner(5184): java.lang.VerifyError: org.simpleframework.xml.core.StructureBuilder04-19 12:30:21.534: INFO/TestRunner(5184): at org.simpleframework.xml.core.Scanner.<init>(Scanner.java:89)04-19 12:30:21.534: INFO/TestRunner(5184): at
org.simpleframework.xml.core.ScannerFactory.getInstance(ScannerFactory.java:66)04-19 12:30:21.534: INFO/TestRunner(5184): at org.simpleframework.xml.core.Support.getScanner(Support.java:170)04-19 12:30:21.534: INFO/TestRunner(5184): at org.simpleframework.xml.core.Support.getName(Support.java:232)04-19 12:30:21.534: INFO/TestRunner(5184): at org.simpleframework.xml.core.Source.getName(Source.java:250)04-19 12:30:21.534: INFO/TestRunner(5184): at org.simpleframework.xml.core.Traverser.getName(Traverser.java:284)04-19 12:30:21.534: INFO/TestRunner(5184): at org.simpleframework.xml.core.Traverser.write(Traverser.java:203)04-19 12:30:21.534: INFO/TestRunner(5184): at org.simpleframework.xml.core.Traverser.write(Traverser.java:186)04-19 12:30:21.534: INFO/TestRunner(5184): at org.simpleframework.xml.core.Persister.write(Persister.java:1187)04-19 12:30:21.534: INFO/TestRunner(5184): at
org.simpleframework.xml.core.Persister.write(Persister.java:1169)04-19 12:30:21.534: INFO/TestRunner(5184): at org.simpleframework.xml.core.Persister.write(Persister.java:1147)04-19 12:30:21.534: INFO/TestRunner(5184): at org.simpleframework.xml.core.Persister.write(Persister.java:1266)04-19 12:30:21.534: INFO/TestRunner(5184): at org.simpleframework.xml.core.Persister.write(Persister.java:1248)04-19 12:30:21.534: INFO/TestRunner(5184): at org.simpleframework.xml.core.Persister.write(Persister.java:1229)04-19 12:30:21.534: INFO/TestRunner(5184): at org.simpleframework.xml.core.Persister.write(Persister.java:1208)04-19 12:30:21.534: INFO/TestRunner(5184): at com.iphase3.android.concert.test.SimpleXmlTest.testSerialize(SimpleXmlTest.java:32)04-19 12:30:21.534: INFO/TestRunner(5184): at java.lang.reflect.Method.invokeNative(Native Method)04-19 12:30:21.534: INFO/TestRunner(5184): at
java.lang.reflect.Method.invoke(Method.java:521)04-19 12:30:21.534: INFO/TestRunner(5184): at junit.framework.TestCase.runTest(TestCase.java:154)04-19 12:30:21.534: INFO/TestRunner(5184): at junit.framework.TestCase.runBare(TestCase.java:127)04-19 12:30:21.534: INFO/TestRunner(5184): at junit.framework.TestResult$1.protect(TestResult.java:106)04-19 12:30:21.534: INFO/TestRunner(5184): at junit.framework.TestResult.runProtected(TestResult.java:124)04-19 12:30:21.534: INFO/TestRunner(5184): at junit.framework.TestResult.run(TestResult.java:109)04-19 12:30:21.534: INFO/TestRunner(5184): at junit.framework.TestCase.run(TestCase.java:118)04-19 12:30:21.534: INFO/TestRunner(5184): at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:169)04-19 12:30:21.534: INFO/TestRunner(5184): at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:154)04-19 12:30:21.534:
INFO/TestRunner(5184): at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:520)04-19 12:30:21.534: INFO/TestRunner(5184): at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1606)04-19 12:30:21.534: INFO/TestRunner(5184): ----- end exception -----04-19 12:30:21.654: DEBUG/dalvikvm(5184): GC_FOR_MALLOC freed 4473 objects / 422056 bytes in 31ms04-19 12:30:21.654: INFO/TestRunner(5184): finished: testSerialize(com.iphase3.android.concert.test.SimpleXmlTest)04-19 12:30:21.664: INFO/TestRunner(5184): started: testAndroidTestCaseSetupProperly(com.iphase3.android.concert.test.SimpleXmlTest)04-19 12:30:21.684: INFO/TestRunner(5184): finished: testAndroidTestCaseSetupProperly(com.iphase3.android.concert.test.SimpleXmlTest)04-19 12:30:21.684: INFO/TestRunner(5184): passed: testAndroidTestCaseSetupProperly(com.iphase3.android.concert.test.SimpleXmlTest) I’m using Eclipse on Windows to
develop. Thank you!
-----Inline Attachment Follows-----
------------------------------------------------------------------------------
Benefiting from Server Virtualization: Beyond Initial Workload
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve
application availability and disaster protection. Learn more about boosting
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
-----Inline Attachment Follows-----
_______________________________________________
Simple-support mailing list
Sim...@li...
https://lists.sourceforge.net/lists/listinfo/simple-support
|
|
From: James O. <Jam...@ip...> - 2011-04-19 18:49:23
|
I'm trying to use Simple XML on Android and although I have seen many say that it works on Android I have not been able to get the basic example from the tutorial working.
Here's the code (the error occurs on "serializer.write(example, result);" according to the stack trace):
import java.io.File;
import android.os.Environment;
import android.test.AndroidTestCase;
import android.test.AssertionFailedError;
import org.simpleframework.xml.Serializer;
import org.simpleframework.xml.core.Persister;
public class SimpleXmlTest extends AndroidTestCase
{
public static final String TEST_DIR = "ConcertTestDir";
public void testSerialize() {
Serializer serializer = new Persister();
Example example = new Example("Example message", 123);
final File baseDir = new File( Environment.getExternalStorageDirectory() + File.separator + TEST_DIR + File.separator );
File result = new File(baseDir.getAbsolutePath()+"example.xml");
try {
serializer.write(example, result);
} catch ( Exception e ) {
System.out.println("Exception thrown of type: "+e.getClass().getName());
e.printStackTrace();
throw new AssertionFailedError("Serializer failed with: "+e);
}
result.delete();
}
}
Here's the error I get:
04-19 12:30:19.544: DEBUG/concert.concertApp(5184): Starting up
04-19 12:30:19.544: INFO/System.out(5184): Sending WAIT chunk
04-19 12:30:19.554: INFO/dalvikvm(5184): Debugger is active
04-19 12:30:19.745: INFO/System.out(5184): Debugger has connected
04-19 12:30:19.745: INFO/System.out(5184): waiting for debugger to settle...
04-19 12:30:19.954: INFO/System.out(5184): waiting for debugger to settle...
04-19 12:30:20.154: INFO/System.out(5184): waiting for debugger to settle...
04-19 12:30:20.355: INFO/System.out(5184): waiting for debugger to settle...
04-19 12:30:20.556: INFO/System.out(5184): waiting for debugger to settle...
04-19 12:30:20.757: INFO/System.out(5184): waiting for debugger to settle...
04-19 12:30:20.954: INFO/System.out(5184): waiting for debugger to settle...
04-19 12:30:21.158: INFO/System.out(5184): debugger has settled (1341)
04-19 12:30:21.174: INFO/TestRunner(5184): started: testSerialize(com.iphase3.android.concert.test.SimpleXmlTest)
04-19 12:30:21.254: INFO/dalvikvm(5184): Could not find method javax.xml.stream.XMLInputFactory.newInstance, referenced from method org.simpleframework.xml.stream.StreamProvider.<init>
04-19 12:30:21.264: WARN/dalvikvm(5184): VFY: unable to resolve static method 323: Ljavax/xml/stream/XMLInputFactory;.newInstance ()Ljavax/xml/stream/XMLInputFactory;
04-19 12:30:21.264: DEBUG/dalvikvm(5184): VFY: replacing opcode 0x71 at 0x0003
04-19 12:30:21.264: DEBUG/dalvikvm(5184): VFY: dead code 0x0006-0009 in Lorg/simpleframework/xml/stream/StreamProvider;.<init> ()V
04-19 12:30:21.264: WARN/dalvikvm(5184): VFY: unable to find class referenced in signature (Ljavax/xml/stream/XMLEventReader;)
04-19 12:30:21.264: WARN/dalvikvm(5184): VFY: unable to find class referenced in signature (Ljavax/xml/stream/XMLEventReader;)
04-19 12:30:21.274: INFO/dalvikvm(5184): Could not find method javax.xml.stream.XMLInputFactory.createXMLEventReader, referenced from method org.simpleframework.xml.stream.StreamProvider.provide
04-19 12:30:21.274: WARN/dalvikvm(5184): VFY: unable to resolve virtual method 321: Ljavax/xml/stream/XMLInputFactory;.createXMLEventReader (Ljava/io/InputStream;)Ljavax/xml/stream/XMLEventReader;
04-19 12:30:21.274: DEBUG/dalvikvm(5184): VFY: replacing opcode 0x6e at 0x0002
04-19 12:30:21.274: DEBUG/dalvikvm(5184): VFY: dead code 0x0005-000a in Lorg/simpleframework/xml/stream/StreamProvider;.provide (Ljava/io/InputStream;)Lorg/simpleframework/xml/stream/EventReader;
04-19 12:30:21.274: INFO/dalvikvm(5184): Could not find method javax.xml.stream.XMLInputFactory.createXMLEventReader, referenced from method org.simpleframework.xml.stream.StreamProvider.provide
04-19 12:30:21.274: WARN/dalvikvm(5184): VFY: unable to resolve virtual method 322: Ljavax/xml/stream/XMLInputFactory;.createXMLEventReader (Ljava/io/Reader;)Ljavax/xml/stream/XMLEventReader;
04-19 12:30:21.274: DEBUG/dalvikvm(5184): VFY: replacing opcode 0x6e at 0x0002
04-19 12:30:21.274: DEBUG/dalvikvm(5184): VFY: dead code 0x0005-000a in Lorg/simpleframework/xml/stream/StreamProvider;.provide (Ljava/io/Reader;)Lorg/simpleframework/xml/stream/EventReader;
04-19 12:30:21.304: INFO/global(5184): Default buffer size used in BufferedWriter constructor. It would be better to be explicit if an 8k-char buffer is required.
04-19 12:30:21.374: WARN/dalvikvm(5184): VFY: returning [Ljava/lang/Object; (cl=0x0), declared [Ljava/lang/annotation/Annotation; (cl=0x0)
04-19 12:30:21.374: WARN/dalvikvm(5184): VFY: rejecting opcode 0x11 at 0x0010
04-19 12:30:21.374: WARN/dalvikvm(5184): VFY: rejected Lorg/simpleframework/xml/core/StructureBuilder;.extract (Ljava/lang/annotation/Annotation;)[Ljava/lang/annotation/Annotation;
04-19 12:30:21.374: WARN/dalvikvm(5184): Verifier rejected class Lorg/simpleframework/xml/core/StructureBuilder;
04-19 12:30:21.454: INFO/TestRunner(5184): failed: testSerialize(com.iphase3.android.concert.test.SimpleXmlTest)
04-19 12:30:21.454: INFO/TestRunner(5184): ----- begin exception -----
04-19 12:30:21.534: INFO/TestRunner(5184): java.lang.VerifyError: org.simpleframework.xml.core.StructureBuilder
04-19 12:30:21.534: INFO/TestRunner(5184): at org.simpleframework.xml.core.Scanner.<init>(Scanner.java:89)
04-19 12:30:21.534: INFO/TestRunner(5184): at org.simpleframework.xml.core.ScannerFactory.getInstance(ScannerFactory.java:66)
04-19 12:30:21.534: INFO/TestRunner(5184): at org.simpleframework.xml.core.Support.getScanner(Support.java:170)
04-19 12:30:21.534: INFO/TestRunner(5184): at org.simpleframework.xml.core.Support.getName(Support.java:232)
04-19 12:30:21.534: INFO/TestRunner(5184): at org.simpleframework.xml.core.Source.getName(Source.java:250)
04-19 12:30:21.534: INFO/TestRunner(5184): at org.simpleframework.xml.core.Traverser.getName(Traverser.java:284)
04-19 12:30:21.534: INFO/TestRunner(5184): at org.simpleframework.xml.core.Traverser.write(Traverser.java:203)
04-19 12:30:21.534: INFO/TestRunner(5184): at org.simpleframework.xml.core.Traverser.write(Traverser.java:186)
04-19 12:30:21.534: INFO/TestRunner(5184): at org.simpleframework.xml.core.Persister.write(Persister.java:1187)
04-19 12:30:21.534: INFO/TestRunner(5184): at org.simpleframework.xml.core.Persister.write(Persister.java:1169)
04-19 12:30:21.534: INFO/TestRunner(5184): at org.simpleframework.xml.core.Persister.write(Persister.java:1147)
04-19 12:30:21.534: INFO/TestRunner(5184): at org.simpleframework.xml.core.Persister.write(Persister.java:1266)
04-19 12:30:21.534: INFO/TestRunner(5184): at org.simpleframework.xml.core.Persister.write(Persister.java:1248)
04-19 12:30:21.534: INFO/TestRunner(5184): at org.simpleframework.xml.core.Persister.write(Persister.java:1229)
04-19 12:30:21.534: INFO/TestRunner(5184): at org.simpleframework.xml.core.Persister.write(Persister.java:1208)
04-19 12:30:21.534: INFO/TestRunner(5184): at com.iphase3.android.concert.test.SimpleXmlTest.testSerialize(SimpleXmlTest.java:32)
04-19 12:30:21.534: INFO/TestRunner(5184): at java.lang.reflect.Method.invokeNative(Native Method)
04-19 12:30:21.534: INFO/TestRunner(5184): at java.lang.reflect.Method.invoke(Method.java:521)
04-19 12:30:21.534: INFO/TestRunner(5184): at junit.framework.TestCase.runTest(TestCase.java:154)
04-19 12:30:21.534: INFO/TestRunner(5184): at junit.framework.TestCase.runBare(TestCase.java:127)
04-19 12:30:21.534: INFO/TestRunner(5184): at junit.framework.TestResult$1.protect(TestResult.java:106)
04-19 12:30:21.534: INFO/TestRunner(5184): at junit.framework.TestResult.runProtected(TestResult.java:124)
04-19 12:30:21.534: INFO/TestRunner(5184): at junit.framework.TestResult.run(TestResult.java:109)
04-19 12:30:21.534: INFO/TestRunner(5184): at junit.framework.TestCase.run(TestCase.java:118)
04-19 12:30:21.534: INFO/TestRunner(5184): at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:169)
04-19 12:30:21.534: INFO/TestRunner(5184): at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:154)
04-19 12:30:21.534: INFO/TestRunner(5184): at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:520)
04-19 12:30:21.534: INFO/TestRunner(5184): at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1606)
04-19 12:30:21.534: INFO/TestRunner(5184): ----- end exception -----
04-19 12:30:21.654: DEBUG/dalvikvm(5184): GC_FOR_MALLOC freed 4473 objects / 422056 bytes in 31ms
04-19 12:30:21.654: INFO/TestRunner(5184): finished: testSerialize(com.iphase3.android.concert.test.SimpleXmlTest)
04-19 12:30:21.664: INFO/TestRunner(5184): started: testAndroidTestCaseSetupProperly(com.iphase3.android.concert.test.SimpleXmlTest)
04-19 12:30:21.684: INFO/TestRunner(5184): finished: testAndroidTestCaseSetupProperly(com.iphase3.android.concert.test.SimpleXmlTest)
04-19 12:30:21.684: INFO/TestRunner(5184): passed: testAndroidTestCaseSetupProperly(com.iphase3.android.concert.test.SimpleXmlTest)
I'm using Eclipse on Windows to develop.
Thank you!
|
|
From: Martin S. <msc...@it...> - 2011-04-19 18:02:50
|
Is there a way to specify xml:lang="en-US" as one of the documents root attributes? I can get @Attribute(name="lang") but if I use @Namespace(prefix="xml") I get the additional and unwanted attribute xmlns:xml="" Thanks for any help. Martin |
|
From: Jouni L. <Jou...@sa...> - 2011-04-18 06:40:52
|
Or you might want to try registering a custom converter for String that does null -> empty string conversion
public class SimpleXMLStringConverter implements Converter<String> {
@Override
public String read(InputNode node) throws Exception {
String value = node.getValue();
if(value == null) {
value = "";
}
return value;
}
@Override
public void write(OutputNode node, String value) throws Exception {
node.setValue(value);
}
}
Just register that to a single element with the @Convert annotation or for global functionality to the Persister.
Regards,
Jouni
On 16.4.11 00:18, "Timo Rumland" <tim...@di...> wrote:
Hello Jake,
> Hello,
> I would like to have the behavior when I see something like:
> <field></field>
> so that it my instance:
> [...]
> is set to an empty string as opposed to null. Can you give me a hint
> on where to look so I can change this behavior?
I don't know if there is a parameter for this in the serializer, but
one solution might be to use the @Commit annotation. From the
tutorial:
"The commit method is invoked in much the same way, the persister
looks for a method marked with the commit annotation, if one exists
it is invoked. However, unlike the validate method the commit method
is typically used to build further data structures, for example hash
tables or trees."
So you could just set your field to an empty string if it is null in
the method annotated with @Commit:
@Commit
public void commit()
{
if ( this.field == null )
this.field = "";
}
Hope that helps - maybe there is a better solution.
Best regards,
Timo
------------------------------------------------------------------------------
Benefiting from Server Virtualization: Beyond Initial Workload
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve
application availability and disaster protection. Learn more about boosting
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
_______________________________________________
Simple-support mailing list
Sim...@li...
https://lists.sourceforge.net/lists/listinfo/simple-support
|
|
From: Jay S. <jay...@gm...> - 2011-04-16 21:39:58
|
Ok, thanks SP and Niall! On Fri, Apr 15, 2011 at 7:25 PM, Niall Gallagher <gal...@ya...>wrote: > Hi, > > There is no such tool at the moment, you have to manually annotate your > classes. > > Niall > > > --- On *Thu, 14/4/11, Jay Sellers <jay...@gm...>* wrote: > > > From: Jay Sellers <jay...@gm...> > Subject: [Simple-support] wsdl2Java twin for Simple? > To: sim...@li... > Received: Thursday, 14 April, 2011, 7:40 AM > > > I'm brand new to 'Simple' and brand new to Android development, but a long > time Enterprise Java guy. I love the size/speed of Simple, but I'm wondering > if there is a utility that will allow me to feed it a wsdl file and auto > create the classes that I need, with annotations that will be recognized by > Simple. Similar to a wsdl2Java tool. > My real-world situation is that I have a client hosting a .NET WS and I > need to call the service and display data. I've connected to the service > using ksoap2, now I'm looking for a way to deserialize and serialize from/to > the soap xml. > Thanks! > -Jay > > -----Inline Attachment Follows----- > > > ------------------------------------------------------------------------------ > Benefiting from Server Virtualization: Beyond Initial Workload > Consolidation -- Increasing the use of server virtualization is a top > priority.Virtualization can reduce costs, simplify management, and improve > application availability and disaster protection. Learn more about boosting > > the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev > > -----Inline Attachment Follows----- > > _______________________________________________ > Simple-support mailing list > Sim...@li...<http://mc/compose?to=...@li...> > https://lists.sourceforge.net/lists/listinfo/simple-support > > |
|
From: Niall G. <gal...@ya...> - 2011-04-16 02:25:47
|
Hi, There is no such tool at the moment, you have to manually annotate your classes. Niall --- On Thu, 14/4/11, Jay Sellers <jay...@gm...> wrote: From: Jay Sellers <jay...@gm...> Subject: [Simple-support] wsdl2Java twin for Simple? To: sim...@li... Received: Thursday, 14 April, 2011, 7:40 AM I'm brand new to 'Simple' and brand new to Android development, but a long time Enterprise Java guy. I love the size/speed of Simple, but I'm wondering if there is a utility that will allow me to feed it a wsdl file and auto create the classes that I need, with annotations that will be recognized by Simple. Similar to a wsdl2Java tool. My real-world situation is that I have a client hosting a .NET WS and I need to call the service and display data. I've connected to the service using ksoap2, now I'm looking for a way to deserialize and serialize from/to the soap xml. Thanks! -Jay -----Inline Attachment Follows----- ------------------------------------------------------------------------------ Benefiting from Server Virtualization: Beyond Initial Workload Consolidation -- Increasing the use of server virtualization is a top priority.Virtualization can reduce costs, simplify management, and improve application availability and disaster protection. Learn more about boosting the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev -----Inline Attachment Follows----- _______________________________________________ Simple-support mailing list Sim...@li... https://lists.sourceforge.net/lists/listinfo/simple-support |
|
From: Timo R. <tim...@di...> - 2011-04-15 21:43:25
|
Hello Jake,
> Hello,
> I would like to have the behavior when I see something like:
> <field></field>
> so that it my instance:
> [...]
> is set to an empty string as opposed to null. Can you give me a hint
> on where to look so I can change this behavior?
I don't know if there is a parameter for this in the serializer, but
one solution might be to use the @Commit annotation. From the
tutorial:
"The commit method is invoked in much the same way, the persister
looks for a method marked with the commit annotation, if one exists
it is invoked. However, unlike the validate method the commit method
is typically used to build further data structures, for example hash
tables or trees."
So you could just set your field to an empty string if it is null in
the method annotated with @Commit:
@Commit
public void commit()
{
if ( this.field == null )
this.field = "";
}
Hope that helps - maybe there is a better solution.
Best regards,
Timo
|
|
From: Jacob S. <ja...@el...> - 2011-04-15 14:14:32
|
Hello, I would like to have the behavior when I see something like: <field></field> so that it my instance: @Element private String field; is set to an empty string as opposed to null. Can you give me a hint on where to look so I can change this behavior? -Jake |
|
From: Jay S. <jay...@gm...> - 2011-04-14 14:40:27
|
I'm brand new to 'Simple' and brand new to Android development, but a long time Enterprise Java guy. I love the size/speed of Simple, but I'm wondering if there is a utility that will allow me to feed it a wsdl file and auto create the classes that I need, with annotations that will be recognized by Simple. Similar to a wsdl2Java tool. My real-world situation is that I have a client hosting a .NET WS and I need to call the service and display data. I've connected to the service using ksoap2, now I'm looking for a way to deserialize and serialize from/to the soap xml. Thanks! -Jay |
|
From: Aaron D. <di...@he...> - 2011-04-14 14:18:40
|
Zitat von Martin Schwartzman <msc...@it...>: > I've searched the mailing list but I have not found a way to read and > write comments from an xml document. I basically just want to be able to > read an xml document and preserve any comments that are in the document > along with the elements. Is there a way to do it and if so is the a > comprehensive example? Note that XML isn't designed to preserve comments and white space. It's a markup language, not a round tripping language. I've written an XML parser that preserves everything. See http://code.google.com/p/decentxml/ But it doesn't support mapping to Java POJOs. Regards, -- Aaron "Optimizer" Digulla a.k.a. Philmann Dark "It's not the universe that's limited, it's our imagination. Follow me and I'll show you something beyond the limits." http://www.pdark.de/ http://blog.pdark.de/ |
|
From: Niall G. <gal...@ya...> - 2011-04-14 08:57:49
|
Hi, Well you can write comments, but currently Simple ignores comments when reading. This is something I will address in a future release. Niall --- On Wed, 13/4/11, Martin Schwartzman <msc...@it...> wrote: From: Martin Schwartzman <msc...@it...> Subject: [Simple-support] read and write comments from an existing xml document To: sim...@li... Received: Wednesday, 13 April, 2011, 3:34 PM I’ve searched the mailing list but I have not found a way to read and write comments from an xml document. I basically just want to be able to read an xml document and preserve any comments that are in the document along with the elements. Is there a way to do it and if so is the a comprehensive example? Thanks in advance, martin -----Inline Attachment Follows----- ------------------------------------------------------------------------------ Benefiting from Server Virtualization: Beyond Initial Workload Consolidation -- Increasing the use of server virtualization is a top priority.Virtualization can reduce costs, simplify management, and improve application availability and disaster protection. Learn more about boosting the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev -----Inline Attachment Follows----- _______________________________________________ Simple-support mailing list Sim...@li... https://lists.sourceforge.net/lists/listinfo/simple-support |
|
From: Saul K. <sb...@ny...> - 2011-04-13 23:45:27
|
Hi,
Please Help.
I having trouble going get sub lists
I just want to get the 1st def in this xml file and I cant get a "
partofspeech" list to show up
Thank you,
Saul
Code for in main:
String xmlData = retrieve(url);
Serializer serializer = new Persister();
Reader reader = new StringReader(xmlData);
Dictionary d = serializer.read(Dictionary.class, reader,
false);
Log.d(theToyActivity.class.getSimpleName(),
d.toString());
System.out.println(d.getQuery());
System.out.println(d.getTotalResults());
System.out.println("Entry list size: "
+ d.getEntry().size());
// System.out.println(d.getEntry());
List<Entry> list = d.getEntry();
for (Entry e : list) {
System.out.println("Entry: " + e.getDisplay() + " "
+ e.getId() + " " + e.getPron());
XML:
<?xml version="1.0" encoding="UTF-8" ?>
<dictionary query="good" totalresults="9">
<entry source="pdict" id="4086801">
<display_form >
<![CDATA[good]]>
</display_form>
<pron
audiofile="http://static-api.dictionary.com/dictstatic/dictionary/audio/luna
WAV/G02/G0255000.wav">
<![CDATA[[g<i>oo</i>d]]]>
</pron>
<partofspeech pos="adjective">
<defset>
<def charcnt="17" defno="1">
<![CDATA[morally excellent]]>
</def>
<def charcnt="27" defno="2">
<![CDATA[of high or adequate quality]]>
</def>
<def charcnt="12" defno="3">
<![CDATA[well-behaved]]>
</def>
<def charcnt="4" defno="4">
<![CDATA[kind]]>
</def>
<def charcnt="5" defno="5">
<![CDATA[valid]]>
</def>
<def charcnt="9" defno="6">
<![CDATA[favorable]]>
</def>
</defset>
</partofspeech>
<partofspeech pos="noun">
<defset>
<def charcnt="19" defno="7">
<![CDATA[profit or advantage]]>
</def>
<def charcnt="6" defno="8">
<![CDATA[virtue]]>
</def>
<def charcnt="11" defno="9">
<![CDATA[possessions]]>
</def>
</defset>
</partofspeech>
</entry>
</dictionary>
Classes
package define;
import java.util.ArrayList;
import java.util.List;
import org.simpleframework.xml.Attribute;
import org.simpleframework.xml.Element;
import org.simpleframework.xml.ElementList;
import org.simpleframework.xml.Root;
import define.Entry;
@Root
public class Dictionary {
@Attribute
private String query;
@Attribute
private String totalresults;
@ElementList(inline = true, name = "entry")
private List<Entry> list;
public Dictionary() {
super();
}
public Dictionary(String query, String totalresults, List<Entry> list) {
this.query = query;
this.totalresults = totalresults;
this.list = list;
}
public String getQuery() {
return query;
}
public String getTotalResults() {
return totalresults;
}
public List getEntry() {
return list;
}
}
--
package com.sbk.xml;
import java.util.List;
import org.simpleframework.xml.Attribute;
import org.simpleframework.xml.Default;
import org.simpleframework.xml.Element;
import org.simpleframework.xml.ElementList;
import org.simpleframework.xml.Root;
@Root
public class Entry {
@Attribute
private String id;
@Element(required = false)
private String display_form;
@Element(required = false)
private String pron;
@ElementList(inline = true, required = false, name = "partofspeech",
type=PartOfSpeech.class)
private List<PartOfSpeech> partofspeech;
public String getId() {
return id;
}
public String getDisplay() {
return display_form;
}
public String getPron() {
return pron;
}
public List getPartOfSpeech() {
return partofspeech;
}
}
--
package com.sbk.xml;
import java.util.List;
import org.simpleframework.xml.Attribute;
import org.simpleframework.xml.ElementList;
import org.simpleframework.xml.Root;
@Root
public class PartOfSpeech {
@Attribute(required = false)
private String pos;
@ElementList(inline = true, required = false, name="defset")
private List<Defset> defset;
public String getPos(){
return pos;
}
public List getDefset() {
return defset;
}
}
--
package com.sbk.xml;
import java.util.List;
import org.simpleframework.xml.Attribute;
import org.simpleframework.xml.Element;
import org.simpleframework.xml.ElementList;
public class Defset {
@ElementList(inline = true, required = false, name="def")
private List<Def> def;
// @Element(required = false, name="def")
// private List<Def> def;
public List getDefList() {
return def;
}
}
--
package com.sbk.xml;
import org.simpleframework.xml.Element;
public class Def {
@Element(required = false)
private String def;
public String getDef(){
return def;
}
}
|