[ERROR] Failed to create an instance of 'com.linzhang.client.mycard1'
via deferred binding
java.lang.Error: Unresolved compilation problems:
The import com.google.gwt.user.client.DOM cannot be resolved
DOM cannot be resolved
DOM cannot be resolved
DOM cannot be resolved
DOM cannot be resolved
DOM cannot be resolved
DOM cannot be resolved
DOM cannot be resolved
at com.google.gwt.user.client.ui.Label.<init>(Label.java:18)
at com.linzhang.client.mycard1.<init>(mycard1.java:17)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
at
com.google.gwt.dev.shell.ModuleSpace.rebindAndCreate(ModuleSpace.java:105)
at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:64)
at
com.google.gwt.dev.shell.BrowserWidget.attachModuleSpace(BrowserWidget.java:286)
at
com.google.gwt.dev.shell.ie.BrowserWidgetIE6.access$100(BrowserWidgetIE6.java:20)
at
com.google.gwt.dev.shell.ie.BrowserWidgetIE6$External.gwtOnLoad(BrowserWidgetIE6.java:44)
<inherits name="com.google.gwt.user.DOM"/>
hi,Justin,thanks for you reply!
i add the line to my xml file like this,but error still exist
<module>
<!-- Inherit the core Web Toolkit stuff. -->
<inherits name='com.google.gwt.user.User'/>
<inherits name='com.google.gwt.user.DOM'/>
<!-- Specify the app entry point class. -->
<entry-point class='com.linzhang.client.mycard1'/>
</module>
Dominik
so did you actually create your project and application through the
projectcreator and applicationcreator?
I just tried it out and it works just fine, without having to inherit
any DOM package.
I just did
projectCreator.cmd -eclipse test -out ..
That created the project 'test'. And then I created the application
like this
applicationCreator.cmd -eclipse test -out .. com.bar.client.Test
That's it. I launched it through the Test-shell.cmd or the launch
configuration in eclipse.
But perhaps your problem is of another kind.
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.ClickListener;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.Widget;
/**
* Entry point classes define <code>onModuleLoad()</code>.
*/
public class mycard1 implements EntryPoint {
/**
* This is the entry point method.
*/
public void onModuleLoad() {
final Button button = new Button("Click me");
final Label label = new Label();
button.addClickListener(new ClickListener() {
public void onClick(Widget sender) {
System.out.println("hello");
}
});
// Assume that the host HTML has elements defined whose
// IDs are "slot1", "slot2". In a real app, you probably would not
want
// to hard-code IDs. Instead, you could, for example, search for
all
// elements with a particular CSS class and replace them with
widgets.
//
RootPanel.get("slot1").add(button);
RootPanel.get("slot2").add(label);
}
}
when i run it it report:
[ERROR] Errors in
'jar:file:/D:/gwt-windows-1.2.22/gwt-user.jar!/com/google/gwt/user/client/DOM.java'
[ERROR] Line 954: The method insertListItem(Element, String, String,
int) is undefined for the type DOMImpl
[ERROR] Line 966: The method setOptionText(Element, String, int) is
undefined for the type DOMImpl
[ERROR] Unable to load module entry point class
com.linzhang.client.mycard1
java.lang.Error: Unresolved compilation problems:
The import com.google.gwt.user.client.DOM cannot be resolved
DOM cannot be resolved
at com.google.gwt.user.client.ui.Button.<init>(Button.java:18)
at com.linzhang.client.mycard1.onModuleLoad(mycard1.java:20)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:67)
at
com.google.gwt.dev.shell.BrowserWidget.attachModuleSpace(BrowserWidget.java:286)
at
com.google.gwt.dev.shell.ie.BrowserWidgetIE6.access$100(BrowserWidgetIE6.java:20)
at
com.google.gwt.dev.shell.ie.BrowserWidgetIE6$External.gwtOnLoad(BrowserWidgetIE6.java:44)
at
com.google.gwt.dev.shell.ie.BrowserWidgetIE6$External.invoke(BrowserWidgetIE6.java:88)
at
com.google.gwt.dev.shell.ie.IDispatchImpl.Invoke(IDispatchImpl.java:245)
[ERROR] Failure to load module 'com.linzhang.mycard1'
import com.google.gwt.core.client.EntryPoint;
/**
* Entry point classes define <code>onModuleLoad()</code>.
*/
public class mycard1 implements EntryPoint {
/**
* This is the entry point method.
*/
public void onModuleLoad() {
}
}
it also report the same error
[ERROR] Errors in
'jar:file:/D:/gwt-windows-1.2.22/gwt-user.jar!/com/google/gwt/user/client/DOM.java'
[ERROR] Line 954: The method insertListItem(Element, String, String,
int) is undefined for the type DOMImpl
[ERROR] Line 966: The method setOptionText(Element, String, int) is
undefined for the type DOMImpl
i think the gwt maybe crazy in my computer,god
i see that you are working wth gwt 1.2.22. did you try it with gwt
1.1.10?
but i must admit that i have no idea why you get those strange
errors...
i would try and download the gwt1.1.10 and have a fresh go with that...
Dominik
"yummy 写道:
i've been messing around one day with this sutff... thanks yummy
for your answer. Now it worksssss!!!!
Juan
aibo ha escrito: