UnrecognizedDocumentException on Order Ack

Help
JemTallon
2010-08-31
2013-04-15
  • JemTallon

    JemTallon - 2010-08-31

    I am trying to send an OrderAcknowledgment XML file through AMTU but I am getting a strange error in the logs. The error is as follows:

    2010-08-31 11:56:25,722  DEBUG com.amazon.merchants.transport.dispatcher.Recognizer  com.amazon.merchants.transport.dispatcher.UnrecognizedDocumentException: Document type not known
            at com.amazon.merchants.transport.dispatcher.impl.RecognizerImpl.createMerchantFeed(RecognizerImpl.java:81)
            at com.amazon.merchants.transport.dispatcher.impl.RecognizerImpl.recognizeFiles(RecognizerImpl.java:46)
            at com.amazon.merchants.transport.dispatcher.impl.DispatcherServiceImpl.dispatchAll(DispatcherServiceImpl.java:73)
            at com.amazon.merchants.transport.dispatcher.impl.DispatcherServiceImpl.dispatchDirectory(DispatcherServiceImpl.java:68)
            at com.amazon.merchants.transport.dispatcher.impl.DispatcherServiceImpl.dispatch(DispatcherServiceImpl.java:53)
            at com.amazon.merchants.transport.TransportClient.run(TransportClient.java:81)
            at com.amazon.merchants.transport.timer.DispatchRunner.handleNotification(DispatchRunner.java:24)
            at com.amazon.merchants.timer.NotificationFilter.handleNotification(NotificationFilter.java:20)
            at mx4j.server.interceptor.NotificationListenerMBeanServerInterceptor$ListenerWrapper.handleNotification(NotificationListenerMBeanServerInterceptor.java:57)
            at javax.management.NotificationBroadcasterSupport.handleNotification(Unknown Source)
            at javax.management.NotificationBroadcasterSupport$SendNotifJob.run(Unknown Source)
            at javax.management.NotificationBroadcasterSupport$1.execute(Unknown Source)
            at javax.management.NotificationBroadcasterSupport.sendNotification(Unknown Source)
            at javax.management.timer.Timer.sendNotification(Unknown Source)
            at javax.management.timer.Timer.notifyAlarmClock(Unknown Source)
            at javax.management.timer.TimerAlarmClock.run(Unknown Source)
            at java.util.TimerThread.mainLoop(Unknown Source)
            at java.util.TimerThread.run(Unknown Source)
    Caused by: com.amazon.merchants.transport.dispatcher.InvalidDocumentException: Document cannot be recognized as a valid Amazon document
            at com.amazon.merchants.transport.dispatcher.impl.FileContentIdentifier.getTypeKey(FileContentIdentifier.java:149)
            at com.amazon.merchants.transport.dispatcher.impl.FileContentIdentifier.getFileTypeFromString(FileContentIdentifier.java:98)
            at com.amazon.merchants.transport.dispatcher.impl.FileContentIdentifier.getFileType(FileContentIdentifier.java:70)
            at com.amazon.merchants.transport.dispatcher.impl.RecognizerImpl.createMerchantFeed(RecognizerImpl.java:70)
            … 17 more
    com.amazon.merchants.transport.dispatcher.InvalidDocumentException: Document cannot be recognized as a valid Amazon document
            at com.amazon.merchants.transport.dispatcher.impl.FileContentIdentifier.getTypeKey(FileContentIdentifier.java:149)
            at com.amazon.merchants.transport.dispatcher.impl.FileContentIdentifier.getFileTypeFromString(FileContentIdentifier.java:98)
            at com.amazon.merchants.transport.dispatcher.impl.FileContentIdentifier.getFileType(FileContentIdentifier.java:70)
            at com.amazon.merchants.transport.dispatcher.impl.RecognizerImpl.createMerchantFeed(RecognizerImpl.java:70)
            at com.amazon.merchants.transport.dispatcher.impl.RecognizerImpl.recognizeFiles(RecognizerImpl.java:46)
            at com.amazon.merchants.transport.dispatcher.impl.DispatcherServiceImpl.dispatchAll(DispatcherServiceImpl.java:73)
            at com.amazon.merchants.transport.dispatcher.impl.DispatcherServiceImpl.dispatchDirectory(DispatcherServiceImpl.java:68)
            at com.amazon.merchants.transport.dispatcher.impl.DispatcherServiceImpl.dispatch(DispatcherServiceImpl.java:53)
            at com.amazon.merchants.transport.TransportClient.run(TransportClient.java:81)
            at com.amazon.merchants.transport.timer.DispatchRunner.handleNotification(DispatchRunner.java:24)
            at com.amazon.merchants.timer.NotificationFilter.handleNotification(NotificationFilter.java:20)
            at mx4j.server.interceptor.NotificationListenerMBeanServerInterceptor$ListenerWrapper.handleNotification(NotificationListenerMBeanServerInterceptor.java:57)
            at javax.management.NotificationBroadcasterSupport.handleNotification(Unknown Source)
            at javax.management.NotificationBroadcasterSupport$SendNotifJob.run(Unknown Source)
            at javax.management.NotificationBroadcasterSupport$1.execute(Unknown Source)
            at javax.management.NotificationBroadcasterSupport.sendNotification(Unknown Source)
            at javax.management.timer.Timer.sendNotification(Unknown Source)
            at javax.management.timer.Timer.notifyAlarmClock(Unknown Source)
            at javax.management.timer.TimerAlarmClock.run(Unknown Source)
            at java.util.TimerThread.mainLoop(Unknown Source)
            at java.util.TimerThread.run(Unknown Source)

    My XML file is as follows:

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <AmazonEnvelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="amzn-envelope.xsd">
        <Header>
            <DocumentVersion>1.01</DocumentVersion>
            <MerchantIdentifier>*******************</MerchantIdentifier>
        </Header>
        <MessageType>OrderAcknowledgment</MessageType>
        <Message>
            <MessageID>1</MessageID>
            <OrderAcknowledgement>
                <AmazonOrderID>105-2246154-6863443</AmazonOrderID>
                <MerchantOrderID>00125259972</MerchantOrderID>
                <StatusCode>Success</StatusCode>
                <Item>
                    <AmazonOrderItemCode>520869748402</AmazonOrderItemCode>
                    <MerchantOrderItemID>00125259972</MerchantOrderItemID>
                </Item>
            </OrderAcknowledgement>
        </Message>
    </AmazonEnvelope>

    It's weird, because it validates against the amazon envelope XSD and looks similar to other people's examples I've seen online. Also, my image, inventory, pricing, and product feeds are very similar and those are accepted and sent off to Amazon by my AMTU install without error. Can anyone help?

    Jem

     
  • JemTallon

    JemTallon - 2010-08-31

    Well now I fell like an idiot. Just figured out I was missing an 'e' in the MessageType so it wasn't matching any of the defined types in the contentIdentifierStrings.properties file. I changed the MessageType to the correct "OrderAcknowledgement" and now it works fine.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks