" /> Failed to parse compiled document in Composer - Genesys CTI User Forum

Author Topic: Failed to parse compiled document in Composer  (Read 7312 times)

Offline yozikkk

  • Newbie
  • *
  • Posts: 5
  • Karma: 1
Failed to parse compiled document in Composer
« on: December 23, 2014, 04:45:37 AM »
Advertisement
Hi  everybody .

I would ask about a problem with scxml application that i m trying to deploy.
When im trying to debug  application , Genesys Composer generates the error "failed to parse compiled document"
In the event details pane , i can see the discription about an error :


first message

2014-12-23 10:27:22,757 ERROR Receive thread core.linenumber.ORSDLineNumberMapper (?) - Failed to parse
org.xml.sax.SAXParseException: Content is not allowed in prolog.
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:174)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:388)
at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1411)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:1017)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:645)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:508)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:395)
at com.genesyslab.composer.route.debug.core.linenumber.ORSDLineNumberMapper.parse(Unknown Source)
at com.genesyslab.composer.route.debug.core.model.ORSDDebugTarget.handleDebugStarted(Unknown Source)
at com.genesyslab.composer.route.debug.core.model.ORSDDebugTarget.receiveMessage(Unknown Source)
at com.genesyslab.composer.debug.comm.ComposerDebugCommMgr.notifyListeners(Unknown Source)
at com.genesyslab.composer.debug.comm.ComposerDebugReceiveThread.run(Unknown Source)


second message


2014-12-23 10:27:22,762 ERROR Receive thread core.model.ORSDDebugTarget (?) - Failed to parse compiled document
An exception stack trace is not available.




Does anyone know , what  im doing wrong ?

Thanks for help






Offline Kubig

  • Hero Member
  • *****
  • Posts: 2755
  • Karma: 44
Re: Failed to parse compiled document in Composer
« Reply #1 on: December 23, 2014, 08:04:36 AM »
Post your XML doc declaration. This error message often means bad declaration (encoding, etc.) or something like whitespaces, etc.

Offline yozikkk

  • Newbie
  • *
  • Posts: 5
  • Karma: 1
Re: Failed to parse compiled document in Composer
« Reply #2 on: December 23, 2014, 08:17:55 AM »
Thanks ,Kubig

[b]This is  IPD xml [/b]



<?xml version="1.0" encoding="utf-8"?>
<scxml version="1.0" xmlns="http://www.w3.org/2005/07/scxml"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:ws="http://www.genesyslab.com/modules/ws"
xmlns:queue="http://www.genesyslab.com/modules/queue"
xmlns:dialog="http://www.genesyslab.com/modules/dialog"
xmlns:session="http://www.genesyslab.com/modules/session"
xmlns:ixn="http://www.genesyslab.com/modules/interaction"
xmlns:classification="http://www.genesyslab.com/modules/classification"
    initial="globalstate" 
        profile="ecmascript"
        name="default.defaultWorkflow">
       
    <script>
        <xi:include href="../include/common.js" parse="text" />
    </script>
    <script>   
        <xi:include href="../include/DataAccess.js" parse="text" />
    </script>   
    <script>
        <xi:include href="../include/RouteFeature.js" parse="text" />
    </script>
    <script>
        <xi:include href="../include/IrdEnumMapper.js" parse="text" />
    </script>
    <script>
        <xi:include href="../include/StringManipulation.js" parse="text" />
    </script>
    <script>
        <xi:include href="../include/DateTime.js" parse="text" />
    </script>
    <script>
        <xi:include href="../include/ListManipulation.js" parse="text" />
    </script>
    <script>
        <xi:include href="../include/MiscIRDFunctions.js" parse="text" />
    </script>
    <script>
        <xi:include href="../include/json.js" parse="text" />
    </script>

<!-- Auto Generated by Composer 8.1.201.52 -->
<!-- Application Author:  Version: 1.0 CreatedOn:  -->

