Page History
Table of Contents |
---|
Jira | ||||||
---|---|---|---|---|---|---|
|
...
The Groovy module replaces Magnolia's DefaultClassFactory
with its GroovyClassFactory
which internally delegates loading the Groovy source files to MgnlGroovyResourceLoader#loadGroovySource(..).
The latter is therefore called very early during Magnolia startup (it is indeed called internally by the GroovyClassLoader
) when ResourceOrigin
(the entry point for clients of the Resources API) is not ready yet. That would cause a ComponentNotFoundException
when NoSuchComponentException
when trying to get hold of ResourceOrigin
via Components.getComponent(..)
.
Solution in PoC consists in using a ResourceOriginProvider
and skip Groovy resources loading as long as the provider is null. This seems to be safe as during Magnolia's early startup phase there are no Groovy scripts/classes to be instantiated and the loading of Java classes needed by Magnolia is delegated to the parent class loader.
...