2015-10-15 39 views
0

我想看到一個工作,我跑的執行狀態作業執行狀態的時候,但在某些隨機點我收到以下錯誤:時出現例外春-XD聯繫

2015-10-14T14:41:24-0400 1.2.0.RELEASE ERROR qtp195949131-28 rest.RestControllerAdvice - Caught exception while handling a request 
org.springframework.http.converter.HttpMessageNotWritableException: Could not write content: java.lang.Integer cannot be cast to java.lang.String (through reference chain: org.springframework.xd.rest.domain.JobExecutionInfoResource["jobExecution"]->org.springframework.batch.core.JobExecution["executionContext"]->org.springframework.batch.item.ExecutionContext["values"]->java.util.concurrent.EntrySetView[0]->java.util.concurrent.MapEntry["value"]->java.util.ArrayList[0]); nested exception is com.fasterxml.jackson.databind.JsonMappingException: java.lang.Integer cannot be cast to java.lang.String (through reference chain: org.springframework.xd.rest.domain.JobExecutionInfoResource["jobExecution"]->org.springframework.batch.core.JobExecution["executionContext"]->org.springframework.batch.item.ExecutionContext["values"]->java.util.concurrent.EntrySetView[0]->java.util.concurrent.MapEntry["value"]->java.util.ArrayList[0]) 

現在,我說「隨機」,但事實是我甚至不知道哪一步導致這個異常,因爲這些是我唯一的日誌。這些工作成功運行,似乎沒有錯誤,但這真的讓我擔心。我一直在網上尋找這方面的日子,但我沒有看到任何可以幫助我調試的東西,甚至沒有提供任何可能導致這種情況的信息。任何幫助?

Thanks,N.S.

回答

0

好吧,所以我發現問題在於我們在執行上下文中序列化List>,其中一個內部映射包含Integer而不是String。這似乎導致上下文的反序列化崩潰。

解決方案?不要將該列表存儲在執行上下文中(而是將整個列表對象寫入文件以在各個步驟之間進行傳輸)。