Closed vivinjoseph9 closed 6 years ago
This issue seems to have been opened against the wrong project perhaps?
Agreed. @vivinjoseph9 can you please open this issue up against the project that owns that code? I'm assuming its some Spring project. This repo is just for OSB API "specification" issues, not implementation issues.
hi all,
I am getting the below error:
org.springframework.http.converter.HttpMessageConversionException: Type definition error: [simple type, class org.springframework.cloud.servicebroker.model.catalog.Catalog]; nested exception is com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot construct instance of
org.springframework.cloud.servicebroker.model.catalog.Catalog
(no Creators, like default construct, exist): cannot deserialize from Object value (no delegate- or property-based Creator) at [Source: (PushbackInputStream); line: 1, column: 2] at org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter.readJavaType(AbstractJackson2HttpMessageConverter.java:238) at org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter.read(AbstractJackson2HttpMessageConverter.java:223) at org.springframework.web.client.HttpMessageConverterExtractor.extractData(HttpMessageConverterExtractor.java:100) at org.springframework.web.client.RestTemplate$ResponseEntityResponseExtractor.extractData(RestTemplate.java:991) at org.springframework.web.client.RestTemplate$ResponseEntityResponseExtractor.extractData(RestTemplate.java:974) .... .... ..AND
for the above call in my test, the call is successful and the reponse is obtained, then this response is deserialized from json to java. that is where the error is thrown
Previously this used to work because the classes given in the expected response type(Catalog - package org.springframework.cloud.servicebroker.model.catalog; , CreateServiceInstanceResponse - package org.springframework.cloud.servicebroker.model.instance; etc) had default constructors, however after the migration to the builder pattern the rest call throws a type definition error, due to the lack of a default constructor which it is looking for.
I tried migrating to the latest jackson version, to see if that could resolve the issue , but it dint help. This problem is specific to the classes that have migrated to the builder pattern.
Please do let me know if anyone has come across this , or atleast has a workaround for this problem.
Thanks in advance.
Vivin.