timja / jenkins-gh-issues-poc-06-18

0 stars 0 forks source link

[JENKINS-33357] Gradle class not found Servlet Exception prevents Configure Pages from loading #7898

Closed timja closed 8 years ago

timja commented 8 years ago

After upgrading to jenkins-1.652-1.1.noarch, I get a ServletException error whenever I try to configure a job. This happens in both firefox and safari. When I downgrade jenkins to 1.651, this issue disappears.

I've attached the Jenkins log, which seems to indicate that Gradle can't be found:

WARNING: Caught exception evaluating: d.helpFile in /job/HFCS_Tools_SLOC/configure. Reason: java.lang.reflect.InvocationTargetException
...
Caused by: java.lang.NoClassDefFoundError: hudson/plugins/gradle/Gradle
...

The stack trace on the "Configure" error page (Screen Shot 2016-03-07 at 11.54.44 AM.png) mentions the ScmSyncConfigruationFilter and ScmSyncConfigurationDataProvider classes, so I figured this was an issue with the Scm-Sync-Configuration-Plugin.


Originally reported by sotola, imported from: Gradle class not found Servlet Exception prevents Configure Pages from loading
  • status: Resolved
  • priority: Major
  • resolution: Not A Defect
  • resolved: 2016-03-09T15:05:10+00:00
  • imported: 2022/01/10
timja commented 8 years ago

jglick:

danielbeck suggests that the fix of JENKINS-25440 might have caused this. Is there a straightforward way to reproduce this from scratch? Messages in your log file during startup?

timja commented 8 years ago

jglick:

Nothing to do with the SCM Sync plugin. TBD whether a core bug, or something wrong with the Gradle plugin, or a configuration problem in your installation.

timja commented 8 years ago

jglick:

I ran a Jenkins dev build, installed the Gradle plugin, created a freestyle project, added a Gradle build step, saved, reconfigured. No exception.

timja commented 8 years ago

sfin:

We have the same error after updating to 1.652:

[#|2016-03-08T07:58:30.161+0100|WARNING|glassfish3.0.1|hudson.ExpressionFactory2$JexlExpression|_ThreadID=3621836;_ThreadName=Thread-1;|Caught exception evaluating: d.helpFile in /hudson/job/nightly-deploy-egb-edict/configure. Reason: java.lang.reflect.InvocationTargetException
java.lang.reflect.InvocationTargetException
at sun.reflect.GeneratedMethodAccessor12621.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.commons.jexl.util.PropertyExecutor.execute(PropertyExecutor.java:125)
at org.apache.commons.jexl.util.introspection.UberspectImpl$VelGetterImpl.invoke(UberspectImpl.java:314)
at org.apache.commons.jexl.parser.ASTArrayAccess.evaluateExpr(ASTArrayAccess.java:185)
at org.apache.commons.jexl.parser.ASTIdentifier.execute(ASTIdentifier.java:75)
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)
...
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NoClassDefFoundError: hudson/plugins/gradle/Gradle
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2615)
at java.lang.Class.getDeclaredMethods(Class.java:1860)
at org.kohsuke.stapler.ClassDescriptor.findMethods(ClassDescriptor.java:148)
at org.kohsuke.stapler.ClassDescriptor.(ClassDescriptor.java:84)
at org.kohsuke.stapler.MetaClass.buildDispatchers(MetaClass.java:106)
at org.kohsuke.stapler.MetaClass.(MetaClass.java:94)
at org.kohsuke.stapler.WebApp.getMetaClass(WebApp.java:203)
at org.kohsuke.stapler.jelly.groovy.GroovyFacet.createRequestDispatcher(GroovyFacet.java:106)
at org.kohsuke.stapler.RequestImpl.getView(RequestImpl.java:255)
at org.kohsuke.stapler.RequestImpl.getView(RequestImpl.java:250)
at hudson.model.Descriptor.getHelpFile(Descriptor.java:744)
at hudson.model.Descriptor.getHelpFile(Descriptor.java:726)
at hudson.model.Descriptor.getHelpFile(Descriptor.java:715)
... 163 more
Caused by: java.lang.ClassNotFoundException: hudson.plugins.gradle.Gradle
at jenkins.util.AntClassLoader.findClassInComponents(AntClassLoader.java:1376)
at jenkins.util.AntClassLoader.findClass(AntClassLoader.java:1326)
at jenkins.util.AntClassLoader.loadClass(AntClassLoader.java:1079)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
... 177 more
|#]

timja commented 8 years ago

sotola:

I searched through /var/lib/jenkins for Gradle/gradle, and it looked like the only place gradle was mentioned in the file name was the artifactory plugin. So I disabled the Artifactory Plugin, restarted Jenkins (1.652), and then went to a job's configure page, and the issue went away (there were a few permission errors related to the artifactory plugin no longer existing on startup).
I then dug into this a little more, and it turns out that the Gradle (1.24) plugin was never installed on my Jenkins machine. I installed it, re-enabled the artifactory plugin, and then went to a Job's configure page... and everything worked.
I've also posted this issue on the JFrog Artifactory Plugin JIRA at: https://www.jfrog.com/jira/browse/HAP-699
jglick Thanks for your help!
sfin Is the Gradle plugin installed on your Jenkins instance?

timja commented 8 years ago

jglick:

Possible dupe of JENKINS-21486 then?

timja commented 8 years ago

sotola:

Possibly: I only noticed the issue when I was upgrading Jenkins, so I'm not 100% sure if it is a duplicate or if something else triggered the issue.

timja commented 8 years ago

hicolour:

Workaround

1. Install gradle

Unable to find source-code formatter for language: jbash. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
sudo add-apt-repository ppa:cwchien/gradle
sudo apt-get update
sudo apt-get install gradle

2. install Gradle plugin