Simple XML Framework and Android - strange class attribute

Go To StackoverFlow.com

0

I am trying to use the Simple XML library with Android and getting some errors with it (http://pastebin.com/7Nrk1esD), 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:

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

this line produces the following xml output:

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

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


1

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


0

Try this

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

This should work.

2012-11-10 14:09
by ng.
Ads