Uploaded image for project: 'ModeShape'
  1. ModeShape
  2. MODE-1257

exception when setting a property to null (deleting the property)

    XMLWordPrintable

Details

    • Hide

      This code produces the exception:

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

      The modeshape configuration is:

      <?xml version="2.0" encoding="UTF-8"?>
      <configuration xmlns:mode="http://www.modeshape.org/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0">
          <mode:repositories>
              <mode:repository jcr:name="repository" >
                  <mode:source>federated</mode:source>
                  <mode:options jcr:primaryType="options">
                      <mode:option jcr:name="projectNodeTypes" mode:value="true"/>
                      <mode:option jcr:name="jaasLoginConfigName" mode:value="modeshape"/>
                      <mode:option jcr:name="queryIndexDirectory" mode:value="${jboss.server.data.dir}/modeshape/repositories/store/indexes"/>
                      <mode:option jcr:name="queryIndexesUpdatedSynchronously" mode:value="true"/>
                      <mode:option jcr:name="queryIndexesRebuiltSynchronously" mode:value="true"/>
                      <mode:option jcr:name="rebuildQueryIndexOnStartup" mode:value="always"/>
                  </mode:options>
              </mode:repository>
          </mode:repositories>
      
          <mode:sources jcr:primaryType="nt:unstructured">
              <mode:source jcr:name="infinispan" 
                  mode:classname="org.modeshape.connector.infinispan.RemoteInfinispanSource" 
                  mode:defaultWorkspaceName="default">
             </mode:source>
              <mode:source jcr:name="filesystem" 
                  mode:classname="org.modeshape.connector.filesystem.FileSystemSource"
                  mode:description="File System Source"
                  mode:workspaceRootPath="/home/mcr/content"
                  mode:defaultWorkspaceName="default"
                  mode:creatingWorkspacesAllowed="false"
                  mode:rootNodeUuid="a9bb5d79-f6c7-4bbc-a016-9453035b1b87"
                  mode:updatesAllowed="true" 
                  mode:exclusionPattern="^.*\.modeshape$"
                  mode:extraPropertiesBehavior="store"/>
              <mode:source jcr:name="federated">
                  <mode:classname>org.modeshape.graph.connector.federation.FederatedRepositorySource</mode:classname>
                  <mode:workspaces>
                      <mode:workspace jcr:name="default">
                          <mode:projections>
                          <mode:projection jcr:name="infinispan projection" mode:source="infinispan" mode:workspaceName="default">
                              <mode:projectionRules>/infinispan => /</mode:projectionRules>
                          </mode:projection>
                          <mode:projection jcr:name="filesystem projection" mode:source="filesystem" mode:workspaceName="default">
                              <mode:projectionRules>/filesystem => /</mode:projectionRules>
                          </mode:projection>
                          </mode:projections>
                      </mode:workspace>
                  </mode:workspaces>
              </mode:source>
          </mode:sources>
      </configuration>
      
      Show
      This code produces the exception: node.setProperty( "prop" , (Value) null ); session.save(); The modeshape configuration is: <?xml version= "2.0" encoding= "UTF-8" ?> <configuration xmlns:mode = "http://www.modeshape.org/1.0" xmlns:jcr = "http://www.jcp.org/jcr/1.0" > <mode:repositories> <mode:repository jcr:name= "repository" > <mode:source> federated </mode:source> <mode:options jcr:primaryType= "options" > <mode:option jcr:name= "projectNodeTypes" mode:value= "true" /> <mode:option jcr:name= "jaasLoginConfigName" mode:value= "modeshape" /> <mode:option jcr:name= "queryIndexDirectory" mode:value= "${jboss.server.data.dir}/modeshape/repositories/store/indexes" /> <mode:option jcr:name= "queryIndexesUpdatedSynchronously" mode:value= "true" /> <mode:option jcr:name= "queryIndexesRebuiltSynchronously" mode:value= "true" /> <mode:option jcr:name= "rebuildQueryIndexOnStartup" mode:value= "always" /> </mode:options> </mode:repository> </mode:repositories> <mode:sources jcr:primaryType= "nt:unstructured" > <mode:source jcr:name= "infinispan" mode:classname= "org.modeshape.connector.infinispan.RemoteInfinispanSource" mode:defaultWorkspaceName= "default" > </mode:source> <mode:source jcr:name= "filesystem" mode:classname= "org.modeshape.connector.filesystem.FileSystemSource" mode:description= "File System Source" mode:workspaceRootPath= "/home/mcr/content" mode:defaultWorkspaceName= "default" mode:creatingWorkspacesAllowed= "false" mode:rootNodeUuid= "a9bb5d79-f6c7-4bbc-a016-9453035b1b87" mode:updatesAllowed= "true" mode:exclusionPattern= "^.*\.modeshape$" mode:extraPropertiesBehavior= "store" /> <mode:source jcr:name= "federated" > <mode:classname> org.modeshape.graph.connector.federation.FederatedRepositorySource </mode:classname> <mode:workspaces> <mode:workspace jcr:name= "default" > <mode:projections> <mode:projection jcr:name= "infinispan projection" mode:source= "infinispan" mode:workspaceName= "default" > <mode:projectionRules> /infinispan => / </mode:projectionRules> </mode:projection> <mode:projection jcr:name= "filesystem projection" mode:source= "filesystem" mode:workspaceName= "default" > <mode:projectionRules> /filesystem => / </mode:projectionRules> </mode:projection> </mode:projections> </mode:workspace> </mode:workspaces> </mode:source> </mode:sources> </configuration>

    Description

      When attempting to delete a property by setting it to null, Modeshape throws an exception when ModeShape is configured to use the federation connector:

      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
      

      Attachments

        Activity

          People

            rhauch Randall Hauch (Inactive)
            jonathandfields_jira Jonathan Fields (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: