Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NoSuchMethodError #246

Closed
Kneudel opened this issue Jun 23, 2022 · 2 comments
Closed

NoSuchMethodError #246

Kneudel opened this issue Jun 23, 2022 · 2 comments
Assignees

Comments

@Kneudel
Copy link

Kneudel commented Jun 23, 2022

Hi,

if I try to create a new JenkisClient object after calling method "...build()" I get this Exception:

`Exception in thread "main" com.google.inject.CreationException: Unable to create injector, see the following errors:

  1. [Guice/ErrorInCustomProvider]: NoSuchMethodError: ConstructorConstructor.(Ljava/util/Map;)V
    at GsonModule.provideGson(GsonModule.java:99)
    _ installed by: JenkinsHttpApiModule -> GsonModule
    at GsonWrapper.(GsonWrapper.java:38)
    _ for 1st parameter
    at GsonWrapper.class(GsonWrapper.java:32)
    while locating GsonWrapper
    while locating Json

Learn more:
https://github.com/google/guice/wiki/ERROR_IN_CUSTOM_PROVIDER
Caused by: NoSuchMethodError: ConstructorConstructor.(Ljava/util/Map;)V
at GsonModule.provideGson(GsonModule.java:130)
at GsonModule$$FastClassByGuice$$2009841.GUICE$TRAMPOLINE()
at GsonModule$$FastClassByGuice$$2009841.apply()
at ProviderMethod$FastClassProviderMethod.doProvision(ProviderMethod.java:260)
at ProviderMethod.doProvision(ProviderMethod.java:171)
at InternalProviderInstanceBindingImpl$CyclicFactory.provision(InternalProviderInstanceBindingImpl.java:185)
at InternalProviderInstanceBindingImpl$CyclicFactory.get(InternalProviderInstanceBindingImpl.java:162)
at ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
at SingletonScope$1.get(SingletonScope.java:169)
at InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:45)
at SingleParameterInjector.inject(SingleParameterInjector.java:40)
at SingleParameterInjector.getAll(SingleParameterInjector.java:60)
at ConstructorInjector.provision(ConstructorInjector.java:113)
at ConstructorInjector.construct(ConstructorInjector.java:91)
at ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:296)
at ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
at SingletonScope$1.get(SingletonScope.java:169)
at InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:45)
at FactoryProxy.get(FactoryProxy.java:60)
at InternalInjectorCreator.loadEagerSingletons(InternalInjectorCreator.java:213)
at InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:186)
at InternalInjectorCreator.build(InternalInjectorCreator.java:113)
at Guice.createInjector(Guice.java:87)
at ContextBuilder.buildInjector(ContextBuilder.java:405)
at ContextBuilder.buildInjector(ContextBuilder.java:328)
at ContextBuilder.buildApi(ContextBuilder.java:651)
at ContextBuilder.buildApi(ContextBuilder.java:643)
at JenkinsClient.createApi(JenkinsClient.java:85)
at JenkinsClient.(JenkinsClient.java:72)
at JenkinsClient$Builder.build(JenkinsClient.java:220)
at JenkinsAccess.main(JenkinsAccess.java:11)`

@cdancy cdancy self-assigned this Jun 23, 2022
@cdancy
Copy link
Owner

cdancy commented Jun 23, 2022

@Kneudel I suspect this is most likely due to dependency clobbering. You can use the all classifier when resolving this artifact and that should give you better results (at the cost of 1 giant shaded jar).

Can you give some more details about your setup or what your build looks like?

@Kneudel
Copy link
Author

Kneudel commented Jun 27, 2022

Hi,

if I use the classifier and find out I had a syntax error on Jenkins domain... :-D Now it works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants