Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Strict Mode logs invalid warning

    Hi Isomorphic,

    I have a DataSource (script.ds.xml) defined with ID="script".

    I am seeing the following warning logged:

    Code:
    2015-07-23-16:28:16:486 -0400   WARN [http-nio-8180-exec-2] attribute 'type' is not declared in Component Schema '{script.ds.xml}' and strict mode is enabled.  See 'Strict Mode' overview in the documentation for details.Object.fields.script /Object[@ID=Method]/fields/script
    2015-07-23-16:28:16:489 -0400   WARN [http-nio-8180-exec-2] Validation errors validating a 'Object':
    {
        "/Object[@ID=Method]/fields/script":{
            recordPath:"/Object[@ID=Method]/fields/script",
            scriptName:{
                errorMessage:"Field is required"
            }
        }
    }
    Here is the field tag for scriptName:

    Code:
    <field name="scriptName" type="text" length="100" required="true"></field>
    I'm not sure why Strict Mode is using Component Schema 'script.ds.xml' instead of 'DataSourceField.ds.xml' in this case. The warning goes away if I use a different DataSource ID.

    I'm using SmartClient Version: SNAPSHOT_v10.1d_2015-07-23/Pro Deployment (built 2015-07-23).

    Thanks.

    #2
    We would need to see more of surrounding XML to figure out why that warning is appearing and whether it's spurious.

    Comment


      #3
      I'm able to reproduce the warning with the following simplified datasource descriptor.

      Code:
      <DataSource ID="script" serverType="generic">
          <fields>
              <field name="scriptName" type="text" length="100" required="true">
              </field>
          </fields>
      </DataSource>

      Comment


        #4
        <script> elements are used by the Server Scripting system to declare inline script in operationBindings.

        Your DataSource being named "script" advertises a willingness to process these <script> blocks when they appear in .ds.xml files.

        We're looking at a way to avoid developer-specified .ds.xml files becoming involved in such processing (which is a powerful feature, but sometimes gets hit unintentionally) but for now, you should either ignore the warning, disable it (see Strict Mode docs) or rename the DataSource.

        Comment


          #5
          Okay, thanks for looking into this.

          Comment


            #6
            After disabling Strict Mode, I no longer see the warning about the 'type' attribute not being declared; however, the following warning is still logged.

            Code:
            WARN [http-nio-8180-exec-9] Validation errors validating a 'Object':
            {
                "/Object[@ID=Method]/fields/script":{
                    recordPath:"/Object[@ID=Method]/fields/script",
                    scriptName:{
                        errorMessage:"Field is required"
                    }
                }
            }
            I added the following to server.properties:

            Code:
            schema.strict.all:false

            Comment


              #7
              Right, the validation error really occurs regardless of whether strict mode is engaged, because your DataSource is being used for any <script> tag. However, the error remains harmless, with the same possible resolutions we listed previously.

              Comment


                #8
                Got it. Thanks for clarifying.

                Comment

                Working...
                X