我有一个分区作业,可以读取和写入数据库。我的块大小为10.如果分区失败并且我想从最后一次提交重启,我已经覆盖了checkpointinfo方法并根据我的应用程序要求编写了我的逻辑。每当我尝试重新启动失败的作业时,我都会遇到一个异常,即Read-Process-Write Loop
出现故障以下是例外日志:
[3/1/18 19:18:09:004 IST] [process partition0] com.ibm.ws.batch.JobLogger CWWKY0030I: An exception occurred while running the step process.
com.ibm.jbatch.container.exception.BatchContainerRuntimeException: Failure in Read-Process-Write Loop
at com.ibm.jbatch.container.controller.impl.ChunkStepControllerImpl.invokeChunk(ChunkStepControllerImpl.java:704)
at com.ibm.jbatch.container.controller.impl.ChunkStepControllerImpl.invokeCoreStep(ChunkStepControllerImpl.java:795)
at com.ibm.jbatch.container.controller.impl.BaseStepControllerImpl.execute(BaseStepControllerImpl.java:293)
at com.ibm.jbatch.container.controller.impl.ExecutionTransitioner.doExecutionLoop(ExecutionTransitioner.java:118)
at com.ibm.jbatch.container.controller.impl.WorkUnitThreadControllerImpl.executeCoreTransitionLoop(WorkUnitThreadControllerImpl.java:93)
at com.ibm.jbatch.container.controller.impl.WorkUnitThreadControllerImpl.executeWorkUnit(WorkUnitThreadControllerImpl.java:155)
at com.ibm.jbatch.container.controller.impl.WorkUnitThreadControllerImpl$AbstractControllerHelper.runExecutionOnThread(WorkUnitThreadControllerImpl.java:480)
at com.ibm.jbatch.container.controller.impl.WorkUnitThreadControllerImpl.runExecutionOnThread(WorkUnitThreadControllerImpl.java:89)
at com.ibm.jbatch.container.util.BatchWorkUnit.run(BatchWorkUnit.java:117)
at com.ibm.ws.context.service.serializable.ContextualRunnable.run(ContextualRunnable.java:79)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: com.ibm.jbatch.container.exception.BatchContainerRuntimeException: java.lang.ClassNotFoundException: [B
at com.ibm.jbatch.container.util.TCCLObjectInputStream.resolveClass(TCCLObjectInputStream.java:40)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1620)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1521)
at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1671)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1347)
at java.io.ObjectInputStream.access$300(ObjectInputStream.java:208)
at java.io.ObjectInputStream$GetFieldImpl.readFields(ObjectInputStream.java:2182)
at java.io.ObjectInputStream.readFields(ObjectInputStream.java:543)
at java.math.BigInteger.readObject(BigInteger.java:4406)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1058)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1909)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1808)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1353)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:373)
at java.util.HashMap.readObject(HashMap.java:1404)
at sun.reflect.GeneratedMethodAccessor57.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1058)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1909)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1808)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1353)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:373)
at java.util.HashMap.readObject(HashMap.java:1404)
at sun.reflect.GeneratedMethodAccessor57.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1058)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1909)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1808)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1353)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2018)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1942)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1808)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1353)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:373)
at com.ibm.jbatch.container.persistence.CheckpointData.<init>(CheckpointData.java:47)
at com.ibm.jbatch.container.persistence.jpa.StepThreadInstanceEntity.getCheckpointData(StepThreadInstanceEntity.java:131)
at com.ibm.jbatch.container.controller.impl.ChunkStepControllerImpl.openReaderAndWriter(ChunkStepControllerImpl.java:935)
at com.ibm.jbatch.container.controller.impl.ChunkStepControllerImpl.invokeChunk(ChunkStepControllerImpl.java:599)
... 14 more
Caused by: java.lang.ClassNotFoundException: [B
at com.ibm.ws.classloading.internal.UnifiedClassLoader.findClass(UnifiedClassLoader.java:119)
at com.ibm.ws.classloading.internal.ThreadContextClassLoader.findClass(ThreadContextClassLoader.java:120)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at com.ibm.ws.classloading.internal.UnifiedClassLoader.loadClass0(UnifiedClassLoader.java:107)
at com.ibm.ws.classloading.internal.UnifiedClassLoader$Delegation.loadClass(UnifiedClassLoader.java:78)
at com.ibm.ws.classloading.internal.UnifiedClassLoader.loadClass(UnifiedClassLoader.java:102)
at com.ibm.ws.classloading.internal.ThreadContextClassLoader.loadClass(ThreadContextClassLoader.java:136)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at com.ibm.jbatch.container.util.TCCLObjectInputStream.resolveClass(TCCLObjectInputStream.java:38)
... 57 more
[3/1/18 19:18:09:005 IST] [process partition0] com.ibm.ws.batch.JobLogger CWWKY0014W: Partition 0 failed with batch status FAILED and exit status null for step process for job instance 105,001 and job execution 105,008.
[3/1/18 19:18:15:588 IST] [process partition0] com.ibm.ws.batch.JobLogger
以下是我的代码段
@Override
public Serializable checkpointInfo() throws Exception {
Checkpoint checkpoint=new Checkpoint();
for (CheckpointProperty prop:dbOp.getCheckpointInfo().getProperty()) {
final Object result = ExprUtils.evaluate(newProps,prop.getCheckpointValue().toString());
checkpoint.addCheckPoint(prop.getName(), result); } return checkpoint;
}
@Override
public Serializable checkpointInfo() throws Exception {
final Properties checkpointInfo = new Properties();
for (String key : checkpointProps.stringPropertyNames()) {
final String expr = checkpointProps.getProperty(key);
final Object result = ExprUtils.evaluate(dataMap, expr);
checkpointInfo.setProperty(key, result.toString());
}
return checkpointInfo;
}
Checkpoint class
----------------------
public class Checkpoint implements Serializable {
private HashMap<String, Object> checkpoints = new HashMap();
public void reset() {
this.checkpoints.clear();
}
public void addCheckPoint(String stream, Object position) {
this.checkpoints.put(stream, position);
}
public Object get(String stream) {
return this.checkpoints.get(stream);
}
public HashMap<String, Object> getCheckpoints() {
return this.checkpoints;
}
}
答案 0 :(得分:1)
这是因为oracle中使用了BigInteger数据类型。
答案 1 :(得分:0)
这似乎是Liberty中的一个错误。已打开issue #2792。
我认为任何数组类型都会发生这种情况,您可以使用 ArrayList 代替数组来解决此问题。
更新:此问题的修复程序已在18.0.0.2中提供。