当我尝试使用模板获取JournalArticleDisplay时,我在Liferay 6.1.20 EE中得到以下异常。模板存在,JournalArticle存在 - 一切都很好;)相同的代码适用于6.1.30 EE;)
但是当我在6.1.20 EE中调用此方法时,它会因为companyId不为0而中断:
Caused by: com.liferay.portal.kernel.templateparser.TransformException: Unhandled exception
at com.liferay.portal.kernel.templateparser.BaseTemplateParser.transform(BaseTemplateParser.java:135)
at com.liferay.portal.kernel.templateparser.BaseTransformer.transform(BaseTransformer.java:163)
at com.liferay.portlet.journal.util.JournalUtil.transform(JournalUtil.java:1036)
at com.liferay.portlet.journal.service.impl.JournalArticleLocalServiceImpl.getArticleDisplay(JournalArticleLocalServiceImpl.java:1090)
... 87 more
Caused by: com.liferay.portal.NoSuchCompanyException: No Company exists with the primary key 0
at com.liferay.portal.service.persistence.CompanyPersistenceImpl.findByPrimaryKey(CompanyPersistenceImpl.java:486)
at com.liferay.portal.service.base.CompanyLocalServiceBaseImpl.getCompany(CompanyLocalServiceBaseImpl.java:385)
at sun.reflect.GeneratedMethodAccessor232.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:122)
at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:71)
at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118)
at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:211)
at com.sun.proxy.$Proxy113.getCompany(Unknown Source)
at com.liferay.portal.service.CompanyLocalServiceUtil.getCompany(CompanyLocalServiceUtil.java:181)
at com.liferay.portal.kernel.templateparser.BaseTemplateParser.getCompany(BaseTemplateParser.java:150)
at com.liferay.portal.kernel.templateparser.BaseTemplateParser.populateTemplateContext(BaseTemplateParser.java:244)
at com.liferay.portlet.journal.util.VelocityTemplateParser.populateTemplateContext(VelocityTemplateParser.java:178)
at com.liferay.portal.kernel.templateparser.BaseTemplateParser.transform(BaseTemplateParser.java:120)
... 90 more
答案 0 :(得分:0)