<state id="globalstate">
<datamodel>
<data id="system" expr="new Object()"/>
<data id="context_management_services_url"/>
<data id="context_management_services_username"/>
<data id="context_management_services_password"/>
<data id="grat_server" />
<data id="grat_username" />
<data id="grat_password" />
<data id="grat_tenant" />
</datamodel>
<onentry>
<script>
<!-- Global Variables declarations -->
var system = new Object();
_data.system.context = system;
_data.system.ipd = system;

system.GlobalErrorHandlerAutoStopIxn;


<!-- Deprecated variables START -->
<!-- Do not use them in your diagrams -->
var App_Name = 'default';
var App_BaseURL = getBaseURL();
var App_RelativePathURL = getRelativePathURL();
var InteractionID;
var CallID;
var DNIS;
var ANI;
var TenantID;
var Tenant_Name;
var App_Last_Error_Event;
var App_Last_Error_Event_Name;
var App_Last_Error_Description;
var App_StartEvent;
<!-- Deprecated variables END -->

var queueName = "";
var queuedInteractionID = "";
</script>
<log expr="'RelativePathURL = ' + getRelativePathURL()" />
</onentry>
<!-- Catch all global transition events to terminate the strategy -->
<transition event="error.*" target="global_exit">
<!-- Log error messages if present -->
<script>
<![CDATA[
if ((typeof system.InteractionID != 'undefined')
&& (typeof _genesys.ixn.interactions[system.InteractionID] != 'undefined')
&& (typeof _genesys.ixn.interactions[system.InteractionID].voice == 'undefined')) {
system.GlobalErrorHandlerAutoStopIxn = true;
}
]]>
</script>
<log expr="'Global error event handler: ' + (typeof _event != 'undefined' ? _event.toSource() : '_event is undefined')" />
<if cond="typeof _event != 'undefined' &amp;&amp; typeof _event.data != 'undefined' &amp;&amp; typeof _event.data.description != 'undefined'">
<log expr="'Error message: ' + _event.data.description" />
</if>
<!-- Auto Stop -->
<if cond="system.GlobalErrorHandlerAutoStopIxn == true">
<script>
var global_error_handler_auto_stop_reqid;
</script>
<ixn:terminate requestid="global_error_handler_auto_stop_reqid" interactionid="system.InteractionID" reason="'Auto-stop interaction'"/>
</if>
</transition>
<initial>
<transition target="defaultWorkflow_event"/>
</initial>
<state id="defaultWorkflow_event">
<onentry>
<script>
<![CDATA[
system.InteractionID = (typeof _event != 'undefined') ? _event.data.interactionid : undefined;
InteractionID = system.InteractionID;
    if ((typeof system.InteractionID != 'undefined')
    && (typeof _genesys.ixn.interactions[system.InteractionID] != 'undefined')
    && (typeof _genesys.ixn.interactions[system.InteractionID].voice != 'undefined')) {
system.CallID = _genesys.ixn.interactions[system.InteractionID].voice.callid;
CallID = system.CallID;
system.DNIS = _genesys.ixn.interactions[system.InteractionID].voice.dnis;
DNIS = system.DNIS;
system.ANI = _genesys.ixn.interactions[system.InteractionID].voice.ani;
ANI = system.ANI;
system.TenantID = parseInt(_genesys.ixn.interactions[system.InteractionID].tenantid);
TenantID = system.TenantID;
system.TenantName = _genesys.session.tenant;
Tenant_Name = system.TenantName;
    }
]]>
</script>
<log expr="_sessionid + ': Interaction ' + system.InteractionID + ' processing'" />
</onentry>
<initial>
<transition target="defaultWorkflow" />
</initial>
<!-- This is the defaultWorkflow State -->
<state id="defaultWorkflow" initial="defaultWorkflow.globalstate">
<!-- include workflow scxml -->
<xi:include href="default.scxml" parse="xml" resolveid="defaultWorkflow" xpointer="AppEntry" />
<transition event="done.state.defaultWorkflow.globalstate" target="global_exit" />
</state>

</state>
</state>

<!-- Global Exit state -->
<final id="global_exit">
<onentry>
<log expr="_sessionid + ': Reached Final global exit state for application. Session will terminate now.'" />
</onentry>
</final>
</scxml>
######################################################

