on 2016 Mar 09 5:59 AM
Hi
I am getting an exception while doing ant all when migrating from 4.7 to 5.0. It is because 'SavedValueEntriesRelation' has now moved to core from hmc extension. Below is an exception. What is the best way to resolve this considering we have a live site working perfectly on 4.7
java.lang.IllegalArgumentException: cannot merge namespace ((hmc)) into (()) due to duplicate type code 'savedvalueentriesrelation' : SavedValueEntriesRelation::((hmc))::YRelation[hmc-items.xml:54(RelationTypeTagListener)]<>SavedValueEntriesRelation::((core))::YRelation[core-items.xml:322(RelationTypeTagListener)] at de.hybris.bootstrap.typesystem.YNamespace.mergeNamespace(YNamespace.java:158) at de.hybris.bootstrap.typesystem.YTypeSystem.mergeNamespaces(YTypeSystem.java:85) at de.hybris.bootstrap.typesystem.YTypeSystem.finalizeTypeSystem(YTypeSystem.java:76) at de.hybris.bootstrap.typesystem.YTypeSystemLoader.finish(YTypeSystemLoader.java:593) at de.hybris.bootstrap.codegenerator.CodeGenerator.readTypeSystem(CodeGenerator.java:289) at de.hybris.bootstrap.codegenerator.CodeGenerator.getTypeSystem(CodeGenerator.java:90) at de.hybris.bootstrap.codegenerator.jalo.JaloClassGenerator.generateClasses(JaloClassGenerator.java:50) at de.hybris.bootstrap.codegenerator.CodeGenerator.generateJaloClasses(CodeGenerator.java:228) at de.hybris.bootstrap.codegenerator.CodeGenerator.generate(CodeGenerator.java:200) at de.hybris.bootstrap.codegenerator.CodeGenerator.generate(CodeGenerator.java:447) at de.hybris.ant.taskdefs.compiling.CodeGeneratorTask.execute(CodeGeneratorTask.java:31) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292) at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106) at org.apache.tools.ant.Task.perform(Task.java:348) at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68) at net.sf.antcontrib.logic.IfTask.execute(IfTask.java:197) at sun.reflect.GeneratedMethodAccessor23.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106) at org.apache.tools.ant.TaskAdapter.execute(TaskAdapter.java:154) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292) at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106) at org.apache.tools.ant.Task.perform(Task.java:348) at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292) at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106) at org.apache.tools.ant.Task.perform(Task.java:348) at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:396) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292) at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106) at org.apache.tools.ant.Task.perform(Task.java:348) at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292) at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106) at org.apache.tools.ant.Task.perform(Task.java:348) at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:396) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292) at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106) at org.apache.tools.ant.Task.perform(Task.java:348) at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292) at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106) at org.apache.tools.ant.Task.perform(Task.java:348) at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:396) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292) at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106) at org.apache.tools.ant.Task.perform(Task.java:348) at org.apache.tools.ant.Target.execute(Target.java:435) at org.apache.tools.ant.Target.performTasks(Target.java:456) at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393) at org.apache.tools.ant.Project.executeTarget(Project.java:1364) at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41) at org.apache.tools.ant.Project.executeTargets(Project.java:1248) at org.apache.tools.ant.Main.runBuild(Main.java:851) at org.apache.tools.ant.Main.startAnt(Main.java:235) at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280) at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
this is how we solved it.
1) Query the Composed type table which holds all many-to-many relation types.
select * from COMPOSEDTYPES where INTERNALCODE = <your-type-here>
. Copy the data and save it in a file.
2) Look at the ITEMJNDINAME column in the result set returned by this query. Let us assume the JNDI name is de.hybris.platform.persistence.link.Link.
3) This means all data related to these types are stored in the Links table. Removing these relations from -items.xml will have no effect. On running system update, Hybris picks up the old deployment table(de.hybris.platform.persistence.link.Link) based on the JNDI name.
4) We need to remove these entries from the ComposedType table by executing the query below.
delete from COMPOSEDTYPES where INTERNALCODE = <your-type-here>
5) Perform step-1 to double check if entries have been deleted from this table.
6) Now change your items.xml file and add deployment table for these many-to-many types.
7) Run ant clean all and start hybris server, followed by system update
😎 At this time, run step-1 again to see the JNDI name of the result set, it should have changed to de.hybris.platform.persistence.link.<your-ext-here>
_<your-type-here>
9) Now use below query to update PKs of many-to-many relations. Copy the PK from the backup file saved in step-1
10) update COMPOSEDTYPES set pk= where INTERNALCODE= <your-type-here>
11) Once done, run a system-update again
12) All select & insert operations should now be performed on new deployment tables. Run an impex to verify.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
13 | |
1 | |
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.