Getting error while creating Structures for Json in Hierachical Mapper.

Highlighted
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

Talend Cloud Developer Series – Fetching Studio License

This video will help someone new to using Talend Studio get started by connecting to Talend Cloud and fetching the Studio License

Watch Now

Talend Cloud Developer Series - Introduction

The Talend Cloud Developer Series was created to give you a solid foundational understanding of Talend’s Cloud Integration Platform

Watch Now

Talend Cloud Available on Microsoft Azure

An integration platform-as-a-serviceto help enterprises collect, govern, transform, and share data from any data sources

Watch Now