You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by sheng <sh...@yahoo.com.cn> on 2010/03/24 09:53:10 UTC
An Error in ComponentConfig.java
When we set webApp with some init parameters like this,
<webapp name="ecommerce"
title="eCommerce"
server="default-server"
location="webapp/ecommerce"
mount-point="/ecommerce"
app-bar-display="false">
<init-param name="appImage" value="/imgs/app1.jpg"/>
</webapp>
we will found it does not work.
Maybe an error in ComponentConfig.java(trunk version) results in this.
http://svn.apache.org/repos/asf/ofbiz/trunk/framework/base/src/org/ofbiz/base/component/ComponentConfig.java
We read the following lines(line 770 ~ 776) in ComponentConfig.java:
// load the init parameters
List<? extends Element> initParamList = UtilXml.childElementList(element, "init-param");
if (UtilValidate.isNotEmpty(initParamList)) {
for (Element e: virtHostList) {
this.initParameters.put(e.getAttribute("name"), e.getAttribute("value"));
}
}
The variable "virtHostList" should be "initParamList" here.
We can get it to work after doing this now. Please tell me if there is anything I have not considered.
Regards,
Qin Sheng
Re: An Error in ComponentConfig.java
Posted by Jacques Le Roux <ja...@les7arts.com>.
Thanks Sheng,
This wrong C/P was introduced by r585750 and is fixed at r928470 in trunk and r928471 in R9.04
Jacques
From: "sheng" <sh...@yahoo.com.cn>
> When we set webApp with some init parameters like this,
>
> <webapp name="ecommerce"
> title="eCommerce"
> server="default-server"
> location="webapp/ecommerce"
> mount-point="/ecommerce"
> app-bar-display="false">
> <init-param name="appImage" value="/imgs/app1.jpg"/>
> </webapp>
>
> we will found it does not work.
>
> Maybe an error in ComponentConfig.java(trunk version) results in this.
> http://svn.apache.org/repos/asf/ofbiz/trunk/framework/base/src/org/ofbiz/base/component/ComponentConfig.java
>
> We read the following lines(line 770 ~ 776) in ComponentConfig.java:
>
> // load the init parameters
> List<? extends Element> initParamList = UtilXml.childElementList(element, "init-param");
> if (UtilValidate.isNotEmpty(initParamList)) {
> for (Element e: virtHostList) {
> this.initParameters.put(e.getAttribute("name"), e.getAttribute("value"));
> }
> }
>
> The variable "virtHostList" should be "initParamList" here.
> We can get it to work after doing this now. Please tell me if there is anything I have not considered.
>
> Regards,
> Qin Sheng
>
>
>
>
>
>