org.springframework.beans.factory.BeanCreationException: Error creating bean with name…
- User
org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘readConfigFile’ defined in class path resource [com/mediaworld/apimanager/configuration/onstart/RoutingElementConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.mediaworld.apimanager.models.routingElement.RoutingElement]: Factory method ‘readConfigFile’ threw exception; nested exception is java.lang.RuntimeException: com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field “routingElement” (class com.mediaworld.apimanager.models.routingElement.RoutingElement), not marked as ignorable (7 known properties: “response”, “accessList”, “backend”, “apiName”, “throttling”, “uri”, “request”])
this is the json i read: { “routingElement”: { “apiName”: “doSelectSalesDocument”, “uri”: “/Services/ServiceFacade/Impl/SalesDocManagement/v1”, “request”: { “type”: “SOAP”, “method”: “POST”, “bodyContent”: “XML” }, “backend”: { “requestType”: “SOAP”, “binding”: “JMS”, “jms”: { “destinationType”: “QUEUE”, “destinationName”: “ms.Retail.Gateway.OP.GAT01.JMS01TibcoSOAP.BDM.SRC.doSelectSalesDocument” } }, “accessList”: { “accessType”: “noSecurity” }, “response”: { “type”: “SOAP”, “bodyContent”: “XML” }, “throttling”: { “rate”: 5000, “seconds”: 10 } }
}
this is my pojo class which i map with objectmapper starting from the json string: package com.mediaworld.apimanager.models.routingElement;
import lombok.Data;
@Data public class RoutingElement { private String apiName; private String uri; private Request request; private Backend backend; private AccessList accessList; private Response response; private Throttling throttling; }
- Assistant
import lombok.Data;
@Data public class RoutingElement { private String apiName; private String uri; private Request request; private Backend backend; private AccessList accessList; private Response response; private Throttling throttling; }
@Data public class Request { private String type; private String method; private String bodyContent; }
@Data public class Backend { private String requestType; private String binding; private Jms jms; }
@Data public class Jms { private String destinationType; private String destinationName; }
@Data public class AccessList { private String accessType; }
@Data public class Response { private String type; private String bodyContent; }
@Data public class Throttling { private int rate; private int seconds; }