Eclipse中未处理的循环异常

时间:2011-12-14 13:07:16

标签: java eclipse gwt stack-overflow gwt-designer

我在Eclipse中遇到异常 我正在尝试使用GWT插件创建Web应用程序项目。我创建了一个复合(名称:浏览器)。之后,我尝试使用Choose Component选项在类(name:Home_Page)中添加浏览器组合。

当我添加它时,在设计视图中给出错误:

  

创建浏览器时出现异常。有关详细信息,请参阅错误日志。

请帮我纠正这个问题。

public class Browse extends Composite {
    static HorizontalSplitPanel RepositoryDisplayPanel = new HorizontalSplitPanel();

public Browse() {
    //RootPanel rootPanel = RootPanel.get();
            RepositoryDisplayPanel.setSplitPosition("200px");
            //rootPanel.add(RepositoryDisplayPanel);
            RepositoryDisplayPanel.setSize("762", "450");
            getObjectStoreTree();
            getObjectStoreCellTable();

}
public void getObjectStoreTree() {
    Tree repositories =new Tree();

    String repo[]={"ecm","ctmos","fhko","zert"};
    for(int i=0;i<4;i++){

        TreeItem reposiItem = new TreeItem();
        reposiItem.setText(repo[i]);
        reposiItem.setStyleName("cmis-TreeItem-objectstore");
        repositories.addItem(reposiItem);


    }
    RepositoryDisplayPanel.add(repositories);

}
public void getObjectStoreCellTable(){

    final CellTable<ContentofObjectStore> table = new CellTable<ContentofObjectStore>();
    table.setPageSize(3);

    // Create name Coloumn
    TextColumn<ContentofObjectStore> versionColumn = new TextColumn<ContentofObjectStore>() {
          @Override
          public String getValue(ContentofObjectStore object) {
            return object.version;
          }
        };


    TextColumn<ContentofObjectStore> nameColumn = new TextColumn<ContentofObjectStore>() {
          @Override
          public String getValue(ContentofObjectStore object) {
            return object.name;
          }
        };


    TextColumn<ContentofObjectStore> sizeColumn = new TextColumn<ContentofObjectStore>() {
          @Override
          public String getValue(ContentofObjectStore object) {
              return object.size;
           }
         };

    TextColumn<ContentofObjectStore> modified_byColumn = new TextColumn<ContentofObjectStore>() {
          @Override
          public String getValue(ContentofObjectStore object) {
              return object.modified_by;
          }
         };


         DateCell dateCell = new DateCell();
         Column<ContentofObjectStore, Date> dateColumn = new Column<ContentofObjectStore,Date>(dateCell){
             @Override
             public Date getValue(ContentofObjectStore object){
                 return object.modified_on;
             }

         };


    TextColumn<ContentofObjectStore> major_versionColumn = new TextColumn<ContentofObjectStore>() {
          @Override
          public String getValue(ContentofObjectStore object) {
              return object.major_version;
           }
         };
        // Add the columns.
         table.addColumn(nameColumn, "Name");
         table.addColumn(versionColumn, "Version");
         table.addColumn(sizeColumn, "Size");
         table.addColumn(modified_byColumn, "Modified By");
         table.addColumn(dateColumn,"Modified On");
         table.addColumn(sizeColumn, "Major Version");

         RepositoryDisplayPanel.add(table);
         table.setHeight("188px");

}

}

错误日志中的

表示:

  

