Jackrabbit Client throws UnsupportedRepositoryOperationException on checkinItem() method

21 views
Skip to first unread message

Emanuele Iannone

unread,
Apr 24, 2015, 9:39:05 AM4/24/15
to jackal...@googlegroups.com
Hi,
I'm trying to use versioning in a symfony-cmf application with PHP-ODM / Jackrabbit based CR.
My setup include latest version of symfony-cmf (1.2-dev), with a jackalope-jackrabbit client (v 1.1-dev) and an Apache Jackrabbit server (v2.8.0).
I can persist and retrieve documents without problems, but when I try to enable versioning, issuing a "checkin" action on a node, the Jackrabbit server responds with a 405 http status, which is translated by transport Client in an UnsupportedRepositoryOperationException.
Could you help me with this problem?

I don't know if the problem lies in Jackrabbit configuration, node configuration or a limitation in the http client/server protocol.

As to Jackrabbit configuration, here are the versioning settings in repository.xml server configuration file:

    <Versioning rootPath="${rep.home}/version">
       
<!--
            Configures the filesystem to use for versioning for the respective
            persistence manager
        -->

       
<FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
           
<param name="path" value="${rep.home}/version" />
       
</FileSystem>

       
<!--
            Configures the persistence manager to be used for persisting version state.
            Please note that the current versioning implementation is based on
            a 'normal' persistence manager, but this could change in future
            implementations.
        -->

       
<PersistenceManager class="org.apache.jackrabbit.core.persistence.pool.H2PersistenceManager">
           
<param name="bundleCacheSize" value="8"/>
           
<param name="consistencyCheck" value="false"/>
           
<param name="minBlobSize" value="16384"/>
           
<param name="driver" value="org.h2.Driver"/>
           
<param name="url" value="jdbc:h2:file:${rep.home}/db/itemState"/>
           
<param name="user" value=""/>
           
<param name="password" value=""/>
           
<param name="schema" value="h2"/>
           
<param name="schemaObjectPrefix" value="version_"/>
           
<param name="errorHandling" value=""/>
           
<param name="lockTimeout" value="10000"/>
       
</PersistenceManager>        
   
</Versioning>


As to node configuration, here are the details of the node I'm trying to checkin:

<sv:node sv:name="documento2">
   
<sv:property sv:name="jcr:primaryType" sv:type="Name">
       
<sv:value>nt:unstructured</sv:value>
   
</sv:property>
   
<sv:property sv:multiple="true" sv:name="jcr:mixinTypes" sv:type="Name">
       
<sv:value>phpcr:managed</sv:value>
       
<sv:value>mix:referenceable</sv:value>
       
<sv:value>mix:simpleVersionable</sv:value>
   
</sv:property>
   
<sv:property sv:name="jcr:uuid" sv:type="String">
       
<sv:value>8fc7fddb-1d95-4c12-8f05-5c4927d41092</sv:value>
   
</sv:property>
   
<sv:property sv:name="nome" sv:type="String">
       
<sv:value>Documento 2</sv:value>
   
</sv:property>
   
<sv:property sv:multiple="true" sv:name="defaults" sv:type="String"/>
   
<sv:property sv:name="jcr:isCheckedOut" sv:type="Boolean">
       
<sv:value>1</sv:value>
   
</sv:property>
   
<sv:property sv:multiple="true" sv:name="schemes" sv:type="String"/>
   
<sv:property sv:multiple="true" sv:name="methods" sv:type="String"/>
   
<sv:property sv:name="phpcr:class" sv:type="String">
       
<sv:value>AppBundle\Document\TestDoc</sv:value>
   
</sv:property>
   
<sv:property sv:multiple="true" sv:name="phpcr:classparents" sv:type="String">
       
<sv:value>Symfony\Component\Routing\Route</sv:value>
       
<sv:value>Symfony\Cmf\Bundle\RoutingBundle\Model\Route</sv:value>
       
<sv:value>Symfony\Cmf\Bundle\RoutingBundle\Doctrine\Phpcr\Route</sv:value>
   
</sv:property>
   
<sv:property sv:multiple="true" sv:name="requirements" sv:type="String"/>
   
