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

not support jdk17? #395

Open
funky-eyes opened this issue Mar 1, 2023 · 9 comments
Open

not support jdk17? #395

funky-eyes opened this issue Mar 1, 2023 · 9 comments

Comments

@funky-eyes
Copy link

Exception in thread "main" java.lang.ExceptionInInitializerError
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make protected native java.lang.Object java.lang.Object.clone() throws java.lang.CloneNotSupportedException accessible: module java.base does not "opens java.lang" to unnamed module @396f6598
	at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)
	at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
	at java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:199)
	at java.base/java.lang.reflect.Method.setAccessible(Method.java:193)
	at ma.glasnost.orika.converter.builtin.CloneableConverter.<init>(CloneableConverter.java:64)
	at ma.glasnost.orika.converter.builtin.CloneableConverter$Builtin.<init>(CloneableConverter.java:221)
	at ma.glasnost.orika.converter.builtin.BuiltinConverters.register(BuiltinConverters.java:135)
	at ma.glasnost.orika.impl.DefaultMapperFactory.build(DefaultMapperFactory.java:1278)
	at ma.glasnost.orika.impl.DefaultMapperFactory.getMapperFacade(DefaultMapperFactory.java:881)

Process finished with exit code 1

@a19930905a
Copy link

Hi @a364176773 , Sadly same issue was open in 2021 and Orika hasn't response for that
u can see there is workaround in that discussion , #377

@numacanedo
Copy link

@a364176773 There is a work around:

  • Just add this jvm args, here is the code if you are using gradle
    bootRun { jvmArgs = ["--add-opens=java.base/java.lang=ALL-UNNAMED"] }

@funky-eyes
Copy link
Author

Sorry, I think this method is only a temporary solution, not a real support for jdk17

@thiagolvlsantos
Copy link

thiagolvlsantos commented Mar 18, 2023

I agree @a364176773!

Looks like the authors gave up Orika, unfortunately.

Looking for replacements already, no new projects with Orika from now on.

@Chr3is
Copy link

Chr3is commented Apr 3, 2023

@thiagolvlsantos we managed to replace Orika with https://mapstruct.org/ successfully. It was straight forward but that depends on the complexity of your mappings.

@wenjiezhang2013
Copy link

duplicate of #377

@KaseiHaku
Copy link

@Chr3is mapstruct is too cumbersome and requires defining conversion classes for each pair of POJOs

@ToryZhou
Copy link

ToryZhou commented Jan 29, 2024

When using .parallelStream(), the orika maper is not working

ma.glasnost.orika.MappingException: ma.glasnost.orika.MappingException: While attempting the following mapping:
Error occurred: java.lang.ClassCastException:

Remove the following dependency solved this issue.

org.springframework.boot
spring-boot-devtools
true

but sometimes:
Caused by: java.lang.ClassNotFoundException: ma.glasnost.orika.impl.GeneratedMapperBase

@ToryZhou
Copy link

@thiagolvlsantos we managed to replace Orika with https://mapstruct.org/ successfully. It was straight forward but that depends on the complexity of your mappings.

MapStruct always requires the writing of mappers.

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

8 participants