Liferay 6.2 LAR导入:没有带有主键2的JournalFolder [英] Liferay 6.2 LAR import: No JournalFolder exists with the primary key 2

查看:171
本文介绍了Liferay 6.2 LAR导入:没有带有主键2的JournalFolder的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从包含导入的网站页面导入包含portlet,JournalFolders和JournalArticles的LAR文件。

I'm trying to import a LAR file containing portlets, JournalFolders and JournalArticles from the Sites page with Import.

但是我得到以下异常:

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包中,但不在数据库中(数据库是清除的)。

The JournalFolder with the key 2 exists in the LAR package however not in the database (the database is clear).

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

Any suggestion how to make Liferay import the folders too? (Creating the folders manually is out of scope because I have around 2000 folders I need to import).

提前致谢。

推荐答案

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

The issue was that we missed one XML file for the main Portlet of Liferay. After we fixed the references the import worked and the folders could be resolved.

所以如果遇到同样的问题(虽然文件夹在LAR中,导入时文件夹丢失了package):确保在manifest.xml中引用主portlet文件夹(15)中的portlet.xml,然后从此portlet.xml引用同一主portlet的portlet-data.xml。

So if you encounter the same problem (folder is missing when importing although the folders are in the LAR package): make sure you reference in manifest.xml to the portlet.xml in the main portlet folder (15) then reference from this portlet.xml to the portlet-data.xml for the same main portlet.

这篇关于Liferay 6.2 LAR导入:没有带有主键2的JournalFolder的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