Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 906439
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T16:23:24+00:00 2026-05-15T16:23:24+00:00

I can’t understand propperly the error I get when I run this code: InputStream

  • 0

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.path.parser.JSon.Parser(JSon.java:65)
at
com.path.parser.JSon.main(JSon.java:29)

What does it mean??

Maybe if I know this, I could find out my error.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T16:23:24+00:00Added an answer on May 15, 2026 at 4:23 pm

    Your problem is the last line:

    MetadataContentBean.class.getClass()
    

    This means “get me the Class object for the MetadataContentBean class, and then get me the Class object for that Class object”…. if you see what I mean. So you’re asking Jackson to deserialize your JSON onto a Class object, which it doesn’t know how to do.

    This should be just

    MetadataContentBean.class
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can find why i get this error can someone help? package Android.data; public class
Can I run this in a Windows command prompt like I can run it
can someone explain why the compiler accepts only this code template<typename L, size_t offset,
Does anyone know how can I replace this 2 symbol below from the string
Can i get the source code for a WAMP stack installer somewhere? Any help
Can someone please tell me why this wont work? I am getting error preg_match_all():
Can I change the field public virtual ClassOne ClassOne { get; set; } to
Can any one tell, how to get the result of LINQ query contains group
Can someone thoroughly explain the last line of the following code: def myMethod(self): #
Can anyone explain to me why this program: for(float i = -1; i <

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.