-2

我创建了一个 Liferay 插件项目,其中包括一个基于 JSF+PF 的 portlet,我在其上创建了一个service.xml文件,因为我的目标是创建一个数据库表。问题是当我尝试使用服务构建器功能构建服务时,既没有创建服务层也没有创建模型层。实际上,尽管 Eclipse 控制台中显示了“构建成功”消息,但没有创建与 Service Builder 相关的内容:

  • WEB-INF/服务/*,
  • /src/db/*,
  • 元信息/*,
  • WEB-INF/sql/*,
  • 服务属性。

显示的日志如下:

Buildfile: C:\Liferay\carevid\liferay-6.2-ce-ga6\liferay-plugins-sdk-6.2\portlets\carevid-entities-portlet\build.xml
build-service:
[jar] Building MANIFEST-only jar: C:\Liferay\carevid\liferay-6.2-ce-ga6\liferay-plugins-sdk-6.2\portlets\carevid-entities-portlet\service-builder-classpath.jar
[delete] Deleting: C:\Liferay\carevid\liferay-6.2-ce-ga6\liferay-plugins-sdk-6.2\portlets\carevid-entities-portlet\service-builder-classpath.jar.manifest
[delete] Deleting: C:\Liferay\carevid\liferay-6.2-ce-ga6\liferay-plugins-sdk-6.2\portlets\carevid-entities-portlet\service-builder-classpath.jar
[echo] Loading jar:file:/C:/Liferay/carevid/apache-tomcat-7.0.59/webapps/ROOT/WEB-INF/lib/portal-impl.jar!/system.properties
[echo] Loading jar:file:/C:/Liferay/carevid/apache-tomcat-7.0.59/webapps/ROOT/WEB-INF/lib/portal-impl.jar!/portal.properties
[echo] Loading file:/C:/Liferay/carevid/apache-tomcat-7.0.59/webapps/ROOT/WEB-INF/classes/portal-ext.properties
[echo] Loading jar:file:/C:/Liferay/carevid/apache-tomcat-7.0.59/webapps/ROOT/WEB-INF/lib/portal-impl.jar!/com/liferay/portal/tools/dependencies/portal-tools.properties
[echo] 20180315091704988 (El parámetro no es correcto)
[echo] java.lang.NullPointerException
[echo]  at com.liferay.portal.tools.servicebuilder.ServiceBuilder.getEntity(ServiceBuilder.java:1012)
[echo]  at com.liferay.portal.tools.servicebuilder.ServiceBuilder.getEntity(ServiceBuilder.java:1080)
[echo]  at com.liferay.portal.tools.servicebuilder.ServiceBuilder._parseEntity(ServiceBuilder.java:5003)
[echo]  at com.liferay.portal.tools.servicebuilder.ServiceBuilder.<init>(ServiceBuilder.java:709)
[echo]  at com.liferay.portal.tools.servicebuilder.ServiceBuilder.main(ServiceBuilder.java:230)
[mkdir] Created dir: C:\Liferay\carevid\liferay-6.2-ce-ga6\liferay-plugins-sdk-6.2\portlets\carevid-entities-portlet\docroot\WEB-INF\service-classes
[jar] Building MANIFEST-only jar: C:\Liferay\carevid\liferay-6.2-ce-ga6\liferay-plugins-sdk-6.2\portlets\carevid-entities-portlet\docroot\WEB-INF\lib\carevid-entities-portlet-service.jar
[delete] Deleting directory C:\Liferay\carevid\liferay-6.2-ce-ga6\liferay-plugins-sdk-6.2\portlets\carevid-entities-portlet\docroot\WEB-INF\service-classes
BUILD SUCCESSFUL

尽管与 Service Builder 相关的构建过程成功(显然)完成,但java.lang.NullPointerException在该构建过程中会出现 a。

我真的很感激是否有人可以向我解释发生了什么以及我应该如何解决这个问题。谢谢。

(我正在使用 liferay-6.2-ce-ga6 版本)

4

1 回答 1

0

您可以检查两次您的 service.xml。

那 NullPointer 似乎是 ServiceBuilder 找不到您定义的实体,因此它无法生成所有类。

如果您需要有关某些标签的文档,可以查看服务构建器定义:liferay-service-builder_6_2_0.dtd

于 2018-03-15T22:16:44.090 回答