Giter Site home page Giter Site logo

Comments (5)

zharpaz-bmc-com avatar zharpaz-bmc-com commented on July 29, 2024 1

It works OK when the data is set with
aRequest.setData ("toSend", Charset.defaultCharset());
if fails with
aRequest.setData (new File("file.txt"));

from as2-lib.

phax avatar phax commented on July 29, 2024

I tried to reproduce that but failed. I was sending an unsigned, unencrypted, non-compressed messages without an issue. Do you have any additional libraries in your jre/ext folder?

from as2-lib.

phax avatar phax commented on July 29, 2024

I see. When no Charset is provided, the following exception occurs:

1342 [main] INFO com.helger.as2lib.exception.OpenAS2Exception - OpenAS2 WrappedOpenAS2Exception terminated: java.io.IOException: "text/plain" DataContentHandler requires String object, was given object of type class [B; sources: {message=[AS2Message@0x2630dbc4: data=javax.mail.internet.MimeBodyPart@5ea4300e; MDN=null]}
java.io.IOException: "text/plain" DataContentHandler requires String object, was given object of type class [B
	at com.sun.mail.handlers.text_plain.writeTo(text_plain.java:133)
	at javax.activation.ObjectDataContentHandler.writeTo(DataHandler.java:889)
	at javax.activation.DataHandler.writeTo(DataHandler.java:317)
	at com.helger.as2lib.crypto.BCCryptoHelper.calculateMIC(BCCryptoHelper.java:321)
	at com.helger.as2lib.processor.sender.AS2SenderModule.calculateAndStoreMIC(AS2SenderModule.java:272)
	at com.helger.as2lib.processor.sender.AS2SenderModule.handle(AS2SenderModule.java:815)
	at com.helger.as2lib.client.AS2Client.sendSynchronous(AS2Client.java:402)
	at com.helger.as2lib.supplementary.main.MainIssue45.main(MainIssue45.java:116)

When instead calling

aRequest.setData (new File ("file.txt"), Charset.defaultCharset ());

it works for me.

That means: we could use that Charset by default if none is provided to work around that error?

from as2-lib.

zharpaz-bmc-com avatar zharpaz-bmc-com commented on July 29, 2024

I wasn't aware of it. Yes, thanks.

from as2-lib.

phax avatar phax commented on July 29, 2024

The respective method without Charset got deprecated.

from as2-lib.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.