Out-of-process extension NodesApi bean not found

cancel
Showing results for 
Search instead for 
Did you mean: 
malekgn
Active Member II

Out-of-process extension NodesApi bean not found

Hello,

I created a spring boot application to create an out-of-process application using rest api.
But it failed to run because the missing of the bean NodesApi by displaying the following error message.

Consider defining a bean of type 'org.alfresco.core.handler.NodesApi' in your configuration.

I followed the documentation https://docs.alfresco.com/content-services/latest/develop/oop-ext-points/rest-api-java-wrapper/#list...

initialized the NodesApi with the @Autowired Spring annotation and here is my code :

package com.arondor.alfrescooutofprocessrestapi;

import org.alfresco.core.handler.NodesApi;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class AlfrescoOutOfProcessRestapiApplication implements CommandLineRunner
{

    public static void main(String[] args)
    {
        SpringApplication.run(AlfrescoOutOfProcessRestapiApplication.class, args);
    }

    @Autowired
    NodesApi nodesApi;

    @Override
    public void run(String... args) throws Exception
    {
        // Some code here.
    }

}

And here are the dependencies in my pom.xml file.

<properties>
		<java.version>17</java.version>
		<alfresco.api.version>5.2.2</alfresco.api.version>
	</properties>

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

	<dependencies>

		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter</artifactId>
		</dependency>

		<!-- https://mvnrepository.com/artifact/org.alfresco/alfresco-acs-java-rest-api-spring-boot-starter -->
		<dependency>
			<groupId>org.alfresco</groupId>
			<artifactId>alfresco-acs-java-rest-api-spring-boot-starter</artifactId>
			<version>${alfresco.api.version}</version>
		</dependency>

		<!-- https://mvnrepository.com/artifact/org.alfresco/alfresco-apa-java-rest-api-spring-boot-starter -->
		<dependency>
			<groupId>org.alfresco</groupId>
			<artifactId>alfresco-apa-java-rest-api-spring-boot-starter</artifactId>
			<version>${alfresco.api.version}</version>
		</dependency>

		<!-- https://mvnrepository.com/artifact/org.alfresco/alfresco-java-event-api-spring-boot-starter -->
		<dependency>
			<groupId>org.alfresco</groupId>
			<artifactId>alfresco-java-event-api-spring-boot-starter</artifactId>
			<version>${alfresco.api.version}</version>
		</dependency>
	</dependencies>



Best regards.

 

1 Reply
angelborroy
Alfresco Employee

Re: Out-of-process extension NodesApi bean not found

You may try adding configuration with @EnableAutoConfiguration, like in this sample:

https://github.com/aborroy/alfresco-outlook-attachments-oop/blob/main/src/main/java/org/alfresco/sdk...

Hyland Developer Evangelist