“找不到适合类型的构造函数”,并且类型存在并且具有默认构造函数

时间:2018-07-20 01:00:01

标签: java tomcat jaxb jersey

我正在构建的新泽西州1.19.4应用程序中收到此消息:

No suitable constructor found for type [simple type, class javax.xml.bind.JAXBElement<com.objex.idms.idd.types.IDDModule>]: can not instantiate from JSON object (need to add/enable type information?)
 at [Source: org.apache.catalina.connector.CoyoteInputStream@5a5e4ec1; line: 1, column: 2]

经过大量搜索后,我发现有很多帖子表明这可能是由于缺少默认构造函数所致。但是,这里似乎并非如此。注意我已经尝试过以相同的结果实现“可序列化”。我确信这很简单,但是只是想念它。

这里是有问题的课程,您可能会想念的任何想法。

package com.objex.idms.idd.types;

// import java.io.Serializable;

public class IDDModule {
    /**
     * 
     */
    //private static final long serialVersionUID = 1897236478938746827L;

    private String DictName;
    private String DictNode;
    private String Name;
    private String Version;
    private String Language;
    private String ModuleMetadata;
    private String ModuleSource;
    private String Message;

    public IDDModule() {
    }   
    /**
     * @param dictName the dictName to set
     */
    public void setDictName(String DictName) {
        this.DictName = DictName;
    }
    /**
     * @return the dictName
     */
    public String getDictName() {
        return DictName;
    }
    /**
     * @param DictNode the dictNode to set
     */
    public void setDictNode(String DictNode) {
        this.DictNode = DictNode;
    }
    /**
     * @return the dictNode
     */
    public String getDictNode() {
        return DictNode;
    }
    /**
     * @param language the language to set
     */
    public void setLanguage(String language) {
        this.Language = language;
    }
    /**
     * @return the language
     */
    public String getLanguage() {
        return Language;
    }
    /**
     * @param Message the message to set
     */
    public void setMessage(String Message) {
        this.Message = Message;
    }
    /**
     * @return the message
     */
    public String getMessage() {
        return Message;
    }
    /**
     * @param ModuleMetadata the moduleMetadata to set
     */
    public void setModuleMetadata(String ModuleMetadata) {
        this.ModuleMetadata = ModuleMetadata;
    }
    /**
     * @return the ModuleMetadata
     */
    public String getModuleMetadata() {
        return ModuleMetadata;
    }
    /**
     * @param ModuleSource the moduleSource to set
     */
    public void setModuleSource(String ModuleSource) {
        this.ModuleSource = ModuleSource;
    }
    /**
     * @return the moduleSource
     */
    public String getModuleSource() {
        return ModuleSource;
    }
    /**
     * @param name the name to set
     */
    public void setName(String name) {
        this.Name = name;
    }
    /**
     * @return the name
     */
    public String getName() {
        return Name;
    }
    /**
     * @param version the version to set
     */
    public void setVersion(String version) {
        this.Version = version;
    }
    /**
     * @return the version
     */
    public String getVersion() {
        return Version;
    }
}

0 个答案:

没有答案