4 Replies Latest reply on Sep 3, 2013 2:39 PM by kcbabo

    Switchyard - Properties injection issue

    srini8881

      Hi,

       

      I am using an external file with set of all properties.

       

      I am injecting the file into the runtime environment using -P during Jboss start up.

       

      > standalone.bat -P=location of my property file\property file

       

      The component which i am using here is SFTP.  One of the property which I want to inject from the property file is poll delay.

       

      So I am using something like ${my.application.sftp.poll.delay} in the swtichyard.xml  (In the property file this property refers to a value 2000)

       

      But I am getting this error which says that the property is not a integer.  [......is not a valid value of union type 'propInteger']

       

      How do we inject integer (non-string) values into the respective property?

       

      Thanks

      Srini.

        • 1. Re: Switchyard - Properties injection issue
          kcbabo

          Where do you see the error?  In the tooling, during project build, during deployment, at runtime?  If a stack trace is present, please include it.

          • 2. Re: Switchyard - Properties injection issue
            srini8881

            Yes.  I am getting this error while building the project using maven.

             

            This is the error:

             

            [ERROR] Failed to execute goal org.switchyard:switchyard-plugin:1.0.0.Alpha1:configure (default) on project SOAIntegrationServices: Model [org.switchyard.config.model.switchyard.v1.V1SwitchYardModel] is invalid: cvc-datatype-valid.1.2.3: '${property.messages.per.poll}' is not a valid value of union type 'propInteger'. -> [Help 1]

            [ERROR]

            [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.

            [ERROR] Re-run Maven using the -X switch to enable full debug logging.

             

             

            In jbossdev studio, I have done the following configuration:

             

            SY_Error_Polling.png

             

            In the external property file:  I have mapped this property as following:

            property.messages.per.poll=10

             

            Thanks

            Srini.

            • 3. Re: Re: Switchyard - Properties injection issue
              kcbabo

              I was able to reproduce this locally and then had the a-ha! moment of realizing we're a bit too strict on the regex for fields that accept property substitution.  The current definition is:

               

              <pattern value="\$\{([a-zA-Z0-9])*(:([a-zA-Z0-9])*)?\}"/>
              

               

              For now, you'll have to go without the "." in your property names, e.g.

               

              ${propertyMessagesPerPoll}
              

               

              Yes, that stinks.  I can update the schema to allow for "-", ".", and "_".  Note that this only affects non-string values in switchyard.xml. 



              • 4. Re: Re: Switchyard - Properties injection issue
                kcbabo