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:
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:jcrRepository = new URLRemoteRepository("http://localhost:8180/jackrabbit-webapp-1.5.5/rmi"); Session session = jcrRepository.login(new SimpleCredentials("admin", "adminId".toCharArray()));
but I get the following exception: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>
- looks like the ClientRepositoryFactory requires URL scheme to be "rmi".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)
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.


