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

loginLink.jelly JellyTagException

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: core
    • Labels:
      None
    • Environment:
      Jenkins ver. 1.638, linux, JDK 1.8
    • Similar Issues:

      Description

      A problem is occurring when attempting to start a job using REST API. To reproduce simply curl the following to the the job:

      curl -i -X POST http://username:password@jenkins.server.address/job/ia-sample-job/build

      This results in:

      org.apache.commons.jelly.JellyTagException: jar:file:/mnt/jenkins/tomcat/webapps/jenkins/WEB-INF/lib/jenkins-core-1.638.jar!/hudson/security/SecurityRealm/loginLink.jelly:28:78: <j:invokeStatic> Could not load class: java.net.URLEncoder. Reason: java.lang.NoSuchMethodException: java.net.URLEncoder.encode(java.lang.Object, java.lang.String)
      	at org.apache.commons.jelly.tags.core.InvokeStaticTag.createLoadClassFailedException(InvokeStaticTag.java:177)
      	at org.apache.commons.jelly.tags.core.InvokeStaticTag.doTag(InvokeStaticTag.java:139)
      	at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:269)
      	at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
      	at org.apache.commons.jelly.tags.core.CoreTagLibrary$2.run(CoreTagLibrary.java:105)
      	at org.kohsuke.stapler.jelly.JellyViewScript.run(JellyViewScript.java:95)
      	at org.kohsuke.stapler.jelly.IncludeTag.doTag(IncludeTag.java:147)
      	at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:269)
      	at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
      	at org.apache.commons.jelly.tags.core.CoreTagLibrary$2.run(CoreTagLibrary.java:105)
      	at org.kohsuke.stapler.jelly.JellyViewScript.run(JellyViewScript.java:95)
      	at org.kohsuke.stapler.jelly.IncludeTag.doTag(IncludeTag.java:147)
      	at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:269)
      	at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:161)
      	at org.apache.commons.jelly.tags.core.OtherwiseTag.doTag(OtherwiseTag.java:41)
      	at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:269)
      	at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
      	at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:161)
      	at org.apache.commons.jelly.tags.core.ChooseTag.doTag(ChooseTag.java:38)
      	at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:269)
      	at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
      	at org.apache.commons.jelly.tags.core.CoreTagLibrary$1.run(CoreTagLibrary.java:98)
      	at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99)
      	at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
      	at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99)
      	at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
      	at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99)
      	at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
      	at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99)
      	at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
      	at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99)
      	at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
      	at org.apache.commons.jelly.tags.core.CoreTagLibrary$2.run(CoreTagLibrary.java:105)
      	at org.kohsuke.stapler.jelly.CallTagLibScript.run(CallTagLibScript.java:120)
      	at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
      	at org.apache.commons.jelly.tags.core.CoreTagLibrary$2.run(CoreTagLibrary.java:105)
      	at org.kohsuke.stapler.jelly.JellyViewScript.run(JellyViewScript.java:95)
      	at org.kohsuke.stapler.jelly.DefaultScriptInvoker.invokeScript(DefaultScriptInvoker.java:63)
      	at org.kohsuke.stapler.jelly.DefaultScriptInvoker.invokeScript(DefaultScriptInvoker.java:53)
      	at org.kohsuke.stapler.jelly.JellyFacet$1.dispatch(JellyFacet.java:95)
      	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746)
      	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876)
      	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:649)
      	at hudson.init.impl.InstallUncaughtExceptionHandler$1.reportException(InstallUncaughtExceptionHandler.java:27)
      	at org.kohsuke.stapler.compression.CompressionFilter.reportException(CompressionFilter.java:77)
      	at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:55)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      	at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:81)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      	at org.kohsuke.stapler.DiagnosticThreadNameFilter.doFilter(DiagnosticThreadNameFilter.java:30)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:217)
      	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
      	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:614)
      	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)
      	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
      	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)
      	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
      	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:518)
      	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1091)
      	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:673)
      	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500)
      	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1456)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
      	at java.lang.Thread.run(Thread.java:745)
      Caused by: java.lang.NoSuchMethodException: java.net.URLEncoder.encode(java.lang.Object, java.lang.String)
      	at java.lang.Class.getMethod(Class.java:1786)
      	at org.apache.commons.jelly.tags.core.InvokeStaticTag.doTag(InvokeStaticTag.java:124)
      	... 68 more
      

      This occurs here:

       <j:invokeStatic var="from" className="java.net.URLEncoder" method="encode">
          <j:arg value="${if (request.session.attribute('from')!=null) request.session.getAttribute('from');  else if (request.getParameter('from')!=null) request.getParameter('from'); else if (request.requestURI=='/loginError' || request.requestURI=='/login') '/'; else request.requestURI;}"/>
          <j:arg value="UTF-8"/>
        </j:invokeStatic>
      

      I'm guessing somehow the above results in it evaluating to the branch of if that doesn't produce a String which never gets hit otherwise.

        Attachments

          Activity

          Hide
          pajasoft Pavel Janoušek added a comment -

          kamran kamran

          Based on your report, you were working with Jenkins-2.7.4, not 2.4.
          I can't find property escapeTestDescp defined nor used in Jenkins-core anywhere. Could you try your scenario with the clean Jenkins deployment if it still occurs? Probably it is incorporated from some plugin you have installed into your deployment (TestNG plug-in?), so is should be fixed there.

          Please provide feedback or more info about your setup. Thank you. Pavel

          Show
          pajasoft Pavel Janoušek added a comment - kamran kamran Based on your report, you were working with Jenkins-2.7.4, not 2.4. I can't find property escapeTestDescp defined nor used in Jenkins-core anywhere. Could you try your scenario with the clean Jenkins deployment if it still occurs? Probably it is incorporated from some plugin you have installed into your deployment (TestNG plug-in?), so is should be fixed there. Please provide feedback or more info about your setup. Thank you. Pavel
          Hide
          pajasoft Pavel Janoušek added a comment -

          The culprit is really TestNG plug-in here. Looks like testngProjAction is unexceptionally NULL.

          Show
          pajasoft Pavel Janoušek added a comment - The culprit is really TestNG plug-in here . Looks like testngProjAction is unexceptionally NULL.
          Hide
          pajasoft Pavel Janoušek added a comment -

          kamran kamran
          Your different issue is reported as JENKINS-38661, I thing we can close this one.

          Show
          pajasoft Pavel Janoušek added a comment - kamran kamran Your different issue is reported as JENKINS-38661 , I thing we can close this one.
          Hide
          gauravk Gaurav Khandelwal added a comment -

          Hello Team,

          We are getting similar exception while executing multiple plans in Jenkins. Jenkins version - 2.46.3.

          Error Summary:

          org.apache.commons.jelly.JellyTagException: jar:file:/C:/Bitnami/jenkins-*2.46.3*-0/apache-tomcat/webapps/jenkins/WEB-INF/lib/jenkins-core-2.46.3.jar!/lib/layout/layout.jelly:259:25: <d:invokeBody> org.apache.commons.jelly.JellyTagException: jar:file:/C:/Bitnami/jenkins-2.46.3-0/apache-tomcat/webapps/jenkins/WEB-INF/lib/jenkins-core-2.46.3.jar!/lib/layout/main-panel.jelly:36:21: <d:invokeBody> org.apache.commons.jelly.JellyTagException: Cannot get property 'escapeExceptionMsg' on null object.

           

          Will appreciate, any idea on resolution or work-around.

           

          Thanks in Advance!

          Show
          gauravk Gaurav Khandelwal added a comment - Hello Team, We are getting similar exception while executing multiple plans in Jenkins. Jenkins version - 2.46.3. Error Summary: org.apache.commons.jelly.JellyTagException: jar: file:/C:/Bitnami/jenkins-*2.46.3*-0/apache-tomcat/webapps/jenkins/WEB-INF/lib/jenkins-core-2.46.3.jar!/lib/layout/layout.jelly:259:25: <d:invokeBody> org.apache.commons.jelly.JellyTagException: jar: file:/C:/Bitnami/jenkins-2.46.3-0/apache-tomcat/webapps/jenkins/WEB-INF/lib/jenkins-core-2.46.3.jar!/lib/layout/main-panel.jelly:36:21: <d:invokeBody> org.apache.commons.jelly.JellyTagException: Cannot get property 'escapeExceptionMsg' on null object.   Will appreciate, any idea on resolution or work-around.   Thanks in Advance!
          Hide
          oleg_nenashev Oleg Nenashev added a comment -

          Gaurav Khandelwal it does not look to be similar. Please create a new issue and attach a full stacktrace.

          Show
          oleg_nenashev Oleg Nenashev added a comment - Gaurav Khandelwal it does not look to be similar. Please create a new issue and attach a full stacktrace.

            People

            • Assignee:
              oleg_nenashev Oleg Nenashev
              Reporter:
              anthonybsd Anthony Guselnikov
            • Votes:
              2 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: