Getting error while creating Structures for Json in Hierachical Mapper.

Highlighted
Moderator

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 when a reply is helpful and click Accept the solution when you think you're good with it.

Accepted Solutions
Highlighted
Moderator

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 when a reply is helpful and click Accept the solution when you think you're good with it.

View solution in original post


All Replies
Highlighted
Employee

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

Please share your steps and if possible your project.

Highlighted
Moderator

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 when a reply is helpful and click Accept the solution when you think you're good with it.
Highlighted
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?

 

Highlighted
Moderator

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 when a reply is helpful and click Accept the solution when you think you're good with it.

View solution in original post

2019 GARTNER 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

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

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