Fórum

error importing a LAR file

Hubert Felber, modificado 13 Anos atrás.

error importing a LAR file

Regular Member Postagens: 157 Data de Entrada: 23/11/09 Postagens Recentes
Hi,

I am using Liferay 6.06/JBoss

I cannot import a LAR file exported from another Liferay portal (6.06), neither can other developers do this.
The LAR file can be imported on the machine that exported it, but not on other machines.
It seams that a unique index IX_88DF994A is violated.
The LAR is exported using the standard settings.

What is going wrong? Could anybody please help, give a hint?
Thank you
Hubert



16:27:49,713 ERROR [JDBCExceptionReporter] Fehler bei nicht atomarer Batch-Operation. Der Batch wurde ³bergeben. Bei einem Batch-Member ist jedoch mindestens eine Ausnahme eingetreten. Mit getNextExce
ption() k÷nnen Sie die Ausnahmen f³r bestimmte Batch-Elemente abrufen.
16:27:49,722 ERROR [JDBCExceptionReporter] Fehler f³r das Batch-Element0: Die Anweisung wurde abgebrochen, weil sie in einer f³r 'JOURNALARTICLERESOURCE' definierten Vorgabe f³r einen eindeutigen oder
 Primõrschl³ssel bzw. f³r einen von 'IX_88DF994A' bezeichneten eindeutigen Index zu einem duplizierten Schl³sselwert gef³hrt hõtte.
16:27:49,732 ERROR [SearchPermissionCheckerImpl] com.liferay.portal.kernel.search.SearchException: com.liferay.portal.kernel.exception.SystemException: com.liferay.portal.kernel.dao.orm.ORMException:
org.hibernate.exception.GenericJDBCException: Could not execute JDBC batch update
com.liferay.portal.kernel.search.SearchException: com.liferay.portal.kernel.exception.SystemException: com.liferay.portal.kernel.dao.orm.ORMException: org.hibernate.exception.GenericJDBCException: Cou
ld not execute JDBC batch update
        at com.liferay.portal.kernel.search.BaseIndexer.reindex(BaseIndexer.java:98)
        at com.liferay.portal.search.SearchPermissionCheckerImpl.doUpdatePermissionFields_6(SearchPermissionCheckerImpl.java:488)
        at com.liferay.portal.search.SearchPermissionCheckerImpl.updatePermissionFields(SearchPermissionCheckerImpl.java:135)
        at com.liferay.portal.kernel.search.SearchEngineUtil.updatePermissionFields(SearchEngineUtil.java:238)
        at com.liferay.portal.service.impl.ResourcePermissionLocalServiceImpl.doUpdateResourcePermission(ResourcePermissionLocalServiceImpl.java:404)
thumbnail
Hitoshi Ozawa, modificado 13 Anos atrás.

RE: error importing a LAR file

Liferay Legend Postagens: 7942 Data de Entrada: 24/03/10 Postagens Recentes
The LAR is exported using the standard settings.


Had the same problem. The fault was with the default settings.
I think this is what I did.
During import:
Data Strategy: Copy as New
User ID Strategy: Always us my user ID

During Export, I may have unchecked "Setup" and "Images". Try unchecking some others as well.
Hubert Felber, modificado 13 Anos atrás.

RE: error importing a LAR file

Regular Member Postagens: 157 Data de Entrada: 23/11/09 Postagens Recentes
Hey Hitoshi,

Thank you. I will try it and feedback here.

Hubert
thumbnail
Karolin Anna Krieg, modificado 13 Anos atrás.

RE: error importing a LAR file

Junior Member Postagens: 53 Data de Entrada: 17/12/09 Postagens Recentes
Thank you Hitoshi for the hint.
Data Strategy "Copy as New" solved the import problem for me :-)

Cheers Karolin
thumbnail
Hitoshi Ozawa, modificado 13 Anos atrás.

Resolved: error importing a LAR file

Liferay Legend Postagens: 7942 Data de Entrada: 24/03/10 Postagens Recentes
Glad that you got it working.emoticon
thumbnail
unai alba, modificado 13 Anos atrás.

RE: Resolved: error importing a LAR file

New Member Postagens: 15 Data de Entrada: 07/06/10 Postagens Recentes
Hi,

