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

dozer can not work for springboot 3 #843

Closed
huihui-hb opened this issue Dec 1, 2022 · 7 comments
Closed

dozer can not work for springboot 3 #843

huihui-hb opened this issue Dec 1, 2022 · 7 comments

Comments

@huihui-hb
Copy link

Whats your runtime?

  • Dozer version: lastest
  • OS version: win
  • JDK version: 17

Whats the problem?

1 required dozer and springboot 3
2 init dozer

Observed Results:

throw exception :
java.lang.ClassNotFoundException: com.sun.xml.bind.v2.ContextFactory at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)

Do you have plan to make dozermapper support springboot3.0.0 , thks

@garethahealy
Copy link
Collaborator

Simple answer; sorry, I dont have time. Longer answer; if you want to update dozer to work on SB3, I am happy to review/merge.

@rivancic
Copy link

rivancic commented Jan 11, 2023

@huihui-hb this isn't SB3 issue.
Dozer is dependent on JAXB-API. JAXB was part of Java core. Now with latest Java version it isn't anymore.
You have upgraded your module to Java 17.
You'll have to declare those dependencies yourself https://jesperdj.com/2018/09/30/jaxb-on-java-9-10-11-and-beyond/

As an alternative those dependencies could be declared in dozer library itself.

@bender316
Copy link

@huihui-hb this isn't SB3 issue. Dozer is dependent on JAXB-API. JAXB was part of Java core. Now with latest Java version it isn't anymore. You have upgraded your module to Java 17. You'll have to declare those dependencies yourself https://jesperdj.com/2018/09/30/jaxb-on-java-9-10-11-and-beyond/

As an alternative those dependencies could be declared in dozer library itself.

This is only one half of the truth. The main problem is that in Boot 3 all dependencies have been updated to Jakarta. The fix you mentioned does not work in all situations (e.g. if you're using Hibernate).

We're currently evaluating what is less pain: switching from Dozer to ??? or upgrading Dozer.

@garethahealy if we decide for the latter would you release a new version of Dozer?

@garethahealy
Copy link
Collaborator

garethahealy commented Jun 1, 2023

@bender316 ; if your willing to do a PR, I am happy to merge/release.

However, I would strongly suggest you move away from dozer.

@bender316
Copy link

bender316 commented Jun 1, 2023

Yeah, I know. If a maintaner tells you to run you'd better run fast 😀 .
Dozer is used in a lot of services in our environment. As the update to SB3 already brought us a lot of tasks (and other migrations) I consider it a valid option to stay with Dozer for the time being.

Long term I totally agree with you. So lets see what happens.

@RuslanHryn
Copy link
Contributor

forked dozer and migrated to Jakarta to unblock migration to Spring Boot 3.
here is repo https://github.com/RuslanHryn/dozer-jakarta
feel free to contribute and test it

@bender316
Copy link

However, I would strongly suggest you move away from dozer.

In the long run we "migrated" to ModelMapper. The effort was much less than anticipated.

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

5 participants