11-04-2009 11:04 AM
import org.apache.chemistry.tck.atompub.TCKMessageWriter;
import org.apache.chemistry.tck.atompub.http.Connection;
import org.apache.chemistry.tck.atompub.utils.LogMessageWriter;
import org.apache.chemistry.tck.atompub.client.CMISClient;
import org.apache.chemistry.tck.atompub.http.ConnectionFactory;
import org.apache.chemistry.tck.atompub.http.httpclient.HttpClientConnectionFactory;
public class CMISApiTest extends CMISClient {
private final static String serverURL = "http://localhost:8080/alfresco/api";
public CMISApiTest(Connection connection, String serviceUrl,
TCKMessageWriter messageWriter) {
super(connection, serviceUrl, messageWriter);
// TODO Auto-generated constructor stub
}
/**
* @param args
*/
public static void main(String[] args) {
getConnection(serverURL, "admin","admin",true,true);
}
public static void getConnection(String serverUrl, String username, String password, boolean validate, boolean trace){
ConnectionFactory connFactory = new HttpClientConnectionFactory();
Connection conn = connFactory.createConnection(username, password);
LogMessageWriter messageWriter = new LogMessageWriter();
CMISApiTest client = new CMISApiTest(conn, serverURL,messageWriter);
try {
//System.out.print(client.getWorkspace());
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}At runtime I get the following exception:
log4j:WARN No appenders could be found for logger (org.apache.commons.httpclient.HttpClient).
log4j:WARN Please initialize the log4j system properly.
Exception in thread "main" java.lang.NoSuchMethodError: org.apache.commons.httpclient.HttpClient.getParams()Lorg/apache/commons/httpclient/params/HttpClientParams;
at org.apache.chemistry.tck.atompub.http.httpclient.HttpClientConnection.<init>(HttpClientConnection.java:47)
at org.apache.chemistry.tck.atompub.http.httpclient.HttpClientConnectionFactory.createConnection(HttpClientConnectionFactory.java:34)
at connector.CMISApiTest.getConnection(CMISApiTest.java:38)
at connector.CMISApiTest.main(CMISApiTest.java:32)
11-04-2009 01:13 PM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.