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

Method ajaxViaJenkins() does not work in GenericJsPortlet without credentials anymore

    Details

    • Similar Issues:

      Description

      Method ajaxViaJenkins() does not work in GenericJsPortlet without credentials anymore - just calling ajaxViaJenkins(url, callback) used to correctly call the signature

      	@JavaScriptMethod
          public HttpResponse ajaxViaJenkins(String urlStr, String user, String pw) {
      		return new ServerSideHttpCall(urlStr, user, pw);
          }
      

      on java side. This does not work anymore (stabler 500), with Jenkins version 1.580.1 only ajaxViaJenkins(url, user, pw, callback) works in js.

        Attachments

          Issue Links

            Activity

            Hide
            ghenzler Georg Henzler added a comment -

            fixed by adding additional signature on java side

            Show
            ghenzler Georg Henzler added a comment - fixed by adding additional signature on java side
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: georg.henzler
            Path:
            pom.xml
            src/main/java/javagh/jenkins/mashupportlets/GenericJsPortlet.java
            http://jenkins-ci.org/commit/mashup-portlets-plugin/67521b95a29a4bcfaf68b1efe176520da50c6a65
            Log:
            JENKINS-26556 fixed by adding additional signature on java side

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: georg.henzler Path: pom.xml src/main/java/javagh/jenkins/mashupportlets/GenericJsPortlet.java http://jenkins-ci.org/commit/mashup-portlets-plugin/67521b95a29a4bcfaf68b1efe176520da50c6a65 Log: JENKINS-26556 fixed by adding additional signature on java side
            Hide
            ghenzler Georg Henzler added a comment -

            worked locally, but fails again on other instance

            Show
            ghenzler Georg Henzler added a comment - worked locally, but fails again on other instance
            Hide
            rocha909 Romain Chalumeau added a comment - - edited

            Hi Georg,

            I have tested the workaround described in JENKINS-25875 (empty user/passwd) with no success. I got the following exception :
            java.lang.IllegalArgumentException: argument count mismatch between ["http://[url]","",""] and [class java.lang.String]
            at org.kohsuke.stapler.MetaClass$JavaScriptProxyMethodDispatcher.doDispatch(MetaClass.java:464)
            ...

            Yet, the "normal" script works fine :
            ajaxViaJenkins(url, function(resp)

            { Q('#'+divId).html(resp.responseText); }

            );

            So that's solved for me.

            Thx.
            Romain

            Show
            rocha909 Romain Chalumeau added a comment - - edited Hi Georg, I have tested the workaround described in JENKINS-25875 (empty user/passwd) with no success. I got the following exception : java.lang.IllegalArgumentException: argument count mismatch between ["http://[url]","",""] and [class java.lang.String] at org.kohsuke.stapler.MetaClass$JavaScriptProxyMethodDispatcher.doDispatch(MetaClass.java:464) ... Yet, the "normal" script works fine : ajaxViaJenkins(url, function(resp) { Q('#'+divId).html(resp.responseText); } ); So that's solved for me. Thx. Romain
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: georg.henzler
            Path:
            src/main/java/javagh/jenkins/mashupportlets/GenericJsPortlet.java
            src/main/resources/javagh/jenkins/mashupportlets/GenericJsPortlet/genericjsportlet.jelly
            http://jenkins-ci.org/commit/mashup-portlets-plugin/160d3c7d9312e93890fc41e5e4493ed38a5de794
            Log:
            JENKINS-26556 fixing by not trying to overload @JavaScriptMethod methods
            anymore

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: georg.henzler Path: src/main/java/javagh/jenkins/mashupportlets/GenericJsPortlet.java src/main/resources/javagh/jenkins/mashupportlets/GenericJsPortlet/genericjsportlet.jelly http://jenkins-ci.org/commit/mashup-portlets-plugin/160d3c7d9312e93890fc41e5e4493ed38a5de794 Log: JENKINS-26556 fixing by not trying to overload @JavaScriptMethod methods anymore

              People

              • Assignee:
                ghenzler Georg Henzler
                Reporter:
                ghenzler Georg Henzler
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: