java - failed to unmarshall using JAXB -


so, have jaxbcontext

jaxbcontext context = jaxbcontext.newinstance(foo.class); 

referring documentation,

if newinstance(foo.class), newly created jaxbcontext} recognize both foo , bar, not foobar

class foo {   @xmltransient foobar c;   bar b; } 

problem is, when try unmarshall xml foo, like:

 unmarshaller unmarshaller = context.createunmarshaller();  object obj = unmarshaller.unmarshal(xmlstring); 

xmlstring representation of foo, unmarshaller fails deliver obj instanceof foo, instead delivers bar instance. (i made simple, problem arises when context knows 5-6 classes)

any appreciated!


Comments

Popular posts from this blog

curl - PHP fsockopen help required -

HTTP/1.0 407 Proxy Authentication Required PHP -

c# - Resource not found error -