SHARE
TWEET

Untitled

a guest Nov 7th, 2019 9 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. org.springframework.web.client.RestClientException: Error while extracting response for type [class [Lcom.kodilla.travel.dto.WeatherDto;] and content type [application/json;charset=utf-8]; nested exception is org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: Cannot deserialize instance of `com.kodilla.travel.dto.WeatherDto[]` out of START_OBJECT token; nested exception is com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance of `com.kodilla.travel.dto.WeatherDto[]` out of START_OBJECT token
  2.  at [Source: (PushbackInputStream); line: 1, column: 1]
  3.  
  4.     at org.springframework.web.client.HttpMessageConverterExtractor.extractData(HttpMessageConverterExtractor.java:117)
  5.     at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:737)
  6.     at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:710)
  7.     at org.springframework.web.client.RestTemplate.getForObject(RestTemplate.java:329)
  8.     at com.kodilla.travel.weatherbit.WeatherbitClient.getForecast(WeatherbitClient.java:40)
  9.     at com.kodilla.travel.weatherbit.WeatherBitTestSuite.testGetLongForecast(WeatherBitTestSuite.java:26)
  10.     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  11.     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  12.     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  13.     at java.lang.reflect.Method.invoke(Method.java:498)
  14.     at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
  15.     at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
  16.     at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
  17.     at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
  18.     at org.springframework.test.context.junit4.statements.RunBeforeTestExecutionCallbacks.evaluate(RunBeforeTestExecutionCallbacks.java:74)
  19.     at org.springframework.test.context.junit4.statements.RunAfterTestExecutionCallbacks.evaluate(RunAfterTestExecutionCallbacks.java:84)
  20.     at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:75)
  21.     at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:86)
  22.     at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:84)
  23.     at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
  24.     at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:251)
  25.     at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:97)
  26.     at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
  27.     at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
  28.     at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
  29.     at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
  30.     at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
  31.     at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
  32.     at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
  33.     at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
  34.     at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:190)
  35.     at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
  36.     at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
  37.     at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
  38.     at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
  39.     at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
  40. Caused by: org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: Cannot deserialize instance of `com.kodilla.travel.dto.WeatherDto[]` out of START_OBJECT token; nested exception is com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance of `com.kodilla.travel.dto.WeatherDto[]` out of START_OBJECT token
  41.  at [Source: (PushbackInputStream); line: 1, column: 1]
  42.     at org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter.readJavaType(AbstractJackson2HttpMessageConverter.java:245)
  43.     at org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter.read(AbstractJackson2HttpMessageConverter.java:227)
  44.     at org.springframework.web.client.HttpMessageConverterExtractor.extractData(HttpMessageConverterExtractor.java:102)
  45.     ... 35 more
  46. Caused by: com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance of `com.kodilla.travel.dto.WeatherDto[]` out of START_OBJECT token
  47.  at [Source: (PushbackInputStream); line: 1, column: 1]
  48.     at com.fasterxml.jackson.databind.exc.MismatchedInputException.from(MismatchedInputException.java:63)
  49.     at com.fasterxml.jackson.databind.DeserializationContext.reportInputMismatch(DeserializationContext.java:1343)
  50.     at com.fasterxml.jackson.databind.DeserializationContext.handleUnexpectedToken(DeserializationContext.java:1139)
  51.     at com.fasterxml.jackson.databind.DeserializationContext.handleUnexpectedToken(DeserializationContext.java:1093)
  52.     at com.fasterxml.jackson.databind.deser.std.ObjectArrayDeserializer.handleNonArray(ObjectArrayDeserializer.java:330)
  53.     at com.fasterxml.jackson.databind.deser.std.ObjectArrayDeserializer.deserialize(ObjectArrayDeserializer.java:175)
  54.     at com.fasterxml.jackson.databind.deser.std.ObjectArrayDeserializer.deserialize(ObjectArrayDeserializer.java:21)
  55.     at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4013)
  56.     at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3084)
  57.     at org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter.readJavaType(AbstractJackson2HttpMessageConverter.java:239)
  58.     ... 37 more
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top