jbossdemocentral/coolstore-microservice

The ShoppingCart has had an extra field added to the Cart service, but not the coolstore-gw service

mikecroft opened this issue · 0 comments

The application is currently broken because there is an extra ShoppingCart field being returned to the gateway Camel route, causing an unmarshalling error:

16:11:53.241 [http-nio-0.0.0.0-8080-exec-8] ERROR o.a.c.processor.DefaultErrorHandler - Failed delivery for (MessageId: ID-coolstore-gw-1-vmsr8-40203-1534519748501-0-40 on ExchangeId: ID-coolstore-gw-1-vmsr8-40203-1534519748501-0-3). Exhau
 at [Source: org.apache.camel.converter.stream.CachedOutputStream$WrappedInputStream@58d7d644; line: 1, column: 122] (through reference chain: com.redhat.coolstore.api_gateway.model.ShoppingCart["cartId"])
Message History
---------------------------------------------------------------------------------------------------------------------------------------
RouteId              ProcessorId          Processor                                                                        Elapsed (ms)
[getCartRoute      ] [getCartRoute      ] [servlet:/cart/%7BcartId%7D?httpMethodRestrict=GET                             ] [      1535]
[getCartRoute      ] [restBinding4      ] [                                                                              ] [         7]  
[getCartRoute      ] [Cart Service (Get ] [hystrix                                                                       ] [      1469]
[getCartRoute      ] [removeHeaders6    ] [removeHeaders[CamelHttp*]                                                     ] [         0]  
[getCartRoute      ] [setBody6          ] [setBody[simple{Simple: null}]                                                 ] [        10] 
[getCartRoute      ] [setHeader15       ] [setHeader[CamelHttpMethod]                                                    ] [         0]  
[getCartRoute      ] [setHeader16       ] [setHeader[CamelHttpUri]                                                       ] [        11] 
[getCartRoute      ] [to13              ] [http4://DUMMY                                                                 ] [      1049]
[getCartRoute      ] [setHeader18       ] [setHeader[CamelJacksonUnmarshalType]                                          ] [        14] 
[getCartRoute      ] [getCartRoute      ] [unmarshal[org.apache.camel.model.dataformat.JsonDataFormat@5511e791]          ] [        39] 
Stacktrace
---------------------------------------------------------------------------------------------------------------------------------------
com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "cartId" (class com.redhat.coolstore.api_gateway.model.ShoppingCart), not marked as ignorable (6 known properties: "cartItemTotal", "cartTotal", "shipping
 at [Source: org.apache.camel.converter.stream.CachedOutputStream$WrappedInputStream@58d7d644; line: 1, column: 122] (through reference chain: com.redhat.coolstore.api_gateway.model.ShoppingCart["cartId"])
    at com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException.from(UnrecognizedPropertyException.java:62)
    at com.fasterxml.jackson.databind.DeserializationContext.handleUnknownProperty(DeserializationContext.java:834)
    at com.fasterxml.jackson.databind.deser.std.StdDeserializer.handleUnknownProperty(StdDeserializer.java:1096)

It looks like it was caused by the commit to add JDG support:
https://github.com/jbossdemocentral/coolstore-microservice/blame/stable-ocp-3.9/cart-service/src/main/java/com/redhat/coolstore/model/kie/ShoppingCart.java#L20-L21