9 Replies Latest reply: Jan 18, 2012 9:34 AM by Viktor.Jarolim-Oracle RSS

    COM cartridge exception in SalesOrderCompleteEventHandler.xqy

    nicvas
      Hi,

      during the execution of Milestone completion the aia cartridge7.2(Out Of the Box) calls the SalesOrderCompleteEventHandler.xqy.
      It worked fine until last week (6 months in development execution environment) but now it’ s raising any exception; below the trace.

      Is it possible that we have reached some limit on the database (sequence, index, etc) which lock the generation of any internal id?
      Or what would be the possible exception reason?

      Thanks
      Nico


      Error trace:

      ####<Nov 22, 2011 11:52:06 AM CET> <Error> <oms> <CRPAS04> <OSM_Admin> <ExecuteThread: '38' for queue: 'oms.automation'> <osmoe> <BEA1-6BA9642E779D81281F99> <> <1321959126081> <BEA-000000> <plugin.XQueryReceiver: [ order ID=205482] Automation exception thrown while running Script plugin: Exception thrown while running Script resource [osmmodel:///CommunicationsSalesOrderFulfillmentPIP/1.0.0/resources/SalesOrderCompleteEventHandler.xqy]; exception location: null.
      com.mslv.oms.automation.AutomationException: Exception thrown while running Script resource [osmmodel:///CommunicationsSalesOrderFulfillmentPIP/1.0.0/resources/SalesOrderCompleteEventHandler.xqy]; exception location: null
      at oracle.communications.ordermanagement.automation.plugin.AbstractScriptPluginImplementation.transform(Unknown Source)
      at oracle.communications.ordermanagement.automation.plugin.AbstractScriptPluginImplementation.runCommonFunctionality(Unknown Source)
      at oracle.communications.ordermanagement.automation.plugin.ScriptRunnerImpl.runScript(Unknown Source)
      at oracle.communications.ordermanagement.automation.plugin.AbstractScriptAutomator.run(Unknown Source)
      at com.mslv.oms.automation.plugin.AbstractAutomator._runAutomator(Unknown Source)
      at oracle.communications.ordermanagement.automation.plugin.XQueryReceiver_x3yf0m_EOImpl._runAutomator(XQueryReceiver_x3yf0m_EOImpl.java:135)
      at oracle.communications.ordermanagement.automation.plugin.XQueryReceiver_x3yf0m_EOImpl_WLSkel.invoke(Unknown Source)
      at weblogic.rmi.internal.ServerRequest.sendReceive(ServerRequest.java:174)
      at weblogic.rmi.internal.BasicRemoteRef.invoke(BasicRemoteRef.java:222)
      at oracle.communications.ordermanagement.automation.plugin.XQueryReceiver_x3yf0m_EOImpl_1031_WLStub._runAutomator(Unknown Source)
      at com.mslv.oms.automation.AutomationDispatcher.a(Unknown Source)
      at com.mslv.oms.automation.plugin.AutomationEventHandlerImpl.processMessage(Unknown Source)
      at com.mslv.oms.automation.AutomationDispatcher.onLocalMessage(Unknown Source)
      at com.mslv.oms.automation.plugin.AutomationEventHandlerImpl.a(Unknown Source)
      at com.mslv.oms.automation.plugin.d.a(Unknown Source)
      at oracle.communications.ordermanagement.cluster.message.ClusterMessageHandlerBean.onMessage(Unknown Source)
      at weblogic.ejb.container.internal.MDListener.execute(MDListener.java:466)
      at weblogic.ejb.container.internal.MDListener.transactionalOnMessage(MDListener.java:371)
      at weblogic.ejb.container.internal.MDListener.onMessage(MDListener.java:327)
      at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:4585)
      at weblogic.jms.client.JMSSession.execute(JMSSession.java:4271)
      at weblogic.jms.client.JMSSession.executeMessage(JMSSession.java:3747)
      at weblogic.jms.client.JMSSession.access$000(JMSSession.java:114)
      at weblogic.jms.client.JMSSession$UseForRunnable.run(JMSSession.java:5096)
      at weblogic.work.ExecuteRequestAdapter.execute(ExecuteRequestAdapter.java:21)
      at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:145)
      at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:117)
      javax.xml.transform.TransformerException: net.sf.saxon.trans.XPathException: An empty sequence is not allowed as the 5th argument of systeminteractionmodule:getInteractionSequence()
      ....
      ....
        • 1. Re: COM cartridge exception in SalesOrderCompleteEventHandler.xqy
          Carlos.Manjarres-Oracle
          Hi Nico:

          Sequences handled by the systeminteractionmodule (Xquery module) refers to the message IDs ( EBMs ) not database sequences.
          O2A uses this xquery module to track the sequence of messages interexchanged between OSM system and other systems such as CRM, BRM, etc.

          When your sales order completes, O2A business logic for the order complete event, appears to execute additional logic ,, not related to the business, that may have been enabled via debug controls on the verbcode of the sales order.

          Please indicate what is the value of your sales order verbcode. Also let us know how the sales order is been generated/submitted to OSM to get a better picture.

          Finally, confirm if the COMPLETE status (order update) was recevied by your CRM system.

          Carlos
          • 2. Re: COM cartridge exception in SalesOrderCompleteEventHandler.xqy
            Carlos.Manjarres-Oracle
            Additional information.

            The xquery uses systeminteracitonmodule to calculate a new message Id sequence for the final order status update (complete) to be sent to CRM.
            The error message indicates that the last parameter: $salesOrderEbmRequestEbmId is empty. which was extracted from the input data available for this event automation ( $taskData )
            • 3. Re: COM cartridge exception in SalesOrderCompleteEventHandler.xqy
              Carlos.Manjarres-Oracle
              Please indicate the version of OSM/O2A

              Thank you
              • 4. Re: COM cartridge exception in SalesOrderCompleteEventHandler.xqy
                Viktor.Jarolim-Oracle
                Hi Nico, I am coming back to your original post.
                I once had something similar.
                The fact is that you are calling a function systeminteractionmodule:getInteractionSequence which has a certain number of arguments.
                And the fifth argument in the call is not populated while it is mandatory; you are probably passing in a variable that has not been populated with any value in the code before.

                You need to investigate in the Xquery code where this variable that is passed in is supposed to get populated and why it was not.

                In my case it was because somebody added the user with which the automator was run to another workgroup, which led to OSM choosing a different view (now called query task) for the GetOrder.Response which is passed into the automator at the beginning where some element was missing which was present in the view that was used before.

                This is because when a user is member of more groups that have different views assigned for an order type/source, OSM picks one at random.

                In your case the cause may well be different, just go throught the Xquery code. Good Luck. Let me know if this was helpful.

                For the security related issue I have no clue :-(

                regards
                Viktor Jarolim
                • 5. Re: COM cartridge exception in SalesOrderCompleteEventHandler.xqy
                  nicvas
                  Hi,

                  this is the line where we are getting the error:
                  let $sequence := systeminteractionmodule:getInteractionSequence($systemInteractionData, $context, $orderId, $SYSTEM_INTERACTION_VIEW, $salesOrderEbmRequestEbmId)

                  Can anybody help me to solve this issue?
                  The solution used is: OSM osmcartridge_V28574-01 related to osm_703_aia_cart

                  Thanks
                  Nico

                  Below the complete stack trace:
                  <Jan 9, 2012 1:06:57 PM CET> <Error> <oms> <BEA-000000> <automation.AutomationDispatcher: Failed to execute plugin[automation/plugin/internal/orderNotification/CommunicationsSalesOrderFulfillmentPIP/1.0.0/om:on-CommunicationsSalesOrder-CommunicationsSalesOrder-completion] due to com.mslv.oms.automation.AutomationException: Exception thrown while running Script resource [osmmodel:///CommunicationsSalesOrderFulfillmentPIP/1.0.0/resources/SalesOrderCompleteEventHandler.xqy]; exception location: ; SystemID: module with no systemId; Line#: 110; Column#: -1
                  com.mslv.oms.automation.AutomationException: com.mslv.oms.automation.AutomationException: Exception thrown while running Script resource [osmmodel:///CommunicationsSalesOrderFulfillmentPIP/1.0.0/resources/SalesOrderCompleteEventHandler.xqy]; exception location: ; SystemID: module with no systemId; Line#: 110; Column#: -1
                  at com.mslv.oms.automation.plugin.AutomationEventHandlerImpl.a(Unknown Source)
                  at com.mslv.oms.automation.plugin.AutomationEventHandlerImpl.processMessage(Unknown Source)
                  at com.mslv.oms.automation.AutomationDispatcher.onLocalMessage(Unknown Source)
                  at oracle.communications.ordermanagement.cluster.message.e.a(Unknown Source)
                  at oracle.communications.ordermanagement.cluster.message.impl.c.a(Unknown Source)
                  Truncated. see log file for complete stacktrace

                  Caused By: com.mslv.oms.automation.AutomationException: Exception thrown while running Script resource [osmmodel:///CommunicationsSalesOrderFulfillmentPIP/1.0.0/resources/SalesOrderCompleteEventHandler.xqy]; exception location: ; SystemID: module with no systemId; Line#: 110; Column#: -1
                  at oracle.communications.ordermanagement.automation.plugin.AbstractScriptPluginImplementation.transform(Unknown Source)
                  at oracle.communications.ordermanagement.automation.plugin.AbstractScriptPluginImplementation.runCommonFunctionality(Unknown Source)
                  at oracle.communications.ordermanagement.automation.plugin.ScriptRunnerImpl.runScript(Unknown Source)
                  at oracle.communications.ordermanagement.automation.plugin.AbstractScriptAutomator.run(Unknown Source)
                  at com.mslv.oms.automation.plugin.AbstractAutomator._runAutomator(Unknown Source)
                  Truncated. see log file for complete stacktrace

                  Caused By: net.sf.saxon.trans.XPathException: An empty sequence is not allowed as the 5th argument of systeminteractionmodule:getInteractionSequence()
                  at net.sf.saxon.expr.Expression.typeError(Expression.java:981)
                  at net.sf.saxon.expr.CardinalityChecker.evaluateItem(CardinalityChecker.java:277)
                  at net.sf.saxon.expr.ExpressionTool.evaluate(ExpressionTool.java:296)
                  at net.sf.saxon.expr.UserFunctionCall.evaluateArguments(UserFunctionCall.java:486)
                  at net.sf.saxon.expr.UserFunctionCall.callFunction(UserFunctionCall.java:412)
                  Truncated. see log file for complete stacktrace
                  • 6. Re: COM cartridge exception in SalesOrderCompleteEventHandler.xqy
                    Viktor.Jarolim-Oracle
                    Hi Nico, as I said, $salesOrderEbmRequestEbmId in your function call does not seem to be populted while it is mandatory in the function call.
                    You need to figure out where it was supposed tpo be populated in your previous code and why it was not.

                    Viktor
                    • 7. Re: COM cartridge exception in SalesOrderCompleteEventHandler.xqy
                      nicvas
                      Below the complete content of SalesOrderCompleteEventHandler.xq related to: Oracle® Communications Order and Service Management Cartridge Guide for Oracle Application Integration Architecture Release 7.0.3 E20057-01


                      http://www.heypasteit.com/clip/06OU
                      • 8. Re: COM cartridge exception in SalesOrderCompleteEventHandler.xqy
                        Carlos.Manjarres-Oracle
                        I suspect the issue is just data.
                        Perhaps logging an SR to work with Oracle Support is more appropiated for this issue.

                        I also suggest applying a couple of xquery debug tips:
                        1. You can run O2A with a temporally modified xquery script with additional debug logging instructions.
                        Note 1: DEBUG ONLY IN DEVELOPMENT ENVIRONMENT AND ALWAYS MAKE SURE OUT-OF-BOX- SCRIPTS ARE ORIGINAL UNLESS IS PART OF PLANNED CUSTOMIZATION WORK
                        Note 2: If you have patch 703.3, you can use xml catalog rediretion to point to your temporal folder with the modified xquery to debug , instead of
                             re-deploying the cartridge with the modified xquery script.
                             


                        For this case, replace the line 110 by this block:


                        2. Add log.info( concat("your debug string with data=",$taskData) )

                        For example:

                        let $mylog := <myLog><taskData>{$taskData}</taskData></mylog>


                        let $x :=
                        ......
                        ......
                        return
                             <anElement>.........</anElement>,
                        log.info( concat("*** DEBUG: taskData=",$mylog) )      

                        as long as $x is referenced by the xquery payload return, then the log.in() will print out in weblogic console/log file
                        • 9. Re: COM cartridge exception in SalesOrderCompleteEventHandler.xqy
                          Viktor.Jarolim-Oracle
                          Hi Nico, the variable is populated within the same function on lines 90 - 94:

                          let $ebm := if (exists($taskData/oms:_root/oms:messageXmlData/salesord:ProcessSalesOrderFulfillmentEBM))
                          then $taskData/oms:_root/oms:messageXmlData/salesord:ProcessSalesOrderFulfillmentEBM
                          else ()

                          let $salesOrderEbmRequestEbmId := $ebm/corecom:EBMHeader/corecom:EBMID/text()

                          Now since apparently it is not populated with any value, that implies the $taskData does not include the element messageXmlData (or, less likely, the xpath within the Xml data in that element).

                          Verify the roles the user executing the automator using this x query is member of.
                          Normally should be exactly one role. If more, this could be an issue, since they might have different query tasks.
                          Verify the query task assigned to that role for the given order type & source (called Order in the design studio).
                          Verify whether the element is in the task data of this query task.
                          Verify that the element is populated on your order and whether the xpath salesord:ProcessSalesOrderFulfillmentEBM/corecom:EBMHeader/corecom:EBMID is there (but I do not expect a problem here).
                          Let me know what you found.

                          regards
                          Viktor