cancel
Showing results for 
Search instead for 
Did you mean: 

Problem downloading file using Alfresco Webservice

radheya
Champ in-the-making
Champ in-the-making
Hi,
I'm developing a demo project on using Alfresco webservice to upload and download a file.
Now facing one peculiar problem while downloading. i.e. i can download a file which is uploaded into alfresco repository using Alfresco Web Client, but i'm unable to download when it is uploaded through my code(where i'm using Alfresco webservice).

I'd really appreciate a lot if anybody could look at this problem.

Following are the 2 servlets where i'm uploading and downloading a file respectively.


UploadFileAction.java

protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
  // TODO Auto-generated method stub
  String msg="";
  try
  {
      String fileName="";
      String title=request.getParameter("title").trim();
      String description=request.getParameter("description").trim();
      String path = request.getParameter("file");
     
      path = path.replaceAll("\\\\", "/");
      fileName = path.substring(path.lastIndexOf('/')+1,path.length());
     
    String ext= fileName.substring(fileName.lastIndexOf('.')+1,fileName.length());
    String contType="";
   
    if(ext.equals("txt"))
      contType = "text/plain";
    else if (ext.equals("xls"))
      contType = "application/vnd.ms-excel";
    else if (ext.equals("doc"))
      contType = "application/msword";
    else if (ext.equals("html") || ext.equals("htm"))
      contType = "text/html";
    else if (ext.equals("jpg") || ext.equals("jpeg"))
      contType = "image/jpeg";
    else if (ext.equals("bmp"))
      contType = "image/bmp";
    else if (ext.equals("pdf"))
      contType = "application/pdf";
    else if (ext.equals("ppt"))
      contType = "application/vnd.ms-powerpoint";
    else if(ext.equals("xml"))
      contType = "text/xml";
    else if (ext.equals("zip"))
      contType = "application/vnd.ms-zip";
   
    if(contType.equals(""))
    {
      msg="Unknown file format. File not uploded.";
    }
    else
    {
        WebServiceFactory.setEndpointAddress("http://172.19.148.42:8080/alfresco/api");
        AuthenticationUtils.startSession("admin", "admin");
       
          // Create a reference to the parent where we want to create content
          Store storeRef = new Store(Constants.WORKSPACE_STORE, "SpacesStore");
          ParentReference companyHomeParent = new ParentReference(storeRef, null, "/app:company_home/cm:bneps", Constants.ASSOC_CONTAINS, null);

          RepositoryServiceSoapBindingStub repositoryService =WebServiceFactory.getRepositoryService();
          ContentServiceSoapBindingStub contentService =WebServiceFactory.getContentService();
          NamedValue[] contentProps = new NamedValue[1];
          NamedValue[] titledProps = new NamedValue[2];

        // Assign name
          companyHomeParent.setChildName("cm:" + fileName);

          contentProps[0] = Utils.createNamedValue(Constants.PROP_NAME, fileName);
          //Construct CML statement to add titled aspect
          titledProps[0] = Utils.createNamedValue(Constants.PROP_TITLE, title);
          titledProps[1] = Utils.createNamedValue(Constants.PROP_DESCRIPTION, description);

          CMLAddAspect addAspect = new CMLAddAspect(Constants.ASPECT_TITLED, titledProps, null, "1");

          //create content
          // Construct CML statement to create content node
          // Note: Assign "1" as a local id, so we can refer to it in subsequent
          // CML statements within the same CML block
          CMLCreate create = new CMLCreate("1", companyHomeParent, companyHomeParent.getUuid(), Constants.ASSOC_CONTAINS, null, Constants.PROP_CONTENT, contentProps);
          // Construct CML Block
          CML cml = new CML();
          cml.setCreate(new CMLCreate[] {create});
          cml.setAddAspect(new CMLAddAspect[] {addAspect});
          // Issue CML statement via Repository Web Service and retrieve result
          // Note: Batching of multiple statements into a single web call
          UpdateResult[] result = repositoryService.update(cml);
          Reference content = result[0].getDestination();
          // Write some content
          FileInputStream is = new FileInputStream(path);
          byte[] bytes = ContentUtils.convertToByteArray(is);

          ContentFormat format = new ContentFormat(contType, "UTF-8");
          // Write the content
          contentService.write(content, Constants.PROP_CONTENT, bytes, format);
          msg="File Uploaded Successfully";
    }    
  }
  catch(Exception e)
  {
    msg="Error uploading file";
    System.out.println("Error uploading file : "+e);
    System.out.println(e.toString());
  }
  finally
  {
      // End the session
      AuthenticationUtils.endSession();
  }
  request.setAttribute("msg",msg);
  RequestDispatcher rd=request.getRequestDispatcher("StatusMessage.jsp");
  rd.forward(request,response);
}



DownloadFileAction.java

protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
  String fileName=request.getParameter("fileName");

  WebServiceFactory.setEndpointAddress("http://172.19.148.42:8080/alfresco/api");
 
  /**Start the session*/
  AuthenticationUtils.startSession("admin", "admin");
 
  /** Make sure Service Folder has been created,or download files will be failure */
  boolean Success = true;
  Store storeRef = new Store(Constants.WORKSPACE_STORE, "SpacesStore");
  String parentSpace = "/app:company_home/cm:bneps";
  Reference SAMPLE_FOLDER = new Reference(storeRef, null, parentSpace);
   
  try
  {
        WebServiceFactory.getRepositoryService().get(new Predicate(new Reference[]{SAMPLE_FOLDER}, storeRef, null));
  }
  catch (Exception exception)
  {
    System.out.println("Error while getting repository service");
    Success=false;
  }
 
  /**Download files,if exception then "Success = False" */
  try
  {
    if(Success)
    {
      ContentServiceSoapBindingStub contentService = WebServiceFactory.getContentService();
      Reference contentReference = new Reference(storeRef,null,parentSpace+"/cm:"+fileName);
      Content[] readResult = contentService.read(new Predicate(new Reference[]{contentReference}, storeRef, null), Constants.PROP_CONTENT);
      for(Content content: readResult)
      {
        String[] splitedUrl = content.getUrl().split("/");
        if(splitedUrl[splitedUrl.length-1].equals(fileName))
        {
         
            InputStream in=ContentUtils.getContentAsInputStream(content);
         
          response.reset();
          response.setHeader ("Content-Disposition", "attachment;filename=\""+fileName+"\"");
          ServletOutputStream sosStream = response.getOutputStream();

          int ibit = 256;
             while ((ibit) >= 0)
             {
                ibit = in.read();
                sosStream.write(ibit);
             }
            
             sosStream.flush();
             sosStream.close();
             in.close();
        }
      }
    }
  }
  catch(ClientAbortException e)
  {
    System.out.println("File download cancelled by the user");
  }
  catch(Exception e)
  {
    System.out.println("Error downloading file : "+e);
  }
  /** End the session*/
  AuthenticationUtils.endSession();
}


Thanks a lot
Radheya
17 REPLIES 17

sisao
Champ in-the-making
Champ in-the-making
Hi radeya,
you may think of attaching a debug shot of the runtime for that code.
Is that an export method instead?
For example, you can retrieve the node UUID and use the download contents API (/d/a) in order to populate webpages with urls.

openpj
Elite Collaborator
Elite Collaborator
Here some suggestions:
  • Use the Code snippet in the forum to show your source code;

  • Use MimetypesFileTypeMap to manage all the content types via properties: mime.types in your META-INF folder;

  • I think that we need some stacktrace to suggest you a possible solution.
Hope this helps.

radheya
Champ in-the-making
Champ in-the-making
Hi OpenPj and Sisao,
Thanks for your valuable time.
Actually i'm new to alfresco and i really dont have any idea how this code works. I got this  code in forum.
The problem i'm having is i'm not able to get the error messages. I can only catch the exception but i dont have required jars to find out what kind of exception i'm getting so that i can handle. All i can tell you is in which line i'm getting this error while downloading.

DownloadFileAction.java
Content[] readResult = contentService.read(new Predicate(new Reference[]{contentReference}, storeRef, null), Constants.PROP_CONTENT);

