on ‎2018 Oct 21 11:53 AM
Hello,
I created custom item type and added to product. During product synchronization the custom item type is not synchronizing from staged to online.
See the screen shot for custom item type and relation.
I followed the below help document and still not able to synchronize the custom item type.
https://help.hybris.com/6.7.0/hcd/8c6a8d0786691014b52df14168b84ee7.html
If I tried with partof=true in the relation target (video) getting the below error..
Caused by: de.hybris.platform.jalo.JaloInvalidParameterException: cannot set attribute Video.videoLink:localized:java.lang.String[rwolSCRp] to partOf since it holds no items
Any help would be appreciated.
Request clarification before answering.
I just tested the following item configuration to be working:
<relations>
<relation code="Product2VideoRelation" autocreate="true" generate="true" localized="false">
<sourceElement qualifier="product" type="Product" cardinality="one">
<modifiers read="true" write="true" search="true" optional="true"/>
</sourceElement>
<targetElement qualifier="videos" type="Video" cardinality="many" ordered="true" collectiontype="list">
<modifiers read="true" write="true" search="true" optional="true"/>
</targetElement>
</relation>
</relations>
<itemtypes>
<itemtype code="Video"
generate="true"
jaloclass="de.hybris.platform.catalog.jalo.Video"
extends="GenericItem"
autocreate="true">
<deployment table="Videos" typecode="18001"/>
<custom-properties>
<property name="catalogItemType">
<value>java.lang.Boolean.TRUE</value>
</property>
<property name="catalogVersionAttributeQualifier">
<value>"catalogVersion"</value>
</property>
<property name="uniqueKeyAttributeQualifier">
<value>"id"</value>
</property>
</custom-properties>
<attributes>
<attribute qualifier="id" type="java.lang.String">
<modifiers initial="true" optional="false" write="true"/>
<persistence type="property"/>
</attribute>
<attribute qualifier="videoLink" type="localized:java.lang.String">
<modifiers read="true" write="true" search="true" optional="true" unique="true"/>
<persistence type="property"/>
</attribute>
<attribute qualifier="description" type="localized:java.lang.String">
<modifiers read="true" write="true" search="true" optional="true"/>
<persistence type="property"/>
</attribute>
<attribute qualifier="catalogVersion" type="CatalogVersion">
<modifiers read="true" write="true" search="true" optional="false" unique="true"/>
<persistence type="property"/>
</attribute>
</attributes>
</itemtype>
</itemtypes>
Note: You need to add 'Video' item type to root type before performing synchronization. Login to backoffice>Multithreaded Synchronization>Select the Synch job>ADMINISTRATION>Root types

