Return-Path: Delivered-To: apmail-jackrabbit-users-archive@minotaur.apache.org Received: (qmail 58223 invoked from network); 24 Apr 2009 14:52:47 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 24 Apr 2009 14:52:47 -0000 Received: (qmail 33782 invoked by uid 500); 24 Apr 2009 14:41:31 -0000 Delivered-To: apmail-jackrabbit-users-archive@jackrabbit.apache.org Received: (qmail 32491 invoked by uid 500); 24 Apr 2009 14:41:27 -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 31026 invoked by uid 99); 24 Apr 2009 14:39:04 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 Apr 2009 14:39: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 (athena.apache.org: domain of juan.pereyra@globant.com designates 200.70.38.165 as permitted sender) Received: from [200.70.38.165] (HELO einstein.globant.com) (200.70.38.165) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 Apr 2009 14:38:55 +0000 Received: from localhost (unknown [127.0.0.1]) by einstein.globant.com (Postfix) with ESMTP id DEBDB869B0 for ; Fri, 24 Apr 2009 11:36:08 -0300 (ART) Received: from einstein.globant.com ([127.0.0.1]) by localhost (einstein.corp.globant.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id Yf2fHueoobNT for ; Fri, 24 Apr 2009 11:36:08 -0300 (ART) Received: from mailprod01.corp.globant.com (unknown [172.31.201.180]) by einstein.globant.com (Postfix) with ESMTP id 948C086989 for ; Fri, 24 Apr 2009 11:36:08 -0300 (ART) Received: from mailprod01.corp.globant.com (localhost.localdomain [127.0.0.1]) by mailprod01.corp.globant.com (Postfix) with ESMTP id 7D81F4DBCCB7 for ; Fri, 24 Apr 2009 11:38:32 -0300 (ART) Date: Fri, 24 Apr 2009 11:38:32 -0300 (ART) From: Juan Pereyra To: users@jackrabbit.apache.org Message-ID: <3475153.3508901240583912455.JavaMail.root@mailprod01.corp.globant.com> In-Reply-To: <1695997.3508521240583807439.JavaMail.root@mailprod01.corp.globant.com> Subject: Re: Connecting to different repositories MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [200.70.41.2] X-Mailer: Zimbra 5.0.11_GA_2696.RHEL4 (ZimbraWebClient - FF3.0 (Linux)/5.0.11_GA_2696.RHEL4) X-Virus-Checked: Checked by ClamAV on apache.org Do you use Maven for your builds? If so I think you could get that with pro= perty placeholders. ----- Original Message ----- From: "Jacob Berg=C3=B6=C3=B6" To: users@jackrabbit.apache.org Sent: Friday, April 24, 2009 11:01:02 AM GMT -03:00 Argentina Subject: Re: Connecting to different repositories Thanks for the quick reply, have you heard that this has been done before or does everybody else only work with one repository? How do you switch between different states in you= r development process (dev, test, prod)? do you have any more code examples on how to do the rmi connection? thanks for the help, Jacob Alexander Klimetschek wrote: >=20 > On Fri, Apr 24, 2009 at 3:25 PM, Jacob Berg=C3=B6=C3=B6 > wrote: >> >> Hi, >> I am working with Spring 2.5.6, spring-modules-jcr 0.8a, jcrom 1.3.2. >> >> In my application I have the need of be able to connect to different >> repositories depending on if I am in development, test or production >> mode. >> >> The way it is setup now I have a repository.xml configuration in my >> src/main/resources folder where I setup a local derby repository, but I >> want >> to be able to create a "test" build that will connect to a repository >> that >> is on another machine. Therefor I cant use the way I have configured it >> now >> in spring. >> >> This is my configuration: >> >> =C2=A0 >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0org.jcrom.JcrFile >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0> type=3D"java.lang.Class">com.xxx.domain.composition.urltree.URLNode >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0> type=3D"java.lang.Class">com.xxx.domain.composition.urltree.URLTree >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0> type=3D"java.lang.Class">com.xxx.domain.composition.page.ViewPage >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0> type=3D"java.lang.Class">com.xxx.domain.composition.template.TemplateNod= e >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0> type=3D"java.lang.Class">com.xxx.domain.composition.template.ChildArea >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 >> =C2=A0 =C2=A0 >> >> =C2=A0 =C2=A0> class=3D"org.springmodules.jcr.JcrSessionFactory"> >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0> factory-method=3D"toCharArray"/> >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 >> =C2=A0 =C2=A0 >> >> =C2=A0 =C2=A0 >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 >> =C2=A0 =C2=A0 >> >> =C2=A0 =C2=A0> class=3D"org.springmodules.jcr.jackrabbit.LocalTransactionManager"> >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 >> =C2=A0 =C2=A0 >> >> =C2=A0 =C2=A0> class=3D"org.springframework.remoting.rmi.RmiRegistryFactoryBean"/> >> =C2=A0 =C2=A0> class=3D"org.springmodules.jcr.jackrabbit.RmiServerRepositoryFactoryBean= "> >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0> class=3D"org.apache.jackrabbit.rmi.server.ServerAdapterFactory"/> >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 >> =C2=A0 =C2=A0 >> >> =C2=A0 > class=3D"org.springframework.beans.factory.config.PropertyPlaceholderCon= figurer"> >> =C2=A0 =C2=A0 =C2=A0 =C2=A0> value=3D"classpath:jcr-persistence-config.properties"/> >> =C2=A0 =C2=A0 >> >> =C2=A0 =C2=A0> class=3D"org.springmodules.jcr.jackrabbit.RepositoryFactoryBean"> >> =C2=A0 =C2=A0 =C2=A0 =C2=A0> value=3D"${jcr.repository.config.file}"/> >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 >> =C2=A0 =C2=A0 >> >> =C2=A0 =C2=A0 >> >> =C2=A0 =C2=A0 >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 >> =C2=A0 =C2=A0 >> >> >> >> and the property file: >> >> jcr.repository.config.file=3Dclasspath:repository.xml >> jcr.repository.home.dir=3Dfile:./target/trex_jcr_repo >> >> So I am guessing I need to be able to connect to the other machine with >> some >> rmi connection but when I looked on the documentation for >> spring-modules-jcr >> is states: >> >> >> > class=3D"org.apache.jackrabbit.rmi.client.ClientRepositoryFactory"/> >> >> > factory-method=3D"getRepository" >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 depends-o= n=3D"rmiServer"> >> =C2=A0 >> >> >> and that means that depends-on=3D"rmiServer" needs a rmiServer that need= s a >> repository that needs to read a repository.xml file.... this clearly doe= s >> not work... I would have expected that I should be able to create a >> repository bean where I provide a URI and username, password... >=20 > In JCR/Jackrabbit, you use a JCR session to log in. In case of an RMI > connection to the repository, the publicly available interface via RMI > is javax.jcr.Repository (eg. "rmi://localhost:1099/jackrabbit"). You > cannot specify credentials here. These are used when doing a > Repository.login() to get a session. >=20 > You have to change your bean config / factories to allow multiple > repositories, depending on some parameter or context information, > which contains the rmi url. AFAIK the standard spring-jcr module isn't > built for that. >=20 > Regards, > Alex >=20 > --=20 > Alexander Klimetschek > alexander.klimetschek@day.com >=20 >=20 --=20 View this message in context: http://www.nabble.com/Connecting-to-different= -repositories-tp23216439p23217033.html Sent from the Jackrabbit - Users mailing list archive at Nabble.com.