From users-return-11388-apmail-jackrabbit-users-archive=jackrabbit.apache.org@jackrabbit.apache.org Tue May 05 07:33:05 2009 Return-Path: Delivered-To: apmail-jackrabbit-users-archive@minotaur.apache.org Received: (qmail 3303 invoked from network); 5 May 2009 07:33:05 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 5 May 2009 07:33:05 -0000 Received: (qmail 96700 invoked by uid 500); 5 May 2009 07:33:04 -0000 Delivered-To: apmail-jackrabbit-users-archive@jackrabbit.apache.org Received: (qmail 96665 invoked by uid 500); 5 May 2009 07:33:04 -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 96654 invoked by uid 99); 5 May 2009 07:33:04 -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 07:33:04 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of aklimets@day.com designates 207.126.148.183 as permitted sender) Received: from [207.126.148.183] (HELO eu3sys201aog003.obsmtp.com) (207.126.148.183) by apache.org (qpsmtpd/0.29) with SMTP; Tue, 05 May 2009 07:32:55 +0000 Received: from source ([209.85.128.185]) by eu3sys201aob003.postini.com ([207.126.154.11]) with SMTP ID DSNKSf/rkvRwA9o0ZMheOAOo0gbruw2Yr3Q8@postini.com; Tue, 05 May 2009 07:32:34 UTC Received: by fk-out-0910.google.com with SMTP id z22so1872878fkz.2 for ; Tue, 05 May 2009 00:32:34 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.160.9 with SMTP id m9mr4154091muo.53.1241508754353; Tue, 05 May 2009 00:32:34 -0700 (PDT) In-Reply-To: <23380779.post@talk.nabble.com> References: <23380779.post@talk.nabble.com> Date: Tue, 5 May 2009 09:32:34 +0200 Message-ID: Subject: Re: getting exception while trying to register repository with jndi From: Alexander Klimetschek To: users@jackrabbit.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org On Tue, May 5, 2009 at 6:20 AM, astra123 wro= te: > > Hi, > > I have created one Web application project in NetBeans IDE. > To that lib folder i have added the jackrabbit-standalone-1.5.4.jar file. > Then i have created one java file and placed the sample code which is giv= en > in below link. > > http://www.ibm.com/developerworks/java/library/j-jcr/ > > by running that java file ,im able to add/retrieve contents in repository= . > > Now i need to view the repository nodes using JCR browser. > For that i have downloaded the WAR file jcr-explorer.war from net. > Deployed it in tomcat 6 and imported that war project inside NetBeans IDE= . > now im able to launch the Login page of it. > It is asking for JNDI name,username and pwd. > > so i tried registering the repository with JNDI by refering the below lin= k > > http://jackrabbit.apache.org/jcr-client-application-howto.html > > To my Web application's (where sample code resides) web.xml and the java > file i have added the code snippets as given in above link.When i run tha= t > java file. > > Im getting below exception: > > May 5, 2009 9:39:19 AM NewClass1 main > SEVERE: null > javax.naming.NoInitialContextException: Need to specify class name in > environment or system property, or as an applet parameter, or in an > application resource file: =A0java.naming.factory.initial > =A0 =A0 =A0 =A0at > javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:645) > =A0 =A0 =A0 =A0at > javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288) > =A0 =A0 =A0 =A0at > javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:32= 5) > =A0 =A0 =A0 =A0at javax.naming.InitialContext.rebind(InitialContext.java:= 408) > =A0 =A0 =A0 =A0at > org.apache.jackrabbit.core.jndi.RegistryHelper.registerRepository(Registr= yHelper.java:77) > =A0 =A0 =A0 =A0at NewClass1.main(NewClass1.java:41) If NewClass1 is your client, you should retrieve the repository from JNDI there, and not register it (RegistryHelper.registerRepository()). The lookup code is the one on http://jackrabbit.apache.org/jcr-client-application-howto.html Regards, Alex --=20 Alexander Klimetschek alexander.klimetschek@day.com