You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Unfortunately, I am too busy till Friday. I will try to create another example for you over the weekend. I am sorry that I will not be able to devote any time to look into your issue before coming weekend. Please keep trying and hopefully, you will be able to resolve the issue much earlier than I try to find another solution to your problem.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please try the other way round i.e. Click System>Types>Search for Audio>Click Audio from the list>Click the icon marked in the attached screenshot>Click + icon to create a new instance>Add values e.g. id=1234, catalogVersion=Apparel Product Catalog : Staged, and audioLink=Test Link>Click 'Done'>Click SEARCH button>Select the Audio with id=1234 from the list>Add an apparel product as shown in the screenshot>Click 'SAVE'>Click 'System>Multithreaded Synchronization'>Execute the job from list
Writing another comment because of limited space.
In the last step of the above comment, please select the job, sync apparelProductCatalog:Staged->Online and click the icon marked in the screenshot>Click 'NEXT>START>DONE'
Hopefully it will be synchronized successfully (please check the log). Now, you can navigate to that product and check that it has the Audio available.
Hi Sasi - There seems to be some other issue. Just to make sure that the code does not have an issue, I wrote the following code afresh, performed ant clean all, updated the platform by selecting only my extension and the option Update running system, added Audio as a Root type as mentioned earlier, created a new instance of Audio and performed synchronization which got completed without any issue.
<relations>
<relation code="Product2AudioRelation" autocreate="true" generate="true" localized="false">
<sourceElement qualifier="product" type="Product" cardinality="one">
<modifiers read="true" write="true" search="true" optional="true"/>
</sourceElement>
<targetElement qualifier="audio" type="Audio" cardinality="many" ordered="true" collectiontype="list">
<modifiers read="true" write="true" search="true" optional="true"/>
</targetElement>
</relation>
</relations>
<itemtypes>
<itemtype code="Audio"
generate="true"
jaloclass="de.hybris.platform.catalog.jalo.Audio"
extends="GenericItem"
autocreate="true">
<deployment table="Audios" typecode="18002"/>
<custom-properties>
<property name="catalogItemType">
<value>java.lang.Boolean.TRUE</value>
</property>
<property name="catalogVersionAttributeQualifier">
<value>"catalogVersion"</value>
</property>
<property name="uniqueKeyAttributeQualifier">
<value>"id"</value>
</property>
</custom-properties>
<attributes>
<attribute qualifier="id" type="java.lang.String">
<modifiers initial="true" optional="false" write="true"/>
<persistence type="property"/>
</attribute>
<attribute qualifier="audioLink" type="localized:java.lang.String">
<modifiers read="true" write="true" search="true" optional="true" unique="true"/>
<persistence type="property"/>
</attribute>
<attribute qualifier="description" type="localized:java.lang.String">
<modifiers read="true" write="true" search="true" optional="true"/>
<persistence type="property"/>
</attribute>
<attribute qualifier="catalogVersion" type="CatalogVersion">
<modifiers read="true" write="true" search="true" optional="false" unique="true"/>
<persistence type="property"/>
</attribute>
</attributes>
</itemtype>
</itemtypes>
Given below is my log details:
INFO [0000099C::de.hybris.platform.catalog.jalo.synchronization.CatalogVersionSyncJob] (0000099C) [CatalogVersionSyncJob] Starting synchronization ...
INFO [0000099C::de.hybris.platform.catalog.jalo.synchronization.CatalogVersionSyncJob] (0000099C) [CatalogVersionSyncMaster] 1. pass, 0 (+0) of 1 items processed (0 %), 0.00 items/sec, 0 (+0, deadlocks:0) items dumped.
INFO [0000099C::de.hybris.platform.catalog.jalo.synchronization.CatalogVersionSyncJob] (0000099C) [CatalogVersionSyncJob] Finished synchronization in 0d 00h:00m:00s:096ms. No errors
Since, you have mentioned that you tried it with Apparel products, I just verified it with Apparel products as well (i.e. added Audio as a Root type under sync apparelProductCatalog:Staged->Online job, created an instance of Audio with a product belonging to apparelProductCatalog:Staged and executed the sync apparelProductCatalog:Staged->Online job. The log is as given below:
INFO [0000099E::de.hybris.platform.catalog.jalo.synchronization.CatalogVersionSyncJob] (0000099E) [CatalogVersionSyncJob] Sync 'sync apparelProductCatalog:Staged->Online' (pk:8796095709684) configured 1 entries for job '0000099E' (pk:8796486337013) schedule medias: 1
INFO [0000099E::de.hybris.platform.catalog.jalo.synchronization.CatalogVersionSyncJob] (0000099E) [CatalogVersionSyncJob] Finished configureFullVersionSync in 11202ms
INFO [0000099E::de.hybris.platform.catalog.jalo.synchronization.CatalogVersionSyncJob] (0000099E) [CatalogVersionSyncJob] Starting synchronization ...
INFO [0000099E::de.hybris.platform.catalog.jalo.synchronization.CatalogVersionSyncJob] (0000099E) [CatalogVersionSyncMaster] 1. pass, 0 (+0) of 1 items processed (0 %), 0.00 items/sec, 0 (+0, deadlocks:0) items dumped.
INFO [0000099E::de.hybris.platform.catalog.jalo.synchronization.CatalogVersionSyncJob] (0000099E) [CatalogVersionSyncJob] Finished synchronization in 0d 00h:00m:00s:027ms. No errors.
I suggest you to try this and let me know if you face any issue.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Arvind - I tried the code that you provided as is. Without that code I am able to sync the product successfully. With the code that you provided getting the below error.
ERROR [000021LQ::de.hybris.platform.catalog.jalo.synchronization.CatalogVersionSyncJob] (000021LQ) [CatalogVersionSyncMaster] sync ended with 1 unfinished items - see last sync media for details
INFO | jvm 1 | main | 2018/10/23 04:05:00.607 | ERROR [000021LQ::de.hybris.platform.catalog.jalo.synchronization.CatalogVersionSyncJob] (000021LQ) [CatalogVersionSyncJob] Finished synchronization in 0d 00h:00m:03s:113ms. There were errors during the synchronization!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for your quick responses. I ran your example as is with only video link and still not able to synchronize. Getting the below error.. I am trying with the 6.7 OOTB apparel product..
INFO [000000XH::de.hybris.platform.catalog.jalo.synchronization.CatalogVersionSyncJob] (000000XH) [CatalogVersionSyncCronJob] done comparing last dumps - dumps are equal
ERROR [000000XH::de.hybris.platform.catalog.jalo.synchronization.CatalogVersionSyncJob] (000000XH) [CatalogVersionSyncMaster] sync ended with 1 unfinished items - see last sync media for details
ERROR [000000XH::de.hybris.platform.catalog.jalo.synchronization.CatalogVersionSyncJob] (000000XH) [CatalogVersionSyncJob] Finished synchronization in 0d 00h:00m:00s:668ms. There were errors during the synchronization!
I am able to synchronize the product successfully without video link in the product. Still trying to figure what am I missing.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Here is the issue and the solution:
Issue: the issue was that the attribute, videoLink was uniqueKeyAttributeQualifier and at the same time, it was also localized
Solution: I just added another attribute, 'id' (it can be any name) and made it uniqueKeyAttributeQualifier. Also, since videoLink and description are localized, it is recommended to make them optional="true". That's it.
With these changes, everything worked without any issue. I have updated the code for your reference.
Thank you for your quick response. I followed your suggestions. Corrected the attributes and added video to root type. When I try to sync the product after adding video link to the product getting the below error.
ERROR [SyncWorker<00001YZM 3 of 24>] [FlexibleSearch] Flexible search error occured... ERROR [SyncWorker<00001YZM 3 of 24>] [FlexibleSearch] Query translation was not successful. ERROR [SyncWorker<00001YZM 3 of 24>] [AbstractItemCopyContext] error setting partOf attribute videos : no default language provided de.hybris.platform.jalo.flexiblesearch.FlexibleSearchException: no default language provided[HY-0] at de.hybris.platform.persistence.flexiblesearch.ParsedQuery.getDefaultLanguageValueIndex(ParsedQuery.java:319)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It was because of the localized attribute, description. After you reported the issue, I made the description localized and tested it but it failed with the same error that you have reported. So, I added an attribute language and provided the value for language while creating an instance and it worked! Please refer my code which I just updated after having tested it to be working.
I have still not been able to understand the logic behind it but you can proceed with your work and I will update here once I find the answer.

| User | Count |
|---|---|
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.