Error injecting services in connectors

I am creating a connector that needs to upload documents to alfresco(in java), but the problem is that it cannot inject the service correctly. i am trying to do it like this:
"
@Component
@OutboundConnector(
name = “UploadToAlfresco”, inputVariables = {“files”, “filesNames”, “idProceso”}, type = “io.camunda:upload-document:1”)
public class Base64Function implements OutboundConnectorFunction {

private ICmisService cmisService;

@Autowired
public Base64Function(CmisService cmisService ) {
	super();
	this.cmisService = cmisService;
}

private static final Logger LOGGER = LoggerFactory.getLogger(Base64Function.class);

@Override
public Object execute(OutboundConnectorContext context) throws Exception {
var connectorRequest = context.getVariablesAsType(Base64Request.class);
context.replaceSecrets(connectorRequest);
return executeConnector(connectorRequest);
}

private Base64Result executeConnector(final Base64Request connectorRequest) throws IOException {

LOGGER.info("Executing my connector alfresco with request");
  LOGGER.info("String: {}",connectorRequest.toString());
  String[] filesNames= connectorRequest.getFilesNames();
  byte[][] files= connectorRequest.getFiles();
  Long idProceso= connectorRequest.getIdProceso();
  List<MultipartFile> multipartFiles = convertBytesToMultipartFiles(files, filesNames);

  if (null != multipartFiles && multipartFiles.size() > 0) {
	    for (MultipartFile multipartFile : multipartFiles) {
	        String fileName = multipartFile.getOriginalFilename();
	        try {
		        Document docCreated=cmisService.uploadDocumentToAlfresco( fileName,  multipartFile, idProceso );
		      } catch (Exception e) {
		        e.printStackTrace();
		      } 
	    }
	}"

and it gives me this error:
org.springframework.context.ApplicationContextException: Failed to start bean ‘zeebeClientLifecycle’; nested exception is java.lang.IllegalStateException: Failed to load io.camunda.connector.Base64Function

I have also tried to do it like this:
@Autowired
private ICmisService cmisService;”

but it gives me this error:
"java.lang.NullPointerException: Cannot invoke “io.camunda.interfaces.ICmisService.uploadDocumentToAlfresco(String, org.springframework.web.multipart.MultipartFile, java.lang.Long)” because “this.cmisService” is null
connectors | 2023-10-31 14:55:16.709 INFO 1 — [pool-4-thread-1] org.camunda.feel.FeelEngine : Engine created. [value-mapper: CompositeValueMapper(List(org.camunda.feel.impl.JavaValueMapper@1914d43)), function-provider: "

This is mi cmisservice class:
"@Service(“cmisService”)
public class CmisService implements ICmisService{

  private static final Logger LOGGER = LoggerFactory.getLogger(CmisService.class);

  @PostConstruct
  public void init()
  {

      String alfrescoBrowserUrl = System.getenv("alfresco.repository.url") + "/api/-default-/public/cmis/versions/1.1/browser";

      Map<String, String> parameter = new HashMap<String, String>();

      parameter.put(SessionParameter.USER, "admin");
      parameter.put(SessionParameter.PASSWORD, "admin");
      parameter.put(SessionParameter.BROWSER_URL, "http://alfresco:8080/alfresco/api/-default-/public/cmis/versions/1.1/browser");
      parameter.put(SessionParameter.BINDING_TYPE, BindingType.BROWSER.value());
      SessionFactory factory = SessionFactoryImpl.newInstance();
      session = factory.getRepositories(parameter).get(0).createSession();

  }

//clases del cmis
  public void updateProperties(CmisObject cmisObject, Map<String, Object> properties)
  {
      cmisObject.updateProperties(properties);
  }

  public ObjectId createRelationship(CmisObject sourceObject, CmisObject targetObject, String relationshipName)
  {

      Map<String, Object> properties = new HashMap<String, Object>();
      properties.put(PropertyIds.NAME, "a new relationship");
      properties.put(PropertyIds.OBJECT_TYPE_ID, relationshipName);
      properties.put(PropertyIds.SOURCE_ID, sourceObject.getId());
      properties.put(PropertyIds.TARGET_ID, targetObject.getId());

      return session.createRelationship(properties);

  }
  
  public void addAspect(CmisObject cmisObject, String aspect)
  {

      List<Object> aspects = cmisObject.getProperty("cmis:secondaryObjectTypeIds").getValues();
      if (!aspects.contains(aspect))
      {
          aspects.add(aspect);
          Map<String, Object> aspectListProps = new HashMap<String, Object>();
          aspectListProps.put(PropertyIds.SECONDARY_OBJECT_TYPE_IDS, aspects);
          cmisObject.updateProperties(aspectListProps);
      }

  }

  public ItemIterable<Relationship> getRelationships(ObjectId objectId, String relationshipName)
  {

      ObjectType typeDefinition = session.getTypeDefinition(relationshipName);
      OperationContext operationContext = session.createOperationContext();
      return session.getRelationships(objectId, true, RelationshipDirection.EITHER, typeDefinition, operationContext);

  }

  public void remove(CmisObject object)
  {

      if (BaseTypeId.CMIS_FOLDER.equals(object.getBaseTypeId()))
      {
          Folder folder = (Folder) object;
          ItemIterable<CmisObject> children = folder.getChildren();
          for (CmisObject child : children)
          {
              remove(child);
          }
      }
      session.delete(object);
  }

@Override
public Folder getDocLibFolder( String siteName, String folder) {
  String path = "/Sites/" + siteName + "/documentLibrary" + folder;
  return (Folder) session.getObjectByPath(path);
}"

So the problem is that my connector is not being able to access the cmis service.

How could i solve this?

Hi @Juan_Felipe_Parrado .
Are you using the Spring connector runtime?

It looks like the connector that is used was instantiated directly by the connector runtime and not via the spring application context.
Did you register it via the SPI in META-INF/services/io.camunda.connector.api.outbound.OutboundConnectorFunction? That is not needed if you use it via the spring boot starter as a spring bean.

@rohwerj so you are telling me that under META-INF
services\io.camunda.connector.api.outbound.OutboundConnectorFunction should be deleted and instead add the folder spring and spring.factories? i tried it like that but when i try to autowire the cmis like this :
image
is null and when i try like this:
image
i receive these errors when trying to run it

org.springframework.context.ApplicationContextException: Failed to start bean 'zeebeClientLifecycle'; nested exception is java.lang.IllegalStateException: Failed to load io.camunda.connector.Base64Function
Caused by: java.lang.IllegalStateException: Failed to load io.camunda.connector.Base64Function
Caused by: java.lang.NoSuchMethodException: io.camunda.connector.Base64Function.<init>()

This is how my project looks like:
image
my connector is an outbound one so i only left that configuration
image

My connector function

package io.camunda.connector;

import io.camunda.connector.api.annotation.OutboundConnector;
import io.camunda.connector.api.outbound.OutboundConnectorContext;
import io.camunda.connector.api.outbound.OutboundConnectorFunction;
import io.camunda.impl.CmisService;
import io.camunda.interfaces.ICmisService;
import io.camunda.models.CustomMultipartFile;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.multipart.MultipartFile;

@Component
@OutboundConnector(
    name = "UploadToAlfresco",
    inputVariables = {"files", "filesNames", "idProceso"},
    type = "io.camunda:upload-document:1")
public class Base64Function implements OutboundConnectorFunction {
  //	@Autowired
  //	private ProcesarDocumentos procesarDocumentos;

  //	@Autowired
  //	@Qualifier("cmisService")
  private CmisService cmisService;

  @Autowired
  public Base64Function(CmisService cmisService ) {
  	this.cmisService = cmisService;
  }
  //	@PostConstruct
  //    void init() {
  //    }

  private static final Logger LOGGER = LoggerFactory.getLogger(Base64Function.class);

  @Override
  public Object execute(OutboundConnectorContext context) throws Exception {
    LOGGER.info("this: {}",this.cmisService);
    var connectorRequest = context.bindVariables(Base64Request.class);
    return executeConnector(connectorRequest);
  }

  private Base64Result executeConnector(final Base64Request connectorRequest) throws IOException {

    LOGGER.info("Executing my connector alfresco with request");
    LOGGER.info("String: {}", connectorRequest.toString());
    LOGGER.info("this: {}",this.cmisService);
    String[] filesNames = connectorRequest.getFilesNames();
    byte[][] files = connectorRequest.getFiles();
    Long idProceso = connectorRequest.getIdProceso();
    List<MultipartFile> multipartFiles = convertBytesToMultipartFiles(files, filesNames);

    if (null != multipartFiles && multipartFiles.size() > 0) {
      for (MultipartFile multipartFile : multipartFiles) {
        String fileName = multipartFile.getOriginalFilename();
        LOGGER.info("filename: {}", fileName);
        LOGGER.info("inputstream: {}", multipartFile.getInputStream());
        try {
          // Document docCreated=cmisService.uploadDocumentToAlfresco( fileName,  multipartFile,
          // idProceso );

        } catch (Exception e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
        }
      }
    }
    var result = new Base64Result();
    LOGGER.info("getting out of connector");
    return result;
  }

  private List<MultipartFile> convertBytesToMultipartFiles(
      byte[][] fileBytesArray, String[] fileNamesArray) {
    List<MultipartFile> recreatedFiles = new ArrayList<>();
    for (int i = 0; i < fileBytesArray.length; i++) {
      CustomMultipartFile mockMultipartFile =
          new CustomMultipartFile(fileBytesArray[i], fileNamesArray[i], fileNamesArray[i]);
      recreatedFiles.add(mockMultipartFile);
    }
    return recreatedFiles;
  }
}

spring.factories content:

org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
io.camunda.connector.runtime.OutboundConnectorsAutoConfiguration

org.springframework.boot.autoconfigure.AutoConfiguration.imports content:
io.camunda.connector.runtime.OutboundConnectorsAutoConfiguration

ConnectorProperties.java I left it how it was in the repository

OutboundConnectorsAutoConfiguration.java is like this:

package io.camunda.connector.runtime;

import com.fasterxml.jackson.databind.ObjectMapper;
import io.camunda.connector.api.json.ConnectorsObjectMapperSupplier;
import io.camunda.connector.api.secret.SecretProvider;
import io.camunda.connector.feel.FeelEngineWrapper;
import io.camunda.connector.runtime.core.secret.SecretProviderAggregator;
import io.camunda.connector.runtime.core.secret.SecretProviderDiscovery;
import io.camunda.connector.runtime.env.SpringEnvironmentSecretProvider;
import io.camunda.connector.runtime.outbound.OutboundConnectorRuntimeConfiguration;
import io.camunda.impl.CmisService;
import io.camunda.interfaces.ICmisService;

import java.util.LinkedList;
import java.util.List;
import java.util.Optional;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Import;
import org.springframework.core.env.Environment;

@AutoConfiguration
@AutoConfigureBefore(JacksonAutoConfiguration.class)
//@Import(OutboundConnectorRuntimeConfiguration.class)
@EnableConfigurationProperties(ConnectorProperties.class)
public class OutboundConnectorsAutoConfiguration {

  @Value("${camunda.connector.secretprovider.discovery.enabled:true}")
  Boolean secretProviderLookupEnabled;

  @Value("${camunda.connector.secretprovider.environment.prefix:}")
  String environmentSecretProviderPrefix;

  private static final Logger LOG =
      LoggerFactory.getLogger(OutboundConnectorsAutoConfiguration.class);

  @Bean
  @ConditionalOnMissingBean
  public ObjectMapper objectMapper() {
    return ConnectorsObjectMapperSupplier.getCopy();
  }
}

i am using this pom:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <name>document-base64-api</name>
  <description>Gets information from base 64</description>
  <groupId>io.camunda.connector</groupId>
  <artifactId>document-base64-api</artifactId>
  <packaging>jar</packaging>
  <version>0.1.0-SNAPSHOT</version>

  <parent>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-parent</artifactId>
		<version>3.1.3</version>
		<relativePath />
	</parent>

  <properties>
    <maven.compiler.release>17</maven.compiler.release>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

    <!-- connector SDK version -->
    <version.connector-core>8.3.1</version.connector-core>

    <!-- external libraries -->
    <version.assertj>3.23.1</version.assertj>
    <version.junit-jupiter>5.9.0</version.junit-jupiter>
    <version.mockito>4.7.0</version.mockito>
    <version.slf4j>1.7.36</version.slf4j>

    <!-- maven plugins -->
    <plugin.version.maven-clean-plugin>3.2.0</plugin.version.maven-clean-plugin>
    <plugin.version.maven-compiler-plugin>3.10.1</plugin.version.maven-compiler-plugin>
    <plugin.version.maven-dependency-plugin>3.3.0</plugin.version.maven-dependency-plugin>
    <plugin.version.maven-install-plugin>3.0.1</plugin.version.maven-install-plugin>
    <plugin.version.maven-jar-plugin>3.3.0</plugin.version.maven-jar-plugin>
    <plugin.version.maven-resources-plugin>3.3.0</plugin.version.maven-resources-plugin>
    <plugin.version.maven-surefire-plugin>3.0.0-M7</plugin.version.maven-surefire-plugin>
    <version.google-libraries-bom>26.25.0</version.google-libraries-bom>
  </properties>

<dependencyManagement>
    <dependencies>
      <!-- Third party dependencies -->
      <dependency>
        <groupId>com.google.cloud</groupId>
        <artifactId>libraries-bom</artifactId>
        <version>${version.google-libraries-bom}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>


  <dependencies>

  <dependency>
      <groupId>com.google.cloud</groupId>
      <artifactId>google-cloud-secretmanager</artifactId>
    </dependency>
	  <dependency>
      <groupId>com.co.igg.catastro.common</groupId>
      <artifactId>igg-catastro-common</artifactId>
      <version>0.0.1-SNAPSHOT</version>
    </dependency>

    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter</artifactId>
    </dependency>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
	
    <dependency>
      <groupId>io.camunda.connector</groupId>
      <artifactId>connector-core</artifactId>
      <version>${version.connector-core}</version>
    </dependency>
    <dependency>
      <groupId>io.camunda.connector</groupId>
      <artifactId>connector-validation</artifactId>
      <version>${version.connector-core}</version>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
    </dependency>
	<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind -->
	<dependency>
	    <groupId>com.fasterxml.jackson.core</groupId>
	    <artifactId>jackson-databind</artifactId>
	</dependency>

    <!-- test dependencies -->
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-junit-jupiter</artifactId>
      <scope>test</scope>
    </dependency>
    
    <dependency>
      <groupId>org.assertj</groupId>
      <artifactId>assertj-core</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
		<groupId>org.apache.chemistry.opencmis</groupId>
		<artifactId>chemistry-opencmis-client-impl</artifactId>
		<version>1.1.0</version>
	</dependency>
	<dependency>
		<groupId>org.apache.tika</groupId>
		<artifactId>tika-core</artifactId>
		<version>1.18</version>
	</dependency>
<dependency>
			<groupId>org.apache.httpcomponents</groupId>
			<artifactId>httpclient</artifactId>
			<version>4.5.14</version>
		</dependency>	

	
<dependency>
			<groupId>org.apache.poi</groupId>
			<artifactId>poi</artifactId>
			<version>5.2.3</version>
		</dependency>
		<dependency>
			<groupId>org.apache.poi</groupId>
			<artifactId>poi-ooxml</artifactId>
			<version>5.2.3</version>
		</dependency>
		<dependency>
			<groupId>com.co.igg.catastro</groupId>
			<artifactId>igg-catastro-alfresco-upload</artifactId>
			<version>1.0.0-SNAPSHOT</version>
		</dependency>


    <dependency>
      <groupId>io.camunda.connector</groupId>
      <artifactId>connector-runtime-spring</artifactId>
      <version>8.3.1</version>
    </dependency>
    <dependency>
      <groupId>io.camunda.spring</groupId>
      <artifactId>spring-boot-starter-camunda</artifactId>
      <version>8.3.1</version>
      <exclusions>
        <exclusion>
          <groupId>org.springframework.boot</groupId>
          <artifactId>spring-boot-starter</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>io.camunda</groupId>
      <artifactId>camunda-operate-client-java</artifactId>
      <version>8.3.0.1</version>

    </dependency>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-actuator</artifactId>
    </dependency>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-configuration-processor</artifactId>
      <optional>true</optional>
    </dependency>
  </dependencies>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-clean-plugin</artifactId>
          <version>${plugin.version.maven-clean-plugin}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-dependency-plugin</artifactId>
          <version>${plugin.version.maven-dependency-plugin}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-resources-plugin</artifactId>
          <version>${plugin.version.maven-resources-plugin}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>${plugin.version.maven-compiler-plugin}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jar-plugin</artifactId>
          <version>${plugin.version.maven-jar-plugin}</version>
          <configuration>
            <useDefaultManifestFile>false</useDefaultManifestFile>    
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-install-plugin</artifactId>
          <version>${plugin.version.maven-install-plugin}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>${plugin.version.maven-surefire-plugin}</version>
        </plugin>
        <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <configuration>
          <mainClass>io.camunda.connector.bundle.ConnectorRuntimeApplication</mainClass>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-shade-plugin</artifactId>
        <dependencies>
          <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
            <version>${version.spring-boot}</version>
          </dependency>
        </dependencies>
        <configuration>
          <shadedArtifactAttached>true</shadedArtifactAttached>
          <shadedClassifierName>with-dependencies</shadedClassifierName>
          <!-- no need for this since we are not consuming this artifact downstream -->
          <createDependencyReducedPom>false</createDependencyReducedPom>
          <transformers>
            <!-- This is needed if you have dependencies that use Service Loader. Most Google Cloud client libraries does. -->
            <transformer
              implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
            <!-- This is needed to not repeat licenses in the META-INF directory -->
            <transformer
              implementation="org.apache.maven.plugins.shade.resource.ApacheLicenseResourceTransformer"/>
            <!-- This is needed to merge existing NOTICE files and keep them downstream -->
            <transformer
              implementation="org.apache.maven.plugins.shade.resource.ApacheNoticeResourceTransformer">
              <addHeader>false</addHeader>
            </transformer>
            <transformer
              implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
              <resource>META-INF/spring.handlers</resource>
            </transformer>
            <transformer
              implementation="org.springframework.boot.maven.PropertiesMergingResourceTransformer">
              <resource>META-INF/spring.factories</resource>
            </transformer>
            <transformer
              implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
              <resource>META-INF/spring-autoconfigure-metadata.properties</resource>
            </transformer>
            <transformer
              implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
              <resource>
                META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
              </resource>
            </transformer>
            <transformer
              implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
              <resource>META-INF/spring.schemas</resource>
            </transformer>
            <transformer
              implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
              <resource>META-INF/additional-spring-configuration-metadata.json</resource>
            </transformer>
            <transformer
              implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
              <resource>META-INF/spring.tooling</resource>
            </transformer>
            <transformer
              implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
              <resource>META-INF/spring-configuration-metadata.json</resource>
            </transformer>
            <transformer
              implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
              <resource>META-INF/io.netty.versions.properties</resource>
            </transformer>
            <transformer
              implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
              <mainClass>io.camunda.connector.bundle.ConnectorRuntimeApplication</mainClass>
            </transformer>
          </transformers>
        </configuration>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      </plugins>
    </pluginManagement>
  </build>

  <repositories>
    <repository>
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
      <id>connectors</id>
      <name>Connectors Repository</name>
      <url>https://artifacts.camunda.com/artifactory/connectors/</url>
    </repository>

    <repository>
      <releases>
        <enabled>false</enabled>
      </releases>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
      <id>connectors-snapshots</id>
      <name>Connectors Snapshot Repository</name>
      <url>https://artifacts.camunda.com/artifactory/connectors-snapshots/</url>
    </repository>
  </repositories>

</project>

I see that the most recent stable version is 8.3.1 so i am using that one.

I dont have a main class. should i have one?

So could you please tell me what i am doing wrong and how could i use that alfresco sevice?

Hi @Juan_Felipe_Parrado
You’re using spring boot 3.x, so you can delete the spring.factories file. This is not evaluated anymore. The new way for autoconfiguration in spring boot 3.x is the file org.springframework.boot.autoconfigure.AutoConfiguration.imports which you also have.
Please use the dependency

  <groupId>io.camunda.connector</groupId>
  <artifactId>spring-boot-starter-camunda-connectors</artifactId>

That should autoconfigure the outbound connectors from annotated spring beans. It seems somehow your application is still trying to directly instantiate the outbound connector.

Hi @rohwerj i did as you said deleting that file spring.factories and adding the dependency that you suggested.
it shows me this error


This is the link of the repository GitHub - jfparrado/connectors
i really appreciate your help

Please use the same version as for the connector runtime and zeebe for this dependency.
Should be version 8.3.1 but is 0.23.0 in the pom.xml

i just tried it like that but i am receiving the same error

Checkout your example and got it to work.
First of your spring boot application should look like this:

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

And very important move it away from the package io.camunda. Otherwise all components from that package and subpackages will be discovered by the component scan (which includes a lot of components from the zeebe dependencies).
Use your own package e.g. com.co.igg.catastro.connector, if that is your normal package naming.
Then throw away the package config (the configuration is done via component scan anyways).
And also delete the package connector.runtime (those configurations are provided by the spring-boot-starter-camunda-connectors). And also delete the META-INF/spring directory.

the project looks like this
image
image
i moved the main class.
i deleted connector runtime, config and META-INF…
but when i run it i still got this


I have the repository updated with these changes.
Do you have the one that you made work in a repository by any chance?

Yes I can also provide that in my own repository later.
But what I meant is, that you have to move all your classes. In my IDE it looks like this:
image

And I have only the following dependencies in regards of Camunda (meaning io.camunda groupId)

    <dependency>
      <groupId>io.camunda.spring</groupId>
      <artifactId>spring-boot-starter-camunda</artifactId>
      <version>8.3.1</version>
      <exclusions>
        <exclusion>
          <groupId>org.springframework.boot</groupId>
          <artifactId>spring-boot-starter</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

    <dependency>
      <groupId>io.camunda.connector</groupId>
      <artifactId>spring-boot-starter-camunda-connectors</artifactId>
      <version>${version.connector-core}</version>
    </dependency>
    
    <dependency>
      <groupId>io.camunda</groupId>
      <artifactId>camunda-operate-client-java</artifactId>
      <version>8.3.0.1</version>
    </dependency>

The other dependencies (connector-core, connector-validation and connector-runtime-spring) will be pulled in by the spring boot starter (spring-boot-starter-camunda-connectors).

i tried it, moved it as you said and changed the dependencies but i got the same. could you please share your repository?

Had to put some dummy entity classes there to let it run.
It now fails while connecting to zeebe cluster, as the client is unauthorized.
But no problem in creating the application context.

1 Like