Getting error while creating Structures for Json in Hierachical Mapper.

Forteen Stars

Getting error while creating Structures for Json in Hierachical Mapper.

Hi ,

I am getting below error while creating Structures for Json in Hierachical Mapper. 

Overall:Error
1: Error - An exception occurred parsing the document being imported. (15)
Exception: java.lang.ClassCastException: java.lang.String cannot be cast to com.oaklandsw.transform.rep.json.tokener.JSONObject
at com.oaklandsw.transform.rep.json.tokener.JSONTokenTool.aggregate(JSONTokenTool.java:41)
at com.oaklandsw.transform.rep.json.tokener.JSONArray.getTypicalElement(JSONArray.java:1213)
at com.oaklandsw.transform.rep.json.JsonTokenImporter.readJsonArray(JsonTokenImporter.java:95)
at com.oaklandsw.transform.rep.json.JsonTokenImporter.readJsonObject(JsonTokenImporter.java:80)
at com.oaklandsw.transform.rep.json.JsonTokenImporter.readJsonArray(JsonTokenImporter.java:110)
at com.oaklandsw.transform.rep.json.JsonTokenImporter.readJsonObject(JsonTokenImporter.java:80)
at com.oaklandsw.transform.rep.json.JsonTokenImporter.parseSubclass(JsonTokenImporter.java:54)
at com.oaklandsw.transform.rep.AbstractFileReader.parse(AbstractFileReader.java:122)
at com.oaklandsw.util.AbstractXmlReader.parse(AbstractXmlReader.java:69)
at com.oaklandsw.transform.importing.Importer.doImportParse(Importer.java:991)
at com.oaklandsw.transform.rep.json.JsonSampleImporter.doImportSubclass(JsonSampleImporter.java:55)
at com.oaklandsw.transform.importing.Importer.doImport(Importer.java:884)
at com.oaklandsw.transform.importing.Importer.run(Importer.java:787)
at com.oaklandsw.transform.importing.ImportWizard$ImporterRunner.run(ImportWizard.java:407)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:122)

Manohar B
Don't forget to give kudos/accept the solution when a replay is helpful.

Accepted Solutions
Forteen Stars

Re: Getting error while creating Structures for Json in Hierachical Mapper.

I have fixed this error by creating structures.

Manohar B
Don't forget to give kudos/accept the solution when a replay is helpful.

All Replies
Employee

Re: Getting error while creating Structures for Json in Hierachical Mapper.

Please share your steps and if possible your project.

Forteen Stars

Re: Getting error while creating Structures for Json in Hierachical Mapper.

@hnie , I need to convert complex xml into Json and trying to use tHMap.

 

my job looks like below.

 

tfilinputxml-->tHMap--->tFileoutputRaw. where i need to know the configuration details for tHMap.

 

Manohar B
Don't forget to give kudos/accept the solution when a replay is helpful.
Employee

Re: Getting error while creating Structures for Json in Hierachical Mapper.

Hi,

can you please send us a part from your xml and how the json file should be?

 

Forteen Stars

Re: Getting error while creating Structures for Json in Hierachical Mapper.

I have fixed this error by creating structures.

Manohar B
Don't forget to give kudos/accept the solution when a replay is helpful.

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Self-service Talend Migration: Moving from On-Premises to the Cloud

Move from On-Premises to the Cloud by following the advice of experts

Read Now

Modern Data Engineering in the Cloud

Learn about modern data engineering in the Cloud

Watch Now

How to deploy Talend Jobs as Docker images to Amazon, Azure and Google Cloud reg...

Learn how to deploy Talend Jobs as Docker images to Amazon, Azure and Google Cloud registries

Blog