日期:2014-05-20  浏览次数:20671 次

跪求gwt缺少继承的错误提示
错误提示:

[ERROR] [hellogwt] - Unable to load module entry point class chapter2.client.HelloGWT (see associated exception for details)

[ERROR] [hellogwt] - Failed to load module 'hellogwt' from user agent 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; SE 2.X MetaSr 1.0)' at localhost:2486

public class HelloGWT implements EntryPoint {
@SuppressWarnings("deprecation")
public void onModuleLoad() {
//显示Body
Window.alert(RootPanel.get().getElement().getTagName());
RootPanel divrootPanel = RootPanel.get("div1");
//显示div
Window.alert(divrootPanel.getElement().getTagName());
//显示Input
//Window.alert(divrootPanel.getElement().getInnerHTML());
}
}

HelloGWT .html

<html>
<meta name="gwt:module"/>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Web Application Starter Project</title>
<script type="text/javascript" language="javascript" src="hellogwt/hellogwt.nocache.js"></script>
</head>
<body>
<div id="div1"></div>
</body>
</html>



HelloGWT.gwt.xml

<?xml version="1.0" encoding="UTF-8"?>
<module rename-to='hellogwt'>
<!-- Inherit the core Web Toolkit stuff. -->
<inherits name='com.google.gwt.user.User'/>
<inherits name='chapter2.HelloGWT'/>
<!-- Inherit the default GWT style sheet. You can change -->
<!-- the theme of your GWT application by uncommenting -->
<!-- any one of the following lines. -->
<!-- <inherits name='com.google.gwt.user.theme.clean.Clean'/> -->
<inherits name='com.google.gwt.user.theme.standard.Standard'/>
<!--<inherits name='com.google.gwt.user.theme.chrome.Chrome'/>-->
<!-- <inherits name='com.google.gwt.user.theme.dark.Dark'/> -->

<!-- Other module inherits -->

<!-- Specify the app entry point class. -->
<entry-point class='chapter2.client.HelloGWT'/>
<!-- Specify the paths for translatable code -->
<source path='client'/>
<source path="client2"/>
<source path='shared'/>
<stylesheet src="HelloGWT.css"/>
<script src="inject.js"/>
</module>

------解决方案--------------------
我也刚接触GWT 没多久,我试试给点提醒。
1. SDK 是否下载,并用eclipse 引入到classpath 里面。
2. 在helloGWT.gwt.xml 里面<inherits name='chapter2.HelloGWT'/>,这句好像是多余的。

你再试试看,希望有机会多多探讨
------解决方案--------------------
还有就是别往设置JAVA_HOME, 当然一般这个大家都懂得,就怕是忘了,或是什么的