You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-issues@jackrabbit.apache.org by "Julian Reschke (JIRA)" <ji...@apache.org> on 2019/03/19 06:09:00 UTC

[jira] [Updated] (OAK-8136) Oak http service does not handle jcr property types correctly

     [ https://issues.apache.org/jira/browse/OAK-8136?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Julian Reschke updated OAK-8136:
--------------------------------
    Summary: Oak http service does not handle jcr property types correctly  (was: Oak http service does not handle jcr property types correctly.)

> Oak http service does not handle jcr property types correctly
> -------------------------------------------------------------
>
>                 Key: OAK-8136
>                 URL: https://issues.apache.org/jira/browse/OAK-8136
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: oak-http
>            Reporter: Henry Saginor
>            Priority: Major
>         Attachments: OakServlet.patch
>
>
> POST examples documented [here|https://github.com/apache/jackrabbit-oak/tree/trunk/oak-http] do not work because OakServlet post does not handle types for standard JCR properties like jcr:primaryType correctly which always fails property type constraint checks on commit.
> For example jcr:primaryType is always saved as STRING and it should be of type NAME
> See [https://docs.adobe.com/docs/en/spec/jcr/1.0/6.7.5_Special_Properties_jcr_primaryType_and_jcr_mixinTypes.html]
> Example:
> {code:java}
> http -j -b -a admin:admin --timeout=2000 localhost:8080/test jcr\\:primaryType=nt:unstructured  foo=abc bar:=123
> {code}
> This always results in the following exception
> {code:java}
> org.apache.jackrabbit.oak.api.CommitFailedException: OakConstraint0055: /test[[nt:unstructured]]: Required property type violation in jcr:primaryType = nt:unstructured
>     at org.apache.jackrabbit.oak.plugins.nodetype.TypeEditor$1.onConstraintViolation(TypeEditor.java:109)
>     at org.apache.jackrabbit.oak.plugins.nodetype.TypeEditor.constraintViolation(TypeEditor.java:234)
>     at org.apache.jackrabbit.oak.plugins.nodetype.TypeEditor.checkRequiredType(TypeEditor.java:413)
>     at org.apache.jackrabbit.oak.plugins.nodetype.TypeEditor.checkPropertyTypeConstraints(TypeEditor.java:507)
>     at org.apache.jackrabbit.oak.plugins.nodetype.TypeEditor.checkNodeTypeConstraints(TypeEditor.java:463)
>     at org.apache.jackrabbit.oak.plugins.nodetype.TypeEditor.enter(TypeEditor.java:276)
>     at org.apache.jackrabbit.oak.spi.commit.VisibleEditor.enter(VisibleEditor.java:53)
>     at org.apache.jackrabbit.oak.spi.commit.CompositeEditor.enter(CompositeEditor.java:65)
>     at org.apache.jackrabbit.oak.spi.commit.EditorDiff.childNodeAdded(EditorDiff.java:121)
>     at org.apache.jackrabbit.oak.segment.MapRecord$4.childNodeAdded(MapRecord.java:443)
>     at org.apache.jackrabbit.oak.segment.MapRecord.compare(MapRecord.java:505)
>     at org.apache.jackrabbit.oak.segment.MapRecord.compare(MapRecord.java:440)
>     at org.apache.jackrabbit.oak.segment.SegmentNodeState.compareAgainstBaseState(SegmentNodeState.java:651)
>     at org.apache.jackrabbit.oak.spi.commit.EditorDiff.process(EditorDiff.java:51)
>     at org.apache.jackrabbit.oak.spi.commit.EditorHook.processCommit(EditorHook.java:54)
>     at org.apache.jackrabbit.oak.spi.commit.CompositeHook.processCommit(CompositeHook.java:60)
>     at org.apache.jackrabbit.oak.spi.commit.CompositeHook.processCommit(CompositeHook.java:60)
>     at org.apache.jackrabbit.oak.segment.scheduler.Commit.apply(Commit.java:99)
>     at org.apache.jackrabbit.oak.segment.scheduler.LockBasedScheduler.execute(LockBasedScheduler.java:308)
>     at org.apache.jackrabbit.oak.segment.scheduler.LockBasedScheduler.schedule(LockBasedScheduler.java:279)
>     at org.apache.jackrabbit.oak.segment.SegmentNodeStore.merge(SegmentNodeStore.java:211)
>     at org.apache.jackrabbit.oak.core.MutableRoot.commit(MutableRoot.java:251)
>     at org.apache.jackrabbit.oak.core.MutableRoot.commit(MutableRoot.java:262)
>     at org.apache.jackrabbit.oak.http.OakServlet.doPost(OakServlet.java:188)
>     at javax.servlet.http.HttpServlet.service(HttpServlet.java:755)
>     at org.apache.jackrabbit.oak.http.OakServlet.service(OakServlet.java:113)
>     at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
>     at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684)
>     at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:501)
>     at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)
>     at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:427)
>     at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)
>     at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
>     at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
>     at org.eclipse.jetty.server.Server.handle(Server.java:370)
>     at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:494)
>     at org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:984)
>     at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:1045)
>     at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:861)
>     at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:236)
>     at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
>     at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:696)
>     at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:53)
>     at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
>     at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
>     at java.lang.Thread.run(Thread.java:748)
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)