[MAGNOLIA-3916] Magnolia 4.5 resources exception during startup on Jboss Created: 15/Dec/11  Updated: 13/Mar/12  Resolved: 04/Jan/12

Status: Closed
Project: Magnolia
Component/s: core
Affects Version/s: 4.5
Fix Version/s: 4.5

Type: Bug Priority: Neutral
Reporter: Eric Hechinger Assignee: Eric Hechinger
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Jboss AS 5.1 / 6.1


Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled

 Description   

During Magnolia startUp, the application is not deployed due to the following exception:

2011-12-12 10:38:30,888 INFO [STDOUT] (main) 2011-12-12 10:38:30,887 WARN info.magnolia.cms.util.ClasspathResourcesUtil : Looks like we're in a JBoss 5 expanded war directory, will attempt to load resources from the file system instead; see MAGNOLIA-2577.
2011-12-12 10:38:31,149 INFO [STDOUT] (main) 2011-12-12 10:38:31,125 ERROR info.magnolia.init.MagnoliaServletContextListener : Oops, Magnolia could not be started
java.lang.NullPointerException
at java.io.File.<init>(File.java:222)
at info.magnolia.cms.core.Path.getAppRootDir(Path.java:125)
at info.magnolia.cms.core.Path.getAbsoluteFileSystemPath(Path.java:155)
at info.magnolia.cms.util.ClasspathResourcesUtil.collectFromFileSystem(ClasspathResourcesUtil.java:180)
at info.magnolia.cms.util.ClasspathResourcesUtil.findResources(ClasspathResourcesUtil.java:156)
at info.magnolia.module.model.reader.BetwixtModuleDefinitionReader.findModuleDescriptors(BetwixtModuleDefinitionReader.java:115)
at info.magnolia.module.model.reader.BetwixtModuleDefinitionReader.readAll(BetwixtModuleDefinitionReader.java:104)
at info.magnolia.module.ModuleManagerImpl.loadDefinitions(ModuleManagerImpl.java:144)
at info.magnolia.init.MagnoliaServletContextListener.contextInitialized(MagnoliaServletContextListener.java:178)



 Comments   
Comment by Eric Hechinger [ 15/Dec/11 ]

In:
MagnoliaServletContextListener.contextInitialized(…)
Step 1:
// Load module definitions
moduleManager = platform.getComponent(ModuleManager.class);
moduleManager.loadDefinitions();
Step 2:
// Initialize MagnoliaConfigurationProperties
MagnoliaConfigurationProperties configurationProperties = platform.getComponent(MagnoliaConfigurationProperties.class);
configurationProperties.init();

During Step1 in case of Jboss AS, a call to
Path.getAbsoluteFileSystemPath("WEB-INF/lib")
is performed. At this time, SystemProperty is not yet initialized, and we get a null pointer Exception when trying to access SystemProperty.getProperty(SystemProperty.MAGNOLIA_APP_ROOTDIR
These properties are initialized in Step2.

Comment by Eric Hechinger [ 04/Jan/12 ]

In ClasspathResourceUtil.class
Access the rootDire using
Components.getComponent(MagnoliaInitPaths.class).getRootPath();
instead of Path.getAbsoluteFileSystemPath(...

Comment by Eric Hechinger [ 04/Jan/12 ]

Impl Done

Generated at Mon Feb 12 03:50:55 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.