代码之家  ›  专栏  ›  技术社区  ›  Holograham

SmartGWT with REST数据源错误

  •  0
  • Holograham  · 技术社区  · 14 年前

    从REST数据源检索数据时出现以下错误

    00:00:52.439[错误]01:46:57.001:rdq1:warn:resultset:isc_resultset_1(由:isc_customerdocgrid_0创建):get:无效索引-1 com.smartgwt.client.core.jsobject$sgwt_warn:01:46:57.001:rdq1:warn:resultset:isc_resultset_1(创建者:isc_customerdocgrid_0):get:invalid index-1 at sun.reflect.nativeConstructoraccessorimpl.newInsta NCe0(本机方法)at sun.reflect.nativeConstructoracasessorimpl.newInsta(本机构造)在Sun.Real.EngutoRealOrthRoop.Pr.NeWiTnStand(De委托AgutoRealOrthRoop.IMP.java:27)在Java.Lang.Exrime.Cuffor .NeWist立场(构建器.java:513)在COM.谷歌.GWT.DEV.Seul.MultAddioto.Cube(MethOdAdvult.Java:105)在COM.GoGeL.GWT.DEV.S壳中.在(BrowserChannel:1668)中的(BrowserChann)中调用(在Java中遇到)在谷歌上.COM. .GWT.DEV.Sk.BuffSerChhanNeServer。运行(BuffSerChhanelServer,Java:222)在Java.Lang.Trime.Run(线程.java:619)

    这是我的数据源(它扩展了restdatasource)

    代码: 公共CustomerDataSource(字符串ID) { 集合ID(ID); setdataformat(dsdataformat.xml); setrecordxpath(“customerDoc”);

        setOperationBindings();
        OperationBinding fetch = new OperationBinding();
        fetch.setOperationType(DSOperationType.FETCH);
        fetch.setDataProtocol(DSProtocol.GETPARAMS);
    
        setOperationBindings(fetch);
    
        setDataURL("/customer");
    

    我知道我的Web服务正在返回数据,因为我可以在浏览器中显示XML文件。这似乎不是解析错误(我以前见过)。不确定错误的含义。感谢您的帮助。

    1 回复  |  直到 14 年前
        1
  •  1
  •   dube    14 年前

    我不知道这到底是什么时候发生的,但通常是在没有收到数据的情况下。 我猜您的XML与预期格式(错误的xpath)不匹配,因此找不到任何数据。

    试试看:

    dataSource.setRecordXPath("//customerdoc");