You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by Nicolas Malin <ni...@nereide.fr> on 2018/08/01 19:11:05 UTC

Re: Empty parameter on service engine

Hi Jacques,

Analyze parameters from the engine name didn't enter in my mind as 
possible solution :)

I will prepare an issue with my first proposal this change isn't a big 
deal and haven't impact.

Nicolas


On 31/07/2018 07:21, Jacques Le Roux wrote:
> Hi Nicolas,
>
> Maybe to preserve the previous behaviour we can make this change 
> dependent of the engine name?
>
> So would be something like (putting "rest" in lowercase in the name 
> being a convention)
>
>         if (value.isEmpty() && name.contains("rest")) {
>             Debug.logWarning("<parameter name=\"" + name + "\"> 
> element value attribute is empty", module);
>         }
>
> Not sure it's really needed...
>
> Jacques
>
>
> Le 30/07/2018 à 10:54, Nicolas Malin a écrit :
>> Hello,
>>
>> I discovered a conflict with the management of service engine 
>> parameters and how I want to use them :)
>>
>> I created a new engine to call rest service for a specific case with 
>> different parameters on the engine definition for a customer site. I 
>> have different OFBiz environments where my parameters value change :
>>
>>         <engine name="rest-api-serveur-one" 
>> class="com.customersite.service.engine.RestClientApiEngine">
>>             <parameter name="authUrl" value="MyOaut2Server"/>...
>>             <parameter name="apiKey" value="04bdeada5093"/>
>>         </engine>
>>
>> But on one environment, I need to put one parameter value to empty. 
>> The problem in the code base 
>> org.apache.ofbiz.service.config.model.Parameter.java:41 :
>>
>>         if (value.isEmpty()) {
>>             throw new ServiceConfigException("<parameter> element 
>> value attribute is empty");
>>         }
>>
>> So when ofbiz start, this instance failed because an empty parameters 
>> is considers as fatal for the server. I suggest to just inform that 
>> the parameter is empty instead of stop the server loading :
>>
>>         if (value.isEmpty()) {
>>             Debug.logWarning("<parameter name=\"" + name + "\"> 
>> element value attribute is empty", module);
>>         }
>>
>> Do you have an opinion ?
>>
>> Nicolas
>> -- 
>> logoNrd <https://nereide.fr/>
>>     Nicolas Malin
>> The apache way <http://theapacheway.com/> : *Charity* Apache’s 
>> mission is providing software for the public good.
>> information@nereide.fr
>> 8 rue des Déportés 37000 TOURS, 02 47 50 30 54
>>
>> Apache OFBiz <http://ofbiz.apache.org/>|The Apache Way 
>> <http://theapacheway.com/>|réseau LE <http://www.libre-entreprise.org/>
>>
>
>