cancel
Showing results for 
Search instead for 
Did you mean: 

Error while uploading using WebServices API

chapeaurouge
Champ in-the-making
Champ in-the-making
Hello all,

I have custom extensions, and I am using the webservices API to upload docs. This all worked well with 2.9B. I have now deployed the 3.0B war file, and copied over my custom extensions, which load without errors.

I have downloaded the relevant updated API to 3.0B to be up-to-date.

I get the following error when trying to upload through the API (I have no problem when doing it manually, all with custom aspects and the like). The user is owner of the space where I am trying to upload and create my documents.

Error writing content to repository server
java.lang.RuntimeException: Error writing content to repository server
   at org.alfresco.webservice.util.ContentUtils.putContent(ContentUtils.java:276)
   at org.alfresco.webservice.util.ContentUtils.putContent(ContentUtils.java:148)
   at xx.xx.xx.print2file.Uploader.create(Uploader.java:113)
   at xx.xx.xx.print2file.ArcParser.main(ArcParser.java:53)
Caused by: java.lang.RuntimeException: Content could not be uploaded because user does not have sufficient priveledges.
   at org.alfresco.webservice.util.ContentUtils.putContent(ContentUtils.java:244)
   … 3 more

After setting up the specific type and aspects, the code actually doing the uploading is the following:

    private void createCML(CMLCreate id) throws RepositoryFault, java.rmi.RemoteException {
        CML cml = new CML();
        cml.setCreate(new CMLCreate[] {id});
        UpdateResult[] f = WebServiceFactory.getRepositoryService().update(cml);
        dumpUpdateResults(f);
    }

Don't really know where to look for that one..

Pointers greatly appreciated.

Thank you.
fred
4 REPLIES 4

chapeaurouge
Champ in-the-making
Champ in-the-making
Posting stuff here actually makes me think harder on my own so…

Since I recreated the user home space manually, its type is now

{http://www.alfresco.org/model/content/1.0}


instead of

{http://www.alfresco.org/model/system/1.0}

Guess this can come into play..

chapeaurouge
Champ in-the-making
Champ in-the-making
Apparently, new in Alfresco, when you create a system user, its node is of type content, and not system…

Bug or feature?

chapeaurouge
Champ in-the-making
Champ in-the-making
Doesn't change the problem..

Actually, the faulty code is:


String cd = ContentUtils.putContent(docAbsolutePath);

before even calling the CML statement.

All folders and data currently in my alf_data/contentstore directory are well owned by tomcat, it's got rwx permissions.

Thanks for any help.

chapeaurouge
Champ in-the-making
Champ in-the-making