Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
yfujioka
Partner - Contributor III
Partner - Contributor III

tRESTResponseでRest response already sentとエラーとなる

APIでDBにinsert、select、deleteが​できるようにしたいです。

しかし、複数のデータをinsertしようとすると

   Exception in component tRESTResponse_2 (api)

   java.lang.RuntimeException: Rest response already sent.

    at usecase.api_0_1.api.tWriteJSONField_1_InProcess(api.java:8799)

    at usecase.api_0_1.api$1ThreadXMLField_tWriteJSONField_1_Out.run(api.java:3892)

このようにエラーが出てきます。​

​​

作成したジョブ​

0695b00000QFAGrAAP.png

送信内容​

0695b00000QFAJ2AAP.png

・tLogRow8の結果

.--+----.

|tLogRow_8|

|=-+---=|

|id|name|

|=-+---=|

|4 |fuji|

|5 |fuji|

'--+----'

・DBには2レコード作成されています。​​

■できていること

・単一のレコード​では正常に動く。

送信するbodyを

{

 "root":[

  {

   "id":"4",

   "name":"fuji"

  }

 ]

}​

​にした場合はエラーとならない。

​■できていないこと

・複数レコードを送信した場合、tRESTResponseでエラーとなる。​

■予想

tWriteJSONFieldの設定がおかしいのかなと考えております。

tWriteJSONFieldの現在の設定

0695b00000QFAOHAA5.png

0695b00000QFAORAA5.png

よろしくお願いいたします。​

1 Solution

Accepted Solutions
yfujioka
Partner - Contributor III
Partner - Contributor III
Author

・tXMLMapの設定を以下の記事を参考にして[All in one] (オールインワン)をtrueにして解決しました。​

​https://community.talend.com/s/feed/0D53p00007vCoxwCAC?language=ja

https://help.talend.com/r/ja-JP/7.3/txmlmap/txmlmap-tfileinputxml-tlogrow-tfileoutputxml-configuring-txmlmap-with-multiple-loops-standard-component

・tWriteJSONFieldの設定を以下の記事を参考にloopを追加して解決しました。​

https://help.talend.com/r/ja-JP/7.3/processing/twritejsonfield-tmap-trowgenerator-trowgenerator-configuring-and-running-job-create

View solution in original post

1 Reply
yfujioka
Partner - Contributor III
Partner - Contributor III
Author

・tXMLMapの設定を以下の記事を参考にして[All in one] (オールインワン)をtrueにして解決しました。​

​https://community.talend.com/s/feed/0D53p00007vCoxwCAC?language=ja

https://help.talend.com/r/ja-JP/7.3/txmlmap/txmlmap-tfileinputxml-tlogrow-tfileoutputxml-configuring-txmlmap-with-multiple-loops-standard-component

・tWriteJSONFieldの設定を以下の記事を参考にloopを追加して解決しました。​

https://help.talend.com/r/ja-JP/7.3/processing/twritejsonfield-tmap-trowgenerator-trowgenerator-configuring-and-running-job-create