I've faced with the same problem but in other scenario. My problem was with the LAR for the new users, so I couldn't decide the strategy (atleast I didn't find how to do it in portal properties), so to "solve" the problem I have done the following, change the index from unique to index:

ALTER TABLE `lportal6GA4`.`journalarticleresource` DROP INDEX `IX_88DF994A`,
ADD INDEX `IX_88DF994A` USING BTREE(`groupId`, `articleId`);


It'd be worse in terms of performance, but is the only solution in this scenario.

I hope it helps to someone,

regards,

Unai
Jean-Carl AMSLER, modificado 12 Anos atrás.

RE: Resolved: error importing a LAR file

New Member Postagens: 5 Data de Entrada: 14/03/11 Postagens Recentes
unai alba:
Hi,

I've faced with the same problem but in other scenario. My problem was with the LAR for the new users, so I couldn't decide the strategy (atleast I didn't find how to do it in portal properties), so to "solve" the problem I have done the following, change the index from unique to index:

ALTER TABLE `lportal6GA4`.`journalarticleresource` DROP INDEX `IX_88DF994A`,
ADD INDEX `IX_88DF994A` USING BTREE(`groupId`, `articleId`);


It'd be worse in terms of performance, but is the only solution in this scenario.

I hope it helps to someone,

regards,

Unai


Hi Unai,

I followed your post, and didn't have any error : LAR has been imported correctly (no error apparently). However, the information was not good in the table journalarticleresource, with the field articleId containing an empty value ("") that generated broken links in my website.

So i continued to investigate in the liferay forum and issue, and found the fix for the 6.0.6 CE here : http://issues.liferay.com/browse/LPS-17334 (thanks to Artur Linhart (BC))
I created a copy of the jar \webapps\ROOT\WEB-INF\lib\portal-impl.jar, opening the jar with winrar and have replaced the good Java Class "com\liferay\portlet\journal\lar\JournalPortletDataHandlerImpl.class" and have replaced the "patched" jar under the repository \webapps\ROOT\WEB-INF\lib.
I restored the index `IX_88DF994A` as UNIQUE, then I restarted my server, tried the same LAR importation and all was fine (DB and website)!!

Have fun !

JC
Rajesh Nathi, modificado 12 Anos atrás.

RE: Resolved: error importing a LAR file

Junior Member Postagens: 71 Data de Entrada: 08/03/11 Postagens Recentes
Hi Hitoshi,

Is there any other solution to avoid this duplicate index exception, other than - deleting , recreating that index or copying LAR as new ?

Regards
-Rajesh
pammu naik, modificado 12 Anos atrás.

RE: error importing a LAR file

New Member Postagens: 10 Data de Entrada: 04/05/11 Postagens Recentes
Data Strategy "Copy as New" solved the import problem. Thnak u very much
kaushal verkey, modificado 12 Anos atrás.

RE: error importing a LAR file

New Member Mensagem: 1 Data de Entrada: 14/07/11 Postagens Recentes
pammu naik:
Data Strategy "Copy as New" solved the import problem. Thnak u very much


HI,

I have used "Copy as New" data Strategy but still not able to import the lar file.
Do you let me know what options you have selected while exporting and them selected options while importing the lar file

Thanks in adavance
Kaushal
Dana Oredson, modificado 12 Anos atrás.

RE: error importing a LAR file

Junior Member Postagens: 70 Data de Entrada: 14/10/08 Postagens Recentes
Similar issue, which appears to be related to the BatchSession being used.

This thing is configured by default with 20 as the JDBC batch size:
#
# Set the JDBC batch size to improve performance.
#
# If you're using Hypersonic, you SHOULD set the batch size to 0 as a
# workaround for a logging bug in the Hypersonic driver. See LPS-5426 for
# more information.
#
# If you're using Oracle 9i, you MUST set the batch size to 0 as a
# workaround for a hanging bug in the Oracle driver. See LEP-1234 for more
# information.
#
hibernate.jdbc.batch_size=20
#hibernate.jdbc.batch_size=0

However, I have seen it sometimes fail and I believe this is due to something being in the batch and not yet in the database, but the LAR import is validating that it is in the database. Such as when inserting a new Article, then later trying to fetch the latest copy of the article and throwing an NoSuchArticleException.

I'm attempting to set batch size to 0. When I debug through BatchSessionImpl, it acts like the property is still set to 20, so still trying to figure out why.
thumbnail
Orin Fink, modificado 12 Anos atrás.

RE: error importing a LAR file

Junior Member Postagens: 65 Data de Entrada: 25/03/10 Postagens Recentes
For the folks just defaulting to "Copy as New"... I think there will be trouble if you need to upload then a second LAR as you may end up with mulitple copies of your web content... this was a real pain for me when I realized what had happened.

However, when I modified the hibernate.jdbc.batch_size property in the portal-ext.properties file to be 0, my import did work and no duplicate content. I should also note that my experience was with Postgres 9 so that platform maybe aught to be added to the list of ones to look out for.