Reputation: 61
I am developing a Jenkins Plugin in Java, and I'm getting the following error when I try to instantiate the ArtifactoryClient class within JFrog's artifactory client java library.
I used the following code:
ArtifactoryClient artifactory = ArtifactoryClient.create(resolverServerUrl, resolverUsername, resolverPassword);
And I get the error stack trace below when it executes. I have done extensive research on this issue, and I have not found anyone with a similar error except for the ones referenced in this issue which I also opened: https://github.com/JFrogDev/artifactory-client-java/issues/85
I found a similar stack overflow question, but their solution does not work for me and their stack trace is different, which means the error is different. (Upload to Artifactory using Java client)
I am wondering if anyone knows how to resolve this error and why it is happening?
groovy.lang.MissingMethodException: No signature of method:
com.fasterxml.jackson.databind.ObjectMapper.addMixIn() is applicable for argument types: (java.lang.Class, java.lang.Class) values: [interface
org.jfrog.artifactory.client.model.Repository, ...] at
org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:55) at
org.codehaus.groovy.runtime.callsite.PojoMetaClassSite.call(PojoMetaClassSite.java:46) at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:120) at org.jfrog.artifactory.client.impl.ArtifactoryImpl.<init>(ArtifactoryImpl.groovy:46) at
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at
java.lang.reflect.Constructor.newInstance(Constructor.java:423) at
org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:77) at
org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:102) at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCllSite.java:194) at
org.jfrog.artifactory.client.ArtifactoryClient.create(ArtifactoryClient.groovy:
7) at
org.jfrog.artifactory.client.ArtifactoryClient.create(ArtifactoryClient.groovy)
at com.jenkins.plugins.servicenow.artifactory.ArtifactoryService.<init
(ArtifactoryService.java:36) at
com.ge.integration.jenkins.notification.Phase.initialize(Phase.java:152) at
com.ge.integration.jenkins.notification.Phase.perform(Phase.java:210) at
com.ge.integration.jenkins.notification.Phase.handle(Phase.java:114) at
com.ge.integration.jenkins.notification.JobListener.onFinalized(JobListener.jav
:52) at hudson.model.listeners.RunListener.fireFinalized(RunListener.java:230)
at hudson.model.Run.onEndBuilding(Run.java:1890) at
hudson.model.Run.execute(Run.java:1809) at
hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at
hudson.model.ResourceController.execute(ResourceController.java:98) at
hudson.model.Executor.run(Executor.java:381)
I am using the following versions: I'm using the latest version of artifactory-client-java.
Jenkins 1.621
Artifactory 2.3.0
The environment I am using this for requires these versions.
The Java Versions I have tried this plugin on are Java 1.8.02 and Java 1.7.79
Upvotes: 3
Views: 179
Reputation: 61
As @drob said in the comments above, I was using the wrong version of the Jackson Library. JFrog's client library imports and requires Jackson 2.4.6; however, I had imported Jackson 2.1.1 in a dependency that I imported before hand.
My build tool (Maven) read it as a conflict and used 2.1.1 omitting 2.4.6, causing the error described above.
Upvotes: 1