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

maven-metadata-plugin shows ClassCastException

XMLWordPrintable

      We use the maven-metadata-plugin for a lot of deployment jobs.
      Since we've upgraded Jenkins from 2.249.2 (LTS) to 2.277.1 (LTS) the plugin is not longer working.
      The problem still exists on 2.277.2 (LTS) and is reproducable on latest Jenkins core, too.

      The select box on each job's parameter page shows the same error message (see screenshot)

      Looking at the jenkins.log following stack trace is shown

      2021-04-26 13:06:43.841+0000 [id=2293790]       WARNING e.m.j.p.m.MavenMetadataParameterDefinition#getArtifactMetadata: Could not parse maven-metadata.xml
      
      javax.xml.bind.JAXBException: ClassCastException: attempting to cast jar:file:/var/lib/jenkins/plugins/jaxb/WEB-INF/lib/jaxb-api-2.3.0.jar!/javax/xml/bind/JAXBContext.class to jar:file:/var/lib/jenkins/plugins/jackson2-api/WEB-INF/lib/jakarta.xml.bind-api-2.3.2.jar!/jav
      ax/xml/bind/JAXBContext.class.  Please make sure that you are specifying the proper ClassLoader.     
              at javax.xml.bind.ContextFinder.handleClassCastException(ContextFinder.java:111)
      
              at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:254)
      
              at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:240)
      
              at javax.xml.bind.ContextFinder.find(ContextFinder.java:363)
      
              at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:691)
      
              at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:632)
      
              at eu.markov.jenkins.plugin.mvnmeta.MavenMetadataParameterDefinition.getArtifactMetadata(MavenMetadataParameterDefinition.java:258)
      
              at eu.markov.jenkins.plugin.mvnmeta.MavenMetadataParameterDefinition.getVersions(MavenMetadataParameterDefinition.java:208)
      
              at jdk.internal.reflect.GeneratedMethodAccessor17819.invoke(Unknown Source)
      
              at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      
              at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      
              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 org.apache.commons.jelly.expression.ExpressionSupport.evaluateRecurse(ExpressionSupport.java:61)
      
              at org.apache.commons.jelly.expression.ExpressionSupport.evaluateAsIterator(ExpressionSupport.java:94)
      
              at org.apache.commons.jelly.tags.core.ForEachTag.doTag(ForEachTag.java:89)
      
              at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:269)
      
              at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:100)
      
              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.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:100)
      
              at org.kohsuke.stapler.jelly.CallTagLibScript$1.run(CallTagLibScript.java:99)
      
              at org.apache.commons.jelly.tags.define.InvokeBodyTag.doTag(InvokeBodyTag.java:91)
      
              at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:269)
      
              at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:100)
      
              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.WhenTag.doTag(WhenTag.java:46)
      
              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.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:100)
      
              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.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.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:100)
      
              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.ForEachTag.doTag(ForEachTag.java:150)
      
              at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:269)
      
              at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
      
              at org.kohsuke.stapler.jelly.CallTagLibScript$1.run(CallTagLibScript.java:99)
      
              at org.apache.commons.jelly.tags.define.InvokeBodyTag.doTag(InvokeBodyTag.java:91)
      
              at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:269)
      
              at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:100)
      
              at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:100)
      

            marcrohlfs Marc Rohlfs
            gradol Oliver Grad
            Votes:
            4 Vote for this issue
            Watchers:
            12 Start watching this issue

              Created:
              Updated: