aspose file tools*
The moose likes Other Open Source Projects and the fly likes Webdav Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Webdav" Watch "Webdav" New topic
Author

Webdav

Rish Gupta
Greenhorn

Joined: Sep 29, 2011
Posts: 28
If anyone is familiar with the apache.webdav API please look into this.




this is the console:
FILES:
java.lang.NullPointerException
at org.apache.webdav.ant.CollectionScanner.readCollection(CollectionScanner.java:114)
at org.apache.webdav.ant.CollectionScanner.scan(CollectionScanner.java:86)
at com.rxBatch.updateDirectory.main(updateDirectory.java:40)

what am i doing wrong?
Greg Charles
Sheriff

Joined: Oct 01, 2001
Posts: 2854
    
  11

Hmm, curious. It seems your error is coming from line 39 (not 40) of your listing, but that means it should never reach line 41, which is what prints out the "FILES" line. Did you change the code after you got the exception?

I found some source code here: http://www.jdocs.com/slideclient/2.1/org/apache/webdav/ant/CollectionScanner.html

It might be a different version from the one you're using, because it doesn't seem possible to NPE at line 114, but it would at line 111 because you haven't setHttpClient() to anything.
Rish Gupta
Greenhorn

Joined: Sep 29, 2011
Posts: 28
oh yeah! my bad, I did take out some extra commented stuff. I also added an http client.


Console says:
coneection thru
client set
scanning
Oct 5, 2011 4:57:03 PM org.apache.commons.httpclient.HttpMethodDirector executeWithRetry
INFO: I/O exception (java.net.ConnectException) caught when processing request: Connection timed out: connect
Oct 5, 2011 4:57:03 PM org.apache.commons.httpclient.HttpMethodDirector executeWithRetry
INFO: Retrying request
Oct 5, 2011 4:57:24 PM org.apache.commons.httpclient.HttpMethodDirector executeWithRetry
INFO: I/O exception (java.net.ConnectException) caught when processing request: Connection timed out: connect
Oct 5, 2011 4:57:24 PM org.apache.commons.httpclient.HttpMethodDirector executeWithRetry
INFO: Retrying request
Oct 5, 2011 4:57:45 PM org.apache.commons.httpclient.HttpMethodDirector executeWithRetry
INFO: I/O exception (java.net.ConnectException) caught when processing request: Connection timed out: connect
Oct 5, 2011 4:57:45 PM org.apache.commons.httpclient.HttpMethodDirector executeWithRetry
INFO: Retrying request
Can't read collection content! (java.net.ConnectException: Connection timed out: connect)
at org.apache.webdav.ant.Utils.makeBuildException(Utils.java:443)
at org.apache.webdav.ant.CollectionScanner.readCollection(CollectionScanner.java:117)
at org.apache.webdav.ant.CollectionScanner.scan(CollectionScanner.java:86)
at com.rxBatch.UpdateDirectory.main(UpdateDirectory.java:46)
Caused by: java.net.ConnectException: Connection timed out: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:529)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:559)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.<init>(SSLSocketImpl.java:401)
at com.sun.net.ssl.internal.ssl.SSLSocketFactoryImpl.createSocket(SSLSocketFactoryImpl.java:123)
at org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.createSocket(SSLProtocolSocketFactory.java:82)
at org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.createSocket(SSLProtocolSocketFactory.java:127)
at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707)
at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387)
at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323)
at org.apache.webdav.ant.CollectionScanner.readCollection(CollectionScanner.java:114)
... 2 more
--- Nested Exception ---
java.net.ConnectException: Connection timed out: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:529)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:559)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.<init>(SSLSocketImpl.java:401)
at com.sun.net.ssl.internal.ssl.SSLSocketFactoryImpl.createSocket(SSLSocketFactoryImpl.java:123)
at org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.createSocket(SSLProtocolSocketFactory.java:82)
at org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.createSocket(SSLProtocolSocketFactory.java:127)
at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707)
at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387)
at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323)
at org.apache.webdav.ant.CollectionScanner.readCollection(CollectionScanner.java:114)
at org.apache.webdav.ant.CollectionScanner.scan(CollectionScanner.java:86)
at com.rxBatch.UpdateDirectory.main(UpdateDirectory.java:46)
FILES:

Rish Gupta
Greenhorn

Joined: Sep 29, 2011
Posts: 28
I know all this info is kind of vague but i have never used this api before so please bear with me.
Winston Gutkowski
Bartender

Joined: Mar 17, 2011
Posts: 8008
    
  22

Greg Charles wrote:It might be a different version from the one you're using, because it doesn't seem possible to NPE at line 114, but it would at line 111 because you haven't setHttpClient() to anything.

Very bad piece of programming for a library class then; I'm surprised that Apache let something like that out the door.
To my mind, professional software should never produce undocumented NPEs...or at least not without a darn good message to go with it.

Winston
Rish Gupta
Greenhorn

Joined: Sep 29, 2011
Posts: 28
Tell me about it. I couldn't find any examples and not even any description of the methods. Thanks for looking into it though.
If you can, do suggest me a topic to look at because i don't even know where to begin with the error.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Webdav