Navigation Menu

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

java.lang.ClassCastException: class org.javers.core.metamodel.type.ValueObjectType cannot be cast to class org.javers.core.metamodel.type.PrimitiveOrValueType #821

Closed
pethers opened this issue Apr 3, 2019 · 5 comments
Labels

Comments

@pethers
Copy link
Contributor

pethers commented Apr 3, 2019

Strange error, possible regression but not sure exactly when It started will test a few olders versions.

Version used : 5.3.4 (works with 5.2.6/5.3.2)

''java.lang.ClassCastException: class org.javers.core.metamodel.type.ValueObjectType cannot be cast to class org.javers.core.metamodel.type.PrimitiveOrValueType (org.javers.core.metamodel.type.ValueObjectType and org.javers.core.metamodel.type.PrimitiveOrValueType are in unnamed module of loader org.eclipse.jetty.webapp.WebAppClassLoader @1190200a)
at org.javers.core.metamodel.type.EntityType.localIdAsString(EntityType.java:104)
at org.javers.core.metamodel.type.EntityType.createIdFromInstance(EntityType.java:91)
at org.javers.core.metamodel.object.GlobalIdFactory.createId(GlobalIdFactory.java:53)
at org.javers.core.graph.LiveCdoFactory.create(LiveCdoFactory.java:38)
at org.javers.core.graph.ObjectGraphBuilder.buildGraph(ObjectGraphBuilder.java:48)
at org.javers.core.graph.LiveGraphFactory.createLiveGraph(LiveGraphFactory.java:38)
at org.javers.core.commit.CommitFactory.createLiveGraph(CommitFactory.java:95)
at org.javers.core.commit.CommitFactory.create(CommitFactory.java:74)
at org.javers.core.JaversCore.commit(JaversCore.java:82)
at org.javers.spring.jpa.JaversTransactionalDecorator.commit(JaversTransactionalDecorator.java:82)
at org.javers.spring.auditable.aspect.JaversCommitAdvice.commitMethodArguments(JaversCommitAdvice.java:40)
at org.javers.spring.auditable.aspect.JaversCommitAdvice.commitSaveMethodArguments(JaversCommitAdvice.java:28)
at org.javers.spring.auditable.aspect.JaversAuditableAspect.commitAdvice(JaversAuditableAspect.java:37)''

@bartoszwalacik
Copy link
Member

Test case with reproduction?

@pethers
Copy link
Contributor Author

pethers commented Apr 3, 2019

@bartoszwalacik will try to figure it out and provide it, only happens at one place in the application and works in other places.

@bartoszwalacik
Copy link
Member

ok

pethers added a commit to Hack23/cia that referenced this issue Apr 3, 2019
@Sledzik
Copy link

Sledzik commented Apr 4, 2019

I face with the same issue.
In my case I have an entity using composite primary key (@embeddable) which cause the issue.
My workaround is to register the composite primary key class as Value
.registerValue(JpaEntity.CompositeId.class)

bartoszwalacik added a commit that referenced this issue Apr 7, 2019
bartoszwalacik added a commit that referenced this issue Apr 7, 2019
bartoszwalacik added a commit that referenced this issue Apr 7, 2019
bartoszwalacik added a commit that referenced this issue Apr 7, 2019
bartoszwalacik added a commit that referenced this issue Apr 7, 2019
bartoszwalacik added a commit that referenced this issue Apr 7, 2019
bartoszwalacik added a commit that referenced this issue Apr 7, 2019
@bartoszwalacik
Copy link
Member

try 5.3.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants