Forums

Home » Liferay Portal » English » 2. Using Liferay » General

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Hubert Felber
error importing a LAR file
March 22, 2011 8:46 AM
Answer

Hubert Felber

Rank: Regular Member

Posts: 157

Join Date: November 23, 2009

Recent Posts

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


 1
 216: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
 3ption() k÷nnen Sie die Ausnahmen f³r bestimmte Batch-Elemente abrufen.
 416: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
 5 Primõrschl³ssel bzw. f³r einen von 'IX_88DF994A' bezeichneten eindeutigen Index zu einem duplizierten Schl³sselwert gef³hrt hõtte.
 616:27:49,732 ERROR [SearchPermissionCheckerImpl] com.liferay.portal.kernel.search.SearchException: com.liferay.portal.kernel.exception.SystemException: com.liferay.portal.kernel.dao.orm.ORMException:
 7org.hibernate.exception.GenericJDBCException: Could not execute JDBC batch update
 8com.liferay.portal.kernel.search.SearchException: com.liferay.portal.kernel.exception.SystemException: com.liferay.portal.kernel.dao.orm.ORMException: org.hibernate.exception.GenericJDBCException: Cou
 9ld not execute JDBC batch update
10        at com.liferay.portal.kernel.search.BaseIndexer.reindex(BaseIndexer.java:98)
11        at com.liferay.portal.search.SearchPermissionCheckerImpl.doUpdatePermissionFields_6(SearchPermissionCheckerImpl.java:488)
12        at com.liferay.portal.search.SearchPermissionCheckerImpl.updatePermissionFields(SearchPermissionCheckerImpl.java:135)
13        at com.liferay.portal.kernel.search.SearchEngineUtil.updatePermissionFields(SearchEngineUtil.java:238)
14        at com.liferay.portal.service.impl.ResourcePermissionLocalServiceImpl.doUpdateResourcePermission(ResourcePermissionLocalServiceImpl.java:404)
Hitoshi Ozawa
RE: error importing a LAR file
March 22, 2011 4:51 PM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7954

Join Date: March 23, 2010

Recent Posts

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
RE: error importing a LAR file
March 23, 2011 1:14 AM
Answer

Hubert Felber

Rank: Regular Member

Posts: 157

Join Date: November 23, 2009

Recent Posts

Hey Hitoshi,

Thank you. I will try it and feedback here.

Hubert
Karolin Anna Heiss
RE: error importing a LAR file
March 31, 2011 3:58 AM
Answer

Karolin Anna Heiss

Rank: Junior Member

Posts: 53

Join Date: December 17, 2009

Recent Posts

Thank you Hitoshi for the hint.
Data Strategy "Copy as New" solved the import problem for me :-)

Cheers Karolin
Hitoshi Ozawa
Resolved: error importing a LAR file
March 31, 2011 5:04 AM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7954

Join Date: March 23, 2010

Recent Posts

Glad that you got it working.emoticon
unai alba
RE: Resolved: error importing a LAR file
April 18, 2011 3:20 AM
Answer

unai alba

Rank: New Member

Posts: 15

Join Date: June 7, 2010

Recent Posts

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
pammu naik
RE: error importing a LAR file
May 3, 2011 11:16 PM
Answer

pammu naik

Rank: New Member

Posts: 10

Join Date: May 3, 2011

Recent Posts

Data Strategy "Copy as New" solved the import problem. Thnak u very much
Rajesh Nathi
RE: Resolved: error importing a LAR file
June 9, 2011 8:22 AM
Answer

Rajesh Nathi

Rank: Junior Member

Posts: 71

Join Date: March 8, 2011

Recent Posts

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
kaushal verkey
RE: error importing a LAR file
July 14, 2011 2:43 AM
Answer

kaushal verkey

Rank: New Member

Posts: 1

Join Date: July 14, 2011

Recent Posts

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
Jean-Carl AMSLER
RE: Resolved: error importing a LAR file
August 30, 2011 8:11 AM
Answer

Jean-Carl AMSLER

Rank: New Member

Posts: 5

Join Date: March 14, 2011

Recent Posts

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
Dana Oredson
RE: error importing a LAR file
October 7, 2011 2:07 PM
Answer

Dana Oredson

Rank: Junior Member

Posts: 70

Join Date: October 14, 2008

Recent Posts

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.
Orin Fink
RE: error importing a LAR file
December 21, 2011 9:31 PM
Answer

Orin Fink

Rank: Junior Member

Posts: 42

Join Date: March 24, 2010

Recent Posts

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.