最近由于项目需要,研究后决定是REST web Services,在开发中遇到报错如下:
严重: Mapped exception to response: 500 (Internal Server Error)
javax.ws.rs.WebApplicationException: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions
com.hnyxsm.entry.dataExchange.TDsInterface does not have a no-arg default constructor.
this problem is related to the following location:
at com.hnyxsm.entry.dataExchange.TDsInterface
百度 谷歌无数,唯一一个对号的文章,图片不能显示。
万般无奈下,百度“ does not have a no-arg default constructor”的英文意思。问题终于解决了。
下面是原错误文件代码
package com.hnyxsm.entry.dataExchange;
import javax.xml.bind.annotation.XmlRootElement;
@XmlRootElement(name="TDsInterface")
/**
* 数据交换--接口管理
* @author SuperYuan
*/
public class TDsInterface implements java.io.Serializable{
/**
*
*/
private static final long serialVersionUID = -1693894354995782167L;
private int id;/* 主键 */
private String title; /* 接口标题 */
private String identificationCode;/* 识别码 */
private String introdution; /* 功能简介 */
private String sqlCode;/* sql语句 */
private String reDateType;/* 返回数据类型 */
private int reDateNumber;/* 返回数据条数 */
public TDsInterface(int id, String title, String identificationCode,
String introdution, String sqlCode, String reDateType,
int reDateNumber) {
this.id = id;
this.title = title;
this.identificationCode = identificationCode;
this.introdution = introdution;
this.sqlCode = sqlCode;
this.reDateType = reDateType;
this.reDateNumber = reDateNumber;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getIntrodution() {
return introdution;
}
public void setIntrodution(String introdution) {
this.introdution = introdution;
}
public String getIdentificationCode() {
return identificationCode;
}
public void setIdentificationCode(String identificationCode) {
this.identificationCode = identificationCode;
}
public String getSqlCode() {
return sqlCode;
}
public void setSqlCode(String sqlCode) {
this.sqlCode = sqlCode;
}
public String getReDateType() {
return reDateType;
}
public void setReDateType(String reDateType) {
this.reDateType = reDateType;
}
public int getReDateNumber() {
return reDateNumber;
}
public void setReDateNumber(int reDateNumber) {
this.reDateNumber = reDateNumber;
}
}
这是纠正后,能正确运行的代码:
package com.hnyxsm.entry.dataExchange;
import javax.xml.bind.annotation.XmlRootElement;
@XmlRootElement(name="TDsInterface")
/**
* 数据交换--接口管理
* @author SuperYuan
*/
public class TDsInterface implements java.io.Serializable{
/**
*
*/
private static final long serialVersionUID = -1693894354995782167L;
private int id;/* 主键 */
private String title; /* 接口标题 */
private String identificationCode;/* 识别码 */
private String introdution; /* 功能简介 */
private String sqlCode;/* sql语句 */
private String reDateType;/* 返回数据类型 */
private int reDateNumber;/* 返回数据条数 */
public TDsInterface() {//关键就是这个,有了它,问题纠正
super();
}
public TDsInterface(int id, String title, String identificationCode,
String introdution, String sqlCode, String reDateType,
int reDateNumber) {
this.id = id;
this.title = title;
this.identificationCode = identificationCode;
this.introdution = introdution;
this.sqlCode = sqlCode;
this.reDateType = reDateType;
this.reDateNumber = reDateNumber;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getIntrodution() {
return introdution;
}
public void setIntrodution(String introdution) {
this.introdution = introdution;
}
public String getIdentificationCode() {
return identificationCode;
}
public void setIdentificationCode(String identificationCode) {
this.identificationCode = identificationCode;
}
public String getSqlCode() {
return sqlCode;
}
public void setSqlCode(String sqlCode) {
this.sqlCode = sqlCode;
}
public String getReDateType() {
return reDateType;
}
public void setReDateType(String reDateType) {
this.reDateType = reDateType;
}
public int getReDateNumber() {
return reDateNumber;
}
public void setReDateNumber(int reDateNumber) {
this.reDateNumber = reDateNumber;
}
}
分享到:
相关推荐
开源项目-alexflint-go-arg.zip,Why have an API for command line flags when you can just do this?
资源来自pypi官网。 资源全名:smart-arg-0.0.2.tar.gz
npm-package-arg 解析传递给命令(如npm install或npm cache add )或在package.json依赖项部分中找到的包名称和说明符。 例子 var assert = require ( "assert" ) var npa = require ( "npm-package-arg" ) // ...
2.修改配置文件WEB-INF/config/captcha-context.xml <constructor-arg index="0" ref="imageEngine"/> <constructor-arg type="int" index="1" value="180"/> <constructor-arg type="int" index="2" value=...
以二茂铁二甲酸、甘氨酸、酪氨酸和精氨酸为原料,通过多步反应,合成新的二茂铁-肽衍生物 Boc-HN-Fca-Gly-Gly-Tyr-Arg-OMe(7)(Fca代表二茂铁氨基酸) 和Boc-HN-Fca-Gly-Gly-Tyr-Arg-OH(8),对寡聚肽的合成进行研究;...
JNI数组参数传递,在使用JNI编程时注意转换参数,尤其是数组的出入与传出。
<jvm-arg>-Xms512m</jvm-arg> <jvm-arg>-Xss128k</jvm-arg> <jvm-arg>-Xmn184m</jvm-arg> <jvm-arg>-XX:ParallelGCThreads=20</jvm-arg> <jvm-arg>-XX:+UseConcMarkSweepGC</jvm-arg> <jvm-arg>-XX:+UseParNewGC...
前端开源库-argx.zip
Retrofit 1 OkHttp 3 Client ...You can also use the no-arg constructor for a default OkHttpClient instance. Download Gradle: compile 'com.jakewharton.retrofit:retrofit1-okhttp3-client:1.1.0' or M
var args struct {Foo stringBar bool}arg . MustParse ( & args )fmt . Println ( args . Foo , args . Bar )$ ./example --foo=hello --barhello true安装go get github.com/alexflint/go-arg必填参数var args ...
主要介绍了Kotlin之在Gradle中无参(no-arg)编译器插件的使用详解,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧
returns NULL if there isn t a full record in the buffer.
安装 npm install https://github.com/emileswain/validate-arg-types/tarball/master --save npm install validate-arg-types --save用法新建实例 var ValidateArgs = require ( 'validate-arg-types' ) ;...
python 出现SyntaxError: non-keyword arg after keyword arg错误解决办法 前言: 在Python中,这两个是python中的可变参数,*arg表示任意多个无名参数,类型为tuple,**kwargs表示关键字参数,为dict,使用时需将...
官方离线安装包,测试可用。使用rpm -ivh [rpm完整包名] 进行安装
官方离线安装包,测试可用。使用rpm -ivh [rpm完整包名] 进行安装
笑话调用arg是一组实用程序函数,用于调用传递给模拟函数的回调。 这对于测试处理带有回调的模拟函数的代码非常方便。 它在某种程度上受到sinon的callArg功能的启发。 安装 npm install jest-call-arg --save-dev ...
前端开源库-argxargx,分析函数参数。用于实现可变函数。