Я пытаюсь создать many-to-many
между моей собственной сущностью и сущностью группы Liferay. Мой service.xml выглядит так
<entity name="EntityA" local-service="true" remote-service="false">
<column name="entityAId" type="long" primary="true" />
<column name="title" type="String" />
<column name="summary" type="String" />
<column name="authorId" type="long" />
<column name="attachments" type="Collection" entity="EntityAAttachment" mapping-key="entityAId" />
<column name="groups" type="Collection" entity="com.liferay.portal.Group" mapping-table="EntityAs_Groups" />
</entity>
Согласно DTD файла service.xml это должно генерировать отношение «многие ко многим», но я получаю только это
Method public java.util.List com.liferay.portal.tools.servicebuilder.ServiceBuilder.getMappingEntities(java.lang.String) throws java.io.IOException threw an exception when invoked on com.liferay.portal.tools.servicebuilder.ServiceBuilder@21ff3fcf
The problematic instruction:
----------
==> list serviceBuilder.getMappingEntities(column.mappingTable) as mapColumn [on line 201, column 49 in com/liferay/portal/tools/servicebuilder/dependencies/model_impl.ftl]
----------
Java backtrace for programmers:
----------
freemarker.template.TemplateModelException: Method public java.util.List com.liferay.portal.tools.servicebuilder.ServiceBuilder.getMappingEntities(java.lang.String) throws java.io.IOException threw an exception when invoked on com.liferay.portal.tools.servicebuilder.ServiceBuilder@21ff3fcf
at freemarker.ext.beans.SimpleMethodModel.exec(SimpleMethodModel.java:130)
at freemarker.core.MethodCall._getAsTemplateModel(MethodCall.java:93)
at freemarker.core.Expression.getAsTemplateModel(Expression.java:89)
at freemarker.core.IteratorBlock.accept(IteratorBlock.java:94)
at freemarker.core.Environment.visit(Environment.java:210)
at freemarker.core.MixedContent.accept(MixedContent.java:92)
at freemarker.core.Environment.visit(Environment.java:210)
at freemarker.core.Environment.visit(Environment.java:299)
at freemarker.core.CompressedBlock.accept(CompressedBlock.java:73)
at freemarker.core.Environment.visit(Environment.java:210)
at freemarker.core.MixedContent.accept(MixedContent.java:92)
at freemarker.core.Environment.visit(Environment.java:210)
at freemarker.core.IfBlock.accept(IfBlock.java:82)
at freemarker.core.Environment.visit(Environment.java:210)
at freemarker.core.MixedContent.accept(MixedContent.java:92)
at freemarker.core.Environment.visit(Environment.java:210)
at freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:79)
at freemarker.core.Environment.visit(Environment.java:210)
at freemarker.core.IteratorBlock$Context.runLoop(IteratorBlock.java:179)
at freemarker.core.Environment.visit(Environment.java:417)
at freemarker.core.IteratorBlock.accept(IteratorBlock.java:102)
at freemarker.core.Environment.visit(Environment.java:210)
at freemarker.core.MixedContent.accept(MixedContent.java:92)
at freemarker.core.Environment.visit(Environment.java:210)
at freemarker.core.Environment.process(Environment.java:190)
at freemarker.template.Template.process(Template.java:237)
at com.liferay.portal.freemarker.FreeMarkerUtil.process(FreeMarkerUtil.java:49)
at com.liferay.portal.freemarker.FreeMarkerUtil.process(FreeMarkerUtil.java:39)
at com.liferay.portal.tools.servicebuilder.ServiceBuilder._processTemplate(ServiceBuilder.java:4447)
at com.liferay.portal.tools.servicebuilder.ServiceBuilder._createModelImpl(ServiceBuilder.java:2420)
at com.liferay.portal.tools.servicebuilder.ServiceBuilder.<init>(ServiceBuilder.java:1023)
at com.liferay.portal.tools.servicebuilder.ServiceBuilder.<init>(ServiceBuilder.java:404)
at com.liferay.portal.tools.servicebuilder.ServiceBuilder.main(ServiceBuilder.java:176)
Caused by: java.lang.NullPointerException
at com.liferay.portal.tools.servicebuilder.ServiceBuilder.getMappingEntities(ServiceBuilder.java:1366)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at freemarker.ext.beans.BeansWrapper.invokeMethod(BeansWrapper.java:840)
at freemarker.ext.beans.SimpleMethodModel.exec(SimpleMethodModel.java:106)
... 32 more
Что я здесь не так делаю? Я использую последнюю Liferay stable 6.0.5