I can't understand propperly the error I get when I run this code:
InputStream is = this.getClass().getClassLoader().getResourceAsStream(filename);
String jsonTxt = IOUtils.toString(is);
JSONArray json = (JSONArray) JSONSerializer.toJSON(jsonTxt);
JSONObject metadatacontent = json.getJSONObject(0);
ObjectMapper mapper = new ObjectMapper();
mapper.readValue(metadatacontent.toString(), MetadataContentBean.class.getClass());
Error:
org.codehaus.jackson.map.JsonMappingException: Can not deserialize instance of java.lang.Class out of START_OBJECT token at [Source: java.io.StringReader@e3b895; line: 1, column: 1] at org.codehaus.jackson.map.JsonMappingException.from(JsonMappingException.java:159) at org.codehaus.jackson.map.deser.StdDeserializationContext.mappingException(StdDeserializationContext.java:192) at org.codehaus.jackson.map.deser.StdDeserializer$ClassDeserializer.deserialize(StdDeserializer.java:439) at org.codehaus.jackson.map.deser.StdDeserializer$ClassDeserializer.deserialize(StdDeserializer.java:421) at org.codehaus.jackson.map.ObjectMapper._readMapAndClose(ObjectMapper.java:1588) at org.codehaus.jackson.map.ObjectMapper.readValue(ObjectMapper.java:1116) at com.playence.parser.JSon.Parser(JSon.java:65) at com.playence.parser.JSon.main(JSon.java:29)
What does it mean??
Maybe if I know this, I could find out my error.