无法在类路径中找到'at / htlpinkafeld / wps / Wps / gwt / xml.gwt.xml'

时间:2014-01-12 22:36:42

标签: java gwt

我正在研究GWT-App,但在尝试编译应用程序时遇到了问题。

Eclipse说:

at.htlpinkafeld.wps.Wps.gwt.xml
      Loading inherited module 'at.htlpinkafeld.wps.Wps.gwt.xml'
         [ERROR] Unable to find 'at/htlpinkafeld/wps/Wps/gwt/xml.gwt.xml' on 
         your classpath; could be a typo, or maybe you forgot to include a 
         classpath entry for source?

[ERROR] shell failed in doStartup method

这是我的Wps.gwt.xml

<?xml version="1.0" encoding="UTF-8"?>
<!--
  When updating your version of GWT, you should also update this DTD reference,
  so that your app can take advantage of the latest GWT module capabilities.
-->
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.5.1//EN"
  "http://google-web-toolkit.googlecode.com/svn/tags/2.5.1/distro-source/core/src/gwt-module.dtd">

<module>
<!-- Inherit the core Web Toolkit stuff. -->
    <inherits name='com.google.gwt.user.User'/>
    <inherits name='at.htlpinkafeld.wps.Wps.gwt.xml'/>

    <!-- Specify the app entry point class.  -->
    <entry-point class='at.htlpinkafeld.wps.client.Wps'/>

    <!-- servlet context - path is arbritray, but must match up with 
         the rpc init inside java class. Tomcat will listen for this 
         from the server and waits for rpc request in this context -->
    <servlet class="at.htlpinkafeld.wps.server.MySQLConnection"
        path="/MySQLConnection" />
    <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"/>
</module>

<!-- Specify the paths for translatable code -->
<source path='client'/>
<source path='shared'/>

我在哪里弄错了?

1 个答案:

答案 0 :(得分:0)

首先,正如Thomas和El Hoss在评论中所说,<inherits name='at.htlpinkafeld.wps.Wps.gwt.xml'/>行应为<inherits name='at.htlpinkafeld.wps.Wps'/>

二。标签<servlet...>非常受限制,可能不是您可以或想要使用的标签。以下是documentation关于servlet标记的内容:

  

该元素仅适用于GWT的嵌入式服务器   服务器端调试功能。

     

注意:自GWT 1.6起,此标签不起作用   更长时间在开发模式下加载servlet,而不是必须配置   war目录中的WEB-INF / web.xml,用于加载所需的任何servlet。

因此,您需要在web.xml中设置servlet配置或(取决于服务器的版本),您可以使用@WebServlet注释而不是gwt模块文件中的servlet。< / p>