0

I'm currently refactoring an application that uses drools 5.3.1, trying to add a binary package file from classpath instead of a taking it from a URL, but I'm stuck with the following exception:

java.io.StreamCorruptedException: invalid stream header: EFBFBDEF

This is the code I'm using:

KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder(); kbuilder.add(ResourceFactory.newClasspathResource(path), ResourceType.PKG);

I've just changed the static method called from ResourceFactory.newURLResource to ResourceFactory.newClassPathResource, which used to work when the .pkg file was loaded from a remote location.

Any hints?

gnzlrm
  • 190
  • 1
  • 12
  • How was the file on `path` created and is `path` correct and unique? – laune Jan 06 '18 at 09:18
  • I really don't know how the file was created; all I know it's that it worked OK when loaded from a URL. The path is correct and unique. – gnzlrm Jan 08 '18 at 14:01
  • Sorry for being obstinate, but the file on the classpath is identical to the file at the URL? Was the file transferred from the URL into you local file system using a binary copy? – laune Jan 08 '18 at 15:55
  • Thanks for your help, it's no problem at all :) – gnzlrm Jan 08 '18 at 16:06
  • Yes, the file is identical. It's originally hosted on an SVN folder. From there, it's checked out on an AS and uploaded to an S3, from where it's served via HTTP; that's how it worked. I'd checkout the same SVN folder, copied the file into the classpath using `copy /b` but still the same exception is raised. – gnzlrm Jan 08 '18 at 16:27
  • Check this one. stackoverflow.com/questions/5421879/ - Possibly the old problem of trying to convert a text between systems when the data is binary. – laune Jan 08 '18 at 17:27

0 Answers0