无法运行GWT项目

时间:2015-01-10 20:24:50

标签: java gwt intellij-idea

我在IntelliJ IDEA中运行项目时遇到错误:

Runing CodeServer with parameters: [-noprecompile, -port, 9876, -sourceLevel, 1.7, -bindAddress, 127.0.0.1, -launcherDir, /home/dmitry/.IntelliJIdea14/system/gwt/LearnGWT.5e3e85a3/LearnGWT.8f93a286/run/www, -logLevel, INFO, MvpApp]
Super Dev Mode starting up
   workDir: /tmp/gwt-codeserver-4584443402233015855.tmp
   Loading Java files in MvpApp.
   Finding entry point classes
      [ERROR] Hint: Check the inheritance chain from your module; it may not be inheriting a required module or a module may not be adding its source path entries properly
[WARN] Server class 'com.google.gwt.dev.shell.jetty.JDBCUnloader' could not be found in the web app, but was found on the system classpath
   [WARN] Adding classpath entry 'file:/home/dmitry/Disk/Ubuntu/gwt-2.7.0/gwt-dev.jar' to the web app classpath for this session
   For additional info see: file:/home/dmitry/Disk/Ubuntu/gwt-2.7.0/doc/helpInfo/webAppClassPath.html

正如您所看到的,日志几乎没有任何内容 我的源代码可以在这里找到:https://github.com/dvddmt/learn-gwt/tree/03_mvp_pattern
有人可以提供任何帮助吗?

1 个答案:

答案 0 :(得分:2)

我看了一下你的项目并让它运行(在eclipse中)并进行了一些更改。

  1. MvpApp.gwt.xml文件移至mvpApp包中。你应该有一个像下面这样的结构(我选择了随机名称,但你应该明白这一点):

    com.module.package
        - client
        - server ( only if you have server code )
        - shared
        - Module.gwt.xml
    
  2. 默认情况下,GWT会在client包中查找代码。您正在使用shared包来推测在客户端和服务器上共享代码。要完成这项工作,您必须将以下行添加到*.gwt.xml文件中。

    <!-- Specify the paths for translatable code                    -->
    <source path='client'/>
    <source path='shared'/>
    
  3. 在您的示例中,完整的MvpApp.gwt.xml文件应为:

    <!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.0//EN"
        "http://google-web-toolkit.googlecode.com/svn/releases/2.0/distro-source/core/src/gwt-module.dtd">
    <module rename-to="MvpApp">
    
        <inherits name='com.google.gwt.user.User'/>
    
        <entry-point class='mvpApp.client.MvpApp'/>
    
        <!-- Specify the paths for translatable code                    -->
        <source path='client'/>
        <source path='shared'/>
    </module>