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

Issue with generated layered entity code - may need documentation? #187

Open
hrstoyanov opened this issue Mar 28, 2024 · 0 comments
Open
Milestone

Comments

@hrstoyanov
Copy link

hrstoyanov commented Mar 28, 2024

Environment Details

  • EclipseStore Version: 1.3.1
  • JDK version: 21.0.2
  • OS: MacOs Sonoma

Describe the bug

This is not really a bug, but rather a suggestion to add documentation.

In a fully modularized application, when the embedded storage manager attempts to persist entities, it fails with:

java.lang.reflect.InaccessibleObjectException: Unable to make protected datamodel.product._Product.ProductEntity() accessible: module datamodel does not "opens datamodel.product._Product" to module org.eclipse.serializer.persistence.binary
	at java.base/java.lang.reflect.AccessibleObject.throwInaccessibleObjectException(AccessibleObject.java:391)
	at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:367)
	at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:315)
	at java.base/java.lang.reflect.Constructor.checkCanSetAccessible(Constructor.java:194)
	at java.base/java.lang.reflect.Constructor.setAccessible(Constructor.java:187)
	at org.eclipse.serializer.persistence.binary@1.3.1/org.eclipse.serializer.persistence.binary.org.eclipse.serializer.entity.BinaryHandlerEntityLayerIdentity.WrapDefaultConstructor(BinaryHandlerEntityLayerIdentity.java:61)
	at org.eclipse.serializer.persistence.binary@1.3.1/org.eclipse.serializer.persistence.binary.org.eclipse.serializer.entity.BinaryHandlerEntityLayerIdentity.New(BinaryHandlerEntityLayerIdentity.java:50)
	at org.eclipse.serializer.persistence.binary@1.3.1/org.eclipse.serializer.persistence.binary.types.BinaryTypeHandlerCreator$Default.createEntityLayerIdentityHandler(BinaryTypeHandlerCreator.java:368)
	at org.eclipse.serializer.persistence.binary@1.3.1/org.eclipse.serializer.persistence.binary.types.BinaryTypeHandlerCreator$Default.internalCreateTypeHandlerEntity(BinaryTypeHandlerCreator.java:351)

Additional context

This is fixed by declaring the entity module "open" (also notice that the generated packages like _Product would need to be exported as well):

open module datamodel {
    //...
    exports datamodel.product._Product;
}
@hrstoyanov hrstoyanov changed the title Issue with generated layered entity code Issue with generated layered entity code - may need documentation? Mar 28, 2024
@fh-ms fh-ms added this to the 1.3.2 milestone Apr 15, 2024
@fh-ms fh-ms modified the milestones: 1.3.2, 1.3.3 May 6, 2024
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

2 participants