Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I'm getting this error while starting data loader application , I'v done all config and code in video 8 https://www.youtube.com/watch?v=uezZIPK8kPk&list=PLJ5_m4Y8xLkkxfo2Z1Lb0qjXnAZqIWCCZ&index=8 #6

Open
Feras1995 opened this issue Jul 4, 2022 · 2 comments

Comments

@Feras1995
Copy link

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
٢٠٢٢-٠٧-٠٤ ١٩:١٠:١٥.٨١٥ ERROR 12676 --- [ restartedMain] o.s.b.d.LoggingFailureAnalysisReporter :


APPLICATION FAILED TO START


Description:

The dependencies of some of the beans in the application context form a cycle:

┌─────┐
| betterReadDataLoaderApplication (field io.betterRead.author.AuthorRepository io.betterRead.BetterReadDataLoaderApplication.authorRepository)
↑ ↓
| authorRepository defined in io.betterRead.author.AuthorRepository defined in @EnableCassandraRepositories declared on CassandraRepositoriesRegistrar.EnableCassandraRepositoriesConfiguration
↑ ↓
| org.springframework.boot.autoconfigure.data.cassandra.CassandraDataAutoConfiguration
↑ ↓
| cassandraSession defined in class path resource [org/springframework/boot/autoconfigure/cassandra/CassandraAutoConfiguration.class]
↑ ↓
| cassandraSessionBuilder defined in class path resource [org/springframework/boot/autoconfigure/cassandra/CassandraAutoConfiguration.class]
└─────┘

Action:

Relying upon circular references is discouraged and they are prohibited by default. Update your application to remove the dependency cycle between beans. As a last resort, it may be possible to break the cycle automatically by setting spring.main.allow-circular-references to true.

image

@rafterco
Copy link

hi @Feras1995 I'm getting the same error - did you manage to figure this out?

My folder sturcutre looks like this:

.
├── HELP.md
├── betterreads-data-loader.iml
├── mvnw
├── mvnw.cmd
├── pom.xml
├── src
│   ├── main
│   │   ├── java
│   │   │   └── com
│   │   │   └── betterreads
│   │   │   └── data
│   │   │   ├── author
│   │   │   │   ├── Author.java
│   │   │   │   └── AuthorRepository.java
│   │   │   ├── connection
│   │   │   │   └── DataStaxAstraProperties.java
│   │   │   └── loader
│   │   │   └── BetterReadsApplication.java
│   │   └── resources
│   │   ├── application.yml
│   │   └── secure-connect.zip

@rafterco
Copy link

This isn't the best solution but it does mean you can progress with the course.
I'd love to understand how to fix this properly.

Add allow-circlular-references: true to the yaml file.


spring:
  main:
    allow-circular-references: true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants