Details
-
Bug
-
Resolution: Done
-
Critical
-
2.2.1.GA, 2.5.0.Beta1
Description
The following code causes a PathNotFoundException during the checkin attempt. This seems to be a caching problem. The exception will not be thrown when the call to isVersionable is omitted. Tested with jpa and inmemory.
Session session = RepositoryReferenceFactory.getRepository("test-jpa").login(); VersionManager vm = session.getWorkspace().getVersionManager(); Node outer = session.getRootNode().addNode("outerFolder"); Node inner = outer.addNode("innerFolder"); Node file = inner.addNode("testFile.dat"); file.setProperty("jcr:mimeType", "text/plain"); file.setProperty("jcr:data", "Original content"); session.save(); file.addMixin("mix:versionable"); //session.save(); isVersionable(vm, file); // here's the problem session.save(); Version v1 = vm.checkin(file.getPath()); log.info("Created version: " + v1);
boolean isVersionable(VersionManager vm, Node node) throws RepositoryException { try { vm.getVersionHistory(node.getPath()); return true; } catch (UnsupportedRepositoryOperationException e) { return false; } }
Exception:
org.modeshape.graph.property.PathNotFoundException: Unable to find "[{http://www.modeshape.org/1.0}uuid = 1c879461-d9c4-479c-b9fa-5bbad41812bc]"; lowest existing path is "/" at org.modeshape.graph.connector.base.MapTransaction.getNode(MapTransaction.java:198) at org.modeshape.graph.connector.base.MapTransaction.getNode(MapTransaction.java:65) at org.modeshape.graph.connector.base.Processor.getTargetNode(Processor.java:646) at org.modeshape.graph.connector.base.Processor.process(Processor.java:104) at org.modeshape.graph.request.processor.RequestProcessor.process(RequestProcessor.java:288) at org.modeshape.graph.connector.base.Connection.execute(Connection.java:115) at org.modeshape.graph.Graph.execute(Graph.java:283) at org.modeshape.graph.Graph$5.process(Graph.java:226) at org.modeshape.graph.request.RequestBuilder.readNode(RequestBuilder.java:142) at org.modeshape.graph.Graph.getNodeAt(Graph.java:2413) at org.modeshape.graph.Graph.getNodeAt(Graph.java:2403) at org.modeshape.jcr.JcrVersionManager.checkin(JcrVersionManager.java:361) at org.modeshape.jcr.JcrVersionManager.checkin(JcrVersionManager.java:1723) at org.jboss.soa.modeshape.qa.tests.GenericConnectorVersioningTest.testVersioningBug(GenericConnectorVersioningTest.java:108) ...