Spring Batch Admin Console - com.thoughtworks.xstream.mapper.CannotResolveClassException "class : java.util.HashMap"

StackOverflow https://stackoverflow.com/questions/14672550

質問

I have configured SpringBatch-Admin-Console for launching and viewing jobs we use in our application.

When I launch the job from our application's console the job completes, and I am able to view the status of the job in the Console as expected.

Property        Value
ID              449
Job Name        analyzeJob
Job Instance    449
Job Parameters  time=03-02-2013 17\:58\:13.54
Start Date      2013-02-03
Start Time      17:58:16
Duration        00:00:09
Status          COMPLETED
Exit Code       COMPLETED
Step Executions Count   3
Step Executions [processHeaderStep,inDBScanStep,inMemoryScanStep]

But when I launch the job from SpringBatch Admin Console, the job gets completed as expected, but when I try to view the status of the job in the console, I get the following error message.

"HTTP Status 500 - Request processing failed; nested exception is com.thoughtworks.xstream.converters.ConversionException: id : id : id : id ---- Debugging information ---- message : id : id cause-exception : com.thoughtworks.xstream.mapper.CannotResolveClassException cause-message : id : id class : java.util.HashMap required-type : java.util.HashMap path : /map/entry[3]/masterdata.analyzer.metadata.Metadata/hubCodeTables/masterdata.analyzer.metadata.MHubCodeTable/codeValueMap/entry[7]/id line number : -1 ------------------------------- "

I thought the exception may occured because my application is able to use the class java.util.Hashmap from JAVA_HOME whereas the SpringBatch-Admin-War inside tomcat is not able to use the same.

So I even created a jar file with all the Java class files (including java.util.HashMap) and included inside the LIB folder of this SpringBatch-Admin-Console but I still got the same error.

I also made sure all the required LIB files in my application is present inside the SpringBatch-Admin's LIB folder also. Got the same error still.

The weird behaviour is I am able to launch the job and also I am able to view the job if I launch it from outside, but gets this error only when I launch from the SpringBatch-Admin-Console.

Can anyone please tell me why this error occurs?

役に立ちましたか?

解決

Delete the batch-tables before restarting the job.

他のヒント

Since spring-batch stores all the execution of a job with same parameter in same table, if you don't delete those entries, you might get previous error carried on now, even if you have resolved the error.

So make sure you delete the batch-tables before executing (restarting) the job again.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top