An Error in ComponentConfig.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

An Error in ComponentConfig.java

sheng
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





Reply | Threaded
Open this post in threaded view
|

Re: An Error in ComponentConfig.java

Jacques Le Roux
Administrator
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" <[hidden email]>

> 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
>
>
>
>      
>
>