[ 
https://issues.apache.org/jira/browse/SLING-254?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12630573#action_12630573
 ] 

Scott Basinger commented on SLING-254:
--------------------------------------

The url I'm using is:

-Dsling.repository.url=jndi://java:jcr/local|java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory,java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces,java.naming.provider.url=http://www.apache.org/jackrabbit

And changes I've made to RepositoryAccessor are twofold.  First, in the 
getRepository method,  the JCARepositoryHandle returned by jndi lookup of 
Jackrabbit jca implements Repository but is not an instance of a Repository.  I 
made quick hack to add JCARepositoryHandle to if/else block.  

               } else if (repoObject instanceof JCARepositoryHandle) {
                    result = (JCARepositoryHandle) repoObject;
                    log.info("Acquired Repository '" + repositoryName
                        + "' via JNDI");


Also changed the jndi parser to look for | instead of colon.
            final int colonPos = urlNoPrefix.indexOf('|');


So essentially I can drop the jackrabbit-jca-1.4.rar and jcr-ds.xml into the 
JBoss 4.2.2 deploy directory and then start server with the sling.url property 
set and everything hooks up ok.  


> Launchpad war should optionally use an external Repository, without requiring 
> a change of bundles
> -------------------------------------------------------------------------------------------------
>
>                 Key: SLING-254
>                 URL: https://issues.apache.org/jira/browse/SLING-254
>             Project: Sling
>          Issue Type: Improvement
>          Components: Launchpad
>            Reporter: Bertrand Delacretaz
>            Assignee: Bertrand Delacretaz
>
> It would be useful to allow the Launchpad to use an external Repository 
> (accessed via JNDI or RMI), without having to modify the war file or 
> load/unload bundles.
> I'll search for a solution along these lines:
> 1) Launchpad includes both the jackrabbit-server (embedded repository) and 
> jackrabbit-client (access to external repositories via JNDI or RMI) bundles, 
> but by default the jackrabbit-client does not provide a Repository.
> 2) At startup, the Sling class searches the classpath and/or environment for 
> additional configuration properties
> 3) A specific configuration property prevents the jackrabbit-server bundle 
> from providing a Repository, and lets the jackrabbit-client provide it.
> In this way, the web container could be setup in advance to define which 
> Repository to use, and new releases of the launchpad war file could be 
> dropped in without requiring any configuration or war file changes.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to