Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Jira
serverMagnolia - Issue tracker
serverId500b06a6-e204-3125-b989-2d75b973d05f
keyDEV-124

...

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. 

...