报错:java.util.Map is an interface, and JAXB can't handle interfaces.
2016-11-07 08:57
537 查看
报错:java.util.Map is an interface, and JAXB can't handle interfaces.
2016-04-08 10:21 339人阅读 评论(0) 收藏 举报分类:
rest和soap服务(5)
版权声明:本文为博主原创文章,未经博主允许不得转载。
<code class="hljs applescript has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: "Source Code Pro", monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;">严重: Context [/cgf_service] startup failed due <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">to</span> previous errors <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">at</span> org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">330</span>) ... <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">68</span> more Caused <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">by</span>: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2</span> counts <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">of</span> IllegalAnnotationExceptions java.util.Map <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">is</span> an interface, <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">and</span> JAXB can't handle interfaces. this problem <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">is</span> related <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">to</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">the</span> following location: <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">at</span> java.util.Map <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">at</span> private java.util.Map org.sklse.management.service.jaxws_asm.InvokeServiceMethod2.transportData <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">at</span> org.sklse.management.service.jaxws_asm.InvokeServiceMethod2 java.util.Map <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">does</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">not</span> have a no-arg default constructor. this problem <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">is</span> related <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">to</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">the</span> following location: <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">at</span> java.util.Map <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">at</span> private java.util.Map org.sklse.management.service.jaxws_asm.InvokeServiceMethod2.transportData <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">at</span> org.sklse.management.service.jaxws_asm.InvokeServiceMethod2</code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li><li style="box-sizing: border-box; padding: 0px 5px;">3</li><li style="box-sizing: border-box; padding: 0px 5px;">4</li><li style="box-sizing: border-box; padding: 0px 5px;">5</li><li style="box-sizing: border-box; padding: 0px 5px;">6</li><li style="box-sizing: border-box; padding: 0px 5px;">7</li><li style="box-sizing: border-box; padding: 0px 5px;">8</li><li style="box-sizing: border-box; padding: 0px 5px;">9</li><li style="box-sizing: border-box; padding: 0px 5px;">10</li><li style="box-sizing: border-box; padding: 0px 5px;">11</li><li style="box-sizing: border-box; padding: 0px 5px;">12</li><li style="box-sizing: border-box; padding: 0px 5px;">13</li><li style="box-sizing: border-box; padding: 0px 5px;">14</li></ul><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li><li style="box-sizing: border-box; padding: 0px 5px;">3</li><li style="box-sizing: border-box; padding: 0px 5px;">4</li><li style="box-sizing: border-box; padding: 0px 5px;">5</li><li style="box-sizing: border-box; padding: 0px 5px;">6</li><li style="box-sizing: border-box; padding: 0px 5px;">7</li><li style="box-sizing: border-box; padding: 0px 5px;">8</li><li style="box-sizing: border-box; padding: 0px 5px;">9</li><li style="box-sizing: border-box; padding: 0px 5px;">10</li><li style="box-sizing: border-box; padding: 0px 5px;">11</li><li style="box-sizing: border-box; padding: 0px 5px;">12</li><li style="box-sizing: border-box; padding: 0px 5px;">13</li><li style="box-sizing: border-box; padding: 0px 5px;">14</li></ul>
解决方法:将服务端的services接口返回的Map类型的值改为HashMap.
因为在做webService复杂类型值传递时,返回值的类型不要用接口类型。例如List应该改为ArrayList,Map改为HashMap等
相关文章推荐
- 报错:java.util.Map is an interface, and JAXB can't handle interfaces.
- java.util.Map is an interface, and JAXB can't handle interfaces.
- SpringMvc报错解决:Failed to instantiate [java.util.List]: Specified class is an interface
- 关于运行期异常:Failed to instantiate [java.util.List]: Specified class is an interface
- 解决Failed to instantiate [java.util.List]: Specified class is an interface问题
- 关于运行期异常:Failed to instantiate [java.util.List]: Specified class is an interface
- 关于运行期异常:Failed to instantiate [java.util.List]: Specified class is an interface
- Could not instantiate bean class [java.util.List]: Specified class is an interface] with root cause
- 错误:Could not instantiate bean class [java.util.List]: Specified class is an interface
- The type java.util.Map$Entry cannot be resolved. It is indirectly referenced from required .class fi
- 经常遇到Please ensure that adb is correctly located at 'D:\java\sdk\platform-tools\adb.exe' and can be e
- 解决jdk8之The type java.util.Map$Entry cannot be resolved. It is indirectly referenced from required .
- 经常遇到Please ensure that adb is correctly located at 'D:\java\sdk\platform-tools\adb.exe' and can be e
- The type java.util.Map$Entry cannot be resolved. It is indirectly referenced from required .class files
- What’s the difference between an interface and an abstract class in Java?
- An error occurred at line: 7 in the generated java file Only a type can be imported. java.util.list
- 经常遇到Please ensure that adb is correctly located at 'D:\java\sdk\platform-tools\adb.exe' and can be e
- 经常遇到Please ensure that adb is correctly located at 'C:\java\sdk\platform-tools\adb.exe' and can be e
- 经常遇到Please ensure that adb is correctly located at 'D:\java\sdk\platform-tools\adb.exe' and can be
- The type java.util.Map$Entry cannot be resolved. It is indirectly referenced问题