Fixed problem with serializer

This commit is contained in:
Alex Huang 2013-06-09 04:38:09 -07:00
parent 59c211fca7
commit 1f3d123866
2 changed files with 2 additions and 1 deletions

View File

@ -55,6 +55,7 @@ public class JobSerializerHelper {
gsonBuilder.setVersion(1.5);
s_logger.debug("Job GSON Builder initialized.");
gsonBuilder.registerTypeAdapter(Class.class, new ClassTypeAdapter());
gsonBuilder.registerTypeAdapter(Throwable.class, new ThrowableTypeAdapter());
s_gson = gsonBuilder.create();
}

View File

@ -77,7 +77,7 @@ public class VmWorkJobDispatcher extends AdapterBase implements AsyncJobDispatch
_asyncJobMgr.completeAsyncJob(job.getId(), AsyncJobConstants.STATUS_SUCCEEDED, 0, null);
} catch(Throwable e) {
s_logger.error("Unable to complete " + job, e);
_asyncJobMgr.completeAsyncJob(job.getId(), AsyncJobConstants.STATUS_FAILED, 0, e);
_asyncJobMgr.completeAsyncJob(job.getId(), AsyncJobConstants.STATUS_FAILED, 0, e.getMessage());
} finally {
CallContext.unregister();
}