GWT计划中的错误

时间:2011-12-09 23:36:58

标签: gwt rpc

我正在开发一个简单的应用程序(使用GWT RPC& Hibernate)将数据插入数据库&检索。它在添加用户方法时运行良好。

现在我编写了一个从数据库中检索数据的方法。显示。当模块加载到浏览器中时,它会引发源路径错误。

eclipse中项目的结构是:

-src
-user.hbm.xml
-hibernate.cfg.xml
   ->rpctest
     ->Rpctest.gwt.xml  
   ->rpctest.hibDomain
     ->User.java
   ->rpctest.client
     ->Rpctest.java
     ->service interfaces
   ->rpctest.server
     ->service implementation
     ->HibernateUtil.java

这是堆栈跟踪:

    [DEBUG] [rpctest] - Validating newly compiled units
[TRACE] [rpctest] - Finding entry point classes
    [ERROR] [rpctest] - Unable to find type 'rpctest.client.Rpctest'
        [ERROR] [rpctest] - Hint: Previous compiler errors may have made this type unavailable
        [ERROR] [rpctest] - 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
[ERROR] [rpctest] - Failed to load module 'rpctest' from user agent 'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C)' at 127.0.0.1:49465

Rpctest.gwt.xml

   <?xml version="1.0" encoding="UTF-8"?>
<module rename-to='rpctest'>
  <!-- Inherit the core Web Toolkit stuff.                        -->
  <inherits name='com.google.gwt.user.User'/>

  <!-- 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='rpctest.client.Rpctest'/>

  <!-- Specify the paths for translatable code                    -->
  <source path='rpctest.client.Rpctest'/>
  <source path='server'/>
  <source path='hibDomain.User'/>


 </module>

1 个答案:

答案 0 :(得分:0)

hibDomain包中的类User不包含在您的gwt源路径

您可以通过将gwt编译器添加到gwt xml文件中来配置gwt编译器应该转换为javascript的类。请查看文档:{​​{3}}