jcledera / sardine

Automatically exported from code.google.com/p/sardine
0 stars 0 forks source link

java.lang.reflect.InvocationTargetException #102

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
Sardine sardine = SardineFactory.begin(); or Sardine sardine = 
SardineFactory.begin("username", "password"); where username and password are 
"valid".  Here's the code that has been implemented as a "Bottom up Java bean 
Web Service":

package com.controltierintegrationservices;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;

import com.googlecode.sardine.Sardine;
import com.googlecode.sardine.SardineFactory;

public class WebDavTransport {
    public String copyToControlTier(){
        Sardine sardine = SardineFactory.begin();
        sardine.setCredentials("default", "default");
        InputStream fis;
        File sourceFile = new File("./web.xml");
        String targetURL = "http://localhost:8080/jackrabbit/repository/controltier/DeployMgr/QAbuilds/";
        try {
            fis = new FileInputStream(sourceFile);
            try {
                sardine.put(targetURL, fis);
            } catch (IOException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        } catch (FileNotFoundException e1) {
            // TODO Auto-generated catch block
            e1.printStackTrace();
        }
        return "Success";
    }
} 

What is the expected output? What do you see instead?
"Success" given all my other code is correct ;)  What I get instead: SOAP Fault 
Code: soapenv:Server.userExceptionSOAP Fault String: 
java.lang.reflect.InvocationTargetException

What version of the product are you using?
253

On what operating system?
Windows development platform (ugh) with Tomcat 7 running locally.

What webdav server are you hitting?
JackRabbit

What is in the server error logs?
Nothing.  Not getting that far.

Please provide any additional information below (including code examples and 
full stack traces with line numbers in them).
I have added all the dependencies to the build path.  I did so after receiving 
the error so I started out without them on the build path.  No difference.

Original issue reported on code.google.com by bill.m...@gmail.com on 22 Jun 2011 at 2:34

GoogleCodeExporter commented 9 years ago
Just curious, what happens when you go to: 
http://localhost:8080/jackrabbit/repository/controltier/DeployMgr/QAbuilds/ in 
a web browser?

Original comment by latch...@gmail.com on 22 Jun 2011 at 2:45

GoogleCodeExporter commented 9 years ago
Thank you for the quick reply!  The exception was thrown on the Sardine sardine 
= SardineFactory.begin(); so it was never getting to the jackrabbit server.  It 
is/was surfable from a browser.

I did resolve the problem though!  I had to copy the Sardine library and its 
dependencies to the WEB-INF/lib folder.  Could be different when I export a WAR 
file to drop on my Tomcat server, but just publishing the service on my Tomcat 
server running in Eclipse is how I created this (now non-) issue.

Original comment by bill.m...@gmail.com on 23 Jun 2011 at 1:03

GoogleCodeExporter commented 9 years ago
Ah, I didn't notice the SOAP exception which would have further implied this 
has nothing to do with sardine. ;-)

Glad you figured it out and hope it works well for you. Enjoy.

Original comment by latch...@gmail.com on 23 Jun 2011 at 1:19