With openas versione 2.13 we have an errore when a message comes on retry i report it
[18112021105232+0100-1268d7ac-c6d1-4037-ad1f-be9916765fa1@02529870103_B$3071206604]
2021-11-18 10:52:33.633 ERROR OpenAS2Exception: Error occurred:: MIC not matched. Forcing Resend
Sources: {message=Message From:{as2_id=TESIEINT2020, name=TESIEINT2020, email=, x509_alias=as2prod_256.e-integrationservice.net}To:{as2_id=SEXLKAD963MAW6, name=SEXLKAD963MAW6, email=, x509_alias=amazon_almonature_prod}
Headers:{Message-Id=18112021105232+0100-1268d7ac-c6d1-4037-ad1f-be9916765fa1@02529870103_B$3071206604, Subject=From TESIEINT2020 to SEXLKAD963MAW6, Content-Type=application/EDI-X12, AS2-To=SEXLKAD963MAW6, AS2-From=TESIEINT2020, Content-Disposition=Attachment; filename="02529870103_B$3071206604"}
Attributes:{pendinginfo=D:\OpenAS2v2\OpenAS2.\config/../data/pendinginfoMDN3/18112021105232+0100-1268d7ac-c6d1-4037-ad1f-be9916765fa1@02529870103_B$3071206604, errordir=\tesinas01\eint_stor\gruppotesi\datasite\orxt\ds_dati\amazon_almo\error_prod_new\, sentfilename=null, filename=02529870103_B$3071206604, destination_ip=as2-eu.amazonsedi.com, errorfilename=null, destination_port=-1, pendingfilename=D:\OpenAS2v2\OpenAS2.\config/../data/pendingMDN3/18112021105232+0100-1268d7ac-c6d1-4037-ad1f-be9916765fa1@02529870103_B$3071206604, sentdir=\tesinas01\eint_stor\gruppotesi\datasite\orxt\ds_dati\amazon_almo\sent_prod_new\, status=pending}
MDN:MDN From:{as2_id=SEXLKAD963MAW6, name=SEXLKAD963MAW6, email=, x509_alias=amazon_almonature_prod}To:{as2_id=TESIEINT2020, name=TESIEINT2020, email=, x509_alias=as2prod_256.e-integrationservice.net}
Headers:{Date=18 Nov 2021 09:52:33 GMT, From=as2@10.1.34.229, Message-Id=20211118-095233-54471@10.1.34.229, Subject=Message Disposition Notification, Content-Type=multipart/signed; protocol="application/pkcs7-signature"; micalg=sha256; boundary="----=_Part_58005_122460036.1637229153558", AS2-To=TESIEINT2020, AS2-From=SEXLKAD963MAW6, AS2-Version=1.1, Recipient-Address=unknown@unknown, Transfer-Encoding=chunked, Connection=close, Server=Server}
Attributes:{FINAL_RECIPIENT=rfc822; "TESIEINT2020", MIC=qKYh5EKQH8Ch99rElhUQn29AvYZQbvVLL5pY1YMFqBQ=, sha256, REPORTING_UA=Amazon AS2 Server 1.0, ORIGINAL_MESSAGE_ID=18112021105232+0100-1268d7ac-c6d1-4037-ad1f-be9916765fa1@02529870103_B$3071206604, ORIGINAL_RECIPIENT=rfc822; "TESIEINT2020", DISPOSITION=automatic-action/MDN-sent-automatically; processed}
Text:
This is not a guarantee that the message has been completely processed or understood by the receiving translator
}
org.openas2.OpenAS2Exception: Message was sent but an error occured while receiving the MDN: MIC not matched. Forcing Resend
at org.openas2.util.AS2Util.processMDN(AS2Util.java:492)
at org.openas2.processor.sender.AS2SenderModule.processResponse(AS2SenderModule.java:215)
at org.openas2.processor.sender.AS2SenderModule.sendMessage(AS2SenderModule.java:188)
at org.openas2.processor.sender.AS2SenderModule.handle(AS2SenderModule.java:119)
at org.openas2.processor.DefaultProcessor.handle(DefaultProcessor.java:55)
at org.openas2.processor.receiver.MessageBuilderModule.processDocument(MessageBuilderModule.java:179)
at org.openas2.processor.receiver.DirectoryPollingModule.processFile(DirectoryPollingModule.java:209)
at org.openas2.processor.receiver.DirectoryPollingModule.updateTracking(DirectoryPollingModule.java:182)
at org.openas2.processor.receiver.DirectoryPollingModule.poll(DirectoryPollingModule.java:77)
at org.openas2.processor.receiver.PollingModule$PollTask.run(PollingModule.java:52)
at java.base/java.util.TimerThread.mainLoop(Timer.java:556)
at java.base/java.util.TimerThread.run(Timer.java:506)
Caused by: org.openas2.OpenAS2Exception: MIC not matched. Forcing Resend
at org.openas2.util.AS2Util.checkMDN(AS2Util.java:268)
at org.openas2.util.AS2Util.processMDN(AS2Util.java:459)
... 11 more
2021-11-18 10:52:33.648 FINE AS2SenderModule: Message sent and response received in 31 millisecondsms [18112021105233+0100-b1bd84ee-95f3-4d6a-ab16-5739d9776a71@04911190488LTTP_20211118104938026_906207149_inforit.xml]
2021-11-18 10:52:33.648 FINE AS2Util: Renamed pending info file : 18112021105232+0100-1268d7ac-c6d1-4037-ad1f-be9916765fa1@02529870103_B$3071206604 :::: New name: 18112021105233+0100-261f3d53-ef35-452b-94d4-757fcf5e002e@02529870103_B$3071206604 [18112021105233+0100-261f3d53-ef35-452b-94d4-757fcf5e002e@02529870103_B$3071206604]
2021-11-18 10:52:33.648 FINE AS2Util: received MDN [automatic-action/MDN-sent-automatically; processed][18112021105233+0100-b1bd84ee-95f3-4d6a-ab16-5739d9776a71@04911190488LTTP_20211118104938026_906207149_inforit.xml]
2021-11-18 10:52:33.648 FINE AS2Util: Message sent and MDN received successfully. [18112021105233+0100-b1bd84ee-95f3-4d6a-ab16-5739d9776a71@04911190488LTTP_20211118104938026_906207149_inforit.xml]
2021-11-18 10:52:33.648 ERROR AS2SenderModule: Unhandled error condition processing synchronous MDN. Message and associated files cleanup will be attempted but may be in an unknown state. [18112021105232+0100-1268d7ac-c6d1-4037-ad1f-be9916765fa1@02529870103_B$3071206604]
java.lang.ClassCastException: class java.lang.String cannot be cast to class java.lang.Integer (java.lang.String and java.lang.Integer are in module java.base of loader 'bootstrap')
at org.openas2.processor.resender.DirectoryResenderModule.handle(DirectoryResenderModule.java:58)
at org.openas2.processor.DefaultProcessor.handle(DefaultProcessor.java:55)
at org.openas2.util.AS2Util.resend(AS2Util.java:399)
at org.openas2.util.AS2Util.processMDN(AS2Util.java:495)
at org.openas2.processor.sender.AS2SenderModule.processResponse(AS2SenderModule.java:215)
at org.openas2.processor.sender.AS2SenderModule.sendMessage(AS2SenderModule.java:188)
at org.openas2.processor.sender.AS2SenderModule.handle(AS2SenderModule.java:119)
at org.openas2.processor.DefaultProcessor.handle(DefaultProcessor.java:55)
at org.openas2.processor.receiver.MessageBuilderModule.processDocument(MessageBuilderModule.java:179)
at org.openas2.processor.receiver.DirectoryPollingModule.processFile(DirectoryPollingModule.java:209)
at org.openas2.processor.receiver.DirectoryPollingModule.updateTracking(DirectoryPollingModule.java:182)
at org.openas2.processor.receiver.DirectoryPollingModule.poll(DirectoryPollingModule.java:77)
at org.openas2.processor.receiver.PollingModule$PollTask.run(PollingModule.java:52)
at java.base/java.util.TimerThread.mainLoop(Timer.java:556)
at java.base/java.util.TimerThread.run(Timer.java:506)
As result the file don't go if is into resent mode and the file into resend directory was empty.
What the problems? A configuration missing
Thank you for help
Regs
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi, sorry to use this post but I think the issue I'm having might be the same or related and more info might be helpful.
In my case I get the same exception "java.lang.ClassCastException: class java.lang.String cannot be cast to class java.lang.Integer" when trying to send a message to a partner and it fails.
One way it can be reproduced is to change the "to partner" AS2 url to a url that will give timeout and it will first throw this error "ERROR AS2SenderModule: Unexpected error sending file: connect timed out", which I think its normal since the partners AS2 couldn't be reached but just after that it throws a few more:
ERROR OpenAS2Exception: Error occurred:: java.io.EOFException
Sources: {file=/mnt/openas2/data/resend/11-26-21-14-46-14.845ab656-789d-4a65-af8d-84aa7fc7cdbe, message=null}
org.openas2.WrappedException: java.io.EOFException
at org.openas2.processor.resender.DirectoryResenderModule.processFile(DirectoryResenderModule.java:191)
at org.openas2.processor.resender.DirectoryResenderModule.resend(DirectoryResenderModule.java:100)
at org.openas2.processor.resender.BaseResenderModule$PollTask.run(BaseResenderModule.java:30)
at java.base/java.util.TimerThread.mainLoop(Timer.java:556)
at java.base/java.util.TimerThread.run(Timer.java:506)
Caused by: java.io.EOFException
at java.base/java.io.ObjectInputStream$BlockDataInputStream.peekByte(ObjectInputStream.java:3171)
at java.base/java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1630)
at java.base/java.io.ObjectInputStream.readObject(ObjectInputStream.java:493)
at java.base/java.io.ObjectInputStream.readObject(ObjectInputStream.java:451)
at org.openas2.processor.resender.DirectoryResenderModule.processFile(DirectoryResenderModule.java:157)
... 4 more
Thanks.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have done some debug and I have created a patch that fixes the cast exception, I've tested and now it works, it throws the timeout exception and puts the message in the resend queue, I'm sharing the patch:
diff --git server/openas2/Server/src/main/java/org/openas2/processor/resender/DirectoryResenderModule.java server/openas2/Server/src/main/java/org/openas2/processor/resender/DirectoryResenderModule.javaindex ebc394b..afb94dc 100755--- server/openas2/Server/src/main/java/org/openas2/processor/resender/DirectoryResenderModule.java+++ server/openas2/Server/src/main/java/org/openas2/processor/resender/DirectoryResenderModule.java@@ -26,6 +26,8 @@ import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.StringTokenizer;
+import java.lang.Integer;+import java.lang.NumberFormatException;
public class DirectoryResenderModule extends BaseResenderModule {
@@ -55,7 +57,9 @@ public class DirectoryResenderModule extends BaseResenderModule {
if (method == null) {
method = SenderModule.DO_SEND;
}
- int retries = (int) options.get(ResenderModule.OPTION_RETRIES);++ int retries = Integer.parseInt((String) options.get(ResenderModule.OPTION_RETRIES));+
oos.writeObject(method);
oos.writeObject("" + retries);
oos.writeObject(msg);
@@ -69,6 +73,8 @@ public class DirectoryResenderModule extends BaseResenderModule {
}
} catch (IOException ioe) {
throw new WrappedException(ioe);
+ } catch (NumberFormatException nfe) {+ throw new WrappedException(nfe);
} finally {
if (oos != null) {
try {
Hope it helps,
Cheers.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
There is an issue identifed with 2.13.1 where it uses up all OS fiule handles.
You should upgrade to the just released 2.14.0 ASAP - only the jar file neeeds replacing :
Replace openas2-server-2.13.1.jar. with openas2-server-2.14.0.jar.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
With openas versione 2.13 we have an errore when a message comes on retry i report it
[18112021105232+0100-1268d7ac-c6d1-4037-ad1f-be9916765fa1@02529870103_B$3071206604]
2021-11-18 10:52:33.633 ERROR OpenAS2Exception: Error occurred:: MIC not matched. Forcing Resend
Sources: {message=Message From:{as2_id=TESIEINT2020, name=TESIEINT2020, email=, x509_alias=as2prod_256.e-integrationservice.net}To:{as2_id=SEXLKAD963MAW6, name=SEXLKAD963MAW6, email=, x509_alias=amazon_almonature_prod}
Headers:{Message-Id=18112021105232+0100-1268d7ac-c6d1-4037-ad1f-be9916765fa1@02529870103_B$3071206604, Subject=From TESIEINT2020 to SEXLKAD963MAW6, Content-Type=application/EDI-X12, AS2-To=SEXLKAD963MAW6, AS2-From=TESIEINT2020, Content-Disposition=Attachment; filename="02529870103_B$3071206604"}
Attributes:{pendinginfo=D:\OpenAS2v2\OpenAS2.\config/../data/pendinginfoMDN3/18112021105232+0100-1268d7ac-c6d1-4037-ad1f-be9916765fa1@02529870103_B$3071206604, errordir=\tesinas01\eint_stor\gruppotesi\datasite\orxt\ds_dati\amazon_almo\error_prod_new\, sentfilename=null, filename=02529870103_B$3071206604, destination_ip=as2-eu.amazonsedi.com, errorfilename=null, destination_port=-1, pendingfilename=D:\OpenAS2v2\OpenAS2.\config/../data/pendingMDN3/18112021105232+0100-1268d7ac-c6d1-4037-ad1f-be9916765fa1@02529870103_B$3071206604, sentdir=\tesinas01\eint_stor\gruppotesi\datasite\orxt\ds_dati\amazon_almo\sent_prod_new\, status=pending}
MDN:MDN From:{as2_id=SEXLKAD963MAW6, name=SEXLKAD963MAW6, email=, x509_alias=amazon_almonature_prod}To:{as2_id=TESIEINT2020, name=TESIEINT2020, email=, x509_alias=as2prod_256.e-integrationservice.net}
Headers:{Date=18 Nov 2021 09:52:33 GMT, From=as2@10.1.34.229, Message-Id=20211118-095233-54471@10.1.34.229, Subject=Message Disposition Notification, Content-Type=multipart/signed; protocol="application/pkcs7-signature"; micalg=sha256; boundary="----=_Part_58005_122460036.1637229153558", AS2-To=TESIEINT2020, AS2-From=SEXLKAD963MAW6, AS2-Version=1.1, Recipient-Address=unknown@unknown, Transfer-Encoding=chunked, Connection=close, Server=Server}
Attributes:{FINAL_RECIPIENT=rfc822; "TESIEINT2020", MIC=qKYh5EKQH8Ch99rElhUQn29AvYZQbvVLL5pY1YMFqBQ=, sha256, REPORTING_UA=Amazon AS2 Server 1.0, ORIGINAL_MESSAGE_ID=18112021105232+0100-1268d7ac-c6d1-4037-ad1f-be9916765fa1@02529870103_B$3071206604, ORIGINAL_RECIPIENT=rfc822; "TESIEINT2020", DISPOSITION=automatic-action/MDN-sent-automatically; processed}
Text:
This is not a guarantee that the message has been completely processed or understood by the receiving translator
}
org.openas2.OpenAS2Exception: Message was sent but an error occured while receiving the MDN: MIC not matched. Forcing Resend
at org.openas2.util.AS2Util.processMDN(AS2Util.java:492)
at org.openas2.processor.sender.AS2SenderModule.processResponse(AS2SenderModule.java:215)
at org.openas2.processor.sender.AS2SenderModule.sendMessage(AS2SenderModule.java:188)
at org.openas2.processor.sender.AS2SenderModule.handle(AS2SenderModule.java:119)
at org.openas2.processor.DefaultProcessor.handle(DefaultProcessor.java:55)
at org.openas2.processor.receiver.MessageBuilderModule.processDocument(MessageBuilderModule.java:179)
at org.openas2.processor.receiver.DirectoryPollingModule.processFile(DirectoryPollingModule.java:209)
at org.openas2.processor.receiver.DirectoryPollingModule.updateTracking(DirectoryPollingModule.java:182)
at org.openas2.processor.receiver.DirectoryPollingModule.poll(DirectoryPollingModule.java:77)
at org.openas2.processor.receiver.PollingModule$PollTask.run(PollingModule.java:52)
at java.base/java.util.TimerThread.mainLoop(Timer.java:556)
at java.base/java.util.TimerThread.run(Timer.java:506)
Caused by: org.openas2.OpenAS2Exception: MIC not matched. Forcing Resend
at org.openas2.util.AS2Util.checkMDN(AS2Util.java:268)
at org.openas2.util.AS2Util.processMDN(AS2Util.java:459)
... 11 more
2021-11-18 10:52:33.648 FINE AS2SenderModule: Message sent and response received in 31 millisecondsms [18112021105233+0100-b1bd84ee-95f3-4d6a-ab16-5739d9776a71@04911190488LTTP_20211118104938026_906207149_inforit.xml]
2021-11-18 10:52:33.648 FINE AS2Util: Renamed pending info file : 18112021105232+0100-1268d7ac-c6d1-4037-ad1f-be9916765fa1@02529870103_B$3071206604 :::: New name: 18112021105233+0100-261f3d53-ef35-452b-94d4-757fcf5e002e@02529870103_B$3071206604 [18112021105233+0100-261f3d53-ef35-452b-94d4-757fcf5e002e@02529870103_B$3071206604]
2021-11-18 10:52:33.648 FINE AS2Util: received MDN [automatic-action/MDN-sent-automatically; processed] [18112021105233+0100-b1bd84ee-95f3-4d6a-ab16-5739d9776a71@04911190488LTTP_20211118104938026_906207149_inforit.xml]
2021-11-18 10:52:33.648 FINE AS2Util: Message sent and MDN received successfully. [18112021105233+0100-b1bd84ee-95f3-4d6a-ab16-5739d9776a71@04911190488LTTP_20211118104938026_906207149_inforit.xml]
2021-11-18 10:52:33.648 ERROR AS2SenderModule: Unhandled error condition processing synchronous MDN. Message and associated files cleanup will be attempted but may be in an unknown state. [18112021105232+0100-1268d7ac-c6d1-4037-ad1f-be9916765fa1@02529870103_B$3071206604]
java.lang.ClassCastException: class java.lang.String cannot be cast to class java.lang.Integer (java.lang.String and java.lang.Integer are in module java.base of loader 'bootstrap')
at org.openas2.processor.resender.DirectoryResenderModule.handle(DirectoryResenderModule.java:58)
at org.openas2.processor.DefaultProcessor.handle(DefaultProcessor.java:55)
at org.openas2.util.AS2Util.resend(AS2Util.java:399)
at org.openas2.util.AS2Util.processMDN(AS2Util.java:495)
at org.openas2.processor.sender.AS2SenderModule.processResponse(AS2SenderModule.java:215)
at org.openas2.processor.sender.AS2SenderModule.sendMessage(AS2SenderModule.java:188)
at org.openas2.processor.sender.AS2SenderModule.handle(AS2SenderModule.java:119)
at org.openas2.processor.DefaultProcessor.handle(DefaultProcessor.java:55)
at org.openas2.processor.receiver.MessageBuilderModule.processDocument(MessageBuilderModule.java:179)
at org.openas2.processor.receiver.DirectoryPollingModule.processFile(DirectoryPollingModule.java:209)
at org.openas2.processor.receiver.DirectoryPollingModule.updateTracking(DirectoryPollingModule.java:182)
at org.openas2.processor.receiver.DirectoryPollingModule.poll(DirectoryPollingModule.java:77)
at org.openas2.processor.receiver.PollingModule$PollTask.run(PollingModule.java:52)
at java.base/java.util.TimerThread.mainLoop(Timer.java:556)
at java.base/java.util.TimerThread.run(Timer.java:506)
As result the file don't go if is into resent mode and the file into resend directory was empty.
What the problems? A configuration missing
Thank you for help
Regs
Any suggestions ?
regs
That is a bug - I will look into it this weekend.
Hi, sorry to use this post but I think the issue I'm having might be the same or related and more info might be helpful.
In my case I get the same exception "java.lang.ClassCastException: class java.lang.String cannot be cast to class java.lang.Integer" when trying to send a message to a partner and it fails.
One way it can be reproduced is to change the "to partner" AS2 url to a url that will give timeout and it will first throw this error "ERROR AS2SenderModule: Unexpected error sending file: connect timed out", which I think its normal since the partners AS2 couldn't be reached but just after that it throws a few more:
and:
Thanks.
I have done some debug and I have created a patch that fixes the cast exception, I've tested and now it works, it throws the timeout exception and puts the message in the resend queue, I'm sharing the patch:
Hope it helps,
Cheers.
Thanks - I will pply that to the next release.
Hi,
Thank you very much for support
@ Christopher
Any idea when was released ?
regs
On Wed, Dec 1, 2021 at 12:52 AM Christopher Broderick
uhurusurfa@users.sourceforge.net wrote:
--
Claudio Degioanni
Skype: claudiodegio
Hi,
Thank you very much for support
@ Christopher
Any idea when was released ?
regs
2..13.1 just released with that fix in it.
I will test it and let you know. Thank you.
Works correctly tanks
Works correctly tanks
I don't have any issues with this release. Thank you Christopher for your support.
There is an issue identifed with 2.13.1 where it uses up all OS fiule handles.
You should upgrade to the just released 2.14.0 ASAP - only the jar file neeeds replacing :
Replace openas2-server-2.13.1.jar. with openas2-server-2.14.0.jar.