0

我正在org.openntf.domino一个个人 XPage 项目中使用 API,我遇到了一个我自己似乎无法解决的问题。我有以下代码:

public class SeasonService implements Serializable {

private Vector<?> seasons = new Vector();

public Vector<Season> getSeasons(){
    System.out.println("Retrieve all season entries");
    Database db = DominoUtil.getCurrentDatabase();

    View vw = db.getView(".AllDocuments");
    ViewEntryCollection coll = vw.getAllEntriesByKey("Season");

    Iterator<ViewEntry> it = coll.iterator();
    Vector<Season> l = new Vector();
    while(it.hasNext()){
        ViewEntry entry = it.next();
        l.add(fromEntry(entry));
    }

    return l;
}

private static final Season fromEntry(ViewEntry entry){
    ViewEntryEx vex = new ViewEntryEx(entry);
    System.out.println("Retrieve season from entry");

    //try {
        Season s = new Season();
        s.setDescription("Test");
        s.setKey("0000");
        //s.setDescription((String) vex.getColumnValue("Description"));
        //s.setKey((String) vex.getColumnValue("Key"));
        return s;
    //} catch (ColumnNameNotFoundException e) {
        // TODO Auto-generated catch block
    //  e.printStackTrace();
    //}
    //return null;
    }
}

domino Util 类如下所示:

public static final Database getCurrentDatabase(){
    Session s = Factory.fromLotus(ExtLibUtil.getCurrentSession(), org.openntf.domino.Session.class, null);
    return s.getCurrentDatabase();
}

由于某种原因,一旦我尝试启动 View 对象,代码就会返回 Stackoverflow 错误。任何人都知道原因是什么?

4

1 回答 1

0

你用的是什么里程碑?您是否可以分享有问题的应用程序?

堆栈溢出通常表示无限回归,但我在 .getView 代码中看不到任何可能导致这种情况的内容。有一点,对结果视图的空检查不存在,它会抛出 NPE,但我认为这在 OpenNTF 的当前版本之前已经解决。

    public View getView(final String name) {
    try {
        View result = Factory.fromLotus(getDelegate().getView(name), View.class, this);
        if (result != null) {
            result.setAutoUpdate(false);
        }
        return result;
    } catch (NotesException e) {
        DominoUtils.handleException(e);
        return null;

    }
}
于 2013-08-25T20:00:07.827 回答