Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-29055

Problem with Active Choices 1.0 and jQuery

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Trivial Trivial
    • active-choices-plugin
    • None
    • Java 1.8.0_31
      Clean installation of Jenkins 1.617;
      Additional plugins:
       - Active Choices 1.0
       - Validating String Parameter 2.3
       - jQuery 1.11.2-0

      In short: I tried to migrate an existing project from Uno Choice 0.19 to Active Choice 1.0 and I found that I can not reach the referred parameter. I tried various methods to get the value of the referred parameter with no success. I tried to reproduce the problem on a clean Jenkins copy and everything worked like a charm. What was going on, then?!

      Here you are the details:
      1. I installed a fresh copy of Jenkins - I took jenkins.war version 1.617 and started it with
      java -jar jenkins.war
      2. Entered the management console and:

      Here is the list of the installed plugins with their versions:

       Active Choices Plug-in              | 1.0
       Ant Plugin                          | 1.2
       Credentials Plugin                  | 1.22
       CVS Plug-in                         | 2.12
       External Monitor Job Type Plugin    | 1.4
       GIT client plugin                   | 1.17.1
       GIT plugin                          | 2.3.5
       Git server plugin                   | 1.6
       Javadoc Plugin                      | 1.3
       JUnit Plugin                        | 1.6
       LDAP Plugin                         | 1.11
       Mailer Plugin                       | 1.15
       MapDB API Plugin                    | 1.0.6.0
       Matrix Authorization Strategy Plugin| 1.2
       Matrix Project Plugin               | 1.6
       Maven Integration plugin            | 2.10
       OWASP Markup Formatter Plugin       | 1.3
       PAM Authentication plugin           | 1.2
       SCM API Plugin                      | 0.2
       Script Security Plugin              | 1.14
       Scriptler                           | 2.7
       SSH Credentials Plugin              | 1.11
       SSH Slaves plugin                   | 1.9
       Subversion Plug-in                  | 2.5
       Token Macro Plugin                  | 1.10
       Translation Assistance plugin       | 1.12
       Validating String Parameter Plugin  | 2.3
       Windows Slaves Plugin               | 1.1
      

      3. Created a simple test project (attached). You can see that its only purpose is to get the value of the Validating String parameter using different paths;

      4. Opened the test project and hit "Build with Parameters"

      The observations on the script running:
      A. There is always one error thrown on the page load:

      Jun 23, 2015 4:57:02 PM FINEST org.biouno.unochoice.model.GroovyScript
      
      Fallback to default script...
      groovy.lang.MissingPropertyException: No such property: validStr for class: Script1
          at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:50)
          at org.codehaus.groovy.runtime.callsite.PogoGetPropertySite.getProperty(PogoGetPropertySite.java:49)
          at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGroovyObjectGetProperty(AbstractCallSite.java:231)
          at Script1.run(Script1.groovy:2)
          at groovy.lang.GroovyShell.evaluate(GroovyShell.java:580)
          at groovy.lang.GroovyShell.evaluate(GroovyShell.java:618)
          at groovy.lang.GroovyShell.evaluate(GroovyShell.java:589)
          at org.biouno.unochoice.model.GroovyScript.eval(GroovyScript.java:128)
          at org.biouno.unochoice.util.ScriptCallback.call(ScriptCallback.java:69)
          at org.biouno.unochoice.AbstractScriptableParameter.eval(AbstractScriptableParameter.java:138)
          at org.biouno.unochoice.AbstractScriptableParameter.getChoices(AbstractScriptableParameter.java:104)
          at org.biouno.unochoice.AbstractScriptableParameter.getChoices(AbstractScriptableParameter.java:93)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:483)
          at org.apache.commons.jexl.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:258)
          at org.apache.commons.jexl.parser.ASTMethod.execute(ASTMethod.java:104)
          at org.apache.commons.jexl.parser.ASTReference.execute(ASTReference.java:83)
          at org.apache.commons.jexl.parser.ASTReference.value(ASTReference.java:57)
          at org.apache.commons.jexl.parser.ASTReferenceExpression.value(ASTReferenceExpression.java:51)
          at org.apache.commons.jexl.ExpressionImpl.evaluate(ExpressionImpl.java:80)
          at hudson.ExpressionFactory2$JexlExpression.evaluate(ExpressionFactory2.java:74)
              ...
      

      B. Immediately after that the (valid) script output is observed in the console:

         ---------------------------------------------
         ---> validStr=
         ---> validStr=
         ---> binding.variables.get =
         ---> binding = groovy.lang.Binding@2d47c5ae
         ---> binding.variables = [validStr:]
         ---> binding.getProperty =
         ---> getBinding = groovy.lang.Binding@2d47c5ae
         ---> getProperty =
      

      C. Entering a value in the Validating String parameter, on the exit (lost focus) of the text field, the correct value is observed in the Active Choices parameter:

         ---------------------------------------------
         ---> validStr= 123
         ---> validStr= 123
         ---> binding.variables.get = 123
         ---> binding = groovy.lang.Binding@2c331bee
         ---> binding.variables = [validStr:123]
         ---> binding.getProperty = 123
         ---> getBinding = groovy.lang.Binding@2c331bee
         ---> getProperty = 123
      

      So far - so good

      5. (In short) Installed jQuery Plugin ( https://wiki.jenkins-ci.org/display/JENKINS/jQuery+Plugin ) and restarted Jenkins. The newly installed plugin is
      {{ jQuery plugin | 1.11.2-0}}

      6. Opened the test project and hit "Build with Parameters"

      The observations on the script running:
      A. The "No such property" exception is still there;

      B. Immediately after that the (valid) script output is observed in the console:

         ---------------------------------------------
         ---> validStr=
         ---> validStr=
         ---> binding.variables.get =
         ---> binding = groovy.lang.Binding@2d47c5ae
         ---> binding.variables = [validStr:]
         ---> binding.getProperty =
         ---> getBinding = groovy.lang.Binding@2d47c5ae
         ---> getProperty =
      

      C. Entering a value in the Validating String parameter, on the exit (lost focus) of the text field, the NO value is observed in the Active Choices parameter:

         ---------------------------------------------
         ---> validStr=
         ---> validStr=
         ---> binding.variables.get =
         ---> binding = groovy.lang.Binding@1af9ece6
         ---> binding.variables = [validStr:]
         ---> binding.getProperty =
         ---> getBinding = groovy.lang.Binding@1af9ece6
         ---> getProperty =
      

      7. Edited the test project and gave the Validating String parameter a default value - "234". Saved the new definition and hit "Build with Parameters"
      The observations on the script running:
      A. The "No such property" exception is still there;

      B. Immediately after that the (valid) script output is observed in the console - the default value is displayed:

         ---------------------------------------------
         ---> validStr= 234
         ---> validStr= 234
         ---> binding.variables.get = 234
         ---> binding = groovy.lang.Binding@4ae9665a
         ---> binding.variables = [validStr:234]
         ---> binding.getProperty = 234
         ---> getBinding = groovy.lang.Binding@4ae9665a
         ---> getProperty = 234
      

      C. Entering a different value ("123" in the Validating String parameter, on the exit (lost focus) of the text field, the default value is observed in the Active Choices parameter:

         ---------------------------------------------
         ---> validStr= 234
         ---> validStr= 234
         ---> binding.variables.get = 234
         ---> binding = groovy.lang.Binding@77a897d5
         ---> binding.variables = [validStr:234]
         ---> binding.getProperty = 234
         ---> getBinding = groovy.lang.Binding@77a897d5
         ---> getProperty = 234
      

      9. Removed the jQuery plugin, restarted Jenkins and the correct behavior of Active Choices parameter came back.

      Notes:

      • during all experiments there are no other errors registered in Jenkins logs except the "No such property" one;
      • the existing project (the one that uses Uno Choice 0.19) works fine with the mentioned jQuery version 1.11.2-0

      To be honest, I repeated the above scenario (from the Jenkins installation) several times due to different technical reasons and the result was always the same - jQuery interferes with Active Choices Plugin

            kinow Bruno P. Kinoshita
            mmaker1234 Monique Maker
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: