DataSphereStudio is a one stop data application development& management portal, covering scenarios including data exchange, desensitization/cleansing, analysis/mining, quality measurement, visualization, and task scheduling.
报错信息:
Exception in thread "main" com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 3 path $[0] at com.google.gson.Gson.fromJson(Gson.java:975) at com.google.gson.Gson.fromJson(Gson.java:928) at com.google.gson.Gson.fromJson(Gson.java:877) at com.google.gson.Gson.fromJson(Gson.java:848) at pers.xiaoxd.druidsample.DruidSampleApplication.main(DruidSampleApplication.java:28) Caused by: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 3 path $[0] at com.google.gson.stream.JsonReader.beginArray(JsonReader.java:349) at com.google.gson.internal.bind.MapTypeAdapterFactory$Adapter.read(MapTypeAdapterFactory.java:172) at com.google.gson.internal.bind.MapTypeAdapterFactory$Adapter.read(MapTypeAdapterFactory.java:145) at com.google.gson.Gson.fromJson(Gson.java:963) ... 4 more
示例代码:
`
Gson gson = new Gson();
Map<String, MemDisplaySlideWidgetCreate> obj = new LinkedHashMap<>();
obj = gson.fromJson("[{\"widgetId\":1,\"name\":\"企业规模分布饼图\",\"type\":1,\"params\":\"{\\"width\\":460,\\"height\\":250,\\"positionX\\":16,\\"positionY\\":16,\\"backgroundColor\\":[255,255,255,0],\\"borderColor\\":[0,0,0],\\"borderWidth\\":null,\\"borderStyle\\":\\"solid\\",\\"borderRadius\\":null,\\"polling\\":\\"false\\",\\"frequency\\":60}\",\"index\":1,\"displaySlideId\":3}]", obj.getClass());
public class MemDisplaySlideWidgetCreate {
private Long id;
private String name;
private Long displaySlideId;
private Long widgetId;
private Short type;
private Short subType;
private Integer index = 0;
private String params;
private List<Long> roleIds;
}
`
报错的代码:
\DataSphereStudio\plugins\linkis\dss-gateway-support\src\main\scala\com\webank\wedatasphere\linkis\gateway\parser\DSSGatewayParser.scala
getServiceNameFromLabel方法
val json = BDPJettyServerHelper.gson.fromJson(body, classOf[java.util.Map[String, Object]])
报错信息:
Exception in thread "main" com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 3 path $[0] at com.google.gson.Gson.fromJson(Gson.java:975) at com.google.gson.Gson.fromJson(Gson.java:928) at com.google.gson.Gson.fromJson(Gson.java:877) at com.google.gson.Gson.fromJson(Gson.java:848) at pers.xiaoxd.druidsample.DruidSampleApplication.main(DruidSampleApplication.java:28) Caused by: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 3 path $[0] at com.google.gson.stream.JsonReader.beginArray(JsonReader.java:349) at com.google.gson.internal.bind.MapTypeAdapterFactory$Adapter.read(MapTypeAdapterFactory.java:172) at com.google.gson.internal.bind.MapTypeAdapterFactory$Adapter.read(MapTypeAdapterFactory.java:145) at com.google.gson.Gson.fromJson(Gson.java:963) ... 4 more
示例代码: ` Gson gson = new Gson(); Map<String, MemDisplaySlideWidgetCreate> obj = new LinkedHashMap<>(); obj = gson.fromJson("[{\"widgetId\":1,\"name\":\"企业规模分布饼图\",\"type\":1,\"params\":\"{\\"width\\":460,\\"height\\":250,\\"positionX\\":16,\\"positionY\\":16,\\"backgroundColor\\":[255,255,255,0],\\"borderColor\\":[0,0,0],\\"borderWidth\\":null,\\"borderStyle\\":\\"solid\\",\\"borderRadius\\":null,\\"polling\\":\\"false\\",\\"frequency\\":60}\",\"index\":1,\"displaySlideId\":3}]", obj.getClass());
public class MemDisplaySlideWidgetCreate {
} `
报错的代码: \DataSphereStudio\plugins\linkis\dss-gateway-support\src\main\scala\com\webank\wedatasphere\linkis\gateway\parser\DSSGatewayParser.scala getServiceNameFromLabel方法 val json = BDPJettyServerHelper.gson.fromJson(body, classOf[java.util.Map[String, Object]])