Skip to Content
author's profile photo Former Member
Former Member

Adding attribute into already existing type results into runtime error

I have added an attribute to AbstractOrder. I have updated the system. But now I get following error in the hmc when i try to view that attribute: Error: object is not an instance of declaring class

Also, when I try to enter a value via code, I get following error: Argument mismatch trying to set value '0.0' for attribute de.hybris.platform.jalo.order.Cart.totalCvValue (got java.lang.Double, expected de.hybris.platform.jalo.order.AbstractOrder).",

I am using hybris 6 with HSQL DB. Follows a stack trace from console.

at de.hybris.platform.servicelayer.internal.model.impl.wrapper.ModelWrapper.invokeValidateInterceptors(ModelWrapper.java:284) ~[coreserver.jar:?] at de.hybris.platform.servicelayer.internal.model.impl.wrapper.ModelWrapper.validate(ModelWrapper.java:217) ~[coreserver.jar:?] at de.hybris.platform.servicelayer.internal.model.extractor.impl.DefaultModelExtractor.process(DefaultModelExtractor.java:58) ~[coreserver.jar:?] at de.hybris.platform.servicelayer.internal.model.impl.DefaultModelService.performPersistenceOperations(DefaultModelService.java:694) ~[coreserver.jar:?] at de.hybris.platform.servicelayer.internal.model.impl.DefaultModelService.saveAllInternal(DefaultModelService.java:689) ~[coreserver.jar:?] at de.hybris.platform.servicelayer.internal.model.impl.DefaultModelService.saveAll(DefaultModelService.java:669) ~[coreserver.jar:?] at de.hybris.platform.servicelayer.internal.model.impl.DefaultModelService.saveAll(DefaultModelService.java:624) ~[coreserver.jar:?] at de.hybris.platform.servicelayer.hmc.ServicelayerHMCCreateAction.create(ServicelayerHMCCreateAction.java:126) [ServicelayerHMCCreateAction.class:?] at de.hybris.platform.hmc.util.action.CreateAction.perform(CreateAction.java:194) [CreateAction.class:?] at de.hybris.platform.hmc.generic.organizer.OrganizerItemCreatorChip.performSave(OrganizerItemCreatorChip.java:119) [OrganizerItemCreatorChip.class:?] at de.hybris.platform.hmc.ItemChip.save(ItemChip.java:222) [ItemChip.class:?] at de.hybris.platform.hmc.generic.organizer.OrganizerCreatorSaveAndCopyToolbarActionChip.perform(OrganizerCreatorSaveAndCopyToolbarActionChip.java:47) [Org at de.hybris.platform.hmc.AbstractToolbarActionChip.processEvents(AbstractToolbarActionChip.java:129) [AbstractToolbarActionChip.class:?] at de.hybris.platform.hmc.webchips.DisplayState.dispatchEvents(DisplayState.java:632) [DisplayState.class:?] at de.hybris.platform.hmc.webchips.DisplayState.extractEventsFromParameters(DisplayState.java:441) [DisplayState.class:?] at de.hybris.platform.hmc.webchips.DisplayState.processEvents(DisplayState.java:352) [DisplayState.class:?] at de.hybris.platform.hmc.webchips.MasterServlet.process(MasterServlet.java:193) [MasterServlet.class:?] at de.hybris.platform.hmc.webchips.MasterServlet.doPost(MasterServlet.java:82) [MasterServlet.class:?] at javax.servlet.http.HttpServlet.service(HttpServlet.java:646) [servlet-api.jar:?] at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) [servlet-api.jar:?] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) [catalina.jar:7.0.59] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) [catalina.jar:7.0.59] at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) [tomcat7-websocket.jar:7.0.59] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) [catalina.jar:7.0.59] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) [catalina.jar:7.0.59]

 This is the items.xml
 
 <itemtype code="AbstractOrder" autocreate="false"
                 generate="false">
                 <attributes>
                     <attribute qualifier="totalPvValue" type="java.lang.Double">
                         <description>Contains the total PSV amount for the order</description>
                         <persistence type="property">
                             <columntype>
                                 <value>java.math.BigDecimal</value>
                             </columntype>
                         </persistence>
                         <modifiers read="true" write="true" search="false"
                             optional="true" />
                     </attribute>
                     <attribute qualifier="totalCvValue" type="java.lang.Double">
                         <description>Contains the total CSV amount for the order</description>
                         <persistence type="property">
                             <columntype>
                                 <value>java.math.BigDecimal</value>
                             </columntype>
                         </persistence>
                         <modifiers read="true" write="true" search="false"
                             optional="true" />
                     </attribute>
                 </attributes>
             </itemtype>
Add a comment
10|10000 characters needed characters exceeded

Related questions

0 Answers

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.