gpt4 book ai didi

java - "StreamCorruptedException: invalid stream header"的可能原因

转载 作者:塔克拉玛干 更新时间:2023-11-03 04:04:30 31 4
gpt4 key购买 nike

我(尝试)使用 drools 来处理我的定价规则。但是当我尝试执行规则时,会抛出以下异常:

java.lang.RuntimeException: KnowledgeAgent exception while trying to deserialize KnowledgeDefinitionsPackage  
at org.drools.agent.impl.KnowledgeAgentImpl.rebuildResources(KnowledgeAgentImpl.java:418)
at org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:120)
at org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:109)
at com.sapienter.jbilling.server.pluggableTask.PluggableTask.readKnowledgeBase(PluggableTask.java:115)
at com.sapienter.jbilling.server.rule.RulesBaseTask.executeRules(RulesBaseTask.java:57)
at com.sapienter.jbilling.server.item.tasks.RulesPricingTask2.getPrice(RulesPricingTask2.java:81)
at com.sapienter.jbilling.server.item.ItemBL.getPrice(ItemBL.java:357)
[...many not so interesting lines...]
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.io.StreamCorruptedException: invalid stream header: 3C3F786D
at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:783)
at java.io.ObjectInputStream.<init>(ObjectInputStream.java:280)
at org.drools.common.DroolsObjectInputStream.<init>(DroolsObjectInputStream.java:55)
at org.drools.common.DroolsObjectInputStream.<init>(DroolsObjectInputStream.java:49)
at org.drools.util.DroolsStreamUtils.streamIn(DroolsStreamUtils.java:189)
at org.drools.util.DroolsStreamUtils.streamIn(DroolsStreamUtils.java:158)
at org.drools.agent.impl.KnowledgeAgentImpl.rebuildResources(KnowledgeAgentImpl.java:408)
... 88 more

由于所有代码都来自库,所以我猜问题不在代码中,而是在我的项目设置/jar 的使用/规则的使用/等等。此异常的典型原因是什么?我应该寻找什么来找到异常的原因?有人有策略来查明问题吗?

更新:有趣...我的应用程序似乎无论如何都可以工作。看起来它从错误中恢复了。那么,也许是我项目库中的错误?看到每次启动时记录的错误并不好,但似乎并不重要。嗯……

最佳答案

您正在将 XML 文件作为 ObjectInputStream 进行传递,但该数据应该事先通过 ObjectOutputStream 进行序列化。

关于java - "StreamCorruptedException: invalid stream header"的可能原因,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3837574/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com