ejb - Java XML, The number of formal and actual parameters differs, or an unwrapping conversion has failed -


when requesting data endpoint accept: application/xml keep getting following error:

javax.xml.bind.marshalexception - linked exception: [exception [eclipselink-27] (eclipse persistence services - 2.6.1.v20150916-55dc7c3): org.eclipse.persistence.exceptions.descriptorexception exception description: trying invoke method [getsurveyid] on object [com.on24.ejb.mapping.surveyquestion]. number of actual , formal parameters differs, or unwrapping conversion has failed. internal exception: java.lang.illegalargumentexception: object not instance of declaring class mapping: org.eclipse.persistence.oxm.mappings.xmldirectmapping[surveyid-->surveyid/text()] descriptor: xmldescriptor(com.on24.ejb.mapping.survey --> [databasetable(survey)])]

the response works fine when accept: application/json know can't problem extracting info db; haven't been able solve issue appreciated.

dtos involved:

@xmlrootelement @xmltype (proporder={"surveyid", "surveyquestions"}) @xmlaccessortype(xmlaccesstype.public_member) public class survey {     private long surveyid;     private list<surveyquestion> surveyquestions;      public survey(){}      public long getsurveyid() {         return surveyid;     }      public void setsurveyid(long surveyid) {         this.surveyid = surveyid;     }      @xmlelementwrapper(name="surveyquestionslist")     @xmlelement(name="surveyquestion")     public list<surveyquestion> getsurveyquestions() {         return surveyquestions;     }      public void setsurveyquestions(list<surveyquestion> surveyquestions) {         this.surveyquestions = surveyquestions;     } } 

and

@xmlrootelement @xmltype (proporder={"surveyquestionid", "surveyquestion", "surveyanswers"}) @xmlaccessortype(xmlaccesstype.public_member) public class surveyquestion {     private long surveyquestionid;     private string surveyquestion;     private list<string> surveyanswers;       public surveyquestion(){}      public long getsurveyquestionid() {         return surveyquestionid;     }      public void setsurveyquestionid(long surveyquestionid) {         this.surveyquestionid = surveyquestionid;     }      public string getsurveyquestion() {         return surveyquestion;     }      public void setsurveyquestion(string surveyquestion) {         this.surveyquestion = surveyquestion;     }      @xmlelementwrapper(name="surveyanswerslist")     @xmlelement(name="surveyanswer")     public list<string> getsurveyanswers() {         return surveyanswers;     }      public void setsurveyanswers(list<string> surveyanswers) {         this.surveyanswers = surveyanswers;     } } 

i've tried several thinks refactoring use xmlaccesstype.public_member, xmlaccesstype.field, xmlaccesstype.property no success there.

i'd understand why error generated. if more info need i'll add per asked for, thanks.


Comments

Popular posts from this blog

Ansible warning on jinja2 braces on when -

Parsing a protocol message from Go by Java -

html - How to custom Bootstrap grid height? -