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

Guice error "Unable to create injector" When trying to build the client #297

Open
algernon28 opened this issue May 25, 2023 · 2 comments
Open

Comments

@algernon28
Copy link

algernon28 commented May 25, 2023

Current Behavior

When I try to build a client I get the error

`_com.google.inject.CreationException: Unable to create injector, see the following errors:

  1. at GsonModule.provideGson(GsonModule.java:99)
    _ installed by: JenkinsHttpApiModule -> GsonModule_`

I attached my dependency:tree and the whole stacktrace

Context

The code will not compile. I tried versions 0.0.31, 1.0.0 and 1.0.2
Version 0.0.29 will work but in that case I have to add JAXB dependencies and --add-opens java.base/java.lang=ALL-UNNAMED
which I cannot do in production.

Steps to Reproduce (for bugs)

This test is enough to make it fail for me

@Test
void run() throws MalformedURLException {
        String url = "https://<server-ip>/jenkins"; 
        String user = "<username>"; // username
        String pass = "<password>"; // password
    JenkinsClient client = JenkinsClient.builder()
            .endPoint(url)
            .credentials("%s:%s".formatted(user,pass))
            .build();
   IntegerResponse r = client.api().jobsApi().build("/Test Automation/Prove varie/Dummy", "00-FirstStep");
   log.debug("RESPONSE {}", r);
}

Your Environment

I am running on Java 19, and as you can see from the dependency tree I am using Springboot 3.0
Jenkins is 2.249.2

pom.zip
maventree.txt

stacktrace.txt

@iamironz
Copy link

iamironz commented Sep 20, 2023

The same issue, JDK 17

@cdancy
Copy link
Owner

cdancy commented Sep 20, 2023

We're just building off of the jclouds library here and the error here speaks to things more internal. If using the all classifier does not solve your problems we'd have to think of some other way of getting around things.

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

No branches or pull requests

3 participants