Announcement Announcement Module
Collapse

Spring Modules forum decommissioned in favor of Spring Extensions

As the Spring Modules project has been replaced by the Spring Extensions (http://www.springsource.org/extensions) project, this forum has been decommissioned in favour of Spring Extensions one at:
http://forum.springsource.org/forumdisplay.php?f=44

Please see the Spring Extensions home page for a complete list of current projects in Java, .NET and ActionScript. You can also propose one if you want.

Cheers,
Costin Leau
SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
http://twitter.com/costinl
See more
See less
syntax for creating remote repository Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    spring-modules-jcr: connecting to remote jackrabbit with &quot;http&quot; 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>

    Comment

    Working...
    X