Hi,
I'm facing the following problem (not related to WS directly, but I post here because of the JAXB component) :
I want to Marshall a org.springframework.social.twitter.api.Tweet to xml. But this object does not have a no-arg constructor as the Jaxb2Marshaller says
So I create a SimpleTweet class that simply propose the same get/set but with a default constructor.Code:Caused by: com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions org.springframework.social.twitter.api.Tweet does not have a no-arg default constructor. this problem is related to the following location: at org.springframework.social.twitter.api.Tweet
Then I create a TweetAdapter to link those two classes.
Next, I change my Jaxb2Manager configuration like this.
But I still get the same error message. Do I forget something ?HTML Code:<bean id="marshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller"> <property name="classesToBeBound"> <list> <value>org.springframework.social.twitter.api.Tweet</value> </list> </property> <property name="adapters"> <list> <bean class="test.TweetAdapter" /> </list> </property> </bean>
Note that I can't modify the original Tweet class to add an Annotation.
Thanks in advance


Reply With Quote