前两天看见Gwt2.0发布的消息,新的特性让人相当兴奋,尤其是开发者模式,大大提高了调试效率。随即就将项目升级到了Gwt2.0+Gxt2.1, 并且eclipse也更新到最新的1.2..
安装插件,运行代码,一路基本都没有问题。。 在开发者模式下访问host page... 碰到如下错误:
错误信息 写道
17:03:39.250 [ERROR] [webim] Unable to load module entry point class st.lv.web.im.client.WebIM (see associated exception for details)
java.lang.VerifyError: (class: com/extjs/gxt/ui/client/widget/Container, method: adjustIndex signature: (Lcom/extjs/gxt/ui/client/widget/Component;I)I) Illegal constant pool index
at com.extjs.gxt.ui.client.widget.MessageBox.getDialog(MessageBox.java:339)
at com.extjs.gxt.ui.client.widget.MessageBox.show(MessageBox.java:737)
at com.extjs.gxt.ui.client.widget.MessageBox.alert(MessageBox.java:104)
at st.lv.web.im.client.WebIM.onModuleLoad(WebIM.java:18)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:369)
at com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:185)
at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:380)
at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:222)
at java.lang.Thread.run(Unknown Source
经过一番google也没查出什么原因, 用一段很简单的代码调试追踪(代码如下:),发现是devMode反射的时候出的问题,虽然知道问题的大致原因,但是还是没办法解决。
package st.lv.web.im.client;
import com.google.gwt.core.client.EntryPoint;
/**
* Entry point classes define <code>onModuleLoad()</code>.
*/
public class WebIM implements EntryPoint {
/**
* This is the entry point method.
*/
public void onModuleLoad() {
// com.google.gwt.user.client.Window.alert("ok..");//this line is ok..
com.extjs.gxt.ui.client.widget.MessageBox.alert("gxt", "gxt", null);
}
}
最后只得求助ext的官方论坛, 最终将这段代码跑通解决了。。
http://www.extjs.com/forum/showthread.php?p=420100#post420100post420100
经tortexy解释: 该原因是由Class Loader产生的,当com.extjs.gxt.ui.client.widget.Layout加载太晚,classloader将停止执行。
最终代码如下所示:
package st.lv.demo.overview.client;
import com.extjs.gxt.ui.client.widget.Layout;
import com.extjs.gxt.ui.client.widget.MessageBox;
import com.extjs.gxt.ui.client.widget.layout.AnchorLayout;
import com.google.gwt.core.client.EntryPoint;
/**
* Entry point classes define <code>onModuleLoad()</code>.
*/
public class Gwt2Gxt implements EntryPoint {
/**
* This is the entry point method.
*/
public void onModuleLoad() {
@SuppressWarnings("unused")
Layout junk = new AnchorLayout();//提前初始化Layout对象
MessageBox.alert("Msg", "gxt MessageBox", null);
}
}
虽然这个问题解决了,但是项目在Gxt2.1+Gwt2.0的Develop Mode下还是会报很多错误,依然没有升级到Gwt2.0... 不过在Gxt的论坛上并没有太多设计关于Gxt2.1中使用Gwt2.0新特性的问题,看来这些东西又得自己开始慢慢摸索了。。。
分享到:
相关推荐
在Google发布GWT2.0不久,SmartGWT 2.0也发布了,功能更强大,界面效果一流,个人感觉比GXT好用多了,尤其在大量数据处理方面有很多优势!
gxt-2.2.4 EXT GWT Note : Ext GWT 2.X requires GWT 1.7+ or GWT 2.0+ (any build ending in "-gwt2.zip").
gxt是ext使用gwt api开发的一套东东。比使用原始gwt开发是要轻松一些的。
Ext GWT 2.0: Beginner's Guide is a practical book that teaches you how to use the Ext GWT library to its full potential. It provides a thorough, no-nonsense explanation of the Ext GWT library, what ...
浪曦原创]GXT系列+第1讲+GXT_GWT的安装.
gxt-2.2.3-gwt22.jar包,备份以自用。
gxt用jar包,2.25版本,我自己用过的,没问题,放在这里备份下~
gxt-2.1.1-gwt2gxt-2.1.1-gwt2gxt-2.1.1-gwt2gxt-2.1.1-gwt2gxt-2.1.1-gwt2gxt-2.1.1-gwt2gxt-2.1.1-gwt2gxt-2.1.1-gwt2gxt-2.1.1-gwt2gxt-2.1.1-gwt2gxt-2.1.1-gwt2gxt-2.1.1-gwt2
gwt 开发
看看吧看看吧看看吧看看吧看看吧看看吧看看吧看看吧
EXT-GWT(GXT) 2.2.4 JAVA API DOC chm 版.完美的的搜索功能,支持全文检索。2011年11月制作。如果打不开,请选中它,点右键 看属性,选择解除锁定。别再抱怨打不开了。
EXT-GWT(GXT) 2.2.4 JAVA API DOC chm 版.完美的的搜索功能,支持全文检索。2011年6月制作。如果打不开,请选中它,点右键 看属性,选择解除锁定。别再抱怨打不开了。
extjs gwt gxt 学习资源 ajax技术
这是GTA4里的源文件american.gxt
gwt+gxt jar 包。。基于java语言编写前台界面,java语言最终会被编译成js。方便了不会js的java程序员编写前台
只要你好好利用这本书,GXT你就会了。带你入门!
EXT-GWT 2.2.0 API DOC (gxt) chm 版 。 2010年10月制作。完美的搜索功能。如果打不开,请选中它,点右键 看属性,选择解除锁定。别再抱怨打不开了。
Developing with Ext GWT Enterprise RIA Development May 2009.pdf 完全版
org.liveSense.framework.gxt.zip,livesense ext gxt frameworklivesense gxt(ext gwt)包
搭建简单的EXT-GWT(GXT)的开发环境