According to me the problem must be in UploadFileAction.java, coz i'm able to a download file which is uploaded through Alfresco web client. Please tell me what i'm doing wrong while uploading.

Thanks again
Radheya

openpj
Elite Collaborator
Elite Collaborator
Usually to upload a file using Alfresco Web Service Client you can use the following code:

WebServiceFactory.setEndpointAddress(ALFRESCO_WS_API_URL);
      AuthenticationUtils.startSession(ADMIN_USERNAME, ADMIN_PASSWORD);
      String mimeType = new MimetypesFileTypeMap().getContentType(file.getNameWithExtension());
      ContentFormat contentFormat = new ContentFormat(mimeType,"UTF-8");
      Reference reference = new Reference(ConstantsAlfresco.STORE, null, yourFullPathOfTheContent);
      NamedValue[] properties = createProperties(yourUploadFormBean); //create all the custom properties for your content from your form
      ParentReference parentRef = new ParentReference();
      parentRef.setStore(store);
      parentRef.setUuid(reference.getUuid());
      parentRef.setPath(reference.getPath());
      parentRef.setAssociationType(Constants.ASSOC_CONTAINS);
      parentRef.setChildName(Constants.ASSOC_CONTAINS);
      
      CMLCreate create = new CMLCreate();
      create.setParent(parentRef);
      create.setProperty(properties);
      create.setType(yourCustomContentType);   

      CML cml = new CML();
      cml.setCreate(new CMLCreate[] {create});
       
        UpdateResult[] result = WebServiceFactory.getRepositoryService().update(cml);
       
        ByteArrayOutputStream stream = new ByteArrayOutputStream();
      int c;
      while ((c = form.getFile().getStream().read()) != -1) {
         stream.write((char) c);
      }
      
      Reference contentNode = result[0].getDestination();
      Content content = WebServiceFactory.getContentService().write(contentNode,
            Constants.PROP_CONTENT, stream.toByteArray(), contentFormat);
      
      if (content == null)
         throw new RemoteException("Error during storing file");

radheya
Champ in-the-making
Champ in-the-making
Hi OpenPj,
Thank you very much, its working fine now…

Thanks a lot
Radheya

keerthi
Champ in-the-making
Champ in-the-making
Hi Radheya,

Could u plz help me solve the download problem.. . got the same error which u have mentioned..  the following are my pages
1. jsp
2. webservice classes for upload and download

upload jsp
————
<html>
<body>    
    This is my JSP page. <br>
     
   <!–<form action="CreateFolder.jsp"  method="post"  >–>
   
    <form method="post" action="sampleTest" method="post">
   <table>
   <tR>
   <td>Title
   </td>
   <td><input type="text" name="title"  />
   </td>
   </tR>
      <tR>
   <td>Description
   </td>
      <td><input type="text" name="description"  />
   </td>
   </tR>
      <tR>
   <td>select File
   </td><td><input type="file" name="file" id="file" />
      
   </td>
   </tR>
   <tr>
   
   <td colspan="2">
   <input type="submit"  value="upload" />
   </td>
   </tr>
   </table>
   </form>
   
   
   </body>
</html>

upload.java
————–
import java.io.FileInputStream;
import java.io.IOException;

import javax.security.auth.callback.PasswordCallback;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.alfresco.repo.webservice.authentication.AuthenticationResult;
import org.alfresco.repo.webservice.types.QueryConfiguration;
import org.alfresco.webservice.authentication.AuthenticationServiceLocator;
import org.alfresco.webservice.authentication.AuthenticationServiceSoapBindingStub;
import org.alfresco.webservice.content.ContentServiceSoapBindingStub;
import org.alfresco.webservice.repository.RepositoryServiceLocator;
import org.alfresco.webservice.repository.RepositoryServiceSoapBindingStub;
import org.alfresco.webservice.repository.UpdateResult;
import org.alfresco.webservice.types.CML;
import org.alfresco.webservice.types.CMLAddAspect;
import org.alfresco.webservice.types.CMLCreate;
import org.alfresco.webservice.types.ContentFormat;
import org.alfresco.webservice.types.NamedValue;
import org.alfresco.webservice.types.ParentReference;
import org.alfresco.webservice.types.Reference;
import org.alfresco.webservice.types.Store;
import org.alfresco.webservice.util.AuthenticationUtils;
import org.alfresco.webservice.util.Constants;
import org.alfresco.webservice.util.ContentUtils;
import org.alfresco.webservice.util.Utils;
import org.alfresco.webservice.util.WebServiceFactory;

