Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

socket timeout exception, but file sent #23

Closed
fiorenzino opened this issue Jul 15, 2016 · 13 comments
Closed

socket timeout exception, but file sent #23

fiorenzino opened this issue Jul 15, 2016 · 13 comments
Assignees
Labels
Milestone

Comments

@fiorenzino
Copy link

fiorenzino commented Jul 15, 2016

Hi Philip,
using your library sometimes we have this error:

com.helger.as2lib.exception.OpenAS2Exception OpenAS2 WrappedOpenAS2Exception terminated: java.net.SocketTimeoutException: Read timed out; sources: {message=[AS2Message@0x107cf2de: data=javax.mail.internet.MimeBodyPart@6fbf0b80; MDN=null]}: java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
at java.net.SocketInputStream.read(SocketInputStream.java:170)
at java.net.SocketInputStream.read(SocketInputStream.java:141)
at sun.security.ssl.InputRecord.readFully(InputRecord.java:465)
at sun.security.ssl.InputRecord.read(InputRecord.java:503)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:973)
at sun.security.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:930)
at sun.security.ssl.AppInputStream.read(AppInputStream.java:105)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:246)
at java.io.BufferedInputStream.read1(BufferedInputStream.java:286)
at java.io.BufferedInputStream.read(BufferedInputStream.java:345)
at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:704)
at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:647)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1536)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1441)
at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:480)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:338)
at com.helger.as2lib.processor.sender.AS2SenderModule._sendViaHTTP(AS2SenderModule.java:635)
at com.helger.as2lib.processor.sender.AS2SenderModule.handle(AS2SenderModule.java:706)
at com.helger.as2lib.client.AS2Client.sendSynchronous(AS2Client.java:318)
at com.helger.peppol.as2client.AS2ClientBuilder.sendSynchronous(AS2ClientBuilder.java:983)
at com.jpeppol.as2sender.service.As2SenderService.process(As2SenderService.java:250)

But the file is received correctly.
Did you experience this?

thanks in advance
Fiorenzo Pizza

@phax
Copy link
Owner

phax commented Jul 15, 2016

This maybe resolved by finally implementing phax/as2-server#10

We're just receiving files, but we're not sending anything.
Do you have a proxy inbetween?
Do you think by switching to httpclient this can be resolved?

// Philip

@phax phax added the bug label Jul 15, 2016
@phax phax self-assigned this Jul 15, 2016
@fiorenzino
Copy link
Author

Hi Philip,
no proxy in my case. We send DESPATCH_ADVICESs or INVOICEs and we receive ORDERs.
Yes, the use of httpclient could help. Starting from your code, I would like to create a simple As2 client (prototype), with only this functionality. i will share if you want.

Fiorenzo

@phax
Copy link
Owner

phax commented Jul 15, 2016

Hi Fiorenzo!

Any sharing is welcome :)
You could maybe fork it and create a PR??

Btw. shall we have a short Skype talk on these issues (also the Wildfly one)?

// Philip

@fiorenzino
Copy link
Author

fiorenzino commented Jul 15, 2016

Hi Philip,
can we share our mail?
Edited: done :)

Fiorenzo

@phax
Copy link
Owner

phax commented Jul 15, 2016

You've got a mail

@tellouze
Copy link

Hello,
Is this issue is still open ? we are facing the same problem with our partners ? but we are behind a proxy.
Thanks
Toufik

@phax
Copy link
Owner

phax commented Oct 22, 2016

Hi. I could never reproduce the error :(
Did you try increasing the read-timeout? Maybe some special HTTP headers for the proxy are needed????

@tellouze
Copy link

Hi Philip,
How can I increase the read timeout ?
Thanks

@phax
Copy link
Owner

phax commented Oct 24, 2016

Hi! This is currently a little pain in the ass (must be an attribute in the message). I will make this configurable in the AS2ClientSettings for 3.0.2

@phax
Copy link
Owner

phax commented Oct 24, 2016

I added AS2ClientSettings.setConnectTimeoutMS(int) and AS2ClientSettings.setReadTimeoutMS(int) methods in 3.0.2-SNAPSHOT

@phax phax added this to the v3.0.2 milestone Oct 24, 2016
@tellouze
Copy link

Great! thank you.

@tellouze
Copy link

tellouze commented Nov 4, 2016

Hi Philip,
Using 3.0.2-SNAPSHOT I tried to increase the timeout but it seems that it's not taken into account. It's always using the value by default 60s. Could you give a check please ?
Thanks.

phax added a commit that referenced this issue Nov 4, 2016
@phax
Copy link
Owner

phax commented Nov 4, 2016

Mea culpa. I set the attribute at the message instead of the sender module. Fixed in latest SNAPSHOT (on server in a few minutes)

@phax phax closed this as completed Nov 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants