Hermes2 - "Cannot reconstruct the message from repository" error

398 views Asked by At

My intention is to send ebxml message to MSH (Hermes2 http://www.cecid.hku.hk/hermes.php) through another Hermes2.

I am sending fairly simple message (with no attachments), this is the message:

POST /corvus/httpd/ebms/sender HTTP/1.0
User-Agent: PEAR-SOAP 0.12.0-beta
Host: 10.0.4.9
Content-Type: text/xml; charset=UTF-8
Content-Length: 698
SOAPAction: "PaymentAddRequest"
Connection: close

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
 xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
 xmlns:xsd="http://www.w3.org/2001/XMLSchema"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<cpaId>ZSK_KOLEK</cpaId>
<service>http://www.squiz.pl/zsk/ebxml</service>
<action>PaymentAddRequest</action>
<convId>convId</convId>
<fromPartyId>KOLEK</fromPartyId>
<fromPartyType>urn:oasis:names:tc:ebxml-cppa:partyid-type:duns</fromPartyType>
<toPartyId>ZSK-C</toPartyId>
<toPartyType>urn:oasis:names:tc:ebxml-cppa:partyid-type:duns</toPartyType>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

In response I get following:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header/>
<SOAP-ENV:Body>
<message_id xmlns="http://service.ebms.edi.cecid.hku.hk/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" type="xsd:string">[email protected]</message_id>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Message gets registered, but then in logs/ebms.log I get following error

[Thread-1855 ] <ERROR> <cecid.ebms.spa> <Error in outbox task>
hk.hku.cecid.ebms.spa.task.MessageValidationException: Cannot reconstruct the message [email protected] from repository
    by java.lang.RuntimeException: com.sun.xml.messaging.saaj.SOAPExceptionImpl: Unable to create envelope from given source: 
    by com.sun.xml.messaging.saaj.SOAPExceptionImpl: Unable to create envelope from given source: 
    by javax.xml.transform.TransformerException: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog.

Also looking at repository table in DB I can see that a row has been inserted, content column contains message in hex form (\x3c3f786d6c2076657273696f6e3d...), once converted to ASCII it says:

<?xml version="1.0" encoding="UTF-8" ?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://schemas.xmlsoap.org/soap/envelope/ http://www.oasis-open.org/committees/ebxml-msg/schema/envelope.xsd">
    <SOAP-ENV:Header xsi:schemaLocation="http://www.oasis-open.org/committees/ebxml-msg/schema/msg-header-2_0.xsd http://www.oasis-open.org/committees/ebxml-msg/schema/msg-header-2_0.xsd">
        <eb:MessageHeader SOAP-ENV:mustUnderstand="1" eb:version="2.0" xmlns:eb="http://www.oasis-open.org/committees/ebxml-msg/schema/msg-header-2_0.xsd">
            <eb:From>
                <eb:PartyId eb:type="urn:oasis:names:tc:ebxml-cppa:partyid-type:duns">KOLEK</eb:PartyId>
            </eb:From>
            <eb:To>
                <eb:PartyId eb:type="urn:oasis:names:tc:ebxml-cppa:partyid-type:duns">ZSK-C</eb:PartyId>
            </eb:To>
            <eb:CPAId>ZSK_KOLEK</eb:CPAId>
            <eb:ConversationId>convId</eb:ConversationId>
            <eb:Service>http://www.squiz.pl/zsk/ebxml</eb:Service>
            <eb:Action>PaymentAddRequest</eb:Action>
            <eb:MessageData>
                <eb:MessageId>[email protected]</eb:MessageId>
                <eb:Timestamp>2015-01-12T09:24:35.207+01:00</eb:Timestamp>
            </eb:MessageData>
            <eb:DuplicateElimination/>
        </eb:MessageHeader>
        <eb:SyncReply SOAP-ENV:actor="http://schemas.xmlsoap.org/soap/actor/next" SOAP-ENV:mustUnderstand="1" eb:version="2.0" xmlns:eb="http://www.oasis-open.org/committees/ebxml-msg/schema/msg-header-2_0.xsd"/>
        <eb:AckRequested SOAP-ENV:actor="urn:oasis:names:tc:ebxml-msg:actor:toPartyMSH" SOAP-ENV:mustUnderstand="1" eb:signed="false" eb:version="2.0" xmlns:eb="http://www.oasis-open.org/committees/ebxml-msg/schema/msg-header-2_0.xsd"/>
    </SOAP-ENV:Header>
    <SOAP-ENV:Body xsi:schemaLocation="http://www.oasis-open.org/committees/ebxml-msg/schema/msg-header-2_0.xsd http://www.oasis-open.org/committees/ebxml-msg/schema/msg-header-2_0.xsd"/>
</SOAP-ENV:Envelope>

but it doesn't get delivered to the endpoint, seems like Hermes2 doesn't even try to send it to the second Hermes2. Both instances have proper partnership configured.

Can someone point me in the right direction?

1

There are 1 answers

1
Michał Bielecki On BEST ANSWER

Ok, it took me a longer while to find the issue and then a solution, so hopefully I can save someones time.

Documentation on Hermes 2 installation says that it requires PostgreSQL 8.0 or later. This is a lie! Removing Postgres 9.3 and reinstalling Hermes with Postgres 8.4 solved the problem.