//import org.apache.ws.security.handler.WSHandlerConstants;

public class sampleTest extends HttpServlet {
   protected void doPost(HttpServletRequest request,
         HttpServletResponse response) throws ServletException, IOException {

      String msg = "";
      try {
         
         System.out.println("inside try");
         System.out.println("For Testing Valuess….");

         System.out.println("title::Value::::"
               + (String) request.getParameter("title"));
         // System.out.println("title::::::"+request.getParameter("title").trim());
         String title = (String) request.getParameter("title").trim();
         System.out.println("title::::::" + title);

         String description = request.getParameter("description").trim();
         System.out.println("description ::::" + description);

         String path = request.getParameter("file");
         System.out.println("file name:::: " + path);

         path = path.replaceAll("\\\\", "/");
         String fileName = path.substring(path.lastIndexOf('/') + 1, path
               .length());
         System.out.println("file name:::: " + fileName);

         String ext = fileName.substring(fileName.lastIndexOf('.') + 1,
               fileName.length());
         System.out.println("ext name:::: " + ext);
         String contType = "";

         if (ext.equals("txt"))
            contType = "text/plain";
         else if (ext.equals("xls"))
            contType = "application/vnd.ms-excel";
         else if (ext.equals("doc"))
            contType = "application/msword";
         else if (ext.equals("html") || ext.equals("htm"))
            contType = "text/html";
         else if (ext.equals("jpg") || ext.equals("jpeg"))
            contType = "image/jpeg";
         else if (ext.equals("bmp"))
            contType = "image/bmp";
         else if (ext.equals("pdf"))
            contType = "application/pdf";
         else if (ext.equals("ppt"))
            contType = "application/vnd.ms-powerpoint";
         else if (ext.equals("xml"))
            contType = "text/xml";
         else if (ext.equals("zip"))
            contType = "application/vnd.ms-zip";

         if (contType.equals("")) {
            System.out.println(":::::::insdide file not found");
            msg = "Unknown file format. File not uploded.";
         } else {
            
            // set the batch size in the query header

            
            
            
            
            
            System.out.println("inside alfresco part:::::::::");
            WebServiceFactory.setEndpointAddress("http://192.168.1.114:8080/alfresco/api");
            //WebServiceFactory.setEndpointAddress("http://localhost:8080/alfresco/api");
            // Get a reference to the
            
            // Start the session
            //org.alfresco.webservice.authentication.AuthenticationResult result = authenticationService
               //   .startSession("admin", "admin");
            //String ticket = result.getTicket();

            AuthenticationUtils.startSession("admin", "admin");

            //System.out.println("Ticket::" + ticket);
            System.out.println("Ticket::" + AuthenticationUtils.getTicket());

            // Create a reference to the parent where we want to create
            // content
            Store storeRef = new Store(Constants.WORKSPACE_STORE,
                  "SpacesStore");
            ParentReference companyHomeParent = new ParentReference(
                  storeRef, null, "/app:company_home/cm:myweb", Constants.ASSOC_CONTAINS, null);
            System.out.println("Association type:::"
                  + companyHomeParent.getAssociationType());
            System.out.println("ChildName:::"
                  + companyHomeParent.getChildName());
            System.out.println("Path:::" + companyHomeParent.getPath());

            RepositoryServiceSoapBindingStub repositoryService = WebServiceFactory
                  .getRepositoryService();
            ContentServiceSoapBindingStub contentService = WebServiceFactory
                  .getContentService();
            
            
            NamedValue[] contentProps = new NamedValue[1];
            NamedValue[] titledProps = new NamedValue[2];

            // Assign name
            companyHomeParent.setChildName("cm:" + fileName);
            System.out.println("Child Name::::"
                  + companyHomeParent.getChildName());

            contentProps[0] = Utils.createNamedValue(Constants.PROP_NAME,
                  fileName);
            // Construct CML statement to add titled aspect

            titledProps[0] = Utils.createNamedValue(Constants.PROP_TITLE,
                  title);
            titledProps[1] = Utils.createNamedValue(
                  Constants.PROP_DESCRIPTION, description);

            CMLAddAspect addAspect = new CMLAddAspect(
                  Constants.ASPECT_TITLED, titledProps, null, "1");
            System.out.println("Aspect::" + addAspect.getAspect());
            System.out.println("Property::" + addAspect.getProperty());
            System.out.println("Where" + addAspect.getWhere());

            // create content
            // Construct CML statement to create content node
            // Note: Assign "1" as a local id, so we can refer to it in
            // subsequent
            // CML statements within the same CML block
            CMLCreate create = new CMLCreate("1", companyHomeParent,
                  companyHomeParent.getUuid(), Constants.ASSOC_CONTAINS,
                  null, Constants.PROP_CONTENT, contentProps);
            System.out.println("after CMLcreate :::::");
            // Construct CML Block
            CML cml = new CML();
            cml.setCreate(new CMLCreate[] { create });
            cml.setAddAspect(new CMLAddAspect[] { addAspect });
            System.out.println("after Add Aspect :::::");
            // Issue CML statement via Repository Web Service and retrieve
            // result
            // Note: Batching of multiple statements into a single web call
            System.out.println("before resultset :::::");
            System.out.println("Header::" + repositoryService.getHeaders());

            UpdateResult[] result1 = repositoryService.update(cml);
            System.out.println("after resultset1");
            System.out.println("result Length:::" + result1.length);
            System.out.println("after resultset2");
            Reference content = result1[0].getDestination();

            System.out.println("content path:::" + content.getPath());
            // Write some content
            FileInputStream is = new FileInputStream(path);
            System.out.println("path" + path);

            byte[] bytes = ContentUtils.convertToByteArray(is);

            ContentFormat format = new ContentFormat(contType, "UTF-8");
            // Write the content
            contentService.write(content, Constants.PROP_CONTENT, bytes,
                  format);
            msg = "File Uploaded Successfully";
         }
      } catch (Exception e) {
         msg = "Error uploading file";
         System.out.println("Error uploading file : " + e);
         e.printStackTrace();
         System.out.println("" + e.getStackTrace());
         System.out.println(e.toString());
      } finally {
         System.out.println("session ending");
         // End the session
         AuthenticationUtils.endSession();
      }
      request.setAttribute("msg", msg);
      RequestDispatcher rd = request
            .getRequestDispatcher("StatusMessage.jsp");
      rd.forward(request, response);
   }

}

