[Logo]
Forums Register Login
XML Decoder exception
Hello all,

While trying to decode a XML string into an specific object using XMLDecoder.readObject() method, I get the below exception
'java.lang.NoSuchMethodException: <unbound>= fooTO.setName("lala")'

The reason I get the exception is due to the fact that there is no "set" method called "setName" on fooTO javabean class.

What I am curious is if there is anyway I can just simple ignore the methods that is not in the javabean class and proceed successfully creating an Object from XML string without throwing any exception.

I REALLY APPRECIATE EVERYONES INPUT.

THANKS IN ADVANCE.
I thought if you wanted a Bean you needed to follow the rules, everything needs a set and a get.
It did had set and get method during the creation of the XML, but not decoding the XML back to the object.

So, basically once the XML is created, the XML is persisted in the database as a string...after few days the javabean that was used to create the xml has been refactored (in this case...deletion of some property), so when I try to decode the XML string back to the object I get the following error... NoSuchMethodException.

Is it possible to ignore the missing property (set and get) and continue with successfull decoding the xml back to the javabean object?.

Thanks a bunch in advance !!
> the javabean that was used to create the xml has been refactored (in this case...deletion of some property),

Well that was a good job of refactoring.

> Is it possible to ignore the missing property (set and get) and continue with successfull decoding the xml back to the javabean object?.

You are running the code, you tell me. Are you getting the output you want?
Wink, wink, nudge, nudge, say no more ... https://richsoil.com/cards



All times above are in ranch (not your local) time.
The current ranch time is
Dec 16, 2017 02:12:41.