Java – possible cause of “StreamCorruptedException: invalid stream header”

I use drools to handle my pricing rules However, when I try to execute the rule, the following exception is thrown:

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

Since all the code comes from the library, I guess the problem is not in the code, but in my project setting / using jar / using rules / and so on What are the typical reasons for this exception? What should I look for to find the cause of the anomaly? Does anyone have a strategy to find out the problem?

Update: interesting... My application seems to be useful anyway It seems that it has recovered from its mistakes So, maybe it's an error in my project library? It's hard to see the errors recorded at each startup, but it doesn't seem important Um

Solution

You pass the XML file as an objectinputstream, but this data should be serialized through objectoutputstream first

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>