On Tue, May 5, 2009 at 6:20 AM, astra123 <[email protected]> wrote: > > 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 given > 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 link > > 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 that > 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: java.naming.factory.initial > at > javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:645) > at > javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288) > at > javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:325) > at javax.naming.InitialContext.rebind(InitialContext.java:408) > at > org.apache.jackrabbit.core.jndi.RegistryHelper.registerRepository(RegistryHelper.java:77) > at 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 -- Alexander Klimetschek [email protected]
