Return-Path: Delivered-To: apmail-jackrabbit-users-archive@minotaur.apache.org Received: (qmail 32856 invoked from network); 5 May 2009 08:55:22 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 5 May 2009 08:55:22 -0000 Received: (qmail 6573 invoked by uid 500); 5 May 2009 08:55:21 -0000 Delivered-To: apmail-jackrabbit-users-archive@jackrabbit.apache.org Received: (qmail 6526 invoked by uid 500); 5 May 2009 08:55:21 -0000 Mailing-List: contact users-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@jackrabbit.apache.org Delivered-To: mailing list users@jackrabbit.apache.org Received: (qmail 6515 invoked by uid 99); 5 May 2009 08:55:21 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 May 2009 08:55:21 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 May 2009 08:55:12 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1M1GQN-0007iO-J7 for users@jackrabbit.apache.org; Tue, 05 May 2009 01:54:51 -0700 Message-ID: <23383528.post@talk.nabble.com> Date: Tue, 5 May 2009 01:54:51 -0700 (PDT) From: astra123 To: users@jackrabbit.apache.org Subject: Re: problem in viewing the repository nodes in JCR browser using JNDI In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: sandhya.jayachandran@tcs.com References: <23380352.post@talk.nabble.com> <23381644.post@talk.nabble.com> X-Virus-Checked: Checked by ClamAV on apache.org Hi, I have tried that first hop...i have a doubt like how to register the created repository with JNDI. the sample code which i tried is String configFile = "repository.xml"; String repHomeDir = "repository"; Hashtable env = new Hashtable(); env.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.jackrabbit.core.jndi" + ".provider.DummyInitialContextFactory"); env.put(Context.PROVIDER_URL, "localhost"); InitialContext ctx = new InitialContext(env); RegistryHelper.registerRepository(ctx, "repo", configFile, repHomeDir, true); Repository r = (Repository) ctx.lookup("repo"); // System.out.println("............."+ctx.list("repo")); //obtaining workspace and nodes SimpleCredentials cred = new SimpleCredentials("userid", "".toCharArray()); Session session = r.login(cred, null); Workspace ws = session.getWorkspace(); Node rn = session.getRootNode(); //print the root node name System.out.println("Name of the RootNode"+rn.getPrimaryNodeType().getName()); Using the above code i am able to create a repository.But how should i register that with JNDI. What are all the files i need to touch and what change needs to be done. Please can you help me on this. Thanks in advance Bertrand Delacretaz wrote: > > On Tue, May 5, 2009 at 8:19 AM, astra123 > wrote: >> ...can i use this link >> http://jackrabbit.apache.org/jcr-client-application-howto.html >> for accessing the repository via JNDI.... > > That should work. > >> if so in my case the client is jcr-explorer.war (which i deployed in >> tomcat >> and imported to netbeans). >> how i will place the code snippets in the client pgm.. > > You could use http://jackrabbit.apache.org/first-hops.html as an > example, and replace the TransientRepository with the one that you get > via JNDI. > > -Bertrand > > -- View this message in context: http://www.nabble.com/problem-in-viewing-the-repository-nodes-in-JCR-browser-using-JNDI-tp23380352p23383528.html Sent from the Jackrabbit - Users mailing list archive at Nabble.com.