OAuth-Apis / apis

OAuth Authorization as a Service
Apache License 2.0
594 stars 301 forks source link

objectMapper.readValue issue #74

Open kumaranilgupta opened 9 years ago

kumaranilgupta commented 9 years ago

Hi ,

Getting following error when i am trying to perform this command. curl -i -v -H "Authorization: bearer 00-11-22-33" http://localhost:8082 getting below error. org.codehaus.jackson.map.JsonMappingException: Unexpected token (START_OBJECT), expected START_ARRAY: need JSON Array to contain As.WRAPPER_ARRAY type information for class org.surfnet.oaaas.model.VerifyTokenResponse at [Source: java.io.StringReader@4d5d021; line: 1, column: 1] at org.codehaus.jackson.map.JsonMappingException.from(JsonMappingException.java:163) at org.codehaus.jackson.map.deser.StdDeserializationContext.wrongTokenException(StdDeserializationContext.java:261) at org.codehaus.jackson.map.jsontype.impl.AsArrayTypeDeserializer._locateTypeId(AsArrayTypeDeserializer.java:100) at org.codehaus.jackson.map.jsontype.impl.AsArrayTypeDeserializer._deserialize(AsArrayTypeDeserializer.java:86) at org.codehaus.jackson.map.jsontype.impl.AsArrayTypeDeserializer.deserializeTypedFromObject(AsArrayTypeDeserializer.java:55) Please suggest. failing to execute this line verifyTokenResponse = objectMapper.readValue(responseString, VerifyTokenResponse.class);

Please suggest for the fix...

davidlzs commented 5 years ago

One quick fix is: update the apis-example-resource-server-war\src\test\resources\apis-resource-server.properties to set the adminService.jsonTypeInfoIncluded property to false.