cancel
Showing results for 
Search instead for 
Did you mean: 

Error al crear carpeta desde Java SDK

jsancarb
Champ in-the-making
Champ in-the-making

Hola, estoy incorporando Alfresco a un proyecto de nuestra compañía desarrollado con Spring Boot, y al crear una carpeta me arroja un error y no sé cómo solventarlo:

Este es el método del servicio con el que estoy realizando pruebas:

	/**
	 * 
	 * @param folderName         Nombre de la carpeta
	 * @param relativeFolderPath Direccion relativa
	 * @return
	 * @throws Exception
	 */
	public Node createFolder(String folderName, String relativeFolderPath) throws Exception{
		Objects.requireNonNull(folderName);
		
		NodeBodyCreate nodeBodyCreate = new NodeBodyCreate();
		nodeBodyCreate.setName(folderName);
		nodeBodyCreate.setNodeType("cm:folder");
		nodeBodyCreate.setRelativePath(relativeFolderPath);

		Node folderNode = nodesApi
				.createNode("Subvencions", nodeBodyCreate, null, null, null, null, null)
				.getBody().getEntry();
		LOGGER.info("Created new folder: {}", folderNode);

		return folderNode;
	}

Pom:

	<repositories>

		<repository>
			<id>alfresco-public</id>
			<url>https://artifacts.alfresco.com/nexus/content/groups/public</url>
		</repository>

	</repositories>

	<dependencies>

		<dependency>
			<groupId>org.alfresco</groupId>
			<artifactId>alfresco-java-rest-api-spring-boot-starter</artifactId>
			<version>5.1.1</version>
		</dependency>
......

Y este es el error que me arroja:

feign.FeignException$BadRequest: [400 Bad Request] during [POST] to [http://___________/alfresco/api/-default-/public/alfresco/versions/1/nodes/Subvencions/children] [NodesApiClient#createNode(String,NodeBodyCreate,Boolean,Boolean,Boolean,List,List)]: [{"error":{"errorKey":"Could not read content from HTTP request body: Unrecognized field \"definition\" (Class org.alfresco.rest.api.model.Node), not marked as ignorable\n at [Source: java.io.BufferedR... (825 bytes)]

Gracias.

3 REPLIES 3

angelborroy
Community Manager Community Manager
Community Manager

¿Qué versión de Alfresco Repositorio estás usando? 7.2?

Hyland Developer Evangelist

jsancarb
Champ in-the-making
Champ in-the-making

Esta es la versión del repositorio:

Close
Alfresco Share v5.2.d
(r134641-b15, Aikau 1.0.101.3, Spring Surf 5.2.d, Spring WebScripts 6.13, Freemarker 2.3.20-alfresco-patched, Rhino 1.7R4-alfresco-patched, Yui 2.9.0-alfresco-20141223)
Alfresco Community v5.2.0
(r134428-b13) schema 10005

 

La SDK no funciona con Alfresco 5.2 (al menos no ha sido probada).

Hyland Developer Evangelist
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.