[b]this one is  workflow
[/b]


<?xml version="1.0" encoding="utf-8"?>
<scxml version="1.0" xmlns="http://www.w3.org/2005/07/scxml"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:ws="http://www.genesyslab.com/modules/ws"
xmlns:queue="http://www.genesyslab.com/modules/queue"
xmlns:dialog="http://www.genesyslab.com/modules/dialog"
xmlns:session="http://www.genesyslab.com/modules/session"
xmlns:ixn="http://www.genesyslab.com/modules/interaction"
xmlns:classification="http://www.genesyslab.com/modules/classification"
initial='noboot' 
        profile="ecmascript"
        name="default">
<!-- Auto Generated by Composer 8.1.201.52 -->
<!-- Application Author:  Version: 1.0 CreatedOn:  -->

<final id="noboot">
<onentry>
<log expr="'This SCXML page cannot be executed as the first page of an application. The first page should always be the SCXML page generated from an Interaction Process Diagram (IPD).'" />
</onentry>
</final>
<state id="AppEntry" initial="$$_MY_PREFIX_$$.globalstate">
<onentry>
<script>
var system = new Object();
system.diagram = 'default';
system.StartEvent = _data.system.ipd.StartEvent;
system.InteractionID = _data.system.ipd.InteractionID;
system.TenantID = _data.system.ipd.TenantID;
system.TenantName = _data.system.ipd.TenantName;
system.CallID = _data.system.ipd.CallID;
system.DNIS = _data.system.ipd.DNIS;
system.ANI = _data.system.ipd.ANI;
_data.system.context = system;


var App_Exit1 = new Object();
var App_ForceRoute1 = new Object();

system.BaseURL = getBaseURL();
system.RelativePathURL = getRelativePathURL();
system.Language = 'en-US';
system.LastErrorEvent = 'undefined';
system.LastErrorEventName = 'undefined';
system.LastErrorDescription = 'undefined';
system.WebServiceStubbing = '0';
system.TerminateIxnOnExit = 1;
system.LastTargetComponentSelected = 'undefined';
system.LastTargetObjectSelected = 'undefined';
system.LastTargetSelected = 'undefined';
system.LastVirtualQueueSelected = 'undefined';
system.LastSubmitRequestId = 'undefined';
system.OPM = getOPMParameters();
system.OCS_RecordURI = getWorkflowRecordURI();
system.OCS_URI = getWorkflowOCSURI();
system.OCS_Record = getWorkflowOCSRecord();

</script>
<log expr="'RelativePathURL = ' + system.RelativePathURL" />
</onentry>
<state id="globalstate">
<initial>
      <transition target="$$_MY_PREFIX_$$.Entry1"/>
</initial>

<!-- This is the Exit1 State -->
<state id="Exit1">
<onentry>
</onentry>
<transition cond="(typeof system.InteractionID != 'undefined')
&amp;&amp; (typeof _genesys.ixn.interactions[system.InteractionID] != 'undefined')
&amp;&amp; (typeof _genesys.ixn.interactions[system.InteractionID].voice == 'undefined')
&amp;&amp; (system.TerminateIxnOnExit == '1' || system.TerminateIxnOnExit == 1)"  target="$$_MY_PREFIX_$$.Exit1_stop_ixn"/>
    <transition target="$$_MY_PREFIX_$$.Exit1_final"/>
</state>
<state id="Exit1_stop_ixn">
<onentry>
<ixn:terminate requestid="App_Exit1['requestid']" interactionid="system.InteractionID" reason="'Auto-stop interaction'"/>
</onentry>
<transition event="interaction.terminate.done" cond="_event.data.requestid==App_Exit1['requestid']" target="$$_MY_PREFIX_$$.Exit1_final"/>
    <transition event="error.interaction.terminate" cond="_event.data.requestid==App_Exit1['requestid']" target="$$_MY_PREFIX_$$.Exit1_final"/>
