cancel
Showing results for 
Search instead for 
Did you mean: 

Duplicate deployment code

former_member610796
Discoverer
0 Kudos

Hi all,

For one of our projects we have an issue at this moment. It started as a B2C platform. When they were defining their itemtypes, they also provided the deployments in the items.xml. However, they used deployment typecodes which are used in the B2B extensions.

         <itemtype code="CustomStockLevel" generate="true" autocreate="true">
             <deployment table="CustomStockLevel" typecode="10037"/>
             <attributes>
                 <attribute qualifier="productCode" type="java.lang.String">
                     <persistence type="property"/>
                     <modifiers read="true" write="true" optional="false"/>
                 </attribute>
                 ...
             </attributes>
         </itemtype> 

Until this moment, this wasn't an issue, but now they need to enable the B2B accelerator on the same platform, which means we need to enable several new extensions... When we enable the 'b2bcommerce' extension, we get the following error during the build:

 java.lang.IllegalArgumentException: cannot merge namespace ((customcore)) into ((<merged>)) due to duplicate deployment code '10037' : de.hybris.platform.persistence.customcore_CustomStockLevel::((customcore))::YDeployment[customcore-items.xml:2037(ItemTypeTagListener)]<>de.hybris.platform.persistence.b2bcommerce_B2BQuoteLimit::((b2bcommerce))::YDeployment[b2bcommerce-items.xml:489(ItemTypeTagListener)]

Any idea's how to solve this? Just changing the typecode will not work...

Accepted Solutions (1)

Accepted Solutions (1)

andyfletcher
Active Contributor
0 Kudos

It's a bit of a pain to do. It's a while since I've needed to do it but I remember the process being like this:

  • export all instances of your custom type using impex (script generator helps here, not exporting pk)

  • delete all instances

  • delete the type in the hmc

  • stop the server

  • drop the table directly in the db

  • change the typecode

  • build

  • start server

  • run system update to recreate the type with the new typecode

  • import your previously exported data

You are correct on your comment about the PK containing the typecode. They are the 15 least significant bits of a pk. Have a look at the pk analyser in the administration console to see how it breaks down. Strangely it seems to label the 16 most significant bits as the typecode but you can see for example that SolrIndexedType has typecode 2207 and the 15 least significant bits are 000100010011111

I knew I'd written about this before... https://wiki.hybris.com/display/forum/Maximum+limit+for+typecodes+in+Hybris?focusedCommentId=2005429...

Answers (1)

Answers (1)

0019187810
Explorer
0 Kudos

Indeed, changing the typecode alone is not enough. I think that you might need to migrate the table into a new one, since the table will not be removed in the DB when you change the typecode.

You might also want to take a look at YDeployment, the tables are mapped to the typecodes there.

former_member610796
Discoverer
0 Kudos

Yeah, found that already. But the tables are correct, it's just the typeCodes which is the problem.

Won't we have a problem with the PK's if we change the typecode?

0019187810
Explorer
0 Kudos

I'm not sure if it will provide a problem with the PK's. I never had to perform such an operation.