GWT程序中的错误

GWT程序中的错误,gwt,rpc,Gwt,Rpc,我正在开发一个简单的应用程序(使用GWT RPC和Hibernate)将数据插入数据库并检索。添加用户方法后效果很好 现在我编写了一个从数据库中检索数据的方法&display。当模块加载到浏览器中时,会引发源路径错误 eclipse中项目的结构是: -src -user.hbm.xml -hibernate.cfg.xml ->rpctest ->Rpctest.gwt.xml ->rpctest.hibDomain ->User.ja

我正在开发一个简单的应用程序(使用GWT RPC和Hibernate)将数据插入数据库并检索。添加用户方法后效果很好

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

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>

您的gwt源路径中不包括hibDomain包中的类用户


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

你能粘贴用户类吗?我在“Rpctest.GWT.xml”中向GWT项目添加了“User”类,比如,,,其中“Rpctest”是包含用户类文件的src&hibDomain文件夹下的包。但出现了相同的错误。源路径是相对于gwt xml文件的。我现在将其设置为“hibDomain.User”。因为包含“User.java”的“hibDomain”文件夹和包含“gwt.xml”的“rpctest”文件夹都位于“src”文件夹中。但是同样的错误:(虽然这个问题仍有待解决,但我通过您的回答知道了错误的原因,即源路径参数。我最好在打开新线程时关闭此线程。谢谢Daniel的帮助。