点击作业时无法创建org.springframework.batch.core.JobExecution

时间:2015-10-12 16:35:02

标签: spring spring-batch spring-xd kryo

我正在尝试使用聚合事件来成功完成一项工作以启动另一项工作。问题是,我得到了一个"无法创建类(缺少无参数构造函数)" JobExecution的例外。

以下是尝试的点击:

stream create --name trigger_myjob--definition "tap:job:prerequisitejob.job > filter --expression=payload.getExitStatus.equals(T(org.springframework.batch.core.ExitStatus).COMPLETED) > queue:job:myjob" --deploy
stream create --name debug_trigger --definition "tap:job:prerequisitejob.job > log --name=TX.DEBUG --expression=payload.getExitStatus"
stream create --name debug_harder_trigger --definition "tap:job:prerequisitejob.job > log"

在每种情况下,我都会得到一个堆栈跟踪,表明兔子监听器无法创建消息,最终由以下原因引起:

Caused by: com.esotericsoftware.kryo.KryoException: Class cannot be created (missing no-arg const
ructor): org.springframework.batch.core.JobExecution
        at com.esotericsoftware.kryo.Kryo.newInstantiator(Kryo.java:1050)
        at com.esotericsoftware.kryo.Kryo.newInstance(Kryo.java:1062)
        at com.esotericsoftware.kryo.serializers.FieldSerializer.create(FieldSerializer.java:228)
        at com.esotericsoftware.kryo.serializers.FieldSerializer.read(FieldSerializer.java:217)
        at com.esotericsoftware.kryo.Kryo.readObject(Kryo.java:626)
        at org.springframework.xd.dirt.integration.bus.serializer.kryo.PojoCodec.doDeserialize(Po
joCodec.java:41)
        at org.springframework.xd.dirt.integration.bus.serializer.kryo.AbstractKryoMultiTypeCodec$1.execute(AbstractKryoMultiTypeCodec.java:63)
        at com.esotericsoftware.kryo.pool.KryoPoolQueueImpl.run(KryoPoolQueueImpl.java:43)
        at org.springframework.xd.dirt.integration.bus.serializer.kryo.AbstractKryoMultiTypeCodec.deserialize(AbstractKryoMultiTypeCodec.java:60)
        at org.springframework.xd.dirt.integration.bus.serializer.kryo.PojoCodec.deserialize(PojoCodec.java:30)
        at org.springframework.xd.dirt.integration.bus.serializer.CompositeCodec.deserialize(CompositeCodec.java:72)
        at org.springframework.xd.dirt.integration.bus.serializer.CompositeCodec.deserialize(CompositeCodec.java:78)
        at org.springframework.xd.dirt.integration.bus.MessageBusSupport.deserializePayload(MessageBusSupport.java:588)
        at org.springframework.xd.dirt.integration.bus.MessageBusSupport.deserializePayload(MessageBusSupport.java:573)
        at org.springframework.xd.dirt.integration.bus.MessageBusSupport.deserializePayloadIfNecessary(MessageBusSupport.java:556)
        at org.springframework.xd.dirt.integration.rabbit.RabbitMessageBus.access$600(RabbitMessageBus.java:101)
        at org.springframework.xd.dirt.integration.rabbit.RabbitMessageBus$ReceivingHandler.handleRequestMessage(RabbitMessageBus.java:748)
        at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.handleMessageInternal(AbstractReplyProducingMessageHandler.java:99)
        at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:78)
        ... 37 more

导致此异常的原因是什么,我该如何解决?还有其他方法可以让你的工作在spring-xd中相互触发吗?

1 个答案:

答案 0 :(得分:0)

我在问这个问题后发现我们的建筑师手动更换了罐子,其中包括Kryo。观察到的行为不会发生在一个vanilla Spring XD安装中。