Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/389.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/gwt/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java GWT应用程序由于内部无限循环而冻结_Java_Gwt_Infinite Loop_Gxt_Gwt 2.5 - Fatal编程技术网

Java GWT应用程序由于内部无限循环而冻结

Java GWT应用程序由于内部无限循环而冻结,java,gwt,infinite-loop,gxt,gwt-2.5,Java,Gwt,Infinite Loop,Gxt,Gwt 2.5,我正在EclipseJuno上运行一个使用GWT2.5.1和ExtGWTv2.2.4的GWT应用程序。Java 6(32位),我无法更改任何内容 我最近交了这个应用程序,它在另一台机器上运行良好。启动应用程序(运行>GWT应用程序)后,我继续登录到我的应用程序,我的代码正常执行,但随后我的应用程序冻结。我调试后发现应用程序在这个GWT内部方法中进入了一个无限循环(即在classcom.google.GWT.dev.shell.BrowserChannelServer): 我清理了项目,删除了缓存

我正在EclipseJuno上运行一个使用GWT2.5.1和ExtGWTv2.2.4的GWT应用程序。Java 6(32位),我无法更改任何内容

我最近交了这个应用程序,它在另一台机器上运行良好。启动应用程序(运行>GWT应用程序)后,我继续登录到我的应用程序,我的代码正常执行,但随后我的应用程序冻结。我调试后发现应用程序在这个GWT内部方法中进入了一个无限循环(即在class
com.google.GWT.dev.shell.BrowserChannelServer
):

我清理了项目,删除了缓存文件、tmp文件,多次重新编译,尝试了旧版本2.4.0,但我不能尝试2.6,因为我需要java 7,目前无法安装。我试过chrome和firefox,结果都一样。经过一些搜索,我发现一些建议,我不应该放大使用浏览器,但是,我没有这样做


有什么问题吗?

我认为你的while条件应该是动态变量,而不是使用true。你应该打破边做边做的循环。否则,您的执行可能会堆叠

public class TestDoWhile {
private static TestDoWhile test;

public static void main(final String[] args) {
    test = new TestDoWhile();
    test.invokeMethod(2);
    test.invokeMethod(1);
}
public final void invokeMethod(final int testCase) {
    do {
        switch (testCase) {
        case 1:
            System.out.println("Invoke");
            break;
        case 2:
            System.out.println("Please , let me quit !");
            return;
        default:
            return;
        }
    } while (true);
}
}
我的java程序的结果是什么?这可能会累加。我无法想象你用这两种方法 sendFreedValues(); ReturnMessage.send(这个,结果)

因此,添加return而不是break。有一些有用的给你


问题是extgwt2.2.4与gwt2.5.1不兼容,但与gwt2.5.0兼容


因此,使用GWT 2.5.0解决了这个问题。

正如我提到的,这是一个内部GWT代码。我不能修改它。如果它行为不端,那么它就出了问题。这可能是一个GWT bug,我对此深表怀疑,但即使如此,也只有GWT团队能够解决它,因为我对GWT的内部结构一无所知。@MuhammadGelbana,对此我很抱歉!如果是这样,您应该复制它的源代码并创建自定义小部件或类,然后请再次测试它。有时候GWT会给我一些缺点,还有一些缺点。我不知道GWT2.6。是的,谢谢你的有用知识。我正在使用GWT2.5.1。(版本1)被您点击:)
Daemon Thread [Code server for av.mymodule from Mozilla/5.0 (Windows NT 6.1; WOW64; rv:26.0) Gecko/20100101 Firefox/26.0 on http://127.0.0.1:8889/mymodule.html?gwt.codesvr=127.0.0.1:9997 @ tsb2t8vtLUT/vrj#] (Suspended)
            BrowserChannelServer.reactToMessages(BrowserChannelServer$SessionHandlerServer) line: 292      
            BrowserChannelServer.processConnection() line: 547  
            BrowserChannelServer.run() line: 364  
            Thread.run() line: 662  
public class TestDoWhile {
private static TestDoWhile test;

public static void main(final String[] args) {
    test = new TestDoWhile();
    test.invokeMethod(2);
    test.invokeMethod(1);
}
public final void invokeMethod(final int testCase) {
    do {
        switch (testCase) {
        case 1:
            System.out.println("Invoke");
            break;
        case 2:
            System.out.println("Please , let me quit !");
            return;
        default:
            return;
        }
    } while (true);
}
}