jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Laura McCord <mcco...@southwestern.edu>
Subject Re: Trying to list resources in a directory
Date Thu, 11 Mar 2010 22:59:37 GMT
Here is my code:
 protected void setUp(String username, String password, String path) 
throws Exception
        {            
             String host = ROOT + "/" + path;           
             HostConfiguration hostConfig = new HostConfiguration();    
        
            hostConfig.setHost(host);
            HttpConnectionManager connectionManager = new 
MultiThreadedHttpConnectionManager();
            HttpConnectionManagerParams params = new 
HttpConnectionManagerParams();
            int maxHostConnections = 20;
            params.setMaxConnectionsPerHost(hostConfig, maxHostConnections);
            connectionManager.setParams(params);
            client = new HttpClient(connectionManager);
            client.setHostConfiguration(hostConfig);
            Credentials creds = new 
UsernamePasswordCredentials(username, password);         
            client.getState().setCredentials(AuthScope.ANY, creds);    
      
            DavMethod pFind = new PropFindMethod(host, 
DavConstants.PROPFIND_ALL_PROP,DavConstants.DEPTH_1);
            int status =  client.executeMethod(hostConfig, pFind);
          
            System.out.println("username: " + username);
            System.out.println("password: " + password);
            System.out.println("host: " + host);
            System.out.println("status: " + status);
        }

The output is all correct....my username, my password, the host to my 
directory, and the status still is bringing up a 401.

I just don't know where to look now. I had no problems using slide to 
connect using the same credentials.

Laura


Laura McCord wrote:
> I'm back on this project after months of it being on the back-burner.  
> I was originally using jakarta slide but I've been trying to switch 
> over to using jackrabbit. This isn't a apache jackrabbit  specific 
> repository but I'm trying to use the client side to access our 
> existing webdav server.
>
> I have been trying out the example on the wiki: 
> http://wiki.apache.org/jackrabbit/WebDAV in particular I've been 
> trying to use the 'Getting a list of subresources of a resource' 
> working.  It seems  all is well until I pass the  following code...
>
> client.executeMethod(pFind);
>
> Once I start getting into the pFind code I start receiving exceptions.
>
> Any suggestions?
>
> Thanks
>
>
> errors:
> org.apache.jackrabbit.webdav.DavException: Unauthorized
>        at 
> org.apache.jackrabbit.webdav.client.methods.DavMethodBase.getResponseException(DavMethodBase.java:167)

>
>        at 
> org.apache.jackrabbit.webdav.client.methods.DavMethodBase.getResponseBodyAsMultiStatus(DavMethodBase.java:95)

>
>        at 
> edu.southwestern.directory.service.JackRabbitServiceImpl.setWebdavConnection(JackRabbitServiceImpl.java:98)

>
>        at 
> edu.southwestern.directory.service.JackRabbitServiceImpl.getContents(JackRabbitServiceImpl.java:130)

>
>        at 
> edu.southwestern.directory.portlet.JackRabbitViewController.getResources(JackRabbitViewController.java:73)

>
>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>        at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
>
>        at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

>
>        at java.lang.reflect.Method.invoke(Method.java:592)
>        at 
> org.springframework.web.bind.annotation.support.HandlerMethodInvoker.doInvokeMethod(HandlerMethodInvoker.java:421)

>
>        at 
> org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:136)

>
>        at 
> org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:271)

>
>        at 
> org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerAdapter.doHandle(AnnotationMethodHandlerAdapter.java:259)

>
>        at 
> org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerAdapter.handleRender(AnnotationMethodHandlerAdapter.java:218)

>
>        at 
> org.springframework.web.portlet.DispatcherPortlet.doRenderService(DispatcherPortlet.java:811)

>
>        at 
> org.springframework.web.portlet.FrameworkPortlet.processRequest(FrameworkPortlet.java:483)

>
>        at 
> org.springframework.web.portlet.FrameworkPortlet.doDispatch(FrameworkPortlet.java:453)

>
>        at javax.portlet.GenericPortlet.render(GenericPortlet.java:178)
>        at 
> org.apache.pluto.core.PortletServlet.dispatch(PortletServlet.java:218)
>        at 
> org.apache.pluto.core.PortletServlet.doGet(PortletServlet.java:158)
>        at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
>        at 
> org.jasig.portal.container.PortletServlet.service(PortletServlet.java:29)
>        at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>        at 
> org.apache.pluto.core.PortletServlet.service(PortletServlet.java:153)
>        at 
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)

>
>        at 
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)

>
>        at 
> org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:691)

>
>        at 
> org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:594)

>
>        at 
> org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:505)

>
>        at 
> org.apache.pluto.invoker.impl.PortletInvokerImpl.invoke(PortletInvokerImpl.java:120)

>
>        at 
> org.apache.pluto.invoker.impl.PortletInvokerImpl.render(PortletInvokerImpl.java:73) 
>
>        at 
> org.apache.pluto.PortletContainerImpl.renderPortlet(PortletContainerImpl.java:119) 
>
>        at 
> org.jasig.portal.channels.portlet.CPortletAdapter.getMarkup(CPortletAdapter.java:582)

>
>        at 
> org.jasig.portal.channels.portlet.CPortletAdapter.renderCharacters(CPortletAdapter.java:511)

>
>        at 
> org.jasig.portal.ChannelRenderer$Worker.execute(ChannelRenderer.java:540)
>        at org.jasig.portal.utils.threading.BaseTask.run(BaseTask.java:27)
>        at 
> edu.emory.mathcs.backport.java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:431)

>
>        at 
> edu.emory.mathcs.backport.java.util.concurrent.FutureTask.run(FutureTask.java:166) 
>
>        at 
> edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:643)

>
>        at 
> edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:668)

>
>        at java.lang.Thread.run(Thread.java:595)


Mime
View raw message