Return-Path: Delivered-To: apmail-jackrabbit-dev-archive@www.apache.org Received: (qmail 57658 invoked from network); 22 Sep 2008 09:51:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 22 Sep 2008 09:51:56 -0000 Received: (qmail 64718 invoked by uid 500); 22 Sep 2008 09:51:52 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 64677 invoked by uid 500); 22 Sep 2008 09:51:52 -0000 Mailing-List: contact dev-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jackrabbit.apache.org Delivered-To: mailing list dev@jackrabbit.apache.org Received: (qmail 64666 invoked by uid 99); 22 Sep 2008 09:51:52 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Sep 2008 02:51:52 -0700 X-ASF-Spam-Status: No, hits=0.2 required=10.0 tests=SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of aklimets@day.com designates 207.126.148.181 as permitted sender) Received: from [207.126.148.181] (HELO eu3sys201aog001.obsmtp.com) (207.126.148.181) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 22 Sep 2008 09:50:51 +0000 Received: from source ([209.85.217.16]) by eu3sys201aob001.postini.com ([207.126.154.11]) with SMTP; Mon, 22 Sep 2008 09:49:01 UTC Received: by gxk9 with SMTP id 9so2749258gxk.13 for ; Mon, 22 Sep 2008 02:49:01 -0700 (PDT) Received: by 10.100.229.14 with SMTP id b14mr2696231anh.43.1222076941128; Mon, 22 Sep 2008 02:49:01 -0700 (PDT) Received: by 10.100.42.14 with HTTP; Mon, 22 Sep 2008 02:49:01 -0700 (PDT) Message-ID: Date: Mon, 22 Sep 2008 11:49:01 +0200 From: "Alexander Klimetschek" To: dev@jackrabbit.apache.org Subject: Re: how to Connect to the Repository In-Reply-To: <19604544.post@talk.nabble.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <19604544.post@talk.nabble.com> X-Virus-Checked: Checked by ClamAV on apache.org There are many ways, depending on the context ;-) But there is not JSR170 way (you cite that it is "outside the spec"). To create a standalone Jackrabbit repository, use new TransientRepository(), see http://jackrabbit.apache.org/first-hops.html In all other use-cases, the repository is created by some server instance (eg. the jackrabbit webapp package or a J2EE container, using a resource configuration) that makes the repository available through JNDI or RMI. The snippet from your mail is the client part of the JNDI case. See also http://jackrabbit.apache.org/jcr-client-application-howto.html Regards, Alex PS: Please post such questions (JCR API, Jackrabbit usage, etc) to the users list, the dev list is used for Jackrabbit development. On Mon, Sep 22, 2008 at 11:33 AM, xing007008 wrote: > > Connect to the Repository > Acquire the Repository object: exact mechanism is outside > spec, but one possible way: JNDI > // Get the Repository object > InitialContext ctx = > Repository repository = > (Repository)ctx.lookup("MyRepository"); > > > I don't know how to get the Repository just use jsp170 api. > > Who can help me? > -- > View this message in context: http://www.nabble.com/how-to-Connect-to-the-Repository-tp19604544p19604544.html > Sent from the Jackrabbit - Dev mailing list archive at Nabble.com. > > -- Alexander Klimetschek alexander.klimetschek@day.com