Simple XML Framework and Android - strange class attribute

Go To


I am trying to use the Simple XML library with Android and getting some errors with it (, where the main error is this:

"org.eclipse.persistence.indirection.IndirectList in loader dalvik.system.PathClassLoader..."

The Model which has to be deserialized is also used by a rest-server to produce the necessary XML, there are also some JPA-annotations like the following:

@ElementList(required = false)
private List<Substance> substances = new ArrayList<>();

this line produces the following xml output:

<substances class="org.eclipse.persistence.indirection.IndirectList">

Here I see now where the error is coming from - Android is not aware of org.eclipse.persistence! But my question is now: Why is the line class="...IndirectList" produced and how can I change that to avoid the errors in the Android application?

PS: I am using simple 2.6.2

thanks in advance!

2012-04-03 22:50
by Eddy


Found the Answer here:

Strategy strategy = new TreeStrategy("clazz", "len");
Serializer serializer = new Persister(strategy);

But I use this snippet only in the Android-client to deserialize and NOT to serialize the model in the server.

2012-04-07 21:09
by Eddy


Try this

@ElementList(required = false, inline=false)
private List<Substance> substances = new ArrayList<>();

This should work.

2012-11-10 14:09
by ng.