You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by Jacques Le Roux <ja...@free.fr> on 2014/04/24 10:18:06 UTC

Re: svn commit: r1589562 - /ofbiz/trunk/framework/start/src/org/ofbiz/base/start/Config.java

Hi Hans,

Did you cross this issue using the portoffset parameters?

This sounds weird to me because you should get there only in this case. And when using a positive non zero parameter (a zero parameter does not make 
sense), your change breaks the portoffset code

I could use
     adminPort = adminPort >= 0 ? adminPort : 10523; // This is necessary because the ASF machines don't allow ports 1 to 3, see INFRA-6790
But I prefer to clarify the issue you crossed before

Jacques

Le 24/04/2014 05:57, hansbak@apache.org a écrit :
> Author: hansbak
> Date: Thu Apr 24 03:57:06 2014
> New Revision: 1589562
>
> URL: http://svn.apache.org/r1589562
> Log:
> adminport in start.properties was ignored. fixed
>
> Modified:
>      ofbiz/trunk/framework/start/src/org/ofbiz/base/start/Config.java
>
> Modified: ofbiz/trunk/framework/start/src/org/ofbiz/base/start/Config.java
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/start/src/org/ofbiz/base/start/Config.java?rev=1589562&r1=1589561&r2=1589562&view=diff
> ==============================================================================
> --- ofbiz/trunk/framework/start/src/org/ofbiz/base/start/Config.java (original)
> +++ ofbiz/trunk/framework/start/src/org/ofbiz/base/start/Config.java Thu Apr 24 03:57:06 2014
> @@ -353,7 +353,7 @@ public class Config {
>               if (args.length > 0) {
>                   for (String arg : args) {
>                       if (arg.toLowerCase().contains("portoffset=") && !arg.toLowerCase().contains("${portoffset}")) {
> -                        adminPort = adminPort != 0 ? adminPort : 10523; // This is necessary because the ASF machines don't allow ports 1 to 3, see  INFRA-6790
> +                        adminPort = adminPort == 0 ? adminPort : 10523; // This is necessary because the ASF machines don't allow ports 1 to 3, see  INFRA-6790
>                           adminPort += Integer.parseInt(arg.split("=")[1]);
>                       }
>                   }
>
>
>

Re: svn commit: r1589562 - /ofbiz/trunk/framework/start/src/org/ofbiz/base/start/Config.java

Posted by Hans Bakker <ma...@antwebsystems.com>.
iAnother problem if you use the offset with an apache frontend 
webserver, it changes the 443 port to 448 with an offset of 5 better no 
change this port if it is 443 or 80

Regards,
Hans


On 24/04/14 15:18, Jacques Le Roux wrote:
> Hi Hans,
>
> Did you cross this issue using the portoffset parameters?
>
> This sounds weird to me because you should get there only in this 
> case. And when using a positive non zero parameter (a zero parameter 
> does not make sense), your change breaks the portoffset code
>
> I could use
>     adminPort = adminPort >= 0 ? adminPort : 10523; // This is 
> necessary because the ASF machines don't allow ports 1 to 3, see 
> INFRA-6790
> But I prefer to clarify the issue you crossed before
>
> Jacques
>
> Le 24/04/2014 05:57, hansbak@apache.org a écrit :
>> Author: hansbak
>> Date: Thu Apr 24 03:57:06 2014
>> New Revision: 1589562
>>
>> URL: http://svn.apache.org/r1589562
>> Log:
>> adminport in start.properties was ignored. fixed
>>
>> Modified:
>> ofbiz/trunk/framework/start/src/org/ofbiz/base/start/Config.java
>>
>> Modified: 
>> ofbiz/trunk/framework/start/src/org/ofbiz/base/start/Config.java
>> URL: 
>> http://svn.apache.org/viewvc/ofbiz/trunk/framework/start/src/org/ofbiz/base/start/Config.java?rev=1589562&r1=1589561&r2=1589562&view=diff
>> ============================================================================== 
>>
>> --- ofbiz/trunk/framework/start/src/org/ofbiz/base/start/Config.java 
>> (original)
>> +++ ofbiz/trunk/framework/start/src/org/ofbiz/base/start/Config.java 
>> Thu Apr 24 03:57:06 2014
>> @@ -353,7 +353,7 @@ public class Config {
>>               if (args.length > 0) {
>>                   for (String arg : args) {
>>                       if (arg.toLowerCase().contains("portoffset=") 
>> && !arg.toLowerCase().contains("${portoffset}")) {
>> -                        adminPort = adminPort != 0 ? adminPort : 
>> 10523; // This is necessary because the ASF machines don't allow 
>> ports 1 to 3, see  INFRA-6790
>> +                        adminPort = adminPort == 0 ? adminPort : 
>> 10523; // This is necessary because the ASF machines don't allow 
>> ports 1 to 3, see  INFRA-6790
>>                           adminPort += 
>> Integer.parseInt(arg.split("=")[1]);
>>                       }
>>                   }
>>
>>
>>


Re: svn commit: r1589562 - /ofbiz/trunk/framework/start/src/org/ofbiz/base/start/Config.java

Posted by Jacques Le Roux <ja...@free.fr>.
Le 24/04/2014 10:29, Hans Bakker a écrit :
> up to you Jacques, but changing the port number in start.properties has no effect without this change.
>

I believe it's completely unrelated
Did you recompile after changing the value in start.properties?
Else you can't expect the value to change. It has to compiled and be picked from bin\org\ofbiz\base\start
Doing so here it works. And if I use portoffset it works also.
For instance if I set ofbiz.admin.port to 10525 in start.properties and compile, this is what I get

C:\projectsASF\ofbizVirgin>ant start
C:\projectsASF\ofbizVirgin>ECHO OFF
C:\projectsASF\ofbizVirgin>"C:\Program Files\Java\jdk1.6.0_45\\bin\java" -jar framework/base/lib/ant-1.9.0-ant-launcher.jar -lib 
framework/base/lib/ant start
Buildfile: C:\projectsASF\ofbizVirgin\build.xml

start:
      [java] Start.java using configuration file org/ofbiz/base/start/start.properties
      [java] Set OFBIZ_HOME to - C:/projectsASF/ofbizVirgin
      [java] Admin socket configured on - /127.0.0.1:10525

If now I use -Dportoffset=1, I get this

C:\projectsASF\ofbizVirgin>ant start -Dportoffset=1
C:\projectsASF\ofbizVirgin>ECHO OFF
C:\projectsASF\ofbizVirgin>"C:\Program Files\Java\jdk1.6.0_45\\bin\java" -jar framework/base/lib/ant-1.9.0-ant-launcher.jar -lib 
framework/base/lib/ant start -Dportoffset 1
Buildfile: C:\projectsASF\ofbizVirgin\build.xml

start:
      [java] Start.java using configuration file org/ofbiz/base/start/start.properties
      [java] Set OFBIZ_HOME to - C:/projectsASF/ofbizVirgin
      [java] Admin socket configured on - /127.0.0.1:10526

As you can see 10256 is 10525+1

Have you another scenario? Else you could confirm you agree (before I revert your change)?

Jacques

> Regards,Hans
>
> On 24/04/14 15:18, Jacques Le Roux wrote:
>> Hi Hans,
>>
>> Did you cross this issue using the portoffset parameters?
>>
>> This sounds weird to me because you should get there only in this case. And when using a positive non zero parameter (a zero parameter does not 
>> make sense), your change breaks the portoffset code
>>
>> I could use
>>     adminPort = adminPort >= 0 ? adminPort : 10523; // This is necessary because the ASF machines don't allow ports 1 to 3, see INFRA-6790
>> But I prefer to clarify the issue you crossed before
>>
>> Jacques
>>
>> Le 24/04/2014 05:57, hansbak@apache.org a écrit :
>>> Author: hansbak
>>> Date: Thu Apr 24 03:57:06 2014
>>> New Revision: 1589562
>>>
>>> URL: http://svn.apache.org/r1589562
>>> Log:
>>> adminport in start.properties was ignored. fixed
>>>
>>> Modified:
>>> ofbiz/trunk/framework/start/src/org/ofbiz/base/start/Config.java
>>>
>>> Modified: ofbiz/trunk/framework/start/src/org/ofbiz/base/start/Config.java
>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/start/src/org/ofbiz/base/start/Config.java?rev=1589562&r1=1589561&r2=1589562&view=diff
>>> ==============================================================================
>>> --- ofbiz/trunk/framework/start/src/org/ofbiz/base/start/Config.java (original)
>>> +++ ofbiz/trunk/framework/start/src/org/ofbiz/base/start/Config.java Thu Apr 24 03:57:06 2014
>>> @@ -353,7 +353,7 @@ public class Config {
>>>               if (args.length > 0) {
>>>                   for (String arg : args) {
>>>                       if (arg.toLowerCase().contains("portoffset=") && !arg.toLowerCase().contains("${portoffset}")) {
>>> -                        adminPort = adminPort != 0 ? adminPort : 10523; // This is necessary because the ASF machines don't allow ports 1 to 3, 
>>> see  INFRA-6790
>>> +                        adminPort = adminPort == 0 ? adminPort : 10523; // This is necessary because the ASF machines don't allow ports 1 to 3, 
>>> see  INFRA-6790
>>>                           adminPort += Integer.parseInt(arg.split("=")[1]);
>>>                       }
>>>                   }
>>>
>>>
>>>
>
>

Re: svn commit: r1589562 - /ofbiz/trunk/framework/start/src/org/ofbiz/base/start/Config.java

Posted by Hans Bakker <ma...@antwebsystems.com>.
up to you Jacques, but changing the port number in start.properties has 
no effect without this change.

Regards,Hans

On 24/04/14 15:18, Jacques Le Roux wrote:
> Hi Hans,
>
> Did you cross this issue using the portoffset parameters?
>
> This sounds weird to me because you should get there only in this 
> case. And when using a positive non zero parameter (a zero parameter 
> does not make sense), your change breaks the portoffset code
>
> I could use
>     adminPort = adminPort >= 0 ? adminPort : 10523; // This is 
> necessary because the ASF machines don't allow ports 1 to 3, see 
> INFRA-6790
> But I prefer to clarify the issue you crossed before
>
> Jacques
>
> Le 24/04/2014 05:57, hansbak@apache.org a écrit :
>> Author: hansbak
>> Date: Thu Apr 24 03:57:06 2014
>> New Revision: 1589562
>>
>> URL: http://svn.apache.org/r1589562
>> Log:
>> adminport in start.properties was ignored. fixed
>>
>> Modified:
>> ofbiz/trunk/framework/start/src/org/ofbiz/base/start/Config.java
>>
>> Modified: 
>> ofbiz/trunk/framework/start/src/org/ofbiz/base/start/Config.java
>> URL: 
>> http://svn.apache.org/viewvc/ofbiz/trunk/framework/start/src/org/ofbiz/base/start/Config.java?rev=1589562&r1=1589561&r2=1589562&view=diff
>> ============================================================================== 
>>
>> --- ofbiz/trunk/framework/start/src/org/ofbiz/base/start/Config.java 
>> (original)
>> +++ ofbiz/trunk/framework/start/src/org/ofbiz/base/start/Config.java 
>> Thu Apr 24 03:57:06 2014
>> @@ -353,7 +353,7 @@ public class Config {
>>               if (args.length > 0) {
>>                   for (String arg : args) {
>>                       if (arg.toLowerCase().contains("portoffset=") 
>> && !arg.toLowerCase().contains("${portoffset}")) {
>> -                        adminPort = adminPort != 0 ? adminPort : 
>> 10523; // This is necessary because the ASF machines don't allow 
>> ports 1 to 3, see  INFRA-6790
>> +                        adminPort = adminPort == 0 ? adminPort : 
>> 10523; // This is necessary because the ASF machines don't allow 
>> ports 1 to 3, see  INFRA-6790
>>                           adminPort += 
>> Integer.parseInt(arg.split("=")[1]);
>>                       }
>>                   }
>>
>>
>>