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 892045
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T13:59:18+00:00 2026-05-15T13:59:18+00:00

HI! I am working with a .json file, like this: [{ SourceFile: videos/KobeAlleyOop.flv, ExifTool:

  • 0

HI!

I am working with a .json file, like this:

[{  
  "SourceFile": "videos/KobeAlleyOop.flv",  
  "ExifTool": {  
    "ExifToolVersion": 8.22,  
    "Warning": "Truncated 'mdat' data"  
  },  
  "System": {  
    "FileName": "KobeAlleyOop.flv",  
    "Directory": "videos",  
    "FileSize": "4.8 MB",  
    "FileModifyDate": "2010:06:15 14:57:24+02:00",  
    "FilePermissions": "rwxr-xr-x"  
  },  
  "File": {  
    "FileType": "MP4",  
    "MIMEType": "video/mp4"  
  }]  

I made a Bean with 3 components:

 public class MetadataContentBean {   
 SourceFileBean sourceFileBean;  
     FileBean fileBean;    
     SystemBean systemBean;   

     public FileBean getFileBean() {   return fileBean;  }   
 @JsonProperty("File")    
public void setFileBean(FileBean fileBean) {    
 this.fileBean = fileBean;    }   
 public SystemBean getSystemBean() {   
 return systemBean;    }   
 @JsonProperty("System")    
public void setSystemBean(SystemBean systemBean) {
 this.systemBean = systemBean;    }   
 public SourceFileBean
 getSourceFileBean() {    
 sourceFileBean.getSource();     return
 sourceFileBean;    }     
 @JsonProperty("SourceFile")    
public void setSourceFileBean(SourceFileBean
 sourceFileBean) {    
 this.sourceFileBean = sourceFileBean; 
 }   }

And I add an example of SourceFileBean, the others are similar:

public class SourceFileBean {

 private String source;
 public String getSource() {
  return source;
 }
 @JsonProperty("SourceFile")
 public void setSource(String source) {
  this.source = source;
 }
}

In the main program I make this call:

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);

But I get this error when I run it, I don’t know why:

org.codehaus.jackson.map.JsonMappingException:
Can not construct instance of
com.path.bean.SourceFileBean,
problem: no suitable creator method
found at [Source:
java.io.StringReader@12d7a10; line: 1,
column: 2] at
org.codehaus.jackson.map.JsonMappingException.from(JsonMappingException.java:159)
at
org.codehaus.jackson.map.deser.StdDeserializationContext.instantiationException(StdDeserializationContext.java:212)
at
org.codehaus.jackson.map.deser.BeanDeserializer.deserializeFromString(BeanDeserializer.java:415)
at
org.codehaus.jackson.map.deser.BeanDeserializer.deserialize(BeanDeserializer.java:291)
at
org.codehaus.jackson.map.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:135)
at
org.codehaus.jackson.map.deser.SettableBeanProperty$MethodProperty.deserializeAndSet(SettableBeanProperty.java:221)
at
org.codehaus.jackson.map.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:390)
at
org.codehaus.jackson.map.deser.BeanDeserializer.deserialize(BeanDeserializer.java:286)
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)

Any help?? Thanks in advance!

  • 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-15T13:59:18+00:00Added an answer on May 15, 2026 at 1:59 pm

    The problem was about sintaxis and the way of writting the fields in my program.
    You must be absotuely sure that it is the SAME as in the json file.

    On the other hand

    “SourceFile”: “videos/KobeAlleyOop.flv”

    is a field with just one field, so is not neccesary make a bean for it.

    It is a stupid error which could make you waist a lot of time!!! :s

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My form action is set to a php file like this: <form name=addstudent action=includes/data.php?act=enquiry
The App that I'm working on requires to parse a very big Json file
When working with JSON, I can use NuGet to add JSON.Net and this allows
I am working with JSON. when I am Passing data for serialization at that
i am working with JSON to send data to and from my server ,
I am trying to get an event calendar working from json data. I just
I'm working on a JSON API and I want to do something like Facebook's
The app I am working on needs to read a JSON file that may
I'm submitting JSON data to a server. The server generates a PDF file and
I'm currently working on a small application that works like this: When the user

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.