Unable to start connect app with mongodb dependency

Hi!

I’m developing connect app for Jira cloud with spring and wanted to use MongoDB as a kind of plugin-only database, but I cannot start the app after adding spring-boot-starter-data-mongodb to my pom.xml.

The error is:

atlassian-connect-spring-boot requires a bean of type 'com.atlassian.connect.spring.AtlassianHostRepository' that could not be found. This repository is used for storing installation data.

As far as I know, the class exists and spring only seems to fail to find it after I add the dependency.
Any help would be appreciated.

Kind regards,
Piotr

@PiotrZieliski, the full error message looks like this.

***************************
APPLICATION FAILED TO START
***************************

Description:

atlassian-connect-spring-boot requires a bean of type 'com.atlassian.connect.spring.AtlassianHostRepository' that could not be found. This repository is used for storing installation data.

Action:

Choose a Spring Data implementation to use with AtlassianHostRepository, and enable Repository scanning with the appropriate @Enable${store}Repositories annotation. If you choose Spring Data JPA, consider using atlassian-connect-spring-boot-jpa-starter.

Did you perform the recommended action (or did you already have that in place)?

We just so happen to have a minimal test project using that Spring Data Starter, so I know that this works in the case of MongoDB. See MongoAddonApplication and the simple POM for that module.

1 Like

Not sure if I had the same problem back then, but I have added an own dummy implementation like that:

package com.duplicateai.data.orga.repo;
import org.springframework.stereotype.Repository;
import com.atlassian.connect.spring.AtlassianHostRepository;

@Repository
public interface DummyAtlassianHostRepository extends AtlassianHostRepository {
}

… and then enabled the mongo repos with @EnableMongoRepositories

@SpringBootApplication
@ComponentScan(basePackages = "com.duplicateai")
@EnableMongoRepositories(basePackages = {"com.duplicateai.data", "com.duplicateai.quickbrainadapter"})
public class BackendApplication {
    public static void main(String[] args) throws Exception {
        new SpringApplication(BackendApplication.class).run(args);
    }    
}
1 Like