Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9014845
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T03:36:40+00:00 2026-06-16T03:36:40+00:00

I am trying to create a file using FileFolderService in alfresco, But I am

  • 0

I am trying to create a file using FileFolderService in alfresco, But I am getting exception and the details are provided below. So can anyone help me!

Site name: mysite
File Name: will be passed as request parameter and a new file with the passed in value to be created in Document library of the site.

Code snippet:

ServiceRegistry serviceRegistry = (ServiceRegistry) ctx.getBean("ServiceRegistry");
FileFolderService fileFolderService = serviceRegistry.getFileFolderService();
String fileName = req.getParameter("fileName");
NodeRef folder = new NodeRef("avm://mysite/-1;www;avm_webapps;ROOT;documentLibrary");
fileFolderService.create(folder, fileName, ContentModel.TYPE_CONTAINER);

Exception thrown:

ERROR [extensions.webscripts.AbstractRuntime] [http-bio-8080-exec-4] Exception from executeScript - redirecting to status template error: 11100002 Wrapped Exception (with status template): 11100016 Invalid node type for AVM.
 org.springframework.extensions.webscripts.WebScriptException: 11100002 Wrapped Exception (with status template): 11100016 Invalid node type for AVM.
    at org.springframework.extensions.webscripts.AbstractWebScript.createStatusException(AbstractWebScript.java:1067)
    at org.springframework.extensions.webscripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:171)
    at org.alfresco.repo.web.scripts.RepositoryContainer$3.execute(RepositoryContainer.java:433)
    at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:433)
    at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java:495)
    at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecuteAs(RepositoryContainer.java:533)
    at org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:349)
    at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:377)
    at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:209)
    at org.springframework.extensions.webscripts.servlet.WebScriptServlet.service(WebScriptServlet.java:118)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T03:36:41+00:00Added an answer on June 16, 2026 at 3:36 am

    You are attempting to access items in the DM repository using AVM-like paths. If you do not understand the difference between the two then I would suggest doing some background reading such as the Professional Alfresco book.

    You could try something like the following code, but I have not tested this myself.

    String siteName = "blah", newFile = "My New File";
    String path = "app:company_home/st:sites/cm:" + siteName + "/cm:documentLibrary";
    List<String> pathElements = Arrays.asList(str.split("/"));
    NodeRef rootNode = nodeService.getRootNode(new StoreRef("workspace", "SpacesStore"));
    NodeRef dlNode = fileFolderService.resolveNamePath(rootNode, pathElements);
    NodeRef newNode = fileFolderService.create(dlNode, newFile, ContentModel.TYPE_CONTENT).getNodeRef();
    

    You will want to set some properties and content for the node, but that will at least create it for you. You can find more examples in the Alfresco FirstFoundationClient SDK project.

    Exactly how you inject the objects nodeService and fileFolderService depends on what container your code is running in, but in the case of a Java-backed web script then you can inject in the dependencies via Spring config by referencing the NodeService and FileFolderService beans. Try to avoid using the serviceRegistry if you can.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to create a CSV file using the C# code below: string
I'm trying to create file upload using iframe(ajax effect) but I need to know
I am trying to create a .docx file using java but for some reason
i'm trying to create an arabic json file using php, but the problem is
I am trying to create an excel file using the below code in an
I'm trying to create an XML file using C# and Linq to XML, but
I'm trying to create a CSV file using php. How can I print non
I am trying to create a zip file using servlets but it returns me
I am Trying to create XLSX file using POI API but an error has
I'm trying to create a .jar file using the mac terminal but am having

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.