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

jakarta.inject support #1383

Closed
cogman opened this issue Aug 20, 2020 · 58 comments
Closed

jakarta.inject support #1383

cogman opened this issue Aug 20, 2020 · 58 comments

Comments

@cogman
Copy link

cogman commented Aug 20, 2020

Jakarta is coming to cause headaches for all :)

It would be nice if Guice could support processing Jakarta inject annotations as well as javax inject annotations. That would prevent us from potentially having to write a cross injection system constructor like

@Inject
@jakarta.inject.Inject

Fortunately, they don't share a package and it looks like jakarta pretty much only changed the package name.

@tandr
Copy link

tandr commented Mar 9, 2021

That's not a small undertaking - whole library sprinkled with java.inject namespace. Thinking about it - would an acceptable solution to have 2 libraries - guice-javax and guice-jakarta , and make them coexists somehow? (thinking out loud)

@GedMarc
Copy link

GedMarc commented Mar 10, 2021

You can use the guiced-ee artifact for jakarta namespacing across the board

https://mvnrepository.com/artifact/com.guicedee.services/guice

@kashike
Copy link
Contributor

kashike commented May 24, 2021

Are there any plans to look into support for this?

@d135-1r43
Copy link

I would be willing to contribute, maybe even with a small team.

@onacit
Copy link

onacit commented Feb 9, 2022

@GedMarc Check this out, yo.

@Azimuts
Copy link

Azimuts commented Oct 14, 2022

Guice's greatest virtue is its agility and that it is a DI library by itself with no frills added. Other DI and CDI solutions are fullstack If you want to use more modern application servers ( or other solutiones....) , on many occasions are forced to do a full stack migration. In itself a migration to , for example, toSpring, Micronaut, Quarkus is a full stack migration generating complicated dependencies that can condition the evolution of the applications.....

Indirectly, not supporting this small functionality is forcing developers to do full stack migrations and it's not easy to get out of there! Reconsider!

@trintaaho
Copy link

We need this.

@csisy
Copy link

csisy commented Mar 17, 2023

Bump on this, still not resolved. Is there any workaround?

@xvik
Copy link

xvik commented Apr 13, 2023

I did an automatic repackage of guice 5.1.0 (with tomcat migration tool) and published it yesterday into maven central (as rc.1 for now). Repackaged version use jakarta.inject, jakarta.servlet and jakarta.persistence.

Conversion performed on source jars (loaded from maven central) which are compiled then, so sources and javadoc are aligned in maven central publication. Pom and manifest files were manually rebuild (to replace dependencies and fix OSGI declarations). Struts2 and spring modules are not included (I doubt someone needs it).

Those who interesterested, please help me test it.

About 3rd party libraries: there would, of course, be problems with 3rd party libraies using javax.inject annotations: migrated guice would not see these annotations causing errors (e.g. not found constructor because of wrong annotation). In my libs I simply replaced all javax.inject.Inject annotations with gucie native annotations (so it could work with both javax and jakarta guice versions).

@sameb
Copy link
Member

sameb commented Apr 21, 2023

FYI all, I'm going to take some time early next week to fix this for core Guice.

I am still against outright forking the servlet extension into the jakarta namespace though, and will gladly welcome (and encourage) any community members that want to fork the servlet extension, fix its warts, and become the "official owners" of it.

@sameb
Copy link
Member

sameb commented Apr 25, 2023

Hi folks -- I have some changes prepared to support this for core Guice. However, the Dagger folks mentioned that they were informed of some issues related to supporting both javax.inject & jakarta.inject at the same time -- see google/dagger#2058 (comment). The TL;DR as best I can make out is:

  • javax.inject (from the javax.inject:javax.inject:1 maven coordinates) is old and doesn't have a "Automatic Module Name"
  • Jakarta folks re-published the javax inject APIs with a module name under jakarta.inject:jakarta.inject-api:1.0.5, but then went ahead and changed the packages to jakarta.inject but kept the jakarta coordinates and just incremented the version, to: jakarta.inject:jakarta.inject-api:2.0.1.
  • As a result, folks wanting JPMS-compatibility cannot use the original javax.inject:javax.inject:1 artifact (because it has no module name), and cannot use the jakarta.inject:jakarta.inject-api:1.0.5 and jakarta.inject:jakarta.inject-api:2.0.1 at the same time, because they're the same thing artifact (just with different versions). This means that folks wanting JPMS compatibility cannot reference both javax.inject and jakarta.inject at the same time.