</state>
<final id="Exit1_final">
<onentry>
<log expr="_sessionid + ': Reached final in Exit Block: Exit1_final. End of this session'" />
</onentry>
</final>

<!-- This is the ForceRoute1 State -->
<state id="ForceRoute1">
<initial>
<transition target="$$_MY_PREFIX_$$.ForceRoute1_redirect">
<log expr="_sessionid + ': Inside ForceRoute Block: ForceRoute1 '"/>
</transition>
</initial>
  <state id="ForceRoute1_redirect">
<onentry>
<script>
var App_hints = new Object();
var destinationResource = {'switch':'Switch','dn':'2005'};
</script>
<ixn:redirect requestid="App_ForceRoute1['requestid']" interactionid="system.InteractionID" from="system.DNIS" to="destinationResource" type="_genesys.queue.rType.RouteTypeDefault"/>
</onentry>
</state>
<transition event="interaction.redirect.done" cond="_event.data.requestid==App_ForceRoute1['requestid']" target="$$_MY_PREFIX_$$.Exit1">
<script>storeEvent("ForceRoute1", _event);</script>
</transition>
</state>

<!-- This is the Entry1 State -->
<state id="Entry1">
<onentry>
    <log expr="_sessionid + ': Inside Entry Block: Entry1'" />
</onentry>
<transition target="$$_MY_PREFIX_$$.ForceRoute1">
</transition>
</state>
</state>
</state>

</scxml>










Offline Kubig

  • Hero Member
  • *****
  • Posts: 2755
  • Karma: 44
Re: Failed to parse compiled document in Composer
« Reply #3 on: December 23, 2014, 10:47:38 AM »
Is this fragment correct [code]initial='noboot'  [/code]? Did you try any XML on-line validators?

Offline yozikkk

  • Newbie
  • *
  • Posts: 5
  • Karma: 1
Re: Failed to parse compiled document in Composer
« Reply #4 on: December 23, 2014, 11:15:24 AM »
Kubig,

I ve tried xmlvalidation.com

So, no errors were found in both files  :(




Offline Kubig

  • Hero Member
  • *****
  • Posts: 2755
  • Karma: 44
Re: Failed to parse compiled document in Composer
« Reply #5 on: December 23, 2014, 11:22:10 AM »
Try to open the XML files within any text editor which can show special characters like a BOM, EoL, etc. or check the characters on byte level if are equals to UTF-8 character representation.

The problem occurrs "just" within DEBUG mode or after standard deployment as well? Did you encounter problem with only these files or the problem have all flow which you have created (if yes, which version of Composer exactly are you using?)?

Offline yozikkk

  • Newbie
  • *
  • Posts: 5
  • Karma: 1
Re: Failed to parse compiled document in Composer
« Reply #6 on: December 23, 2014, 11:46:36 AM »
The problem occurs when i trying to debug  application . Also application doesn't working in standard deployment when its downloaded  to another web server .

All applications which i  created ,  couse the same error .  Genesys Composer version 8.1.201.52

Offline Kubig

  • Hero Member
  • *****
  • Posts: 2755
  • Karma: 44
Re: Failed to parse compiled document in Composer
« Reply #7 on: December 23, 2014, 11:56:32 AM »
Check the incorrect characters like BOM, etc. which version of Eclipse are you using (do not rembember if in that version was composer just like a plugin)? Did you try to reinstall composer or try to use fresh install? I am using composer from start version within release 8.1 and never encounter similiar issue. Did you try to contact G-support for help? If you can, upload original XML file and I will check it in my lab env.

Offline yozikkk

  • Newbie
  • *
  • Posts: 5
  • Karma: 1
Re: Failed to parse compiled document in Composer
« Reply #8 on: December 25, 2014, 03:17:20 AM »
Hi Kubig ! 

W've tried to reinstall and install  Composer version 8.1.201.52, 8.1.2.000.1 , so i ' ve got the same error during debug and application doesnt works too .
Then ,  i install  8.1.101.88 and the deployment was sucssesfull!

Definenatly the problem is in the  Composer version 8.1.2......
Thanks a lot for help !!!