<sv:property sv:name="host" sv:type="String">
       
<sv:value/>
   
</sv:property>
   
<sv:property sv:name="descrizione" sv:type="String">
       
<sv:value>Descrizione documento 2</sv:value>
   
</sv:property>
   
<sv:property sv:multiple="true" sv:name="options" sv:type="String"/>
</sv:node>

Is the checkin action supported over http connection?

Thank you
Emanuele

Emanuele Iannone

unread,
Apr 24, 2015, 10:48:26 AM4/24/15
to jackal...@googlegroups.com
The cause seems to be in the node mixin mix:simpleVersionable (simple versioning mode)
If I add mix:versionable mixin to the node, enabling full versioning mode, then I'm able to check in.

So I changed my class definition from:

/**
 * @PHPCR\Document(versionable="simple")
 */
class TestDoc

to:

/**
 * @PHPCR\Document(versionable="full")
 */
class TestDoc


And the versioning is working.

Can be this considered a bug in PHPCR-ODM, as the documentation (http://docs.doctrine-project.org/projects/doctrine-phpcr-odm/en/latest/reference/versioning.html) states that checkin is possible also with simple versioning mode?

Lukas Kahwe Smith

unread,
Apr 25, 2015, 3:07:18 AM4/25/15
to Emanuele Iannone, jackal...@googlegroups.com

On 24 Apr 2015, at 16:48, Emanuele Iannone <emanuele...@gmail.com> wrote:

The cause seems to be in the node mixin mix:simpleVersionable (simple versioning mode)
If I add mix:versionable mixin to the node, enabling full versioning mode, then I'm able to check in.

So I changed my class definition from:

/**
 * @PHPCR\Document(versionable="simple")
 */
class TestDoc

to:

/**
 * @PHPCR\Document(versionable="full")
 */
class TestDoc


And the versioning is working.

Can be this considered a bug in PHPCR-ODM, as the documentation (http://docs.doctrine-project.org/projects/doctrine-phpcr-odm/en/latest/reference/versioning.html) states that checkin is possible also with simple versioning mode?

indeed .. a checkin should be possible with simple and full versioning (see 15.2): 

Now the issue can be in multiple places.
PHPCR ODM might not be setting simple versioning correctly. You can check that by using the dump command (f.e. with Symfony app/console doctrine:phpcr:node:dump /my/node).
Or it can still be a bug inside Jackalope. In theory it can also be a bug inside Jackrabbit but that is more doubtful.

Can you investigate this a bit more and open a ticket on the relevant repository?

regards,
Lukas

Emanuele Iannone

unread,
Apr 27, 2015, 6:53:02 AM4/27/15
to jackal...@googlegroups.com, emanuele...@gmail.com
As posted before, the node mixin is set correctly by ODM. Node dump reports the following property:

<sv:property sv:multiple="true" sv:name="jcr:mixinTypes" sv:type="Name">
        
<sv:value>phpcr:managed</sv:value>
        
<sv:value>mix:referenceable</sv:value>
        
<sv:value>mix:simpleVersionable</sv:value>
</sv:property>

The mixin corresponds with that defined by JCR specifications (http://www.day.com/specs/jcr/2.0/15_Versioning.html), so if this is the only requirement to enable versioning, as JCR seems to confirm, it shuldn't be a bug in PHPCR-ODM.

I've checked also Jackalope transport call to Jackrabbit server, and there are no differences between checkin on a "simple" versioned node and a "full" one. In both cases it's a simple http request with method "CHECKIN" and node path as url.
So the problem lies probably in Jackrabbit server.

Indeed, doing a web search revealed that this feature is not yet implemented in JCR remoting, as found here: http://docs.adobe.com/docs/en/crx/2-3/release_notes/overview/known_issues.html

I'm not a JCR expert and I'm not sure these issues are still valid (they were opened several years ago), so can you check them please?

David Buchmann

unread,
May 1, 2015, 11:51:09 AM5/1/15
to Emanuele Iannone, jackal...@googlegroups.com
hi emanuele,

i played around with https://github.com/jackalope/JavaDavexClient and
indeed it seems that mix:versionable works while mix:simpleVersionable
does not (and its implemented quite badly, as the mixin is accepted but
then you get failures in unexpected moments)

so indeed we must have full versionable for this to work. can you do a
pull request with a hint on that for the phpcr-odm-documentation please?

cheers,david
> <javascript:>> wrote:
>
>> The cause seems to be in the node
>> mixin mix:simpleVersionable (simple versioning mode)
>> If I add mix:versionable mixin to the node, enabling full
>> versioning mode, then I'm able to check in.
>>
>> So I changed my class definition from:
>>
>> /**
>> * @PHPCR\Document(versionable="simple")
>> */
>> class TestDoc
>>
>> to:
>>
>> /**
>> * @PHPCR\Document(versionable="full")
>> */
>> class TestDoc
>>
>>
>> And the versioning is working.
>>
>> Can be this considered a bug in PHPCR-ODM, as the documentation
>> (http://docs.doctrine-project.org/projects/doctrine-phpcr-odm/en/latest/reference/versioning.html
>> <http://docs.doctrine-project.org/projects/doctrine-phpcr-odm/en/latest/reference/versioning.html>)
>> states that checkin is possible also with simple versioning mode?
>
> indeed .. a checkin should be possible with simple and full
> versioning (see 15.2):
> http://www.day.com/specs/jcr/2.0/15_Versioning.html
> <http://www.day.com/specs/jcr/2.0/15_Versioning.html>
>
> Now the issue can be in multiple places.
> PHPCR ODM might not be setting simple versioning correctly. You can
> check that by using the dump command (f.e. with Symfony app/console
> doctrine:phpcr:node:dump /my/node).
> Or it can still be a bug inside Jackalope. In theory it can also be
> a bug inside Jackrabbit but that is more doubtful.
>
> Can you investigate this a bit more and open a ticket on the
> relevant repository?
>
> regards,
> Lukas
>
> --
> You received this message because you are subscribed to the Google
> Groups "Jackalope" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to jackalope-de...@googlegroups.com
> <mailto:jackalope-de...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout.

--
Liip AG // Agile Web Development // T +41 43 500 39 80
CH-8005 Zurich // PGP 0xA581808B // www.liip.ch

Lukas Kahwe Smith

unread,
May 1, 2015, 11:55:00 AM5/1/15
to David A. Buchmann, Emanuele Iannone, jackal...@googlegroups.com

> On 01 May 2015, at 17:51, David Buchmann <da...@liip.ch> wrote:
>
> hi emanuele,
>
> i played around with https://github.com/jackalope/JavaDavexClient and
> indeed it seems that mix:versionable works while mix:simpleVersionable
> does not (and its implemented quite badly, as the mixin is accepted but
> then you get failures in unexpected moments)
>
> so indeed we must have full versionable for this to work. can you do a
> pull request with a hint on that for the phpcr-odm-documentation please?

but is this then a bug in jackrabbit core or in jackrabbit remoting?

regards,
Lukas Kahwe Smith
sm...@pooteeweet.org



signature.asc

David Buchmann

unread,
May 1, 2015, 12:04:07 PM5/1/15
to Lukas Kahwe Smith, Emanuele Iannone, jackal...@googlegroups.com
> but is this then a bug in jackrabbit core or in jackrabbit remoting?

https://issues.apache.org/jira/browse/JCR-2112 is about jcr2spi, so the
client library. but i played around with jackalope-jackrabbit a bit and
it seems its also broken there (or maybe i make the wrong assumptions
what needs to be done over the remoting)

Lukas Kahwe Smith

unread,
May 1, 2015, 12:09:31 PM5/1/15
to David A. Buchmann, Emanuele Iannone, jackal...@googlegroups.com
so maybe open a new ticket for jackrabbit ?
signature.asc

Emanuele Iannone

unread,
May 8, 2015, 5:48:43 AM5/8/15
to jackal...@googlegroups.com, emanuele...@gmail.com
OK, I've created a pull request for doctrine phpcr documentetion: https://github.com/doctrine/phpcr-odm-documentation/pull/72 
I've added a note about simple versioning mode not yet implemented for Jackrabbit server.
Reply all
Reply to author
Forward
0 new messages