Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

txmlMAp issue: java.lang.RuntimeException: row1.body can't be empty

I am using a tRestclient component which returns xml response. I am using tXMLMap to parse the xml. After defining the input structure i am gettting this issue. See below for my job. I am able to get response from rest client but tXMLMAP gives this error. Please see all screenshots below:

 

 

0683p000009LzWT.png0683p000009LzWY.jpg0683p000009LzAJ.png

Labels (3)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

I'm assuming the data comes back as an XML String. If that is the case an easy way to solve this is to simply place a tConvertType component after your tRestClient component and convert the String to a Document. Then pass the String as a Document to your tXMLMap component. You could add a tMap after the tConvertType and simply move the String Document to output as the Body column if you want to keep it logical. This will be caused by the service you are calling and there is likely a way to force it to send back an XML document. However since I do not know or have access to your service, this is the easiest way of solving your issue 🙂

View solution in original post

9 Replies
Anonymous
Not applicable
Author

Place a tLogRow after your tRestClient and look at the data. Set the tLogRow to show the data "Vertical" mode. I suspect your data is coming back in the String column and not the Body column.

Anonymous
Not applicable
Author

Yes it comes back in string column. How do I process that. If I select 'covert response to dom document' checkbox in advanced settings i don't get any error but no data gets transferred also.
Anonymous
Not applicable
Author

I'm assuming the data comes back as an XML String. If that is the case an easy way to solve this is to simply place a tConvertType component after your tRestClient component and convert the String to a Document. Then pass the String as a Document to your tXMLMap component. You could add a tMap after the tConvertType and simply move the String Document to output as the Body column if you want to keep it logical. This will be caused by the service you are calling and there is likely a way to force it to send back an XML document. However since I do not know or have access to your service, this is the easiest way of solving your issue 🙂

Anonymous
Not applicable
Author

Did this resolve your issue?

Anonymous
Not applicable
Author

Getting a response from tRestClient properly as shown below but facing the same "txmlMAp issue: java.lang.RuntimeException: row1.body can't be empty" Issue

0683p000009M5ts.jpg

Tried the string to document part but it didn't work.

Any other possible way of resolving this issue?

nfz11
Creator III
Creator III

The solution that @rhall suggested should work using tConvertType.  You may have something configured incorrectly.

 

See the output of my test job:

 

Starting job TestXmlBodyToMap at 21:15 13/06/2019.

[statistics] connecting to socket on port 3807
[statistics] connected
.----------------------------------------------------------------------------------------------------------------------------------------------------------.
|                                                                      #1. tLogRow_1                                                                       |
+--------+-------------------------------------------------------------------------------------------------------------------------------------------------+
| key    | value                                                                                                                                           |
+--------+-------------------------------------------------------------------------------------------------------------------------------------------------+
| string | <?xml version="1.0" encoding="UTF-8"?><people><person><id>1</id><name>Bob</name></person><person><id>2</id><name>Sally</name></person></people> |
+--------+-------------------------------------------------------------------------------------------------------------------------------------------------+

.--------------.
|#1. tLogRow_2 |
+------+-------+
| key  | value |
+------+-------+
| id   | 1     |
| name | Bob   |
+------+-------+

.--------------.
|#2. tLogRow_2 |
+------+-------+
| key  | value |
+------+-------+
| id   | 2     |
| name | Sally |
+------+-------+

[statistics] disconnected

Job TestXmlBodyToMap ended at 21:15 13/06/2019. [exit code=0]

and the screenshot of the job showing the details of the tConvertType component:

 

0683p000009M5tx.png

I am also attaching the export of my test project in case you want to look at all the details.


TestXmlBodyToMap.zip
Anonymous
Not applicable
Author

Thank you so much for the Test Job. I found out the issue.

Appreciate your help. 

 

Anonymous
Not applicable
Author

Hi There,

 

I just need very quick help , which I am trying to fetch the records from rest getting an issue as below.

 

[statistics] connecting to socket on port 3487
[statistics] connected
Exception in component tXMLMap_1_TXMLMAP_OUT (Test_Job_1)
java.lang.RuntimeException: row3.string can't be empty
at bat_integration.test_job_1_0_1.Test_Job_1.tRESTClient_1Process(Test_Job_1.java:1923)
at bat_integration.test_job_1_0_1.Test_Job_1.runJobInTOS(Test_Job_1.java:2883)
at bat_integration.test_job_1_0_1.Test_Job_1.main(Test_Job_1.java:2709)
[FATAL]: bat_integration.test_job_1_0_1.Test_Job_1 - tXMLMap_1_TXMLMAP_OUT row3.string can't be empty
java.lang.RuntimeException: row3.string can't be empty
at bat_integration.test_job_1_0_1.Test_Job_1.tRESTClient_1Process(Test_Job_1.java:1923)
at bat_integration.test_job_1_0_1.Test_Job_1.runJobInTOS(Test_Job_1.java:2883)
at bat_integration.test_job_1_0_1.Test_Job_1.main(Test_Job_1.java:2709)
[statistics] disconnected

Job Test_Job_1 ended at 18:05 04/03/2020. [exit code=1]


code.PNG
Output.PNG
Source1.PNG
lfsffernandes
Contributor
Contributor

Shree, could you share your solution?? I'm facing the very same issue as you were.