Liferay 6.2 LAR导入:没有带有主键2的JournalFolder

时间:2014-08-14 12:36:10

标签: import liferay-6

我尝试使用导入从“网站”页面导入包含portlet,JournalFolders和JournalArticles的LAR文件。

但是我得到以下例外:

com.liferay.portal.kernel.lar.PortletDataException: com.liferay.portlet.journal.NoSuchFolderException: No JournalFolder exists with the primary key 2
     at com.liferay.portal.kernel.lar.BaseStagedModelDataHandler.importStagedModel(BaseStagedModelDataHandler.java:168)
     at com.liferay.portal.kernel.lar.StagedModelDataHandlerUtil.importStagedModel(StagedModelDataHandlerUtil.java:317)
     at com.liferay.portal.kernel.lar.StagedModelDataHandlerUtil.importReferenceStagedModels(StagedModelDataHandlerUtil.java:278)
     at com.liferay.portlet.journal.lar.JournalContentPortletDataHandler.doProcessImportPortletPreferences(JournalContentPortletDataHandler.java:214)
     at com.liferay.portal.kernel.lar.BasePortletDataHandler.processImportPortletPreferences(BasePortletDataHandler.java:535)
     at com.liferay.portal.lar.PortletImporter.importPortletPreferences(PortletImporter.java:1159)
     at com.liferay.portal.lar.LayoutImporter.doImportLayouts(LayoutImporter.java:599)
     at com.liferay.portal.lar.LayoutImporter.importLayouts(LayoutImporter.java:118)
     at com.liferay.portal.service.impl.LayoutLocalServiceImpl.importLayouts(LayoutLocalServiceImpl.java:1756)
     at com.liferay.portal.service.impl.LayoutLocalServiceImpl.importLayouts(LayoutLocalServiceImpl.java:1805)
     at sun.reflect.GeneratedMethodAccessor1996.invoke(Unknown Source)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
     at java.lang.reflect.Method.invoke(Method.java:606)
     at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:115)
     at com.liferay.portal.service.impl.LayoutLocalServiceVirtualLayoutsAdvice.invoke(LayoutLocalServiceVirtualLayoutsAdvice.java:180)
     at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
     at com.liferay.portal.service.impl.LayoutLocalServiceStagingAdvice.invoke(LayoutLocalServiceStagingAdvice.java:141)
     at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
     at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:62)
     at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:51)
     at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
     at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:175)
     at com.sun.proxy.$Proxy50.importLayouts(Unknown Source)
     at com.liferay.portal.service.LayoutLocalServiceUtil.importLayouts(LayoutLocalServiceUtil.java:1308)
     at com.liferay.portal.lar.backgroundtask.LayoutImportBackgroundTaskExecutor.execute(LayoutImportBackgroundTaskExecutor.java:61)
     at com.liferay.portal.kernel.backgroundtask.SerialBackgroundTaskExecutor.execute(SerialBackgroundTaskExecutor.java:56)
     at com.liferay.portal.backgroundtask.messaging.BackgroundTaskMessageListener.doReceive(BackgroundTaskMessageListener.java:108)
     at com.liferay.portal.kernel.messaging.BaseMessageListener.receive(BaseMessageListener.java:26)
     at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:72)
     at com.liferay.portal.kernel.messaging.ParallelDestination$1.run(ParallelDestination.java:69)
     at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask._runTask(ThreadPoolExecutor.java:682)
     at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask.run(ThreadPoolExecutor.java:593)
     at java.lang.Thread.run(Thread.java:744)
Caused by: com.liferay.portlet.journal.NoSuchFolderException: No JournalFolder exists with the primary key 2
     at com.liferay.portlet.journal.service.persistence.JournalFolderPersistenceImpl.findByPrimaryKey(JournalFolderPersistenceImpl.java:7729)
     at com.liferay.portlet.journal.service.persistence.JournalFolderPersistenceImpl.findByPrimaryKey(JournalFolderPersistenceImpl.java:7747)
     at com.liferay.portlet.journal.service.impl.JournalFolderLocalServiceImpl.getFolder(JournalFolderLocalServiceImpl.java:248)
     at sun.reflect.GeneratedMethodAccessor1463.invoke(Unknown Source)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
     at java.lang.reflect.Method.invoke(Method.java:606)
     at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:115)
     at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:62)
     at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:51)
     at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
     at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:175)
     at com.sun.proxy.$Proxy243.getFolder(Unknown Source)
     at com.liferay.portlet.journal.service.JournalFolderLocalServiceUtil.getFolder(JournalFolderLocalServiceUtil.java:413)
     at com.liferay.portlet.journal.model.impl.JournalArticleImpl.getFolder(JournalArticleImpl.java:157)
     at com.liferay.portlet.journal.model.impl.JournalArticleImpl.buildTreePath(JournalArticleImpl.java:64)
     at com.liferay.portlet.journal.service.impl.JournalArticleLocalServiceImpl.addArticle(JournalArticleLocalServiceImpl.java:376)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
     at java.lang.reflect.Method.invoke(Method.java:606)
     at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:115)
     at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:62)
     at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:51)
     at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
     at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
     at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
     at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:175)
     at com.sun.proxy.$Proxy236.addArticle(Unknown Source)
     at com.liferay.portlet.journal.service.JournalArticleLocalServiceUtil.addArticle(JournalArticleLocalServiceUtil.java:439)
     at com.liferay.portlet.journal.lar.JournalArticleStagedModelDataHandler.doImportStagedModel(JournalArticleStagedModelDataHandler.java:594)
     at com.liferay.portlet.journal.lar.JournalArticleStagedModelDataHandler.doImportStagedModel(JournalArticleStagedModelDataHandler.java:1)
     at com.liferay.portal.kernel.lar.BaseStagedModelDataHandler.importStagedModel(BaseStagedModelDataHandler.java:159)
     ... 32 more

带有密钥2的JournalFolder存在于LAR包中,但不存在于数据库中(数据库已清除)。

有任何建议如何让Liferay导入文件夹吗? (手动创建文件夹超出范围,因为我需要导入大约2000个文件夹。)

提前致谢。

1 个答案:

答案 0 :(得分:0)

问题是我们错过了Liferay主要Portlet的一个XML文件。修复引用后,导入工作正常,文件夹可以解析。

因此,如果您遇到相同的问题(导入时文件夹丢失,尽管文件夹位于LAR包中):确保在manifest.xml中引用主portlet文件夹(15)中的portlet.xml,然后从此portlet.xml指向同一主portlet的portlet-data.xml。