You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Laura McCord <mc...@southwestern.edu> on 2009/10/23 20:19:06 UTC

Getting a listing of resources from a path

I tried the example, "Getting a list of subresources of a resource", 
that is located in the jackrabbit Webdav wiki 
(http://wiki.apache.org/jackrabbit/WebDAV) documentation. I'm getting an 
error associated with

DavMethod pFind = new PropFindMethod....

Caused by: java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
        at org.apache.jackrabbit.webdav.client.methods.DavMethodBase.<clinit>(DavMethodBase.java:50)


I don't understand what this is telling me. Can someone help?

Thanks,
 Laura



Re: Getting a listing of resources from a path

Posted by Angela Schreiber <an...@day.com>.
>  Credentials creds = new UsernamePasswordCredentials("username", "password");

and you are sure that "username" is a valid userID whose
pw is "password"?

Re: Getting a listing of resources from a path

Posted by Laura McCord <mc...@southwestern.edu>.
Thanks. As a matter of fact there were tons of dependencies that I was 
missing so I finally got rid of the NoClassDefFoundError resolved. 
However, I can't get my connection to work. Given a path to our webdav 
server (http:mywebdavserver.edu/<username>) I can't get a successful 
authorization when setting the username and password credentials.

"org.apache.jackrabbit.webdav.DavException: Unauthorized"

My method simply takes a directory path (the username is set if none is 
passed)

private HttpClient getWebdavConnection(String path){
        if(username == null){
            UserManager userManager = new UserManager();
            Map userInfo = userManager.getAttributes();
            username = (String) userInfo.get("user.login.id");
            password = (String) userInfo.get("password");
        }
        this.host = "http://mywebdavserver.edu";
        if(!path.startsWith("/")){
            this.path = "/" + path;   
        }      
        HostConfiguration hostConfig = new HostConfiguration();         
        hostConfig.setHost(host + this.path);
        HttpConnectionManager connectionManager = new 
MultiThreadedHttpConnectionManager();
        HttpConnectionManagerParams params = new 
HttpConnectionManagerParams();
        int maxHostConnections = 20;
        params.setMaxConnectionsPerHost(hostConfig, maxHostConnections);
        connectionManager.setParams(params);   
        HttpClient client = new HttpClient(connectionManager);
        Credentials creds = new UsernamePasswordCredentials("username", 
"password");     
        client.getState().setCredentials(AuthScope.ANY, creds);
        client.setHostConfiguration(hostConfig);
        return client;
    }

Thanks

Vijay K Pandey wrote:
> You don't have the SL4J jars (such as slf4j-api-1.5.3.jar, slf4j-log4j12-1.5.3.jar) files in your classpath. If you are using log4j - have the log4j-xx.jar in the class path.
>
> -----Original Message-----
> From: Laura McCord [mailto:mccordl@southwestern.edu]
> Sent: Friday, October 23, 2009 1:19 PM
> To: users@jackrabbit.apache.org
> Subject: Getting a listing of resources from a path
>
> I tried the example, "Getting a list of subresources of a resource",
> that is located in the jackrabbit Webdav wiki
> (http://wiki.apache.org/jackrabbit/WebDAV) documentation. I'm getting an
> error associated with
>
> DavMethod pFind = new PropFindMethod....
>
> Caused by: java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
>         at org.apache.jackrabbit.webdav.client.methods.DavMethodBase.<clinit>(DavMethodBase.java:50)
>
>
> I don't understand what this is telling me. Can someone help?
>
> Thanks,
>  Laura
>
>
>   


RE: Getting a listing of resources from a path

Posted by Vijay K Pandey <VP...@mdes.ms.gov>.
You don't have the SL4J jars (such as slf4j-api-1.5.3.jar, slf4j-log4j12-1.5.3.jar) files in your classpath. If you are using log4j - have the log4j-xx.jar in the class path.

-----Original Message-----
From: Laura McCord [mailto:mccordl@southwestern.edu]
Sent: Friday, October 23, 2009 1:19 PM
To: users@jackrabbit.apache.org
Subject: Getting a listing of resources from a path

I tried the example, "Getting a list of subresources of a resource",
that is located in the jackrabbit Webdav wiki
(http://wiki.apache.org/jackrabbit/WebDAV) documentation. I'm getting an
error associated with

DavMethod pFind = new PropFindMethod....

Caused by: java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
        at org.apache.jackrabbit.webdav.client.methods.DavMethodBase.<clinit>(DavMethodBase.java:50)


I don't understand what this is telling me. Can someone help?

Thanks,
 Laura