Return-Path: Delivered-To: apmail-jackrabbit-users-archive@locus.apache.org Received: (qmail 93063 invoked from network); 13 Mar 2008 12:37:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 13 Mar 2008 12:37:24 -0000 Received: (qmail 80455 invoked by uid 500); 13 Mar 2008 12:37:19 -0000 Delivered-To: apmail-jackrabbit-users-archive@jackrabbit.apache.org Received: (qmail 80439 invoked by uid 500); 13 Mar 2008 12:37:19 -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 80426 invoked by uid 99); 13 Mar 2008 12:37:18 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Mar 2008 05:37:18 -0700 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 jain.sudhanshu@indiatimes.com designates 203.199.93.122 as permitted sender) Received: from [203.199.93.122] (HELO omta1.indiatimes.com) (203.199.93.122) by apache.org (qpsmtpd/0.29) with SMTP; Thu, 13 Mar 2008 12:36:28 +0000 Received: (qmail 24239 invoked by uid 609); 13 Mar 2008 12:27:31 -0000 Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=private; d=indiatimes.com; b=EE5rKKrpGnW/FGhM3ZqiQ1TXsd0QTIoRt40MoepsEuPRKMhk/Oe3Vl1lFbnmeh7j ; Received: from 192.168.58.228 by omta1.indiatimes.com (envelope-from , uid 602) with qmail-scanner-1.25st (clamdscan: 0.91.2/4015. spamassassin: 3.2.3. perlscan: 1.25st. Clear:RC:1(192.168.58.228):SA:0(0.0/4.9):. Processed in 0.102185 secs); 13 Mar 2008 12:27:31 -0000 X-Indiatimes-Scanner-Mail-From: jain.sudhanshu@indiatimes.com via omta1.indiatimes.com X-Indiatimes-Scanner: 1.25st (Clear:RC:1(192.168.58.228):SA:0(0.0/4.9):. Processed in 0.102185 secs Process 24230) Received: from unknown (HELO mb3.indiatimes.com) (192.168.58.228) by omta1.indiatimes.com with SMTP; 13 Mar 2008 12:27:31 -0000 Date: Thu, 13 Mar 2008 18:06:44 +0530 (IST) From: jain.sudhanshu@indiatimes.com To: users@jackrabbit.apache.org Message-ID: <101448811.247411205411804396.JavaMail.root@mbv4.indiatimes.com> In-Reply-To: <1491596368.132581205320124154.JavaMail.root@mbv4.indiatimes.com> Subject: Issue :- Access jackrabbit-webapp-1.4.war through JNDI MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [203.199.74.4] X-Virus-Checked: Checked by ClamAV on apache.org X-Old-Spam-Status: No, hits=0.0 required=4.9 Hi All, I have deployed "jackrabbit-webapp-1.4.war" in tomcat server at runtime its create repository at tomcat/bin directory with the name of jackrabbit at tomcat/bin directory.I have two option to get this repository object by my java client program . Scenerio 1 is working fine but in scenerio 2 i stuck to resolve out .please help to rectify it. scenerio 1 ::- Through RMI its work //This set in the web.xml of the repository String repoUrl = "//localhost:1099/jackrabbit-webapp-1.4/rmi"; Repository repository = factory.getRepository(repoUrl); Scenerio 2:- I want to access this repository through JNDI (NOT Working) It cause an error org.apache.jackrabbit.core.config.ConfigurationException: Configuration file could not be read.: Connection timed out: connect: Connection timed out: connect please guide me, how to rectify it. Java Client sample program:- package com.test; import java.io.File; import java.io.FileOutputStream; import java.util.Hashtable; import javax.jcr.Credentials; import javax.jcr.Node; import javax.jcr.Repository; import javax.jcr.Session; import javax.jcr.SimpleCredentials; import javax.naming.Context; import javax.naming.InitialContext; import org.apache.jackrabbit.core.jndi.RegistryHelper; public class TestTomcatRepository { private static Repository getRepository() throws Exception { String configFile = "C:/Tomcat/bin/jackrabbit/repository.xml"; String repHomeDir = "C:/Tomcat/bin/jackrabbit"; 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, "jackrabbit.repository", configFile, repHomeDir,true); return (Repository) ctx.lookup("jackrabbit.repository"); } public static void main(String[] args) { try { Repository repository = getRepository(); System.out.println("Test1.main() repository "+repository); SimpleCredentials creds = new SimpleCredentials("admin", "admin".toCharArray()); Session session = repository.login(creds); Node root = session.getRootNode(); Node test1 = root.addNode("delhi"); Node test2 = test1.addNode("bombay"); test2.setProperty("message", "bangalore"); session.exportDocumentView("/", new FileOutputStream(new File("C://xyz.xml")), false, false); } catch (Exception e) { e.printStackTrace(); } } } can you please help me to rectify this