-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
5.4
Currently, modules do things like
String magnoliaHome = MagnoliaConfigurationProperties.getProperty("magnolia.home"); configSourceFactory.yaml().from(Paths.get(magnoliaHome))
If magnolia.home is not defined, this throws the ugly exception below. There are several things we could do:
- pass a String of the path to configSourceFactory instead of a Path instance.
- pass the name of the property, and let configSourceFactory call MagnoliaConfigurationProperties
- add method to MagnoliaConfigurationProperties to get a Path instance from a property name (can check for existence and it being a directory)
- add getMagnoliaHome() to MagnoliaInitPaths and make this property a first class citizen. This could also ensure that even if the property isn't defined, we fallback to app-root-dir (rather than relying on the fact that the property exists with its default value, which is indeed ${magnolia.app.rootdir}
I would tend to favor #4, but there are perhaps more ideas (and/or combinations thereof). Let's update the title of this issue once we decide.
[INFO] [talledLocalContainer] 2015-03-04 11:18:22,784 ERROR info.magnolia.module.ModuleManagerImpl : Can't start module ui-framework [INFO] [talledLocalContainer] java.lang.NullPointerException [INFO] [talledLocalContainer] at sun.nio.fs.UnixPath.normalizeAndCheck(UnixPath.java:77) [INFO] [talledLocalContainer] at sun.nio.fs.UnixPath.<init>(UnixPath.java:71) [INFO] [talledLocalContainer] at sun.nio.fs.UnixFileSystem.getPath(UnixFileSystem.java:281) [INFO] [talledLocalContainer] at java.nio.file.Paths.get(Paths.java:84) [INFO] [talledLocalContainer] at info.magnolia.ui.framework.UiFrameworkModule.start(UiFrameworkModule.java:84)
Acceptance criteria
- relates to
-
MAGNOLIA-6095 Check if default settings for YamlConfigSourceBuilder could include the magnolia.home path pre-set as default.
- Open