【问题标题】:Error with integration GWT + Hibernate + Postgresql 9.3集成 GWT + Hibernate + Postgresql 9.3 时出错
【发布时间】:2014-11-09 05:41:59
【问题描述】:

我已按照本指南进行操作

http://www.gwtproject.org/articles/using_gwt_with_hibernate.html

但是我在Tomcat下编译时出现这个错误:

[ERROR] Errors in 'file:/C:/source/../src/ProjectName/src/main/java/../../projectname/client/TestDTO.java'
[ERROR]  No source code is available for type org.hibernate.Session; did you forget to inherit a required module?
[ERROR]  No source code is available for type _._.projectname.server.HibernateUtil; did you forget to inherit a required module?
[ERROR] Unable to find type '_._.projectname.client.TestService'
[ERROR] Hint: Previous compiler errors may have made this type unavailable
[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
[ERROR] Errors in '../../projectname/client/JavaClass.java'
[ERROR] Failed to resolve '_._.projectname.client.TestService' via deferred binding

我正在使用 DTO 将 bean 从服务器端映射到客户端,JavaClass.java 是调用异步服务的类,有什么想法吗?

提前致谢。

【问题讨论】:

    标签: java hibernate gwt postgresql-9.3


    【解决方案1】:

    您不能在客户端包中包含服务器端代码。客户端包中的任何类都需要能够转换为 javascript/html。你应该确保你所有的 Hibernate/ 域类只在你的服务器包中被引用。还要确保您的 module.gwt.xml 文件没有服务器代码路径的条目。在这种情况下,将您的 TestDTO 移动到项目中的服务器包应该会有所帮助。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-05-11
      • 2013-06-20
      • 1970-01-01
      • 1970-01-01
      • 2015-11-18
      • 1970-01-01
      • 2012-07-02
      相关资源
      最近更新 更多