案例 1

生成时报错:WSDL file has validation errors. Code generation may fail

启动报错:
Caused by: javax.xml.ws.WebServiceException: Unable to create JAXBContextat com.sun.xml.ws.model.AbstractSEIModelImpl.createJAXBContext(AbstractSEIModelImpl.java:158)at com.sun.xml.ws.model.AbstractSEIModelImpl.postProcess(AbstractSEIModelImpl.java:87)at com.sun.xml.ws.model.RuntimeModeler.buildRuntimeModel(RuntimeModeler.java:262)at com.sun.xml.ws.server.EndpointFactory.createSEIModel(EndpointFactory.java:322)at com.sun.xml.ws.server.EndpointFactory.createEndpoint(EndpointFactory.java:188)at com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:467)at com.sun.xml.ws.transport.http.DeploymentDescriptorParser.parseAdapters(DeploymentDescriptorParser.java:253)at com.sun.xml.ws.transport.http.DeploymentDescriptorParser.parse(DeploymentDescriptorParser.java:147)at com.sun.xml.ws.transport.http.servlet.WSServletContextListener.contextInitialized(WSServletContextListener.java:108)... 24 more
Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 2 counts of IllegalAnnotationExceptions
java.util.List is an interface, and JAXB can't handle interfaces.this problem is related to the following location:at java.util.List
java.util.List does not have a no-arg default constructor.this problem is related to the following location:at java.util.List

参考:http://jyao.iteye.com/blog/1213655

解决方法:将服务端的services接口返回的Map类型的值,改成HashMap.
结论:在做webServices复杂类型值传递时,返回值的类型不要用接口类型。例如(List应该改为ArrayList,Map改为HashMap,或者用String[]数组等)

案例 2

服务端或客户端生成包时,报错:cannot find the declaration of element 'html'

原因:由于在web.xml配置了struts2的过滤器,代码如:

<!-- 配置Struts2核心过滤器(拦截器) -->  <filter><filter-name>struts2</filter-name><filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class></filter><filter-mapping><filter-name>struts2</filter-name><url-pattern>/*</url-pattern></filter-mapping>     

将/*修改为.action或.do,在struts.xml中.action不能访问静态权限,因此不能要:

<!--

该属性设置Struts 2是否支持动态方法调用,该属性的默认值是true。如果需要关闭动态方法调用,则可设置该属性为false

-->

<constant name="struts.enable.DynamicMethodInvocation" value="false" />

而.do必须要:

<!-- 设置url请求后缀 -->

<constant name="struts.action.extension" value="do"></constant>

并且在jsp的表单action中必须加后缀.action或.do

转载于:https://www.cnblogs.com/readstory/articles/7263126.html

Web Service 自动生成代码报错相关推荐

  1. Eclipse导入Web项目代码报错解决方案

    Eclipse导入Web项目代码报错解决方案 我相信很多人在开发中导入别人的项目时,Web项目导入Eclipse中项目出现报错(左上角有红叉).开发环境:J2EE5+JDK8,IDE使用Eclipse ...

  2. SAP RETAIL 自动补货WRP1R事务代码报错 - Forecast values for determining target stock do not exist -

    SAP RETAIL 自动补货WRP1R事务代码报错 - Forecast values for determining target stock do not exist - 如下商品主数据,MRP ...

  3. SpringBoot入门篇--整合mybatis+generator自动生成代码+druid连接池+PageHelper分页插件

    我们这一一篇博客讲的是如何整合Springboot和Mybatis框架,然后使用generator自动生成mapper,pojo等文件.然后再使用阿里巴巴提供的开源连接池druid,这个连接池的好处我 ...

  4. Mybatis Plus自动生成代码

    mybatis-plus自动生成代码 一.简易生成代码 二.指定生成的样式,并且不在一个模块 1.父pom文件配置 2.子模块pom文件配置 3.准备vm文件 4.设置MyBatisPlusGener ...

  5. 【MyBatis】MyBatis自动生成代码之查询爬坑记

    前言 项目使用SSM框架搭建Web后台服务,前台后使用restful api,后台使用MyBatisGenerator自动生成代码,在前台使用关键字进行查询时,遇到了一些很宝贵的坑,现记录如下.为展示 ...

  6. MyBatisPlus自动生成代码springboot+mybatis+mysql 以及动态sql生成方法(测试可用版)

    用了一段时间的springboot,想着百度一下自动生成代码的方式,包括后面如何生成动态sql方法的方式. 摸索了几天,整理一下: ** 1 自动生成代码方式:com.baomidou.mybatis ...

  7. 如何用 APT(Annotation Processing Tool)自动生成代码

    我们很多人都写过代码自动生成的工具,比如用python结合moko模板引擎,或者java 结合freemarker模板引擎,protoc 等,实现解析策划数据类,proto协议类,或者数据库层的实体类 ...

  8. jsp里写java代码报错,jsp里写java代码报错

    jsp里写java代码报错 [2021-02-11 06:42:03]  简介: php去除nbsp的方法:首先创建一个PHP代码示例文件:然后通过"preg_replace("/ ...

  9. javaweb项目:用户(登录和注销)实现 SSM框架(mybatis-generator自动生成代码)

    SSM框架的搭建环境(Spring,SpringMVC,Mybatis) 使用工具:maven.idea.tomcat用的是8.jdk版本1.8 一.整个项目的结构: 用户模块流程 pom.xml - ...

最新文章

  1. 为什么越来越多的人都不再愿意做程序员了?
  2. 1209F - Koala and Notebook
  3. java创建一个人函数类_Java对象和类–学习如何创建和实现
  4. 《Access 2007开发指南(修订版)》一一1.5 什么是数据库对象
  5. 信息学奥赛C++语言:交换数值
  6. 深入理解 gRPC 协议--理解protobuf/.proto/http2
  7. apache 支持 php5
  8. 第一次作业 三班20
  9. 函数计算机显示RAD,计算器rad是什么意思
  10. 小黑笔记:transe模型
  11. arcgis python 百度网盘 视频_arcgis软件零基础入门视频教程27讲百度网盘链接
  12. 数据结构算法—非递归算法求二叉树的叶子结点(C语言)
  13. oracle onlinelog 11G,从alert日志看Oracle 11g Datagurad日志传输(下)
  14. Exception | This means that said other beans do not use the final version of the bean. This is often
  15. 教程篇(7.0) 10. FortiGate安全 反病毒 ❀ Fortinet 网络安全专家 NSE 4
  16. 社群运营的用户画像分析有哪些方法?
  17. \t\t最近两周访问来源统计
  18. 新手如何起步做好微商,微商如何加精准好友?微商如何选产品!如何让别人主动加微信,怎么让别人主动加我微信!
  19. C++ 变量的生存期
  20. 【linux命令】我常用的Linux命令

热门文章

  1. 机械臂末端执行器汇总
  2. mysql取数据库时间函数_MySQL数据库—日期与时间函数
  3. st_atime、st_mtime和st_ctime
  4. Java开发者环境搭建
  5. 做过10亿次设计的人工智能「鹿班」,原来是他负责的!
  6. 虚拟换衣 VITON 论文笔记
  7. 闭门造车的苹果,究竟在造什么车?
  8. Dom对象和java
  9. Http/Https代理Python实现
  10. vue使用tradingview开发K线图相关问题