-
1. Re: java.lang.ClassCastException: org.modeshape.jcr.cache.document.TransactionalWorkspaceCache cannot be cast to org.modeshape.jcr.cache.document.AbstractSessionCache
hchiorean Apr 12, 2017 2:57 AM (in response to hank.cheng)The only thing that I can think of is to check your classpath and make sure all your ModeShape jars belong to 5.x and you don't have any 3.x jars leftover.
-
3. Re: java.lang.ClassCastException: org.modeshape.jcr.cache.document.TransactionalWorkspaceCache cannot be cast to org.modeshape.jcr.cache.document.AbstractSessionCache
hank.cheng Apr 12, 2017 3:39 AM (in response to hank.cheng)Here is error message:
Caused by: javax.jcr.RepositoryException: java.lang.ClassCastException: org.modeshape.jcr.cache.document.TransactionalWorkspaceCache cannot be cast to org.modeshape.jcr.cache.document.AbstractSessionCache
at org.modeshape.jcr.JcrSession.save(JcrSession.java:1198) ~[modeshape-jcr-5.3.0.Final.jar:5.3.0.Final]
at org.modeshape.jcr.JcrVersionManager.restore(JcrVersionManager.java:888) ~[modeshape-jcr-5.3.0.Final.jar:5.3.0.Final]
at org.modeshape.jcr.JcrVersionManager.restore(JcrVersionManager.java:709) ~[modeshape-jcr-5.3.0.Final.jar:5.3.0.Final]
at com.epicgames.cms.jcr.service.impl.JcrVersionServiceImpl$4.doInSession(JcrVersionServiceImpl.java:164) ~[classes/:na]
at com.epicgames.cms.jcr.service.impl.JcrVersionServiceImpl$4.doInSession(JcrVersionServiceImpl.java:156) ~[classes/:na]
at com.epicgames.cms.jcr.util.JcrSessionTemplate.execute(JcrSessionTemplate.java:27) ~[classes/:na]
at com.epicgames.cms.jcr.util.JcrServiceTemplate.execute(JcrServiceTemplate.java:25) ~[classes/:na]
... 149 common frames omitted
Caused by: java.lang.ClassCastException: org.modeshape.jcr.cache.document.TransactionalWorkspaceCache cannot be cast to org.modeshape.jcr.cache.document.AbstractSessionCache
at org.modeshape.jcr.cache.document.SessionNode.session(SessionNode.java:298) ~[modeshape-jcr-5.3.0.Final.jar:5.3.0.Final]
at org.modeshape.jcr.cache.document.SessionNode.getPath(SessionNode.java:480) ~[modeshape-jcr-5.3.0.Final.jar:5.3.0.Final]
at org.modeshape.jcr.cache.PathCache.getPath(PathCache.java:41) ~[modeshape-jcr-5.3.0.Final.jar:5.3.0.Final]
at org.modeshape.jcr.cache.document.WritableSessionCache.computePathChangesForSNS(WritableSessionCache.java:1482) ~[modeshape-jcr-5.3.0.Final.jar:5.3.0.Final]
at org.modeshape.jcr.cache.document.WritableSessionCache.persistChanges(WritableSessionCache.java:1264) ~[modeshape-jcr-5.3.0.Final.jar:5.3.0.Final]
at org.modeshape.jcr.cache.document.WritableSessionCache.save(WritableSessionCache.java:696) ~[modeshape-jcr-5.3.0.Final.jar:5.3.0.Final]
at org.modeshape.jcr.JcrSession.save(JcrSession.java:1179) ~[modeshape-jcr-5.3.0.Final.jar:5.3.0.Final]
... 155 common frames omitted
-
4. Re: java.lang.ClassCastException: org.modeshape.jcr.cache.document.TransactionalWorkspaceCache cannot be cast to org.modeshape.jcr.cache.document.AbstractSessionCache
hchiorean Apr 12, 2017 4:53 AM (in response to hank.cheng)Then I'm not sure what's going on; I've not seen this exception before.
If you can provide a test case that I can run locally to reproduce this issue, I can investigate some more; otherwise you'll have to debug your environment and investigate where the problem is coming from.
-
5. Re: java.lang.ClassCastException: org.modeshape.jcr.cache.document.TransactionalWorkspaceCache cannot be cast to org.modeshape.jcr.cache.document.AbstractSessionCache
hank.cheng Apr 12, 2017 9:38 PM (in response to hchiorean)Hi Horia,
We try to provide a test case but failed, we only can reproduce this issue with on our prod data. We debug our environment and here is our investigation:
There is a function computePathChangesForSNS in WritableSessionCache, When the system run "Path snsOldPath = workspacePaths.getPath(sns);"which "sns" is SessionNode Type and the cach type in workspacePaths is TransactionalWorkspaceCache, it will throw this exception. In the above picture, it show the detailed information. ComputePathChangesForSNS function will be called by function persistChanges in WritableSessionCache. here is runtime picture.
Please help us to investigate some more. Any suggestions are welcome.
Thanks
Hank
-
6. Re: java.lang.ClassCastException: org.modeshape.jcr.cache.document.TransactionalWorkspaceCache cannot be cast to org.modeshape.jcr.cache.document.AbstractSessionCache
hchiorean Apr 13, 2017 3:57 AM (in response to hank.cheng)Luckily I'm able to reproduce it locally, based on your stack trace. See [MODE-2685] ClassCastException when attempting to reoder SNS with transient changes - JBoss Issue Tracker
I was planning on doing a 5.4.1 micro release (Maven only) soon, so I'll try to get the fix in that.