我创建了一个Liferay插件项目,其中包含一个基于JSF + PF的portlet,我在其上创建了一个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
文件,因为我的目标是创建一个数据库表。
问题是当我尝试使用服务构建器功能构建服务时,既不创建服务层也不创建模型层。实际上,尽管在eclipse控制台中显示“Build Successful”消息,但没有创建与Service Builder相关的内容:
显示的日志如下:
java.lang.NullPointerException
虽然Service Builder相关的构建过程成功完成(显然),但在该构建过程中会出现Dim LabelMaxWidth As Integer = 0
For Each _Label As Label In _FlowLayoutPanel.Controls
Dim _TextSize As System.Drawing.Size = TextRenderer.MeasureText(_Label.Text, _Label.Font)
_Label.Size = New Size(_TextSize.Width, _TextSize.Height)
If _Label.Width > LabelMaxWidth Then LabelMaxWidth = _Label.Width
Next
。
我真的很感激是否有人可以向我解释发生了什么以及我应该如何解决这个问题。感谢。
(我正在使用liferay-6.2-ce-ga6版本)
答案 0 :(得分:0)
您可以检查两次service.xml。
NullPointer似乎是ServiceBuilder,无法找到您定义的实体,因此无法生成所有类。
如果您需要有关某些代码的文档,可以查看服务构建器定义:liferay-service-builder_6_2_0.dtd