[MAGNOLIA-1287] weblogic: properties loading fails Created: 22/Dec/06  Updated: 23/Jan/13  Resolved: 22/Dec/06

Status: Closed
Project: Magnolia
Component/s: None
Affects Version/s: 3.0.1
Fix Version/s: 3.0.2

Type: Bug Priority: Major
Reporter: Philipp Bärfuss Assignee: Philipp Bärfuss
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

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
Date of First Response:

 Description   

From the dev list:

I think I finally figured out what was happening here.

If we take a look at the contextInitialized method of the PropertyInitializer class we'll start to see...

public void contextInitialized(ServletContextEvent sce) {
final ServletContext context = sce.getServletContext();

loadBeanProperties();

loadModuleProperties();
....

When we call loadModuleProperties, we end up call ModuleRegistration.getInstance.getModuleDefinitions, and this calls ModuleRegistration.init() which calls readModuleDefinitions.

Now readModuleDefinitions calls ClasspathResourceUtils.findResources.

Here we check to see if we have a URLClassLoader. Apparently with WLS 9.2, we do not.

So, we call Path.getAbsoluteFileSystemPath which eventually tries to get this property:

SystemProperty.getProperty(SystemProperty.MAGNOLIA_APP_ROOTDIR);

However, I found that this property has not been set.

So, I tweaked the PropertyInitializer class to update the contextInitialized method to call initRootPath.

However, this only sets the MAGNOLIA_APP_ROOTDIR property in the local instance, so I also added to the SystemPropety static instance while I was there.

I see there is also a overloadWithSystemProperties method I could have used too. I'm not sure if this is the best way to fix it, or if I'm looking at all this right. However, the magnolia application now deploys successfully for me.



 Comments   
Comment by Philipp Bracher [ 22/Dec/06 ]

I do now first initialize the servername, rootpath, and webapp property. I changed the code so that all properties are imediately set in the magnolia SystemProperty

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