com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 2 counts of IllegalAnnotationException


Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 2 counts of IllegalAnnotationExceptions 

java.util.Map is an interface, and JAXB can't handle interfaces. 
this problem is related to the following location: 
at java.util.Map 
at private java.util.Map com.cecltd.service.jaxws_asm.SayHi.arg0 
at com.cecltd.service.jaxws_asm.SayHi 
java.util.Map does not have a no-arg default constructor. this problem is related to the following location: 
at java.util.Map 
at private java.util.Map com.cecltd.service.jaxws_asm.SayHi.arg0 
at com.cecltd.service.jaxws_asm.SayHi 
解決方法:將服務端的services接口返回的Map類型的值,改成HashMap.
結論:在做webServices復雜類型值傳遞時,返回值的類型不要用接口類型。例如(List應該改為ArrayList,Map改為HashMap等)


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM