加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

webservices复杂类型值传递

发布时间:2020-12-16 23:02:29 所属栏目:安全 来源:网络整理
导读:Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 2 counts of IllegalAnnotationExceptionsjava.util.Map is an interface,and JAXB can't handle interfaces.this problem is related to the following location:at java.util.Mapat
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.test.service.jaxws_asm.Update.arg2
		at com.test.service.jaxws_asm.Update
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.test.service.jaxws_asm.Update.arg2
	at com.test.service.jaxws_asm.Update
	at com.sun.xml.bind.v2.runtime.IllegalAnnotationsException$Builder.check(IllegalAnnotationsException.java:102)
	at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:472)
	at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:302)
	at com.sun.xml.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1140)
	at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:154)
	at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:121)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:202)
	at javax.xml.bind.ContextFinder.find(ContextFinder.java:363)
	at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:574)
	at org.apache.cxf.common.jaxb.JAXBContextCache$2.run(JAXBContextCache.java:268)
	at org.apache.cxf.common.jaxb.JAXBContextCache$2.run(JAXBContextCache.java:267)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.apache.cxf.common.jaxb.JAXBContextCache.createContext(JAXBContextCache.java:266)
	at org.apache.cxf.common.jaxb.JAXBContextCache.getCachedContextAndSchemas(JAXBContextCache.java:172)
	at org.apache.cxf.jaxb.JAXBDataBinding.createJAXBContextAndSchemas(JAXBDataBinding.java:427)
	at org.apache.cxf.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:295)
	... 47 more
将服务端的services接口返回的Map类型的值,改成HashMap. 在做webServices复杂类型值传递时,返回值的类型不要用接口类型。例如(List应该改为ArrayList,Map改为HashMap等)

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读