java.lang.VerifyError: (class: com/thoughtworks/xstream/core/util/SerializationMembers ...

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

java.lang.VerifyError: (class: com/thoughtworks/xstream/core/util/SerializationMembers ...

Ivan Fernandez Calvo
Hi,

We have a gradle build to test the jobDSL definitions, it works perfectly. When we going to move the was version used to 2.266 it starts failing with the following error. I know it is because of the change of the XStream
but I dunno what I have to change. Any idea?

java.lang.VerifyError: (class: com/thoughtworks/xstream/core/util/SerializationMembers, method: callReadResolve signature: (Ljava/lang/Object;)Ljava/lang/Object;) Incompatible object argument for function call
at hudson.util.RobustReflectionConverter.<init>(RobustReflectionConverter.java:98)
at hudson.util.XStream2.setupConverters(XStream2.java:218)
at com.thoughtworks.xstream.XStream.<init>(XStream.java:574)
at com.thoughtworks.xstream.XStream.<init>(XStream.java:496)
at com.thoughtworks.xstream.XStream.<init>(XStream.java:465)
at com.thoughtworks.xstream.XStream.<init>(XStream.java:411)
at com.thoughtworks.xstream.XStream.<init>(XStream.java:378)
at hudson.util.XStream2.<init>(XStream2.java:113)
at jenkins.model.Jenkins.<clinit>(Jenkins.java:5393)
at hudson.PluginManager.<clinit>(PluginManager.java:2113)
at org.jvnet.hudson.test.JenkinsRule.<init>(JenkinsRule.java:341)
at JobScriptsSpec.$spock_initializeSharedFields(JobScriptsSpec.groovy:30)


It fails to evaluate the JenkinsRule

import groovy.util.FileNameFinder
import javaposse.jobdsl.dsl.DslScriptLoader
import javaposse.jobdsl.plugin.JenkinsJobManagement
import org.junit.ClassRule
import org.jvnet.hudson.test.JenkinsRule
import spock.lang.Shared
import spock.lang.Specification
import spock.lang.Unroll

class JobScriptsSpec extends Specification {
    @Shared
    @ClassRule
    JenkinsRule jenkinsRule = new JenkinsRule()

    @Unroll
    def 'test folder script #file.name'(File file) {
        given:
        def jobManagement = new JenkinsJobManagement(System.out, [:], new File('.'))
        def dslLoader = new DslScriptLoader(jobManagement)

        when:
        dslLoader.runScript(file.text)

        then:
        noExceptionThrown()

        where:
        file << new FileNameFinder().getFileNames('jobs', '**/folder.groovy')
                          .collect { new File(it) }
    }
}

This is the exception in Jenkins

[Feb 10, 2021 6:50:59 PM jenkins.model.Jenkins <clinit>
SEVERE: Failed to load Jenkins.class
java.lang.VerifyError: (class: com/thoughtworks/xstream/core/util/SerializationMembers, method: callReadResolve signature: (Ljava/lang/Object;)Ljava/lang/Object;) Incompatible object argument for function call
at hudson.util.RobustReflectionConverter.<init>(RobustReflectionConverter.java:98)
at hudson.util.XStream2.setupConverters(XStream2.java:218)
at com.thoughtworks.xstream.XStream.<init>(XStream.java:574)
at com.thoughtworks.xstream.XStream.<init>(XStream.java:496)
at com.thoughtworks.xstream.XStream.<init>(XStream.java:465)
at com.thoughtworks.xstream.XStream.<init>(XStream.java:411)
at com.thoughtworks.xstream.XStream.<init>(XStream.java:378)
at hudson.util.XStream2.<init>(XStream2.java:113)
at jenkins.model.Jenkins.<clinit>(Jenkins.java:5393)
at hudson.PluginManager.<clinit>(PluginManager.java:2113)
at org.jvnet.hudson.test.JenkinsRule.<init>(JenkinsRule.java:341)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:481)
at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:83)
at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:105)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:59)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:238)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:242)
at JobScriptsSpec.$spock_initializeSharedFields(JobScriptsSpec.groovy:30)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:567)
at org.spockframework.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:200)
at org.spockframework.runtime.model.MethodInfo.invoke(MethodInfo.java:113)
at org.spockframework.runtime.BaseSpecRunner.invokeRaw(BaseSpecRunner.java:484)
at org.spockframework.runtime.BaseSpecRunner.invoke(BaseSpecRunner.java:467)
at org.spockframework.runtime.BaseSpecRunner.doRunSharedInitializer(BaseSpecRunner.java:145)
at org.spockframework.runtime.BaseSpecRunner$2.invoke(BaseSpecRunner.java:130)
at org.spockframework.runtime.BaseSpecRunner.invokeRaw(BaseSpecRunner.java:484)
at org.spockframework.runtime.BaseSpecRunner.invoke(BaseSpecRunner.java:467)
at org.spockframework.runtime.BaseSpecRunner.runSharedInitializer(BaseSpecRunner.java:123)
at org.spockframework.runtime.BaseSpecRunner.runSharedInitializer(BaseSpecRunner.java:118)
at org.spockframework.runtime.BaseSpecRunner.run(BaseSpecRunner.java:63)
at org.spockframework.runtime.Sputnik.run(Sputnik.java:63)
at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.runTestClass(JUnitTestClassExecutor.java:106)
at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.execute(JUnitTestClassExecutor.java:58)
at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.execute(JUnitTestClassExecutor.java:38)
at org.gradle.api.internal.tasks.testing.junit.AbstractJUnitTestClassProcessor.processTestClass(AbstractJUnitTestClassProcessor.java:66)
at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:51)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:567)
at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
at org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:32)
at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
at com.sun.proxy.$Proxy1.processTestClass(Unknown Source)
at org.gradle.api.internal.tasks.testing.worker.TestWorker.processTestClass(TestWorker.java:109)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:567)
at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:155)
at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:137)
at org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:404)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
at java.base/java.lang.Thread.run(Thread.java:830)


--
Un Saludo
Iván Fernández Calvo

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CAKo5QroXLjPfw8-gwujxPzLNNSY1dtNAExNWqjC6Wj%2Bg92hCPQ%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: java.lang.VerifyError: (class: com/thoughtworks/xstream/core/util/SerializationMembers ...

Jesse Glick-4
On Wed, Feb 10, 2021 at 1:26 PM kuisathaverat <[hidden email]> wrote:
I know it is because of the change of the XStream
but I dunno what I have to change. Any idea?

Maybe you have the old forked XStream in your test classpath somewhere?

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CANfRfr2WHdB4gN94k23GXaxXOrt4a16bTMoPxPvH0fOKyzKg2w%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: java.lang.VerifyError: (class: com/thoughtworks/xstream/core/util/SerializationMembers ...

Ivan Fernandez Calvo
yep, I found the culprit, one dependency that I do not need

+--- org.jenkins-ci.plugins:job-dsl-core:1.77
|    +--- org.codehaus.groovy:groovy-all:2.4.12 -> 2.5.14 (*)
|    +--- xmlunit:xmlunit:1.4
|    \--- org.jvnet.hudson:xstream:1.4.7-jenkins-1



El miércoles, 10 de febrero de 2021 a las 21:07:33 UTC+1, Jesse Glick escribió:
On Wed, Feb 10, 2021 at 1:26 PM kuisathaverat <[hidden email]> wrote:
I know it is because of the change of the XStream
but I dunno what I have to change. Any idea?

Maybe you have the old forked XStream in your test classpath somewhere?

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/c428b499-9dae-45f4-be6e-097bdcc04bf3n%40googlegroups.com.