3 Replies Latest reply on Sep 7, 2011 12:44 PM by Randall Hauch

    exception when setting property to null (delete)

    Jonathan Fields Novice

      In this code.

       

      node.setProperty("prop", (Value)null);

      session.save();

       

      I get the following exception. This is with a federated repository (infinispan + file system), attempting to delete a property from an infinispan node.

       

      Caused by: javax.jcr.RepositoryException: java.lang.ClassCastException: org.modeshape.graph.request.RemovePropertyRequest cannot be cast to org.modeshape.graph.request.SetPropertyRequest

          at org.modeshape.jcr.SessionCache.save(SessionCache.java:480)

          at org.modeshape.jcr.JcrSession.save(JcrSession.java:1309)

          at com.montanesolutions.mcr.component.NodeAction.deleteProperty(NodeAction.java:119)

       

      Caused by: org.modeshape.graph.connector.RepositorySourceException: java.lang.ClassCastException: org.modeshape.graph.request.RemovePropertyRequest cannot be cast to org.modeshape.graph.request.SetPropertyRequest

          at org.modeshape.graph.session.GraphSession.save(GraphSession.java:1052)

          at org.modeshape.jcr.SessionCache.save(SessionCache.java:474)

          ... 88 more

      Caused by: java.lang.ClassCastException: org.modeshape.graph.request.RemovePropertyRequest cannot be cast to org.modeshape.graph.request.SetPropertyRequest

          at org.modeshape.graph.connector.federation.JoinRequestProcessor.process(JoinRequestProcessor.java:924)

          at org.modeshape.graph.request.processor.RequestProcessor.process(RequestProcessor.java:303)

          at org.modeshape.graph.connector.federation.JoinRequestProcessor.process(JoinRequestProcessor.java:195)

          at org.modeshape.graph.connector.federation.JoinRequestProcessor.process(JoinRequestProcessor.java:145)

          at org.modeshape.graph.connector.federation.FederatedRepositoryConnection.execute(FederatedRepositoryConnection.java:225)

          at org.modeshape.graph.connector.RepositoryConnectionPool$ConnectionWrapper.execute(RepositoryConnectionPool.java:1129)

          at org.modeshape.graph.request.CompositeRequestChannel$2.call(CompositeRequestChannel.java:193)

          at org.modeshape.graph.request.CompositeRequestChannel$2.call(CompositeRequestChannel.java:183)

          at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)

          at java.util.concurrent.FutureTask.run(FutureTask.java:138)

          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

          ... 1 more