[jboss-jira] [JBoss JIRA] (WFLY-6596) WrongClassException when using remote-store for hibernate entity cache
Gunther v. Wolffersdorff (JIRA)
issues at jboss.org
Mon Aug 29 07:26:00 EDT 2016
[ https://issues.jboss.org/browse/WFLY-6596?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Gunther v. Wolffersdorff updated WFLY-6596:
-------------------------------------------
Steps to Reproduce:
* Application
> unzip sample-10.1.0.Final.zip
> cd sample
> mvn clean install
> ls -la sample-ear/target/sample-ear.ear
* Infinispan
- Version 8.2.4.Final
- start:
> infinispan-server-8.2.4.Final/bin/standalone.sh --server-config=clustered.sample.xml -Djboss.socket.binding.port-offset=100
* Wildfly
- Version 10.1.0.Final
- start:
> wildfly-10.1.0.Final/bin/standalone.sh --server-config=standalone.sample.ha.xml
deploy: sample-ear.ear
Call in web browser: http://localhost:2680/sample-web/rest/members/listAll throws:
{{13:00:52,541 MESZ ERROR [io.undertow.request] (default task-1) UT005023: Exception handling request to /sample-web/rest/members/listAll: org.jboss.resteasy.spi.UnhandledException: javax.persistence.PersistenceException: org.hibernate.WrongClassException: Object [id=2] was not of the specified subclass [de.alvara.ticket.sample.model.Country] : loaded object was of wrong class class de.alvara.ticket.sample.model.Member
at org.jboss.resteasy.core.ExceptionHandler.handleApplicationException(ExceptionHandler.java:77) [resteasy-jaxrs-3.0.19.Final.jar:3.0.19.Final]
at org.jboss.resteasy.core.ExceptionHandler.handleException(ExceptionHandler.java:220) [resteasy-jaxrs-3.0.19.Final.jar:3.0.19.Final]
at org.jboss.resteasy.core.SynchronousDispatcher.writeException(SynchronousDispatcher.java:175) [resteasy-jaxrs-3.0.19.Final.jar:3.0.19.Final]
...}}
was:
* Application
> unzip sample-10.1.0.Final.zip
> cd sample
> mvn clean install
> ls -la sample-ear/target/sample-ear.ear
* Infinispan
- Version 8.2.4.Final
- start:
> infinispan-server-8.2.4.Final/bin/standalone.sh --server-config=clustered.sample.xml -Djboss.socket.binding.port-offset=100
* Wildfly
- Version 10.1.0.Final
- start:
> wildfly-10.1.0.Final/bin/standalone.sh --server-config=standalone.sample.ha.xml
deploy: sample-ear.ear
Call in web browser: http://localhost:2680/sample-web/rest/members/listAll throws:
{{monospaced text}}
> WrongClassException when using remote-store for hibernate entity cache
> ----------------------------------------------------------------------
>
> Key: WFLY-6596
> URL: https://issues.jboss.org/browse/WFLY-6596
> Project: WildFly
> Issue Type: Bug
> Components: EE
> Affects Versions: 10.0.0.Final
> Environment: Java version: 1.8.0_45, vendor: Oracle Corporation
> Java home: C:\Program Files\Java\jdk1.8.0_45\jre
> Default locale: de_DE, platform encoding: Cp1252
> OS name: "windows 8.1", version: "6.3", arch: "amd64", family: "dos"
> Infifnspan 8.1.2 or 8.2.0
> Reporter: Gunther v. Wolffersdorff
> Labels: inifinispan-commons, org.hibernate.WrongClassException, remote-store
> Attachments: clustered.sample.xml, infinispan.zip, sample.zip, standalone.sample.ha.xml
>
>
> Starting an application and then requesting a list of cachable JPA entitties ( configured cachable using a hibernate entity invalidation-cache with a remote-server as remote-store ) causes:
> Caused by: org.hibernate.WrongClassException: Object [id=2] was not of the specified subclass [de.alvara.ticket.sample.model.Country] : loaded object was of wrong class class de.alvara.ticket.sample.model.Member
> at org.hibernate.event.internal.DefaultLoadEventListener.processCachedEntry(DefaultLoadEventListener.java:631) [hibernate-core-5.0.7.Final.jar:5.0.7.Final]
> at org.hibernate.event.internal.DefaultLoadEventListener.loadFromSecondLevelCache(DefaultLoadEventListener.java:602) [hibernate-core-5.0.7.Final.jar:5.0.7.Final]
> at org.hibernate.event.internal.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:462) [hibernate-core-5.0.7.Final.jar:5.0.7.Final]
> at org.hibernate.event.internal.DefaultLoadEventListener.load(DefaultLoadEventListener.java:219) [hibernate-core-5.0.7.Final.jar:5.0.7.Final]
> at org.hibernate.event.internal.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:278) [hibernate-core-5.0.7.Final.jar:5.0.7.Final]
> at org.hibernate.event.internal.DefaultLoadEventListener.doOnLoad(DefaultLoadEventListener.java:121) [hibernate-core-5.0.7.Final.jar:5.0.7.Final]
> at org.hibernate.event.internal.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:89) [hibernate-core-5.0.7.Final.jar:5.0.7.Final]
> at org.hibernate.internal.SessionImpl.fireLoad(SessionImpl.java:1129) [hibernate-core-5.0.7.Final.jar:5.0.7.Final]
> at org.hibernate.internal.SessionImpl.internalLoad(SessionImpl.java:1022) [hibernate-core-5.0.7.Final.jar:5.0.7.Final]
> at org.hibernate.type.EntityType.resolveIdentifier(EntityType.java:632) [hibernate-core-5.0.7.Final.jar:5.0.7.Final]
> at org.hibernate.type.EntityType.resolve(EntityType.java:424) [hibernate-core-5.0.7.Final.jar:5.0.7.Final]
> at org.hibernate.engine.internal.TwoPhaseLoad.doInitializeEntity(TwoPhaseLoad.java:154) [hibernate-core-5.0.7.Final.jar:5.0.7.Final]
> at org.hibernate.engine.internal.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:128) [hibernate-core-5.0.7.Final.jar:5.0.7.Final]
> at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:1132) [hibernate-core-5.0.7.Final.jar:5.0.7.Final]
> at org.hibernate.loader.Loader.processResultSet(Loader.java:992) [hibernate-core-5.0.7.Final.jar:5.0.7.Final]
> at org.hibernate.loader.Loader.doQuery(Loader.java:930) [hibernate-core-5.0.7.Final.jar:5.0.7.Final]
> at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:336) [hibernate-core-5.0.7.Final.jar:5.0.7.Final]
> at org.hibernate.loader.Loader.doList(Loader.java:2611) [hibernate-core-5.0.7.Final.jar:5.0.7.Final]
> at org.hibernate.loader.Loader.doList(Loader.java:2594) [hibernate-core-5.0.7.Final.jar:5.0.7.Final]
> at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2423) [hibernate-core-5.0.7.Final.jar:5.0.7.Final]
> at org.hibernate.loader.Loader.list(Loader.java:2418) [hibernate-core-5.0.7.Final.jar:5.0.7.Final]
> at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:501) [hibernate-core-5.0.7.Final.jar:5.0.7.Final]
> at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:371) [hibernate-core-5.0.7.Final.jar:5.0.7.Final]
> at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:216) [hibernate-core-5.0.7.Final.jar:5.0.7.Final]
> at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1326) [hibernate-core-5.0.7.Final.jar:5.0.7.Final]
> at org.hibernate.internal.QueryImpl.list(QueryImpl.java:87) [hibernate-core-5.0.7.Final.jar:5.0.7.Final]
> at org.hibernate.jpa.internal.QueryImpl.list(QueryImpl.java:606) [hibernate-entitymanager-5.0.7.Final.jar:5.0.7.Final]
> at org.hibernate.jpa.internal.QueryImpl.getResultList(QueryImpl.java:483) [hibernate-entitymanager-5.0.7.Final.jar:5.0.7.Final]
> ... 47 more
> This constellation works fine using Wildfly 8.2.0 and Infinispan 7.2.5 .
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
More information about the jboss-jira
mailing list