You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using @Profile with @PostConstruct, I see the following error saying, there is a circular dependency. This error is not correct as there is no circular dependency.
Error info
The dependencies of some of the beans in the application context form a cycle:
application (field private com.truncated.---ExtractService)
↓
----Service defined in file [/truncated/service/----Service.class]
↓
s3Helper defined in file [/truncated/S3Helper.class]
┌─────┐
| awsLocalConfig
└─────┘
S3Helper.java class uses s3Client bean.
Working spring version: 2.5.8
Failing spring version: 2.6.6
Failing code
Project contains both AwsLocalConfig.java and AwsConfig.java
Local config
Creates S3Client and sets up s3 bucket locally using @PostConstruct
Seems like this issue with already raised in spring-framework here -> spring-projects/spring-framework#27876. So closing out, since this is a duplicate.
Bug description
Summary
When using
@Profile
with@PostConstruct
, I see the following error saying, there is a circular dependency. This error is not correct as there is no circular dependency.Error info
S3Helper.java
class usess3Client
bean.Working spring version: 2.5.8
Failing spring version: 2.6.6
Failing code
Project contains both
AwsLocalConfig.java
andAwsConfig.java
Local config
Creates S3Client and sets up s3 bucket locally using
@PostConstruct
Non local config (dev/qa/stg/prod)
Creates S3Client bean and project starts up without issues as there is no usage of
@PostConstruct
.Temporary Solution
Not using
@PostConstruct
and callingprepareLocalStackResources()
insides3ClientBasicCredentials()
bean creation method.The text was updated successfully, but these errors were encountered: