marklogic-community / roxy

Deployment tool for MarkLogic applications. Also provides optional unit test and XQuery MVC structure
Other
87 stars 66 forks source link

Bootstrap fail due to ERROR: XDMP-AS: (err:XPTY0004) $field-path as xs:string -- Invalid coercion: #889

Closed rajib-cts closed 5 years ago

rajib-cts commented 5 years ago

After adding one field name and path in ml-config.xml I am getting below error like

Bootstrapping your project into MarkLogic 9 on 10.11.101.122... WARN: Running the hybrid app-type with MarkLogic 8 is not recommended. Doing so requires manual patching of the Roxy rewriter. You will be unable to access all of the MarkLogic REST features. See https://github.com/marklogic/roxy/issues/416 for details. ERROR: XDMP-AS: (err:XPTY0004) $field-path as xs:string -- Invalid coercion: (<d b:path xmlns:db="http://marklogic.com/xdmp/database">mml:project...</db:path>, < db:path xmlns:db="http://marklogic.com/xdmp/database">mml:project...</db:path>,

mml:project...) as xs:string See MarkLogic Server error log for more details. ERROR: ... Bootstrap FAILED MarkLogic Server error log XDMP-AS err:XPTY0004 1.0-ml Invalid coercion XDMP-AS: (err:XPTY0004) $field-path as xs:string -- Invalid coercion: (<db:path xmlns:db="http://marklogic.com/xdmp/database">mml:project...</db:path>, <db:path xmlns:db="http://marklogic.com/xdmp/database">mml:project...</db:path>, <db:path xmlns:db="http://marklogic.com/xdmp/database">mml:project...</db:path>) as xs:string false $field-path as xs:string (<db:path xmlns:db="http://marklogic.com/xdmp/database">mml:project...</db:path>, <db:path xmlns:db="http://marklogic.com/xdmp/database">mml:project...</db:path>, <db:path xmlns:db="http://marklogic.com/xdmp/database">mml:project...</db:path>) xs:string /eval 5 17 setup:add-fields(<configuration><databases xsi:schemaLocation="http://marklogic.com..." .../></configuration>, xs:unsignedLong("8707683707355209358"), <db:database group="Default" xmlns:db="http://marklogic.com/xdmp/database">...</db:database>) admin-config <configuration><databases xsi:schemaLocation="http://marklogic.com..." .../></configuration> database xs:unsignedLong("8707683707355209358") db-config <db:database group="Default" xmlns:db="http://marklogic.com/xdmp/database">...</db:database> field <db:field xmlns:db="http://marklogic.com/xdmp/database"><db:field-name>...</db:field-name>...</db:field> path <db:field-path xmlns:db="http://marklogic.com/xdmp/database"><db:path>...</db:path>...</db:field-path> 1.0-ml /eval 2101 23 setup:configure-indexes(<configuration default-group="Default"><groups xsi:schemaLocation="..." .../>...</configuration>) import-config <configuration default-group="Default"><groups xsi:schemaLocation="..." .../>...</configuration> db-config <db:database group="Default" xmlns:db="http://marklogic.com/xdmp/database">...</db:database> database-name db:database-name("mml-cms-app-content-test") database xs:unsignedLong("8707683707355209358") admin-config <configuration/> admin-config <configuration><databases xsi:schemaLocation="http://marklogic.com..." .../></configuration> admin-config <configuration><databases xsi:schemaLocation="http://marklogic.com..." .../></configuration> admin-config <configuration><databases xsi:schemaLocation="http://marklogic.com..." .../></configuration> admin-config <configuration><databases xsi:schemaLocation="http://marklogic.com..." .../></configuration> admin-config <configuration><databases xsi:schemaLocation="http://marklogic.com..." .../></configuration> admin-config <configuration><databases xsi:schemaLocation="http://marklogic.com..." .../></configuration> admin-config <configuration><databases xsi:schemaLocation="http://marklogic.com..." .../></configuration> admin-config <configuration><databases xsi:schemaLocation="http://marklogic.com..." .../></configuration> admin-config <configuration><databases xsi:schemaLocation="http://marklogic.com..." .../></configuration> admin-config <configuration><databases xsi:schemaLocation="http://marklogic.com..." .../></configuration> 1.0-ml /eval 704 90 setup:do-setup(<configuration default-group="Default"><!--&#10; default-group...-->...</configuration>, "all,", map:map(<map:map xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" .../>)) import-config <configuration default-group="Default"><!--&#10; default-group...-->...</configuration> options "all," properties map:map(<map:map xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" .../>) optionsMap map:map(<map:map xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" .../>) do-internals fn:false() import-config <configuration default-group="Default"><groups xsi:schemaLocation="..." .../>...</configuration> 1.0-ml /eval 6371 1 1.0-ml Which Operating System are you using? Linux Which version of MarkLogic are you using? Marklogic 9.0-5 Which version of Roxy are you using (see version.txt)? 1.7.7
grtjn commented 5 years ago

Can you share the relevant part of your ml-config.xml?

rajib-cts commented 5 years ago
  <fields>
    <field>
      <field-name>suggest-field-project</field-name>
      <field-path>
        <path>mml:project/mml:feed/mml:title</path>
        <weight>1.0</weight>
        <path>mml:project/mml:feed/mml:author</path>
        <weight>1.0</weight>    
        <path>mml:project/mml:feed/mml:isbn</path>
        <weight>1.0</weight>
   </field-path>
      <word-lexicons/>
      <included-elements/>
      <excluded-elements/>
      <tokenizer-overrides/>
      <stemmed-searches>basic</stemmed-searches>
      <fast-phrase-searches>true</fast-phrase-searches>
      <fast-case-sensitive-searches>true</fast-case-sensitive-searches>
      <fast-diacritic-sensitive-searches>true</fast-diacritic-sensitive-searches>
    </field>
    <field>
      <field-name>suggest-field-content</field-name>
      <field-path>
        <path>mml:content/mml:feed/mml:descriptive/mml:title</path>
        <weight>1.0</weight>
        <path>mml:content/mml:feed/mml:contentType</path>
        <weight>1.0</weight>    
</field-path>
      <word-lexicons/>
      <included-elements/>
      <excluded-elements/>
      <tokenizer-overrides/>
      <stemmed-searches>basic</stemmed-searches>
      <fast-phrase-searches>true</fast-phrase-searches>
      <fast-case-sensitive-searches>true</fast-case-sensitive-searches>
      <fast-diacritic-sensitive-searches>true</fast-diacritic-sensitive-searches>
    </field>
    <field>
      <field-name>suggest-field-all</field-name>
      <field-path>
        <path>mml:project/mml:feed/mml:title</path>
        <weight>1.0</weight>
        <path>mml:project/mml:feed/mml:author</path>
        <weight>1.0</weight>    
        <path>mml:project/mml:feed/mml:isbn</path>
        <weight>1.0</weight>          
        <path>mml:content/mml:feed/mml:descriptive/mml:title</path>
        <weight>1.0</weight>
        <path>mml:content/mml:feed/mml:contentType</path>
        <weight>1.0</weight>    
     </field-path>
      <word-lexicons/>
      <included-elements/>
      <excluded-elements/>
      <tokenizer-overrides/>
      <stemmed-searches>basic</stemmed-searches>
      <fast-phrase-searches>true</fast-phrase-searches>
      <fast-case-sensitive-searches>true</fast-case-sensitive-searches>
      <fast-diacritic-sensitive-searches>true</fast-diacritic-sensitive-searches>
    </field>
    <field>
      <field-name/>
      <include-root>true</include-root>
      <fast-case-sensitive-searches>false</fast-case-sensitive-searches>
      <fast-diacritic-sensitive-searches>false</fast-diacritic-sensitive-searches>
      <fast-phrase-searches>false</fast-phrase-searches>
      <one-character-searches>false</one-character-searches>
      <stemmed-searches>basic</stemmed-searches>
      <three-character-searches>false</three-character-searches>
      <three-character-word-positions>false</three-character-word-positions>
      <trailing-wildcard-searches>false</trailing-wildcard-searches>
      <trailing-wildcard-word-positions>false</trailing-wildcard-word-positions>
      <two-character-searches>false</two-character-searches>
      <value-positions>false</value-positions>
      <value-searches>false</value-searches>
      <word-searches>false</word-searches>
      <word-lexicons/>
      <included-elements>
        <included-element>
          <namespace-uri>http://ns.com</namespace-uri>
          <localname>blah</localname>
          <weight>1.0</weight>
          <attribute-namespace-uri/>
          <attribute-localname/>
          <attribute-value/>
        </included-element>
      </included-elements>
      <excluded-elements/>
    </field>
  </fields>

 <range-element-indexes>

    <range-field-index>
      <scalar-type>string</scalar-type>
      <field-name>suggest-field-project</field-name>
      <collation>http://marklogic.com/collation/</collation>
      <range-value-positions>false</range-value-positions>
  <invalid-values>ignore</invalid-values>
    </range-field-index>
    <range-field-index>
      <scalar-type>string</scalar-type>
      <field-name>suggest-field-content</field-name>
      <collation>http://marklogic.com/collation/</collation>
      <range-value-positions>false</range-value-positions>
 <invalid-values>ignore</invalid-values>
    </range-field-index>    
    <range-field-index>
      <scalar-type>string</scalar-type>
      <field-name>suggest-field-all</field-name>
      <collation>http://marklogic.com/collation/</collation>
      <range-value-positions>false</range-value-positions>
  <invalid-values>ignore</invalid-values>
    </range-field-index>
grtjn commented 5 years ago

You have to wrap each combination of a path and weight element into separate field-path element, and not group them all together in one..

rajib-cts commented 5 years ago

Thanks @grtjn, Its working fine now.