未处理的循环异常&#34; java.lang.StackOverflowError at   org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)at   org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)at   org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1077)at   org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1058)at   org.eclipse.swt.widgets.Text.wmCommandChild(Text.java:2610)at at   org.eclipse.swt.widgets.Control.WM_COMMAND(Control.java:4669)at at   org.eclipse.swt.widgets.Control.windowProc(Control.java:4531)at   org.eclipse.swt.widgets.Display.windowProc(Display.java:4972)at   org.eclipse.swt.internal.win32.OS.CallWindowProcW(Native Method)at   org.eclipse.swt.internal.win32.OS.CallWindowProc(OS.java:2425)at at   org.eclipse.swt.widgets.Text.callWindowProc(Text.java:255)at   org.eclipse.swt.widgets.Control.windowProc(Control.java:4623)at   org.eclipse.swt.widgets.Text.windowProc(Text.java:2254)at   org.eclipse.swt.widgets.Display.windowProc(Display.java:4972)at   org.eclipse.swt.internal.win32.OS.SetWindowTextW(Native Method)at   org.eclipse.swt.internal.win32.OS.SetWindowText(OS.java:3446)at at   org.eclipse.swt.widgets.Text.setText(Text.java:1977)at   org.eclipse.wb.internal.css.dialogs.style.AbstractTextButtonValueEditor.updateControlsFromValue(AbstractTextButtonValueEditor.java:96)     在   org.eclipse.wb.internal.css.dialogs.style.AbstractTextButtonValueEditor.access $ 1(AbstractTextButtonValueEditor.java:89)     在   org.eclipse.wb.internal.css.dialogs.style.AbstractTextButtonValueEditor $ 3.changed(AbstractTextButtonValueEditor.java:82)     在   org.eclipse.wb.internal.css.semantics.AbstractValue.notifyListeners(AbstractValue.java:52)     在   org.eclipse.wb.internal.css.semantics.SimpleValue.setValue(SimpleValue.java:75)     在   org.eclipse.wb.internal.css.dialogs.style.AbstractTextButtonValueEditor $ 1.modifyText(AbstractTextButtonValueEditor.java:64)     在   org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:179)     在org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)     在org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)at   org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1077)at   org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1058)at   org.eclipse.swt.widgets.Text.wmCommandChild(Text.java:2610)at at   org.eclipse.swt.widgets.Control.WM_COMMAND(Control.java:4669)at at   org.eclipse.swt.widgets.Control.windowProc(Control.java:4531)at   org.eclipse.swt.widgets.Display.windowProc(Display.java:4972)at   org.eclipse.swt.internal.win32.OS.CallWindowProcW(Native Method)at   org.eclipse.swt.internal.win32.OS.CallWindowProc(OS.java:2425)at at   org.eclipse.swt.widgets.Text.callWindowProc(Text.java:255)at   org.eclipse.swt.widgets.Control.windowProc(Control.java:4623)at   org.eclipse.swt.widgets.Text.windowProc(Text.java:2254)at   org.eclipse.swt.widgets.Display.windowProc(Display.java:4972)at   org.eclipse.swt.internal.win32.OS.SetWindowTextW(Native Method)at   org.eclipse.swt.internal.win32.OS.SetWindowText(OS.java:3446)at at   org.eclipse.swt.widgets.Text.setText(Text.java:1977)at   org.eclipse.wb.internal.css.dialogs.style.AbstractTextButtonValueEditor.updateControlsFromValue(AbstractTextButtonValueEditor.java:96)     在   org.eclipse.wb.internal.css.dialogs.style.AbstractTextButtonValueEditor.access $ 1(AbstractTextButtonValueEditor.java:89)     在   org.eclipse.wb.internal.css.dialogs.style.AbstractTextButtonValueEditor $ 3.changed(AbstractTextButtonValueEditor.java:82)     在   org.eclipse.wb.internal.css.semantics.AbstractValue.notifyListeners(AbstractValue.java:52)     在   org.eclipse.wb.internal.css.semantics.SimpleValue.setValue(SimpleValue.java:75)     在   org.eclipse.wb.internal.css.dialogs.style.AbstractTextButtonValueEditor $ 1.modifyText(AbstractTextButtonValueEditor.java:64)     在   org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:179)     在org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)     在org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)at   org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1077)at   org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1058)at   org.eclipse.swt.widgets.Text.wmCommandChild(Text.java:2610)at at   org.eclipse.swt.widgets.Control.WM_COMMAND(Control.java:4669)at at   org.eclipse.swt.widgets.Control.windowProc(Control.java:4531)at   org.eclipse.swt.widgets.Display.windowProc(Display.java:4972)at   org.eclipse.swt.internal.win32.OS.CallWindowProcW(Native Method)at   org.eclipse.swt.internal.win32.OS.CallWindowProc(OS.java:2425)at at   org.eclipse.swt.widgets.Text.callWindowProc(Text.java:255)at   org.eclipse.swt.widgets.Control.windowProc(Control.java:4623)at   org.eclipse.swt.widgets.Text.windowProc(Text.java:2254)at   org.eclipse.swt.widgets.Display.windowProc(Display.java:4972)at   org.eclipse.swt.internal.win32.OS.SetWindowTextW(Native Method)at   org.eclipse.swt.internal.win32.OS.SetWindowText(OS.java:3446)

1 个答案:

答案 0 :(得分:1)

Stack overflow errors(堆栈跟踪中的第一行)没有太多原因。最可能的情况是,当你添加复合时,你以某种方式进行无限递归(也就是说,一个调用自身的方法,它调用自身,调用自身,调用自身......)。

查看您正在使用的规格,并确保正确添加复合材料。它可能只是某个地方的错字,但听起来问题就是接近插入点。