我正在尝试在基于UiBinder的GWT应用中添加CKEditor。 但得到以下例外:
引起:com.google.gwt.user.client.ui.AttachDetachException:捕获到一个或多个异常,请参阅UmbrellaException中的完整设置#getCauses 在com.google.gwt.user.client.ui.AttachDetachException.tryCommand(AttachDetachException.java:87) 在com.google.gwt.user.client.ui.Panel.doAttachChildren(Panel.java:170) 在com.google.gwt.user.client.ui.Widget.onAttach(Widget.java:340) 在com.google.gwt.user.client.ui.AttachDetachException $ 1.execute(AttachDetachException.java:34) 在com.google.gwt.user.client.ui.AttachDetachException.tryCommand(AttachDetachException.java:74) 在com.google.gwt.user.client.ui.Panel.doAttachChildren(Panel.java:170) 在com.google.gwt.user.client.ui.Widget.onAttach(Widget.java:340) 在com.google.gwt.user.client.ui.AttachDetachException $ 1.execute(AttachDetachException.java:34) 在com.google.gwt.user.client.ui.AttachDetachException.tryCommand(AttachDetachException.java:74) 在com.google.gwt.user.client.ui.Panel.doAttachChildren(Panel.java:170) 在com.google.gwt.user.client.ui.Widget.onAttach(Widget.java:340) 在com.google.gwt.user.client.ui.Composite.onAttach(Composite.java:103) 在com.lokur.uilibrary.widgets.disclosure.client.tabbed.TabPanelMarkup.onAttach(TabPanelMarkup.java:114) 在com.google.gwt.user.client.ui.Composite.onAttach(Composite.java:103) 在com.google.gwt.user.client.ui.AttachDetachException $ 1.execute(AttachDetachException.java:34) 在com.google.gwt.user.client.ui.AttachDetachException.tryCommand(AttachDetachException.java:74) 在com.google.gwt.user.client.ui.Panel.doAttachChildren(Panel.java:170) 在com.google.gwt.user.client.ui.Widget.onAttach(Widget.java:340) 在com.google.gwt.user.client.ui.Composite.onAttach(Composite.java:103) 在com.google.gwt.user.client.ui.Widget.setParent(Widget.java:470) 在com.google.gwt.user.client.ui.Panel.adopt(Panel.java:127) 在com.google.gwt.user.client.ui.ComplexPanel.add(ComplexPanel.java:97) 在com.google.gwt.user.client.ui.AbsolutePanel.add(AbsolutePanel.java:97) 在com.lokur.admin.usp.motd.client.MessageOfTheDay.onModuleLoad(MessageOfTheDay.java:24) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 在java.lang.reflect.Method.invoke(Method.java:597) 在com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:396) 在com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:193) 在com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:510) 在com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:352) 在java.lang.Thread.run(Thread.java:695) 引起:com.google.gwt.core.client.JavaScriptException:(TypeError):$ wnd.CKEDITOR未定义 在com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:237) 在com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:132) 在com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561) 在com.google.gwt.dev.shell.ModuleSpace.invokeNativeVoid(ModuleSpace.java:289) 在com.google.gwt.dev.shell.JavaScriptHost.invokeNativeVoid(JavaScriptHost.java:107) 在com.axeiya.gwtckeditor.client.CKEditor.replaceTextArea(CKEditor.java) 在com.axeiya.gwtckeditor.client.CKEditor.initInstance(CKEditor.java:173) 在com.axeiya.gwtckeditor.client.CKEditor.onLoad(CKEditor.java:164) 在com.google.gwt.user.client.ui.Composite.onAttach(Composite.java:112) 在com.google.gwt.user.client.ui.AttachDetachException $ 1.execute(AttachDetachException.java:34) 在com.google.gwt.user.client.ui.AttachDetachException.tryCommand(AttachDetachException.java:74) 在com.google.gwt.user.client.ui.Panel.doAttachChildren(Panel.java:170) 在com.google.gwt.user.client.ui.Widget.onAttach(Widget.java:340) 在com.google.gwt.user.client.ui.AttachDetachException $ 1.execute(AttachDetachException.java:34) 在com.google.gwt.user.client.ui.AttachDetachException.tryCommand(AttachDetachException.java:74) 在com.google.gwt.user.client.ui.Panel.doAttachChildren(Panel.java:170) 在com.google.gwt.user.client.ui.Widget.onAttach(Widget.java:340) 在com.google.gwt.user.client.ui.AttachDetachException $ 1.execute(AttachDetachException.java:34) 在com.google.gwt.user.client.ui.AttachDetachException.tryCommand(AttachDetachException.java:74) 在com.google.gwt.user.client.ui.Panel.doAttachChildren(Panel.java:170) 在com.google.gwt.user.client.ui.Widget.onAttach(Widget.java:340) 在com.google.gwt.user.client.ui.Composite.onAttach(Composite.java:103) 在com.lokur.uilibrary.widgets.disclosure.client.tabbed.TabPanelMarkup.onAttach(TabPanelMarkup.java:114) 在com.google.gwt.user.client.ui.Composite.onAttach(Composite.java:103) 在com.google.gwt.user.client.ui.AttachDetachException $ 1.execute(AttachDetachException.java:34) 在com.google.gwt.user.client.ui.AttachDetachException.tryCommand(AttachDetachException.java:74) 在com.google.gwt.user.client.ui.Panel.doAttachChildren(Panel.java:170) 在com.google.gwt.user.client.ui.Widget.onAttach(Widget.java:340) 在com.google.gwt.user.client.ui.Composite.onAttach(Composite.java:103) 在com.google.gwt.user.client.ui.Widget.setParent(Widget.java:470) 在com.google.gwt.user.client.ui.Panel.adopt(Panel.java:127) 在com.google.gwt.user.client.ui.ComplexPanel.add(ComplexPanel.java:97) 在com.google.gwt.user.client.ui.AbsolutePanel.add(AbsolutePanel.java:97) 在com.lokur.admin.usp.motd.client.MessageOfTheDay.onModuleLoad(MessageOfTheDay.java:24) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 在java.lang.reflect.Method.invoke(Method.java:597) 在com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:396) 在com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:193) 在com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:510) 在com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:352) 在java.lang.Thread.run(Thread.java:695)
我已经配置了我所知道的所有内容:
在pom.xml中添加了maven依赖:
<dependency>
<groupId>com.axeiya.gwt</groupId>
<artifactId>gwt-ckeditor</artifactId>
<version>1.0</version>
</dependency>
在myModule.ui.xml文件中添加了xmlns条目:
xmlns:ck="urn:import:com.axeiya.gwtckeditor.client"
在myModule.ui.xml文件中添加了小部件:
<ck:CKEditor ui:field="ckEditor" />
在MyModuleWidgets.java文件中添加了相应的ui字段:
5)还为myModule.gwt.xml
文件添加了源:
`<inherits name="com.axeiya.gwtckeditor.Gwtckeditor"/>`
6)这是UIBinder文件:
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
xmlns:g='urn:import:com.google.gwt.user.client.ui'
xmlns:ck="urn:import:com.axeiya.gwtckeditor.client"
ui:generateFormat='com.google.gwt.i18n.rebind.format.PropertiesFormat'
ui:generateKeys='com.google.gwt.i18n.rebind.keygen.MD5KeyGenerator'
ui:generateLocales="default">
<g:HTMLPanel>
<ck:CKEditor ui:field="ckEditor2" />
</g:HTMLPanel>
</ui:UiBinder>
可能缺少什么?