Closed ChrisVanBael closed 1 year ago
I do get the same error message with a different setup for parsing EDIFACT messages. I have narrowed it down to the message source.
The following does work (Kotlin code):
val inputStream = FileInputStream(File(fileName))
smooks.filterSource(StreamSource(inputStream), StreamResult(outputStream))
while this fails with the above error message:
val inputStream = FileInputStream(File(fileName))
val inputString = inputStream.readBytes().toString(Charsets.UTF_8).trim()
smooks.filterSource(StringSource(inputString), StreamResult(outputStream))
However, it is not just the StringSource
that causes problems. The following results in the same error:
val input = StringReader(inputString)
smooks.filterSource(StreamSource(input), StreamResult(outputStream))
...while this solution does work:
val inputStream = inputString.byteInputStream(Charsets.UTF_8)
smooks.filterSource(StreamSource(inputStream), StreamResult(outputStream))
So, maybe the problem seems to be using a String rather than a byte stream?
See this thread on the mailinglist: https://groups.google.com/g/smooks-user/c/BKnqqGUyX3Y
Used following dependencies:
Created following method to parse DELJIT messages:
Tried to call it with several different messages (both from our test environment which matches production, so the messages seem to be correct):
Gives me this stacktrace:
Full stacktrace in attached file, we use Serenity-BDD with Cucumber to run the tests. stack.txt