How much of an issue is this for folks? My plan is basically to keep the javax.inject:javax.inject:1 dependency, introduce a new jakarta.inject:jakarta.inject-api:2.0.1 dependency, and have Guice depend on both the javax.inject namespace & the jakarta.inject namespace. But IIUC, that may break strict JPMS compatibility.

I'm open to ideas from folks more familiar with Maven about how to handle this.

(@mcculls FYI)

@norrisjeremy
Copy link

Why attempt to support both namespaces simultaneously, as opposed to just declaring Guice version X.Y.Z only supports the jakarta.inject namespace only?
Are folks wanting to intermix usage of both namespaces simultaneously?

@sameb
Copy link
Member

sameb commented Apr 25, 2023

@norrisjeremy -- For one, Google has quite literally millions of files referencing javax.inject. It isn't feasible to just up and say "switch'm all to another package". I wouldn't want to demand that from any other users either. Even if a migration were to happen, it would need to be incremental -- we can't just say "switch your entire codebase in order to use the new version".

One possibility here is to introduce a separate published artifact with a -jpms-compat suffix, and that artifact could potentially shade the javax.inject references. A naive shade would produce some awkward APIs, where Binder (for example) would have toProvider(Class<? extends shaded.javax.inject.Provider>)-like APIs. (The toProvider methods in Binder are also a problem in general for supporting jakarta.inject, so maybe there's another solution that could deal with those too.)

@martin-g
Copy link

martin-g commented Apr 25, 2023 via email

@sameb
Copy link
Member

sameb commented Apr 25, 2023

If I were able to cajole folks into a new release of javax.inject (at the javax.inject maven coordinates) that included a module name, etc.. would that make these problems go away?

@cdietrich
Copy link

i see this regression in 7 @sameb : #1729

@sameb
Copy link
Member

sameb commented May 5, 2023

Thanks for giving it a spin, @cdietrich, and glad to hear the regression was just a mistaken javax import.

All: I posted release notes & made a proper announcement post @ #1732. Please follow up there with your success or failure stories in adopting Guice 6.0 or 7.0. Thank you!

@mkurz
Copy link
Contributor

mkurz commented May 8, 2023

6.0.0-rc2 works with the Play Framework and we do have quite some testing going on. I didn't change anything besides bumping the guice version (keep using javax.inject):

7.0.0-rc1 works as well also, switched everything to the jakarta namespace: playframework/playframework#11792
On GitHub the build fails, but this is because other (Play) dependencies didn't switch to Jakarta yet. Therefore I build those dependencies on my machine which also made all the tests pass locally 👍

@hgschmie
Copy link

hgschmie commented May 8, 2023

We will be shipping support for both javax.inject (guice 5.x-6.x) and jakarta.inject (guice 7.x) in the next release of https://github.com/jdbi/jdbi. Testing looks good; ideally we could use the releases as base lines; everything works so far with the release candidates.

@ben-manes
Copy link

RestEasy dropped support for Guice when they migrated to Jakarta. That used to be the more popular JAX-RS framework to use with Guice since Jersey 2 had buggy integration due lifecycle clashes with HK2. I'm hoping they'll restore this module (RESTEASY-3329).

@GedMarc
Copy link

GedMarc commented May 9, 2023

@ben-manes they also dropped any future support for any modules in their entirety - by separating out the spi's,

Rest Easy is not compatible with modular development, Guice is a modular DI.
I would not hold my breath for that, intentional move by rest easy. Also, it's not future compliant in any way, zero loss. A rest handler and api isn't required in any JDK 9 and up In any shape or form

@sameb
Copy link
Member

sameb commented May 9, 2023

Thanks all, this is great to hear that things are working in your environments. If it's possible to continue the discussion on the release announcement @ #1732, it's a little easier to keep track of the one discussion post instead of comments inside a closed issue.

hanwen pushed a commit to GerritCodeReview/gerrit that referenced this issue Oct 2, 2023
Guice 6.x release is adding support for jakarta.inject, see this issue
for more details: [1]. Guice release 7.0.0 will remove support for
javax.inject annotation and only support jakarta.inject.

Also add new dependency to jakarta.inject library.

[1] google/guice#1383

Release-Notes: Update guice version to 6.0.0
Change-Id: I0eb5320289bde532ac57bdd376802b37c1cee47f
j-sandy added a commit to j-sandy/kork that referenced this issue Dec 12, 2024
…f spring boot 3.x upgrade

While upgrading the spring boot to 3.0.13 and spring cloud 2022.0.5, encountered the below error:
```
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'javax.inject.Provider<com.netflix.spectator.api.Registry>' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
	at app//org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoMatchingBeanFound(DefaultListableBeanFactory.java:1824)
	at app//org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1383)
	at app//org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1337)
	at app//org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:910)
	at app//org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:788)
	... 175 more
```
The root cause is use of `javax.inject` that has been moved from present coordinate to `jakarta.inject`. So, updating the coordinates in kork-eureka, kork-plugins and kork-web modules.
google/guice#1463
google/guice#1383
https://docs.openrewrite.org/recipes/java/migrate/jakarta/javaxinjectmigrationtojakartainject
j-sandy added a commit to j-sandy/kork that referenced this issue Dec 18, 2024
…grade wiremock as part of spring boot 3.x upgrade

While upgrading the spring boot to 3.0.13 and spring cloud 2022.0.5, encountered the below errors:
```
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'javax.inject.Provider<com.netflix.spectator.api.Registry>' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
	at app//org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoMatchingBeanFound(DefaultListableBeanFactory.java:1824)
	at app//org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1383)
	at app//org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1337)
	at app//org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:910)
	at app//org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:788)
	... 175 more
```
The root cause is use of `javax.inject` that has been moved from present coordinate to `jakarta.inject`. So, updating the coordinates in kork-eureka, kork-plugins and kork-web modules.
google/guice#1463
google/guice#1383
https://docs.openrewrite.org/recipes/java/migrate/jakarta/javaxinjectmigrationtojakartainject

```
javax/servlet/DispatcherType
java.lang.NoClassDefFoundError: javax/servlet/DispatcherType
	at com.github.tomakehurst.wiremock.jetty9.JettyHttpServerFactory.buildHttpServer(JettyHttpServerFactory.java:31)
	at com.github.tomakehurst.wiremock.WireMockServer.<init>(WireMockServer.java:74)
	at com.netflix.spinnaker.kork.plugins.sdk.httpclient.Ok3HttpClientIntegrationTest$Fixture.<init>(Ok3HttpClientIntegrationTest.kt:78)
	at com.netflix.spinnaker.kork.plugins.sdk.httpclient.Ok3HttpClientIntegrationTest$test$1$1.invoke(Ok3HttpClientIntegrationTest.kt:40)
	at com.netflix.spinnaker.kork.plugins.sdk.httpclient.Ok3HttpClientIntegrationTest$test$1$1.invoke(Ok3HttpClientIntegrationTest.kt:40)
	at dev.minutest.TestContextBuilder$fixture$1.invoke(ContextBuilder.kt:48)
```
In order to fix this issue, upgrading wiremock dependency to 3.0.4 and updating its coordinates.
Wiremock [3.0.0](https://github.com/wiremock/wiremock/releases/tag/3.0.0) onwards 2 major breaking changes are introduced:
1. support for Java 17, dropping Java 8 support
2. Change the Maven repository groupID to org.wiremock
https://github.com/wiremock/wiremock/releases?page=3
j-sandy added a commit to j-sandy/kork that referenced this issue Dec 19, 2024
…grade wiremock as part of spring boot 3.x upgrade

While upgrading the spring boot to 3.0.13 and spring cloud 2022.0.5, encountered the below errors:
```
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'javax.inject.Provider<com.netflix.spectator.api.Registry>' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
	at app//org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoMatchingBeanFound(DefaultListableBeanFactory.java:1824)
	at app//org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1383)
	at app//org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1337)
	at app//org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:910)
	at app//org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:788)
	... 175 more
```
The root cause is use of `javax.inject` that has been moved from present coordinate to `jakarta.inject`. So, updating the coordinates in kork-eureka, kork-plugins and kork-web modules.
google/guice#1463
google/guice#1383
https://docs.openrewrite.org/recipes/java/migrate/jakarta/javaxinjectmigrationtojakartainject

```
javax/servlet/DispatcherType
java.lang.NoClassDefFoundError: javax/servlet/DispatcherType
	at com.github.tomakehurst.wiremock.jetty9.JettyHttpServerFactory.buildHttpServer(JettyHttpServerFactory.java:31)
	at com.github.tomakehurst.wiremock.WireMockServer.<init>(WireMockServer.java:74)
	at com.netflix.spinnaker.kork.plugins.sdk.httpclient.Ok3HttpClientIntegrationTest$Fixture.<init>(Ok3HttpClientIntegrationTest.kt:78)
	at com.netflix.spinnaker.kork.plugins.sdk.httpclient.Ok3HttpClientIntegrationTest$test$1$1.invoke(Ok3HttpClientIntegrationTest.kt:40)
	at com.netflix.spinnaker.kork.plugins.sdk.httpclient.Ok3HttpClientIntegrationTest$test$1$1.invoke(Ok3HttpClientIntegrationTest.kt:40)
	at dev.minutest.TestContextBuilder$fixture$1.invoke(ContextBuilder.kt:48)
```
In order to fix this issue, upgrading wiremock dependency to 3.0.4 and updating its coordinates.
Wiremock [3.0.0](https://github.com/wiremock/wiremock/releases/tag/3.0.0) onwards 2 major breaking changes are introduced:
1. support for Java 17, dropping Java 8 support
2. Change the Maven repository groupID to org.wiremock
https://github.com/wiremock/wiremock/releases?page=3
j-sandy added a commit to j-sandy/kork that referenced this issue Dec 19, 2024
…grade wiremock as part of spring boot 3.x upgrade

While upgrading the spring boot to 3.0.13 and spring cloud 2022.0.5, encountered the below errors:
```
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'javax.inject.Provider<com.netflix.spectator.api.Registry>' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
	at app//org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoMatchingBeanFound(DefaultListableBeanFactory.java:1824)
	at app//org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1383)
	at app//org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1337)
	at app//org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:910)
	at app//org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:788)
	... 175 more
```
The root cause is use of `javax.inject` that has been moved from present coordinate to `jakarta.inject`. So, updating the coordinates in kork-eureka, kork-plugins and kork-web modules.
google/guice#1463
google/guice#1383
https://docs.openrewrite.org/recipes/java/migrate/jakarta/javaxinjectmigrationtojakartainject

```
javax/servlet/DispatcherType
java.lang.NoClassDefFoundError: javax/servlet/DispatcherType
	at com.github.tomakehurst.wiremock.jetty9.JettyHttpServerFactory.buildHttpServer(JettyHttpServerFactory.java:31)
	at com.github.tomakehurst.wiremock.WireMockServer.<init>(WireMockServer.java:74)
	at com.netflix.spinnaker.kork.plugins.sdk.httpclient.Ok3HttpClientIntegrationTest$Fixture.<init>(Ok3HttpClientIntegrationTest.kt:78)
	at com.netflix.spinnaker.kork.plugins.sdk.httpclient.Ok3HttpClientIntegrationTest$test$1$1.invoke(Ok3HttpClientIntegrationTest.kt:40)
	at com.netflix.spinnaker.kork.plugins.sdk.httpclient.Ok3HttpClientIntegrationTest$test$1$1.invoke(Ok3HttpClientIntegrationTest.kt:40)
	at dev.minutest.TestContextBuilder$fixture$1.invoke(ContextBuilder.kt:48)
```
In order to fix this issue, upgrading wiremock dependency to 3.0.4 and updating its coordinates.
Wiremock [3.0.0](https://github.com/wiremock/wiremock/releases/tag/3.0.0) onwards 2 major breaking changes are introduced:
1. support for Java 17, dropping Java 8 support
2. Change the Maven repository groupID to org.wiremock
https://github.com/wiremock/wiremock/releases?page=3
j-sandy added a commit to j-sandy/igor that referenced this issue Jan 9, 2025
… cloud from 2021.0.x to 2022.0.x

Upgrading spring boot 2.7.18 to 3.0.13 and spring cloud 2021.0.8 to 2022.0.5.
Spring cloud release 2022.0.x is compatible with spring boot 3.0.x.
https://github.com/spring-cloud/spring-cloud-release/wiki/Supported-Versions#supported-releases

======================================================
refactor(dependency): replace javax with jakarta, javax.inject with jakarta.inject, rxjava with rxjava3 and add resilience4j-vavr during upgrade of spring boot 3.0.x

Spring Boot 3.0 has migrated from Java EE to Jakarta EE APIs for all dependencies.
https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.0-Release-Notes#third-party-library-upgrades
So, replacing the imports with `javax` to `jakarta`.

Spring boot 3.x deprecated and removed rxjava, and rxjava3 has been added. So, update the dependency.
https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.0-Migration-Guide#rxjava

`io.vavr` dependency has been removed from resilience4j:2.0.2.
https://github.com/resilience4j/resilience4j/releases/tag/v2.0.0
Resilience4j comes as transitive dependency of spring-cloud-dependencies.
https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-dependencies/2022.0.5
So, adding explicit dependency of `resilience4j-vavr`

`javax.inject` that has been moved from present coordinate to `jakarta.inject`. So, updating the coordinates in igor-web module.
google/guice#1463
google/guice#1383
https://docs.openrewrite.org/recipes/java/migrate/jakarta/javaxinjectmigrationtojakartainject
j-sandy added a commit to j-sandy/clouddriver that referenced this issue Feb 17, 2025
… cloud from 2021.0.x to 2022.0.x

Upgrading spring boot 2.7.18 to 3.0.13 and spring cloud 2021.0.8 to 2022.0.5.
Spring cloud release 2022.0.x is compatible with spring boot 3.0.x.
https://github.com/spring-cloud/spring-cloud-release/wiki/Supported-Versions#supported-releases

`WebMvcConfigurerAdapter` class has been deprecated in Springframework 5.0 and subsequently removed from Springframework 6.0. So, replacing it with `WebMvcConfigurer` interface for direct implementation.
https://docs.spring.io/spring-framework/docs/5.0.0.RELEASE/javadoc-api/org/springframework/web/servlet/config/annotation/WebMvcConfigurerAdapter.html

===============================================================================================

refactor(dependency): replace javax with jakarta and javax.inject with jakarta.inject during upgrade of spring boot 3.0.x

Spring Boot 3.0 has migrated from Java EE to Jakarta EE APIs for all dependencies.
https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.0-Release-Notes#third-party-library-upgrades
So, replacing the imports with `javax` to `jakarta`.

`javax.inject` that has been moved from present coordinate to `jakarta.inject`. So, updating the coordinates in igor-web module.
google/guice#1463
google/guice#1383
https://docs.openrewrite.org/recipes/java/migrate/jakarta/javaxinjectmigrationtojakartainject

===============================================================================================

refactor(jedis): migrate jedis from 3.x to 4.x during upgrade of spring boot 3.0.x

Spring boot upgrade from 2.7.18 to 3.0.13, upgrades `redis.clients:jedis` from 3.8.0 to 4.3.2.
So, migrating jedis from 3.x to 4.x by following the migration [document](https://github.com/redis/jedis/blob/master/docs/3to4.md)
And for further changelogs, please refer [here](https://github.com/redis/jedis/releases/tag/v4.0.0)

===============================================================================================

refactor(dependency): migrate rxjava to rxjava3 during upgrade of spring boot 3.0.x

Spring boot 3.x deprecated and removed rxjava, and rxjava3 has been added. So, update the dependency.
https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.0-Migration-Guide#rxjava

And refactored the code to accomodate changes required by rxjava2 and rxjava3 following the changelogs.
https://github.com/ReactiveX/RxJava/wiki/What's-different-in-2.0
https://github.com/ReactiveX/RxJava/wiki/What%27s-different-in-3.0

===============================================================================================

refactor(dependency): add explicit resilience4j-vavr dependency with spring boot upgrade to 3.x

`io.vavr` dependency has been removed from resilience4j:2.0.2.
https://github.com/resilience4j/resilience4j/releases/tag/v2.0.0
Resilience4j comes as transitive dependency of spring-cloud-dependencies.
https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-dependencies/2022.0.5
So, adding explicit dependency of `resilience4j-vavr`
As part of removing vavr dependency, resilience4j has made change that returns a Set instead of Seq when retryRegistry.getAllRetries() is called.
Link:
https://github.com/resilience4j/resilience4j/pull/1121/files#diff-f58a549005afee4cef1bdce1c1a5571f40fcede02013722f6bd05d221bde56eeR153
resilience4j/resilience4j#1537
j-sandy added a commit to j-sandy/kork that referenced this issue Feb 18, 2025
…grade wiremock as part of spring boot 3.x upgrade

While upgrading the spring boot to 3.0.13 and spring cloud 2022.0.5, encountered the below errors:
```
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'javax.inject.Provider<com.netflix.spectator.api.Registry>' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
	at app//org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoMatchingBeanFound(DefaultListableBeanFactory.java:1824)
	at app//org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1383)
	at app//org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1337)
	at app//org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:910)
	at app//org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:788)
	... 175 more
```
The root cause is use of `javax.inject` that has been moved from present coordinate to `jakarta.inject`. So, updating the coordinates in kork-eureka, kork-plugins and kork-web modules.
google/guice#1463
google/guice#1383
https://docs.openrewrite.org/recipes/java/migrate/jakarta/javaxinjectmigrationtojakartainject

```
javax/servlet/DispatcherType
java.lang.NoClassDefFoundError: javax/servlet/DispatcherType
	at com.github.tomakehurst.wiremock.jetty9.JettyHttpServerFactory.buildHttpServer(JettyHttpServerFactory.java:31)
	at com.github.tomakehurst.wiremock.WireMockServer.<init>(WireMockServer.java:74)
	at com.netflix.spinnaker.kork.plugins.sdk.httpclient.Ok3HttpClientIntegrationTest$Fixture.<init>(Ok3HttpClientIntegrationTest.kt:78)
	at com.netflix.spinnaker.kork.plugins.sdk.httpclient.Ok3HttpClientIntegrationTest$test$1$1.invoke(Ok3HttpClientIntegrationTest.kt:40)
	at com.netflix.spinnaker.kork.plugins.sdk.httpclient.Ok3HttpClientIntegrationTest$test$1$1.invoke(Ok3HttpClientIntegrationTest.kt:40)
	at dev.minutest.TestContextBuilder$fixture$1.invoke(ContextBuilder.kt:48)
```
In order to fix this issue, upgrading wiremock dependency to 3.0.4 and updating its coordinates.
Wiremock [3.0.0](https://github.com/wiremock/wiremock/releases/tag/3.0.0) onwards 2 major breaking changes are introduced:
1. support for Java 17, dropping Java 8 support
2. Change the Maven repository groupID to org.wiremock
https://github.com/wiremock/wiremock/releases?page=3
j-sandy added a commit to j-sandy/kork that referenced this issue Feb 18, 2025
…grade wiremock as part of spring boot 3.x upgrade

While upgrading the spring boot to 3.0.13 and spring cloud 2022.0.5, encountered the below errors:
```
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'javax.inject.Provider<com.netflix.spectator.api.Registry>' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
	at app//org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoMatchingBeanFound(DefaultListableBeanFactory.java:1824)
	at app//org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1383)
	at app//org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1337)
	at app//org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:910)
	at app//org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:788)
	... 175 more
```
The root cause is use of `javax.inject` that has been moved from present coordinate to `jakarta.inject`. So, updating the coordinates in kork-eureka, kork-plugins and kork-web modules.
google/guice#1463
google/guice#1383
https://docs.openrewrite.org/recipes/java/migrate/jakarta/javaxinjectmigrationtojakartainject

```
javax/servlet/DispatcherType
java.lang.NoClassDefFoundError: javax/servlet/DispatcherType
	at com.github.tomakehurst.wiremock.jetty9.JettyHttpServerFactory.buildHttpServer(JettyHttpServerFactory.java:31)
	at com.github.tomakehurst.wiremock.WireMockServer.<init>(WireMockServer.java:74)
	at com.netflix.spinnaker.kork.plugins.sdk.httpclient.Ok3HttpClientIntegrationTest$Fixture.<init>(Ok3HttpClientIntegrationTest.kt:78)
	at com.netflix.spinnaker.kork.plugins.sdk.httpclient.Ok3HttpClientIntegrationTest$test$1$1.invoke(Ok3HttpClientIntegrationTest.kt:40)
	at com.netflix.spinnaker.kork.plugins.sdk.httpclient.Ok3HttpClientIntegrationTest$test$1$1.invoke(Ok3HttpClientIntegrationTest.kt:40)
	at dev.minutest.TestContextBuilder$fixture$1.invoke(ContextBuilder.kt:48)
```
In order to fix this issue, upgrading wiremock dependency to 3.0.4 and updating its coordinates.
Wiremock [3.0.0](https://github.com/wiremock/wiremock/releases/tag/3.0.0) onwards 2 major breaking changes are introduced:
1. support for Java 17, dropping Java 8 support
2. Change the Maven repository groupID to org.wiremock
https://github.com/wiremock/wiremock/releases?page=3
j-sandy added a commit to j-sandy/echo that referenced this issue Mar 4, 2025
… cloud from 2021.0.x to 2022.0.x

Upgrading spring boot 2.7.18 to 3.0.13 and spring cloud 2021.0.8 to 2022.0.5.
Spring cloud release 2022.0.x is compatible with spring boot 3.0.x.
https://github.com/spring-cloud/spring-cloud-release/wiki/Supported-Versions#supported-releases

===============================================================================================

refactor(dependency): replace javax with jakarta and javax.inject with jakarta.inject during upgrade of spring boot 3.0.x

Spring Boot 3.0 has migrated from Java EE to Jakarta EE APIs for all dependencies.
https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.0-Release-Notes#third-party-library-upgrades
So, replacing the imports with `javax` to `jakarta`.

`javax.inject` that has been moved from present coordinate to `jakarta.inject`. So, updating the coordinates in igor-web module.
google/guice#1463
google/guice#1383
https://docs.openrewrite.org/recipes/java/migrate/jakarta/javaxinjectmigrationtojakartainject

===============================================================================================

refactor(dependency): migrate rxjava to rxjava3 during upgrade of spring boot 3.0.x

Spring boot 3.x deprecated and removed rxjava, and rxjava3 has been added. So, update the dependency.
https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.0-Migration-Guide#rxjava

And refactored the code to accomodate changes required by rxjava2 and rxjava3 following the changelogs.
https://github.com/ReactiveX/RxJava/wiki/What's-different-in-2.0
https://github.com/ReactiveX/RxJava/wiki/What%27s-different-in-3.0

===============================================================================================

refactor(dependency): upgrade wiremock as part of spring boot 3.x and spring cloud 2022.0.x upgrade

Upgrading wiremock dependency to 3.0.4 and updating its coordinates.
Wiremock [3.0.0](https://github.com/wiremock/wiremock/releases/tag/3.0.0) onwards 2 major breaking changes are introduced:
1. support for Java 17, dropping Java 8 support
2. Change the Maven repository groupID to org.wiremock
https://github.com/wiremock/wiremock/releases?page=3
3. Change Artifact IDs of wiremock-jre8 and wiremock-jre8-standalone to wiremock and wiremock-standalone

===============================================================================================

refactor(dependency): upgrade greenmail as part of spring boot 3.x and spring cloud 2022.0.x upgrade

Greenmail dependency is used for email notifications in echo. Greenmail 1.5.14 is based on javax.mail package. With spring boot 3.x upgrade javax.mail package has been replaced with jakarta.mail, so, upgrading the greenmail to 2.0.1 which is based on jakarta.mail package.
https://github.com/greenmail-mail-test/greenmail/releases/tag/release-2.0.1
j-sandy added a commit to j-sandy/echo that referenced this issue Mar 4, 2025
… cloud from 2021.0.x to 2022.0.x

Upgrading spring boot 2.7.18 to 3.0.13 and spring cloud 2021.0.8 to 2022.0.5.
Spring cloud release 2022.0.x is compatible with spring boot 3.0.x.
https://github.com/spring-cloud/spring-cloud-release/wiki/Supported-Versions#supported-releases

===============================================================================================

refactor(dependency): replace javax with jakarta and javax.inject with jakarta.inject during upgrade of spring boot 3.0.x

Spring Boot 3.0 has migrated from Java EE to Jakarta EE APIs for all dependencies.
https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.0-Release-Notes#third-party-library-upgrades
So, replacing the imports with `javax` to `jakarta`.

`javax.inject` that has been moved from present coordinate to `jakarta.inject`. So, updating the coordinates in igor-web module.
google/guice#1463
google/guice#1383
https://docs.openrewrite.org/recipes/java/migrate/jakarta/javaxinjectmigrationtojakartainject

===============================================================================================

refactor(dependency): migrate rxjava to rxjava3 during upgrade of spring boot 3.0.x

Spring boot 3.x deprecated and removed rxjava, and rxjava3 has been added. So, update the dependency.
https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.0-Migration-Guide#rxjava

And refactored the code to accomodate changes required by rxjava2 and rxjava3 following the changelogs.
https://github.com/ReactiveX/RxJava/wiki/What's-different-in-2.0
https://github.com/ReactiveX/RxJava/wiki/What%27s-different-in-3.0

===============================================================================================

refactor(dependency): upgrade wiremock as part of spring boot 3.x and spring cloud 2022.0.x upgrade

Upgrading wiremock dependency to 3.0.4 and updating its coordinates.
Wiremock [3.0.0](https://github.com/wiremock/wiremock/releases/tag/3.0.0) onwards 2 major breaking changes are introduced:
1. support for Java 17, dropping Java 8 support
2. Change the Maven repository groupID to org.wiremock
https://github.com/wiremock/wiremock/releases?page=3
3. Change Artifact IDs of wiremock-jre8 and wiremock-jre8-standalone to wiremock and wiremock-standalone

===============================================================================================

refactor(dependency): upgrade greenmail as part of spring boot 3.x and spring cloud 2022.0.x upgrade

Greenmail dependency is used for email notifications in echo. Greenmail 1.5.14 is based on javax.mail package. With spring boot 3.x upgrade javax.mail package has been replaced with jakarta.mail, so, upgrading the greenmail to 2.0.1 which is based on jakarta.mail package.
https://github.com/greenmail-mail-test/greenmail/releases/tag/release-2.0.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet