bertramdev / asset-pipeline

The core implementation of the asset pipeline for the jvm
192 stars 90 forks source link

Circular Dependency #293

Closed wuwu2000 closed 2 years ago

wuwu2000 commented 2 years ago

Hi, asset.pipeline.grails.CachingLinkGenerator has def assetProcessorService as property.

asset.pipeline.grails.AssetProcessorService has

    @Resource
    grails.web.mapping.LinkGenerator grailsLinkGenerator

as property. When I deploy my application after building with gradlew assemble I get following error:

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.

--
 Action:

└─────┘
|  assetProcessorService
 ↑     ↓
|  grailsLinkGenerator
 ┌─────┐
.....

Caused by: org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'grailsLinkGenerator': Requested bean is currently in creation: Is there an unresolvable circular reference?

grailsVersion = 5.1.0 assetVersion = 3.3.6

wuwu2000 commented 2 years ago

This issue might just be a false-flagged product of https://github.com/grails/grails-core/issues/12346