jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Charles Johnson ...@proteanit.net>
Subject Correct way to address remote repository using a URLRemoteRepository?
Date Sun, 16 Mar 2008 16:56:31 GMT
My log file reports the rmi uri of the running repository to be the 
following (obfuscated):

16.03.2008 15:09:33 *INFO * AbstractConfig:   rmiUri: 
//hostname:8180/jackrabbit.repository

This is how I'm trying to reach it:


import org.apache.jackrabbit.rmi.repository.URLRemoteRepository;

import javax.jcr.Repository;
import javax.jcr.Session;


public class RemoteContent {
     public static void main(String[] args) throws Exception {
         Session session = null;

         try {
             Repository repository = new 
URLRemoteRepository("http://hostname:8180/jackrabbit-webapp-1.4");
             session = repository.login();
             System.out.printf("The username with this session is %s\n",
                 session.getUserID());
             System.out.printf("The workspace for this session is %s\n",
                 session.getWorkspace());
         } finally {
             if (session != null) {
                 session.logout();
             }
         }
     }
}


and this is the result:



log4j:WARN Continuable parsing error 29 and column 23
log4j:WARN The content of element type "log4j:configuration" must match 
"(renderer*,appender*,(category|logger)*,root?,categoryFactory?)".
Exception in thread "main" javax.jcr.RepositoryException: Remote 
repository not found: The resource at 
http://hostname:8180/jackrabbit.repository could not be retrieved: 
Unexpected end of file from server: Unexpected end of file from server
	at 
org.apache.jackrabbit.rmi.repository.URLRemoteRepositoryFactory.getRemoteRepository(URLRemoteRepositoryFactory.java:84)
	at 
org.apache.jackrabbit.rmi.repository.AbstractRemoteRepositoryFactory.getRepository(AbstractRemoteRepositoryFactory.java:59)
	at 
org.apache.jackrabbit.commons.repository.ProxyRepository.login(ProxyRepository.java:100)
	at 
org.apache.jackrabbit.commons.AbstractRepository.login(AbstractRepository.java:41)
	at RemoteContent.main(RemoteContent.java:23)
Caused by: java.net.SocketException: Unexpected end of file from server
	at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:714)
	at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:577)
	at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:711)
	at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:577)
	at 
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1004)
	at java.net.URL.openStream(URL.java:1009)
	at 
org.apache.jackrabbit.rmi.repository.URLRemoteRepositoryFactory.getRemoteRepository(URLRemoteRepositoryFactory.java:61)
	... 4 more
java.net.SocketException: Unexpected end of file from server
	at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:714)
	at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:577)
	at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:711)
	at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:577)
	at 
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1004)
	at java.net.URL.openStream(URL.java:1009)
	at 
org.apache.jackrabbit.rmi.repository.URLRemoteRepositoryFactory.getRemoteRepository(URLRemoteRepositoryFactory.java:61)
	at 
org.apache.jackrabbit.rmi.repository.AbstractRemoteRepositoryFactory.getRepository(AbstractRemoteRepositoryFactory.java:59)
	at 
org.apache.jackrabbit.commons.repository.ProxyRepository.login(ProxyRepository.java:100)
	at 
org.apache.jackrabbit.commons.AbstractRepository.login(AbstractRepository.java:41)
	at RemoteContent.main(RemoteContent.java:23)
	
//================================================================================================

I'm really just guessing at this URL. What *should* it be for it to work?

Charles


Mime
  • Unnamed multipart/mixed (inline, None, 0 bytes)
View raw message