Java 无法将json字符串转换为POJO,因为错误应为字符串,但为BEGIN\u数组

Java 无法将json字符串转换为POJO,因为错误应为字符串,但为BEGIN\u数组,java,json,gson,Java,Json,Gson,由于某种原因,我无法将其隐藏到POJO中。我正在拨打并尝试拨打的电话如下: NewsEntities newsEntities = new Gson().fromJson(jsonString, NewsEntities.class); 神秘之处在于json不在数组中。我认为这是一个jsonObject。 jsonString是 我在android中遇到的错误是: Caused by: java.lang.IllegalStateException: Expected a strin

由于某种原因,我无法将其隐藏到POJO中。我正在拨打并尝试拨打的电话如下:

NewsEntities  newsEntities = new Gson().fromJson(jsonString, NewsEntities.class);
神秘之处在于json不在数组中。我认为这是一个jsonObject。 jsonString是

我在android中遇到的错误是:

    Caused by: java.lang.IllegalStateException: Expected a string but was BEGIN_ARRAY at line 1 column 1006 path $.results[0].org_facet
02-24 23:42:49.955 15463-15531/news.myapp.com.technewssample W/System.err:     at com.google.gson.stream.JsonReader.nextString(JsonReader.java:831)
02-24 23:42:49.955 15463-15531/news.myapp.com.technewssample W/System.err:     at com.google.gson.internal.bind.TypeAdapters$16.read(TypeAdapters.java:422)
02-24 23:42:49.955 15463-15531/news.myapp.com.technewssample W/System.err:     at com.google.gson.internal.bind.TypeAdapters$16.read(TypeAdapters.java:410)
02-24 23:42:49.955 15463-15531/news.myapp.com.technewssample W/System.err:     at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:116)
02-24 23:42:49.956 15463-15531/news.myapp.com.technewssample W/System.err:     at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(Reflect
newsEntities类本身看起来是这样的,我只是根据以下内容创建它:

公共类NewsEntities实现可包裹
{
@序列化名称(“状态”)
@暴露
私有字符串状态;
@序列化名称(“版权”)
@暴露
私有字符串版权;
@序列化名称(“节”)
@暴露
私有字符串部分;
@SerializedName(“上次更新”)
@暴露
私有字符串更新;
@SerializedName(“num_结果”)
@暴露
私有整数numResults;
@SerializedName(“结果”)
@暴露
私有列表结果=null;
公共最终静态包裹。创建者=新创建者(){
@抑制警告({
“未选中”
})
公共新闻实体createFromParcel(地块中){
NewsEntities实例=新的NewsEntities();
instance.status=((String)in.readValue((String.class.getClassLoader());
instance.copyright=((String)in.readValue((String.class.getClassLoader());
instance.section=((String)in.readValue((String.class.getClassLoader());
instance.lastUpdated=((String)in.readValue((String.class.getClassLoader());
instance.numResults=((整数)in.readValue((Integer.class.getClassLoader());
in.readList(instance.results,(Result.class.getClassLoader());
返回实例;
}
公共新闻实体[]新数组(整数大小){
返回(新新闻实体[大小]);
}
}
;
公共字符串getStatus(){
返回状态;
}
公共无效设置状态(字符串状态){
这个状态=状态;
}
公共字符串getCopyright(){
归还版权;
}
公共版权(字符串版权){
版权=版权;
}
公共字符串getSection(){
返回段;
}
公共无效设置部分(字符串部分){
this.section=section;
}
公共字符串getLastUpdated(){
返回最新更新;
}
公共void setLastUpdated(字符串lastUpdated){
this.lastUpdated=lastUpdated;
}
公共整数getNumResults(){
返回numResults;
}
公共void setNumResults(整数numResults){
this.numResults=numResults;
}
公共列表getResults(){
返回结果;
}
公共void setResults(列出结果){
这个结果=结果;
}
公共无效写入包裹(包裹目的地,内部标志){
目的写入值(状态);
目的书面价值(版权);
目的书面价值(第节);
dest.writeValue(最近更新);
目的写入值(numResults);
目的写入列表(结果);
}
公共int描述内容(){
返回0;
}
}
更新:以下是结果类:

    public class Result implements Parcelable
{

    @SerializedName("section")
    @Expose
    private String section;
    @SerializedName("subsection")
    @Expose
    private String subsection;
    @SerializedName("title")
    @Expose
    private String title;
    @SerializedName("abstract")
    @Expose
    private String _abstract;
    @SerializedName("url")
    @Expose
    private String url;
    @SerializedName("byline")
    @Expose
    private String byline;
    @SerializedName("item_type")
    @Expose
    private String itemType;
    @SerializedName("updated_date")
    @Expose
    private String updatedDate;
    @SerializedName("created_date")
    @Expose
    private String createdDate;
    @SerializedName("published_date")
    @Expose
    private String publishedDate;
    @SerializedName("material_type_facet")
    @Expose
    private String materialTypeFacet;
    @SerializedName("kicker")
    @Expose
    private String kicker;
    @SerializedName("des_facet")
    @Expose
    private List<String> desFacet = null;
    @SerializedName("org_facet")
    @Expose
    private String orgFacet;
    @SerializedName("per_facet")
    @Expose
    private String perFacet;
    @SerializedName("geo_facet")
    @Expose
    private List<String> geoFacet = null;
    @SerializedName("multimedia")
    @Expose
    private List<Multimedium> multimedia = null;
    public final static Parcelable.Creator<Result> CREATOR = new Creator<Result>() {


        @SuppressWarnings({
            "unchecked"
        })
        public Result createFromParcel(Parcel in) {
            Result instance = new Result();
            instance.section = ((String) in.readValue((String.class.getClassLoader())));
            instance.subsection = ((String) in.readValue((String.class.getClassLoader())));
            instance.title = ((String) in.readValue((String.class.getClassLoader())));
            instance._abstract = ((String) in.readValue((String.class.getClassLoader())));
            instance.url = ((String) in.readValue((String.class.getClassLoader())));
            instance.byline = ((String) in.readValue((String.class.getClassLoader())));
            instance.itemType = ((String) in.readValue((String.class.getClassLoader())));
            instance.updatedDate = ((String) in.readValue((String.class.getClassLoader())));
            instance.createdDate = ((String) in.readValue((String.class.getClassLoader())));
            instance.publishedDate = ((String) in.readValue((String.class.getClassLoader())));
            instance.materialTypeFacet = ((String) in.readValue((String.class.getClassLoader())));
            instance.kicker = ((String) in.readValue((String.class.getClassLoader())));
            in.readList(instance.desFacet, (java.lang.String.class.getClassLoader()));
            instance.orgFacet = ((String) in.readValue((String.class.getClassLoader())));
            instance.perFacet = ((String) in.readValue((String.class.getClassLoader())));
            in.readList(instance.geoFacet, (java.lang.String.class.getClassLoader()));
            in.readList(instance.multimedia, (Multimedium.class.getClassLoader()));
            return instance;
        }

        public Result[] newArray(int size) {
            return (new Result[size]);
        }

    }
    ;

    public String getSection() {
        return section;
    }

    public void setSection(String section) {
        this.section = section;
    }

    public String getSubsection() {
        return subsection;
    }

    public void setSubsection(String subsection) {
        this.subsection = subsection;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getAbstract() {
        return _abstract;
    }

    public void setAbstract(String _abstract) {
        this._abstract = _abstract;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getByline() {
        return byline;
    }

    public void setByline(String byline) {
        this.byline = byline;
    }

    public String getItemType() {
        return itemType;
    }

    public void setItemType(String itemType) {
        this.itemType = itemType;
    }

    public String getUpdatedDate() {
        return updatedDate;
    }

    public void setUpdatedDate(String updatedDate) {
        this.updatedDate = updatedDate;
    }

    public String getCreatedDate() {
        return createdDate;
    }

    public void setCreatedDate(String createdDate) {
        this.createdDate = createdDate;
    }

    public String getPublishedDate() {
        return publishedDate;
    }

    public void setPublishedDate(String publishedDate) {
        this.publishedDate = publishedDate;
    }

    public String getMaterialTypeFacet() {
        return materialTypeFacet;
    }

    public void setMaterialTypeFacet(String materialTypeFacet) {
        this.materialTypeFacet = materialTypeFacet;
    }

    public String getKicker() {
        return kicker;
    }

    public void setKicker(String kicker) {
        this.kicker = kicker;
    }

    public List<String> getDesFacet() {
        return desFacet;
    }

    public void setDesFacet(List<String> desFacet) {
        this.desFacet = desFacet;
    }

    public String getOrgFacet() {
        return orgFacet;
    }

    public void setOrgFacet(String orgFacet) {
        this.orgFacet = orgFacet;
    }

    public String getPerFacet() {
        return perFacet;
    }

    public void setPerFacet(String perFacet) {
        this.perFacet = perFacet;
    }

    public List<String> getGeoFacet() {
        return geoFacet;
    }

    public void setGeoFacet(List<String> geoFacet) {
        this.geoFacet = geoFacet;
    }

    public List<Multimedium> getMultimedia() {
        return multimedia;
    }

    public void setMultimedia(List<Multimedium> multimedia) {
        this.multimedia = multimedia;
    }

    public void writeToParcel(Parcel dest, int flags) {
        dest.writeValue(section);
        dest.writeValue(subsection);
        dest.writeValue(title);
        dest.writeValue(_abstract);
        dest.writeValue(url);
        dest.writeValue(byline);
        dest.writeValue(itemType);
        dest.writeValue(updatedDate);
        dest.writeValue(createdDate);
        dest.writeValue(publishedDate);
        dest.writeValue(materialTypeFacet);
        dest.writeValue(kicker);
        dest.writeList(desFacet);
        dest.writeValue(orgFacet);
        dest.writeValue(perFacet);
        dest.writeList(geoFacet);
        dest.writeList(multimedia);
    }

    public int describeContents() {
        return  0;
    }

}
公共类结果实现可包裹
{
@序列化名称(“节”)
@暴露
私有字符串部分;
@序列化名称(“小节”)
@暴露
私有字符串分段;
@序列化名称(“标题”)
@暴露
私有字符串标题;
@序列化名称(“摘要”)
@暴露
私有字符串_抽象;
@序列化名称(“url”)
@暴露
私有字符串url;
@序列化名称(“署名”)
@暴露
私人署名;
@序列化名称(“项目类型”)
@暴露
私有字符串itemType;
@SerializedName(“更新日期”)
@暴露
私有字符串更新日期;
@SerializedName(“创建日期”)
@暴露
私有字符串createdDate;
@序列化名称(“发布日期”)
@暴露
私有字符串数据;
@序列化名称(“材料类型面”)
@暴露
私有字符串材质类型方面;
@序列化名称(“踢球者”)
@暴露
私人串踢;
@序列化名称(“des_方面”)
@暴露
私有列表desFacet=null;
@序列化名称(“组织方面”)
@暴露
私有字符串;
@序列化名称(“每个方面”)
@暴露
私有字符串perFacet;
@序列化名称(“geo_方面”)
@暴露
私有列表geoFacet=null;
@序列化名称(“多媒体”)
@暴露
私有列表多媒体=空;
公共最终静态包裹。创建者=新创建者(){
@抑制警告({
“未选中”
})
公共结果createFromParcel(中的地块){
结果实例=新结果();
instance.section=((String)in.readValue((String.class.getClassLoader());
instance.subsection=((String)in.readValue((String.class.getClassLoader());
instance.title=((String)in.readValue((String.class.getClassLoader());
实例。_abstract=((String)in.readValue((String.class.getClassLoader());
instance.url=((String)in.readValue((String.class.getClassLoader());
instance.byline=((String)in.readValue((String.class.getClassLoader());
instance.itemType=((String)in.readValue((String.class.getClassLoader());
instance.updateDate=((String)in.readValue((String.class.getClassLoader());
instance.createdDate=((String)in.readValue((String.class.getClassLoader());
instance.publishedDate=((String)in.readValue((String.class.getClassLoader());
instance.materialTypeFacet=((String)in.readValue((String.class.getClassLoader());
instance.kicker=((String)in.readValue((String.class.getClassLoader());
in.readList(instance.desFacet,(java.lang.String.class.getClassLoader());
instance.orgFacet=((字符串)in.readValue((
    public class Result implements Parcelable
{

    @SerializedName("section")
    @Expose
    private String section;
    @SerializedName("subsection")
    @Expose
    private String subsection;
    @SerializedName("title")
    @Expose
    private String title;
    @SerializedName("abstract")
    @Expose
    private String _abstract;
    @SerializedName("url")
    @Expose
    private String url;
    @SerializedName("byline")
    @Expose
    private String byline;
    @SerializedName("item_type")
    @Expose
    private String itemType;
    @SerializedName("updated_date")
    @Expose
    private String updatedDate;
    @SerializedName("created_date")
    @Expose
    private String createdDate;
    @SerializedName("published_date")
    @Expose
    private String publishedDate;
    @SerializedName("material_type_facet")
    @Expose
    private String materialTypeFacet;
    @SerializedName("kicker")
    @Expose
    private String kicker;
    @SerializedName("des_facet")
    @Expose
    private List<String> desFacet = null;
    @SerializedName("org_facet")
    @Expose
    private String orgFacet;
    @SerializedName("per_facet")
    @Expose
    private String perFacet;
    @SerializedName("geo_facet")
    @Expose
    private List<String> geoFacet = null;
    @SerializedName("multimedia")
    @Expose
    private List<Multimedium> multimedia = null;
    public final static Parcelable.Creator<Result> CREATOR = new Creator<Result>() {


        @SuppressWarnings({
            "unchecked"
        })
        public Result createFromParcel(Parcel in) {
            Result instance = new Result();
            instance.section = ((String) in.readValue((String.class.getClassLoader())));
            instance.subsection = ((String) in.readValue((String.class.getClassLoader())));
            instance.title = ((String) in.readValue((String.class.getClassLoader())));
            instance._abstract = ((String) in.readValue((String.class.getClassLoader())));
            instance.url = ((String) in.readValue((String.class.getClassLoader())));
            instance.byline = ((String) in.readValue((String.class.getClassLoader())));
            instance.itemType = ((String) in.readValue((String.class.getClassLoader())));
            instance.updatedDate = ((String) in.readValue((String.class.getClassLoader())));
            instance.createdDate = ((String) in.readValue((String.class.getClassLoader())));
            instance.publishedDate = ((String) in.readValue((String.class.getClassLoader())));
            instance.materialTypeFacet = ((String) in.readValue((String.class.getClassLoader())));
            instance.kicker = ((String) in.readValue((String.class.getClassLoader())));
            in.readList(instance.desFacet, (java.lang.String.class.getClassLoader()));
            instance.orgFacet = ((String) in.readValue((String.class.getClassLoader())));
            instance.perFacet = ((String) in.readValue((String.class.getClassLoader())));
            in.readList(instance.geoFacet, (java.lang.String.class.getClassLoader()));
            in.readList(instance.multimedia, (Multimedium.class.getClassLoader()));
            return instance;
        }

        public Result[] newArray(int size) {
            return (new Result[size]);
        }

    }
    ;

    public String getSection() {
        return section;
    }

    public void setSection(String section) {
        this.section = section;
    }

    public String getSubsection() {
        return subsection;
    }

    public void setSubsection(String subsection) {
        this.subsection = subsection;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getAbstract() {
        return _abstract;
    }

    public void setAbstract(String _abstract) {
        this._abstract = _abstract;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getByline() {
        return byline;
    }

    public void setByline(String byline) {
        this.byline = byline;
    }

    public String getItemType() {
        return itemType;
    }

    public void setItemType(String itemType) {
        this.itemType = itemType;
    }

    public String getUpdatedDate() {
        return updatedDate;
    }

    public void setUpdatedDate(String updatedDate) {
        this.updatedDate = updatedDate;
    }

    public String getCreatedDate() {
        return createdDate;
    }

    public void setCreatedDate(String createdDate) {
        this.createdDate = createdDate;
    }

    public String getPublishedDate() {
        return publishedDate;
    }

    public void setPublishedDate(String publishedDate) {
        this.publishedDate = publishedDate;
    }

    public String getMaterialTypeFacet() {
        return materialTypeFacet;
    }

    public void setMaterialTypeFacet(String materialTypeFacet) {
        this.materialTypeFacet = materialTypeFacet;
    }

    public String getKicker() {
        return kicker;
    }

    public void setKicker(String kicker) {
        this.kicker = kicker;
    }

    public List<String> getDesFacet() {
        return desFacet;
    }

    public void setDesFacet(List<String> desFacet) {
        this.desFacet = desFacet;
    }

    public String getOrgFacet() {
        return orgFacet;
    }

    public void setOrgFacet(String orgFacet) {
        this.orgFacet = orgFacet;
    }

    public String getPerFacet() {
        return perFacet;
    }

    public void setPerFacet(String perFacet) {
        this.perFacet = perFacet;
    }

    public List<String> getGeoFacet() {
        return geoFacet;
    }

    public void setGeoFacet(List<String> geoFacet) {
        this.geoFacet = geoFacet;
    }

    public List<Multimedium> getMultimedia() {
        return multimedia;
    }

    public void setMultimedia(List<Multimedium> multimedia) {
        this.multimedia = multimedia;
    }

    public void writeToParcel(Parcel dest, int flags) {
        dest.writeValue(section);
        dest.writeValue(subsection);
        dest.writeValue(title);
        dest.writeValue(_abstract);
        dest.writeValue(url);
        dest.writeValue(byline);
        dest.writeValue(itemType);
        dest.writeValue(updatedDate);
        dest.writeValue(createdDate);
        dest.writeValue(publishedDate);
        dest.writeValue(materialTypeFacet);
        dest.writeValue(kicker);
        dest.writeList(desFacet);
        dest.writeValue(orgFacet);
        dest.writeValue(perFacet);
        dest.writeList(geoFacet);
        dest.writeList(multimedia);
    }

    public int describeContents() {
        return  0;
    }

}
...,"org_facet":["Amazon.com Inc","Cravath Swaine \u0026 Moore"],...
             // ^____here