I'm trying to upload a file to Sourceforge and create a file release for it using the Collabnet API and SOAP in Java, in Eclipse, This works fine until I pack the class into a jar, add it to the build path, and try to execute it via an Ant Java task. Then I get the fault given below fi_sfSoap.upLoadFile hangs and then times out. It's not the size of the file and at first I thought it was the file paths but the file can be read by a file reader from inside the jar. Any help would be greatly appreciated!
File latest_release = new File(file_path);
if(!latest_release.canRead()){
System.out.println("File does not Exist");
}else{
DataSource ds = new FileDataSource(latest_release);
DataHandler dh = new DataHandler(ds);
try{
String file_id = fi_sfSoap.uploadFile(sessionId, dh);
f_sfSoap.createFrsFile(sessionId, release_id, fileName, "application/zip", file_id);
}catch(Exception e){
e.printStackTrace();
}
}
Error message
[java] AxisFault
[java] faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
[java] faultSubcode:
[java] faultString: java.net.SocketTimeoutException: Read timed out
[java] faultActor:
[java] faultNode:
[java] faultDetail:
[java] {http://xml.apache.org/axis/}stackTrace:java.net.SocketTimeoutException: Read timed out
[java] at java.net.SocketInputStream.socketRead0(Native Method)
[java] at java.net.SocketInputStream.read(Unknown Source)
At a guess your file is too large to upload.
BTW
!latest_release.canRead()
does not unambiguously mean that the file doesn't exist. It could exist but be inaccessible due to access control.