你忘了继承一个必需的模块吗?

时间:2017-05-31 19:29:22

标签: java gwt

我知道关于这个问题已经有很多话题了(你忘了继承一个必需的模块吗?)但我的问题有点特别。     让我来解释一下:     我有一个包含我的模型类的现有包(包的名称是模型)。我所有的模型都放在那个包里。但是我在我的应用程序中进行了更改,现在我在应用程序中使用的部分模型现在从另一个名为" MyAppModel"的应用程序中提取。我已经在我的pom.xml文件中添加了对此MyAppModel应用程序的依赖项。我没有编译错误(mvn编译成功)但是当我做maven安装时:我有以下错误:     [错误]第130行:com.data.service.models.Product类型没有源代码可用;你忘了继承一个必需的模块吗?     [INFO] [ERROR]第588行:没有源代码可用于com.data.service.models.Order类型;你忘了继承一个必需的模块吗?

These 2 models:com.data.service.models.Order.java and com.data.service.models.Product.java are from the MyAppModel application but I am not authorized to add them manually to the existing model package of my application. 
It seems like it can not find those 2 models Product and Order.

Here is the content of my gwt.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<module>
  <inherits name='com.google.gwt.user.User'/>
  <source path='model'/>
</module>
The source path is only pointing to he existing model package. My question is: how can I do to modify this gwt.xml file to take into account both models packages(the model package of the existing application and also the model package of the external application "MyAppModel")

我需要保留现有的源路径=&#39; model&#39;并应在MyAppModel应用程序中添加对外部模型的访问权限

Thank you very much for your help

2 个答案:

答案 0 :(得分:0)

我认为这是错误正是它所说的少数情况之一。 如果您将其中一部分模型放在另一个工件中,请确保您还拥有可用的源,而不仅仅是class个文件。 您需要打包-sources工件或在与编译类相同的工件中包含源。

答案 1 :(得分:0)

在GWT的情况下,如果我们在客户端代码中引用服务器端类,有时我们会看到此错误。