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

Remove unneeded grailsLinkGenerator already created by grails-plugin-url-mappings #362

Merged

Conversation

codeconsole
Copy link
Contributor

@codeconsole codeconsole commented Nov 21, 2024

I am not sure why it is there in the first place?

Overriding bean definition for bean 'grailsLinkGenerator' with a different definition: replacing [Root bean: class=null; scope=; abstract=false; lazyInit=null; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; fallback=false; factoryBeanName=org.grails.plugins.web.mapping.UrlMappingsAutoConfiguration; factoryMethodName=grailsLinkGenerator; initMethodNames=null; destroyMethodNames=[(inferred)]; defined in class path resource [org/grails/plugins/web/mapping/UrlMappingsAutoConfiguration.class]] with [Generic bean: class=asset.pipeline.grails.CachingLinkGenerator; scope=singleton; abstract=false; lazyInit=false; autowireMode=1; dependencyCheck=0; autowireCandidate=true; primary=false; fallback=false; factoryBeanName=null; factoryMethodName=null; initMethodNames=null; destroyMethodNames=null]

@codeconsole
Copy link
Contributor Author

#361

@davydotcom
Copy link
Contributor

This is used in AssetProcessorService for resolving assets dynamically for reference as links in the various taglibs. It has to be exist to deal with differences between development and production resolution

@codeconsole
Copy link
Contributor Author

@davydotcom

grailsLinkGenerator is created by the UrlMappingsPlugin

The asset-pipeline-grails depends on grails-plugin-url-mappings

implementation("org.grails:grails-plugin-url-mappings")

grails-plugin-url-mappings creates grailsLinkGenerator so this code is creating it a second time

grailsLinkGenerator(cacheUrls ? CachingLinkGenerator : LinkGenerator, serverURL) { bean ->
bean.autowire = true
}

which causes:

Overriding bean definition for bean 'grailsLinkGenerator' with a different definition: replacing [Root bean: class=null; scope=; abstract=false; lazyInit=null; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; fallback=false; factoryBeanName=org.grails.plugins.web.mapping.UrlMappingsAutoConfiguration; factoryMethodName=grailsLinkGenerator; initMethodNames=null; destroyMethodNames=[(inferred)]; defined in class path resource [org/grails/plugins/web/mapping/UrlMappingsAutoConfiguration.class]] with [Generic bean: class=asset.pipeline.grails.CachingLinkGenerator; scope=singleton; abstract=false; lazyInit=false; autowireMode=1; dependencyCheck=0; autowireCandidate=true; primary=false; fallback=false; factoryBeanName=null; factoryMethodName=null; initMethodNames=null; destroyMethodNames=null]

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

Successfully merging this pull request may close these issues.

2 participants