my upload is working fine..
but for my download program i got the error in the line which is bold

download.java
—————-
import java.io.IOException;
import java.io.InputStream;

import javax.servlet.ServletException;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.alfresco.repo.webservice.types.Predicate;
import org.alfresco.webservice.content.Content;
import org.alfresco.webservice.content.ContentServiceSoapBindingStub;
import org.alfresco.webservice.types.Reference;
import org.alfresco.webservice.types.Store;
import org.alfresco.webservice.util.AuthenticationUtils;
import org.alfresco.webservice.util.Constants;
import org.alfresco.webservice.util.ContentUtils;
import org.alfresco.webservice.util.WebServiceFactory;


public class downloadFile {

   protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
   {
   String fileName=request.getParameter("fileName");
   
   System.out.println("fileName::::"+fileName);
   
   WebServiceFactory.setEndpointAddress("http://192.168.17.33:8080/alfresco/api");

   /**Start the session*/
   AuthenticationUtils.startSession("admin", "admin");

   /** Make sure Service Folder has been created,or download files will be failure */
   boolean Success = true;
   Store storeRef = new Store(Constants.WORKSPACE_STORE, "SpacesStore");
   String parentSpace = "/app:company_home/cm:myweb";
   Reference SAMPLE_FOLDER = new Reference(storeRef, null, parentSpace);

   try
   {
   WebServiceFactory.getRepositoryService().get(new Predicate(new Reference[]{SAMPLE_FOLDER}, storeRef, null));   }

   catch (Exception exception)
   {
   System.out.println("Error while getting repository service");
   Success=false;
   }

   /**Download files,if exception then "Success = False" */
   try
   {
   if(Success)
   {
   ContentServiceSoapBindingStub contentService = WebServiceFactory.getContentService();
   Reference contentReference = new Reference(storeRef,null,parentSpace+"/cm:"+fileName);
   Content[] readResult = contentService.read(new Predicate(new Reference[]{contentReference}, storeRef, null), Constants.PROP_CONTENT);
   for(Content content: readResult)
   
{
   String[] splitedUrl = content.getUrl().split("/");
   if(splitedUrl[splitedUrl.length-1].equals(fileName))
   {

   InputStream in=ContentUtils.getContentAsInputStream(content);

   response.reset();
   response.setHeader ("Content-Disposition", "attachment;filename=\""+fileName+"\"");
   ServletOutputStream sosStream = response.getOutputStream();

   int ibit = 256;
   while ((ibit) >= 0)
   {
   ibit = in.read();
   sosStream.write(ibit);
   }

   sosStream.flush();
   sosStream.close();
   in.close();
   }
   }
   }
   }
   catch(ClientAbortException e)
   {
   System.out.println("File download cancelled by the user");
   }
   catch(Exception e)
   {
   System.out.println("Error downloading file : "+e);
   }
   /** End the session*/
   AuthenticationUtils.endSession();
   }
}


Could you plz tel me how to change and get it done

thanks in advance

shamabbas
Champ in-the-making
Champ in-the-making
Sham

shamabbas
Champ in-the-making
Champ in-the-making
Hi ALL and hey keerthi

"keerthi"::
I tried your code to upload files in  new application.
CAN U PLEASE HELP ME AS SOON AS POSSIBLE!?!!?

I tried following steps…
1- created new web project
2-added all alfresco liberaries from its sdk.
3-pasted your jsp code in jsp file n renamed to upload.jsp
4-created new servlets page and pasted ur upload code into its doPost function.
5-gave all webservices wsdl url.

and when i run that project.
when i click on upload button it gives me Error. You said ur uploading is working.??? please let me know.
"
type Status report

message /NewAppAlf/StatusMessage.jsp

description The requested resource (/NewAppAlf/StatusMessage.jsp) is not available
.
"


16:46:01,126 INFO  [STDOUT] inside try
16:46:01,126 INFO  [STDOUT] For Testing Values….
16:46:01,126 INFO  [STDOUT] title::Valuebismlillah
16:46:01,126 INFO  [STDOUT] title::::::bismlillah
16:46:01,126 INFO  [STDOUT] Description:::::desp
16:46:01,126 INFO  [STDOUT] file name:::test_file.doc
16:46:01,126 INFO  [STDOUT] file name :::test_file.doc
16:46:01,126 INFO  [STDOUT] ext name :::doc
16:46:01,126 INFO  [STDOUT] inside alfresco part::::::::
16:46:02,486 INFO  [STDOUT] Error uploading file:::org.alfresco.webservice.util.WebServiceException: Error starting session.
16:46:02,486 ERROR [STDERR] org.alfresco.webservice.util.WebServiceException: Error starting session.
16:46:02,486 ERROR [STDERR]     at org.alfresco.webservice.util.AuthenticationUtils.startSession(AuthenticationUtils.java:94)
16:46:02,486 ERROR [STDERR]     at upload.doPost(upload.java:174)
16:46:02,486 ERROR [STDERR]     at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
16:46:02,486 ERROR [STDERR]     at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
16:46:02,486 ERROR [STDERR]     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
16:46:02,486 ERROR [STDERR]     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
16:46:02,486 ERROR [STDERR]     at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
16:46:02,486 ERROR [STDERR]     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
16:46:02,486 ERROR [STDERR]     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
16:46:02,486 ERROR [STDERR]     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
16:46:02,486 ERROR [STDERR]     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
16:46:02,486 ERROR [STDERR]     at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
16:46:02,486 ERROR [STDERR]     at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
16:46:02,486 ERROR [STDERR]     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
16:46:02,486 ERROR [STDERR]     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
16:46:02,486 ERROR [STDERR]     at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
16:46:02,486 ERROR [STDERR]     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
16:46:02,486 ERROR [STDERR]     at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
16:46:02,486 ERROR [STDERR]     at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
16:46:02,486 ERROR [STDERR]     at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
16:46:02,486 ERROR [STDERR]     at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
16:46:02,486 ERROR [STDERR]     at java.lang.Thread.run(Thread.java:619)
16:46:02,486 ERROR [STDERR] Caused by: java.net.ConnectException: Connection refused: connect
16:46:02,486 ERROR [STDERR]     at org.apache.axis.AxisFault.makeFault(AxisFault.java:101)
16:46:02,486 ERROR [STDERR]     at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:154)
16:46:02,486 ERROR [STDERR]     at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
16:46:02,486 ERROR [STDERR]     at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
16:46:02,486 ERROR [STDERR]     at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
16:46:02,486 ERROR [STDERR]     at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
16:46:02,486 ERROR [STDERR]     at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
16:46:02,486 ERROR [STDERR]     at org.apache.axis.client.Call.invoke(Call.java:2767)
16:46:02,486 ERROR [STDERR]     at org.apache.axis.client.Call.invoke(Call.java:2443)
16:46:02,486 ERROR [STDERR]     at org.apache.axis.client.Call.invoke(Call.java:2366)
16:46:02,486 ERROR [STDERR]     at org.apache.axis.client.Call.invoke(Call.java:1812)
16:46:02,486 ERROR [STDERR]     at org.alfresco.webservice.authentication.AuthenticationServiceSoapBindingStub.startSession(AuthenticationServiceSoapBindingStub.java:187)
16:46:02,486 ERROR [STDERR]     at org.alfresco.webservice.util.AuthenticationUtils.startSession(AuthenticationUtils.java:79)
16:46:02,486 ERROR [STDERR]     … 21 more
16:46:02,486 ERROR [STDERR] Caused by: java.net.ConnectException: Connection refused: connect
16:46:02,486 ERROR [STDERR]     at java.net.PlainSocketImpl.socketConnect(Native Method)
16:46:02,486 ERROR [STDERR]     at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
16:46:02,486 ERROR [STDERR]     at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
16:46:02,486 ERROR [STDERR]     at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
16:46:02,486 ERROR [STDERR]     at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
16:46:02,486 ERROR [STDERR]     at java.net.Socket.connect(Socket.java:519)
16:46:02,486 ERROR [STDERR]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
16:46:02,486 ERROR [STDERR]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
16:46:02,486 ERROR [STDERR]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
16:46:02,486 ERROR [STDERR]     at java.lang.reflect.Method.invoke(Method.java:597)
16:46:02,486 ERROR [STDERR]     at org.apache.axis.components.net.DefaultSocketFactory.create(DefaultSocketFactory.java:153)
16:46:02,486 ERROR [STDERR]     at org.apache.axis.components.net.DefaultSocketFactory.create(DefaultSocketFactory.java:120)
16:46:02,486 ERROR [STDERR]     at org.apache.axis.transport.http.HTTPSender.getSocket(HTTPSender.java:191)
16:46:02,486 ERROR [STDERR]     at org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:404)
16:46:02,486 ERROR [STDERR]     at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:138)
16:46:02,486 ERROR [STDERR]     … 32 more
16:46:02,486 INFO  [STDOUT] [Ljava.lang.StackTraceElement;@9882d2
16:46:02,486 INFO  [STDOUT] org.alfresco.webservice.util.WebServiceException: Error starting session.
16:46:02,486 INFO  [STDOUT] session ending


PLZ PLZ PLZ PLZ PLZ HELP ME OUT AS SOON AS POSSIBLE!
Sham

shamabbas
Champ in-the-making
Champ in-the-making
It compiles and run properly but doesn't upload any file neither in database nore in alfresco repository. What error gives i have pasted above…
please reply asap!

thankss