From oak-dev-return-3325-apmail-jackrabbit-oak-dev-archive=jackrabbit.apache.org@jackrabbit.apache.org Fri Jan 25 15:21:07 2013 Return-Path: X-Original-To: apmail-jackrabbit-oak-dev-archive@minotaur.apache.org Delivered-To: apmail-jackrabbit-oak-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 27C80E335 for ; Fri, 25 Jan 2013 15:21:07 +0000 (UTC) Received: (qmail 84669 invoked by uid 500); 25 Jan 2013 15:21:06 -0000 Delivered-To: apmail-jackrabbit-oak-dev-archive@jackrabbit.apache.org Received: (qmail 84636 invoked by uid 500); 25 Jan 2013 15:21:06 -0000 Mailing-List: contact oak-dev-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: oak-dev@jackrabbit.apache.org Delivered-To: mailing list oak-dev@jackrabbit.apache.org Received: (qmail 84613 invoked by uid 99); 25 Jan 2013 15:21:05 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 25 Jan 2013 15:21:05 +0000 X-ASF-Spam-Status: No, hits=-1.6 required=5.0 tests=RCVD_IN_DNSWL_MED,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [64.18.1.187] (HELO exprod6og104.obsmtp.com) (64.18.1.187) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 25 Jan 2013 15:20:58 +0000 Received: from outbound-smtp-1.corp.adobe.com ([192.150.11.134]) by exprod6ob104.postini.com ([64.18.5.12]) with SMTP ID DSNKUQKixVdzL0hYNvPo6gDBIcwrKOKzBffn@postini.com; Fri, 25 Jan 2013 07:20:38 PST Received: from inner-relay-4.eur.adobe.com (inner-relay-4.adobe.com [193.104.215.14]) by outbound-smtp-1.corp.adobe.com (8.12.10/8.12.10) with ESMTP id r0PFHa1v014060 for ; Fri, 25 Jan 2013 07:17:37 -0800 (PST) Received: from nacas03.corp.adobe.com (nacas03.corp.adobe.com [10.8.189.121]) by inner-relay-4.eur.adobe.com (8.12.10/8.12.9) with ESMTP id r0PFKZXL026163 for ; Fri, 25 Jan 2013 07:20:35 -0800 (PST) Received: from eurhub01.eur.adobe.com (10.128.4.30) by nacas03.corp.adobe.com (10.8.189.121) with Microsoft SMTP Server (TLS) id 8.3.297.1; Fri, 25 Jan 2013 07:20:34 -0800 Received: from susi.local (10.136.134.89) by eurhub01.eur.adobe.com (10.128.4.111) with Microsoft SMTP Server id 8.3.297.1; Fri, 25 Jan 2013 15:20:32 +0000 Message-ID: <5102A2C0.6080101@apache.org> Date: Fri, 25 Jan 2013 15:20:32 +0000 From: =?ISO-8859-1?Q?Michael_D=FCrig?= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/20130107 Thunderbird/17.0.2 MIME-Version: 1.0 To: Subject: Re: Oak over HTTP guidelines References: In-Reply-To: Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hmm strange. The default node types should be there. See /org/apache/jackrabbit/oak/plugins/nodetype/write/builtin_nodetypes.cnd Maybe there something wrong in how the http remoting is being set up? Michael On 25.1.13 15:16, Tommaso Teofili wrote: > I managed to go a little further by commenting out the new TypeValidatorProvider() in oak-run Main.HttpServer#createDefaultValidatorProvider (line 223) which prevented me to create anything just because no node type is registered. > Then with the following I could add some content: > http -f -v -a admin:admin http://localhost:8080/ < samplenode.json > where > samplenode.json is > {"test2" : > { > "jcr:primaryType" : "nt:unstructured", > "name" : "some other name" > } > } > > Maybe adding a small set of node types (the default ones nt:*) would help to prevent having to do this workaround. > Hope this helps, > Tommaso > > > On 25/gen/2013, at 12:51, Tommaso Teofili wrote: > >> Hi all, >> >> I'm trying to access an Oak repository over HTTP as explained at [1] so I assumed I had to use oak-run as explained at [2]. >> >> If I try with curl: >> curl -d foo=bar http://localhost:8080/test >> >> I get: >> >> >> >> Error 500 String index out of range: -1 >> >> >>

HTTP ERROR: 500

>>

Problem accessing /test. Reason: >>

    String index out of range: -1

>>
Powered by Jetty:// >> ... >> >> If I try with httpie: >> http -b http://localhost:8080/ test:={} >> >> I get: >> >> >> >> Error 500 Cannot add node 'test' at / >> >> >>

HTTP ERROR: 500

>>

Problem accessing /. Reason: >>

    Cannot add node 'test' at /

>>
Powered by Jetty:// >> >> or trying: >> http POST http://localhost:8080/node name=John >> >> I get: >> >> >> >> Error 500 String index out of range: -1 >> >> >>

HTTP ERROR: 500

>>

Problem accessing /node. Reason: >>

    String index out of range: -1

>>
Powered by Jetty:// >> >> So neither using httpie nor using curl I can create a node, is the wiki outdated or am I missing something? >> >> The StringIndexOutOfRange seems to be due to the missing final slash on the sent URL (http://localhost:8080/test) so I wonder if that's a bug. >> >> Thanks in advance, >> Tommaso >> >> [1] : http://wiki.apache.org/jackrabbit/Oak-over-HTTP >> [2] : http://markmail.org/message/vq52qfhpdyqr2ojv >