Results 1 to 2 of 2

Thread: syntax for creating remote repository

  1. #1

    Default syntax for creating remote repository

    I am trying to configure a Spring app to talk to a Jackrabbit deployed as a webapp in a different tomcat instance on the same machine. (I do not have control over deploying jacrabbit in the same tomcat instance as my spring app).

    I managed to connect OK with the following snippit of test code:

    Code:
    jcrRepository = new URLRemoteRepository("http://localhost:8180/jackrabbit-webapp-1.5.5/rmi");
            Session session = jcrRepository.login(new SimpleCredentials("admin", "adminId".toCharArray()));
    However, I have not been able to create the connection witn spring config and I cannot find any documentation that covers this case (seems to be plenty of examples using direct filesystem access, jndi). I have tried the following:

    Code:
    <bean id="rmiClientFactory" class="org.apache.jackrabbit.rmi.client.ClientRepositoryFactory"/>
    
    <bean id="jcrRepository" factory-bean="rmiClientFactory" factory-method="getRepository">
        <constructor-arg value="http://localhost:8180/jackrabbit-webapp-1.5.5/rmi"/>
    </bean>
    but I get the following exception:

    Code:
    org.apache.jackrabbit.rmi.client.RemoteRepositoryException: Malformed URL: http://localhost:8180/jackrabbit-webapp-1.5.5/rmi; nested exception is: 
    	java.net.MalformedURLException: invalid URL scheme: http://localhost:8180/jackrabbit-webapp-1.5.5/rmi: Malformed URL: http://localhost:8180/jackrabbit-webapp-1.5.5/rmi; nested exception is: 
    	java.net.MalformedURLException: invalid URL scheme: http://localhost:8180/jackrabbit-webapp-1.5.5/rmi
    	at org.apache.jackrabbit.rmi.client.SafeClientRepository.remoteLogin(SafeClientRepository.java:112)
    	at org.apache.jackrabbit.rmi.client.SafeClientRepository.login(SafeClientRepository.java:120)
    	at org.apache.jackrabbit.rmi.client.SafeClientRepository.login(SafeClientRepository.java:131)
    	at JcrTest.test(JcrTest.java:25)
    - looks like the ClientRepositoryFactory requires URL scheme to be "rmi".

    Can anyone suggest what I am doing wrong here, or if connecting to this type of URL is possible with spring-modules jcr ?

    Thanks,
    Ken.

  2. #2

    Default spring-modules-jcr: connecting to remote jackrabbit with "http" url scheme

    OK, guess not. I'll revert to standard spring bean definition:

    <bean id="jcrRepository" class="org.apache.jackrabbit.rmi.repository.URLRem oteRepository">
    <constructor-arg value="http://localhost:8180/jackrabbit-webapp-1.5.5/rmi"/>
    </bean>

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •