Skip to content

Migrating application from java 8 to java 17 and facing issues with couch base documents BigDecimal types (module system java issue) : #1541

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

Closed
raj7A opened this issue Aug 17, 2022 · 1 comment
Labels
status: feedback-provided Feedback has been provided

Comments

@raj7A
Copy link

raj7A commented Aug 17, 2022

Java 17 

Springboot 2.6.10

Spring-data-couchbase 4.3.6

Example :
@document
public class User {
@id
private final String id;
private final BigDecimal amout;
}

Above User domain has a field with BigDecimal as type and gives the below error and fails (when the app comes up) while spring reflection utils is trying to make amount field accessible.

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userRepository' defined in com.example.demo.repository.UserRepository defined in @EnableReactiveCouchbaseRepositories declared on CouchbaseReactiveRepositoriesRegistrar.EnableReactiveCouchbaseRepositoriesConfiguration: Invocation of init method failed; nested exception is java.lang.reflect.InaccessibleObjectException: Unable to make field private final java.math.BigInteger java.math.BigDecimal.intVal accessible: module java.base does not "opens java.math" to unnamed module @3b084709

Works good with the following vm arguments, “java --add-opens java.base/java.math=ALL-UNNAMED” (https://openjdk.org/jeps/261). But is this a good approach that could be done in prod environments and will this issue be solved/addressed in any future releases ?

If needed, Will be able to share the code to reproduce the issue.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Aug 17, 2022
@mikereiche
Copy link
Collaborator

This is fixed in #1439
please use the latest version - spring-data-couchbase 4.4.2.

@mikereiche mikereiche added status: feedback-provided Feedback has been provided and removed status: waiting-for-triage An issue we've not yet triaged labels Aug 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: feedback-provided Feedback has been provided
Projects
None yet
Development

No branches or pull requests

3 participants