You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by Geoffrey Seanor <Ge...@mufgsecurities.com> on 2021/04/15 09:00:51 UTC

Karaf 4.3.0: Configuration override of management ports

Hi all,

I added the following to Karaf’s setenv.bat file (and the equivalent to the setenv shell script) as described in the docs:

set KARAF_OPTS=^
-Dorg.apache.karaf.management.rmiRegistryPort=1730^
-Dorg.apache.karaf.management.rmiServerPort=44730


So instead of the default serviceUrl value:
service:jmx:rmi://127.0.0.1:44444/jndi/rmi://127.0.0.1:1099/karaf

I was expecting something like this:
service:jmx:rmi://127.0.0.1:44730/jndi/rmi://127.0.0.1:1730/karaf


The Activator class resolves the values of rmiRegistryPort and rmiServerPort correctly, however when it resolves serviceUrl it is still taking their values from the org.apache.karaf.management.cfg config file so you get port conflicts when running multiple Karaf instances.
If I add an override for serviceUrl in the setenv scripts you get the expected URL value at runtime.

I was stumped on this for a while.  Now I am wondering if there is a better way to handle this (that does not require instance specific file edits), or if this behaviour likely to change so that one doesn’t need to override the serviceUrl property if you override rmiRegistryPort and/or rmiServerPort?

Thanks,

GS

This email including any attachments is confidential and may be subject to legal privilege. Unless otherwise indicated, you may not disclose or distribute this email to any other person.  If you are not the intended recipient of this email, please delete it and notify the sender immediately. 

MUFG Bank, Ltd. (“MUFG Bank”), MUFG Securities EMEA plc ("MUS(EMEA)") and Mitsubishi UFJ Financial Group, Inc. (“MUFG Inc.”) are members of the MUFG group.

-	MUFG Bank is a limited liability stock company incorporated in Japan and registered in the Tokyo Legal Affairs Bureau (company no. 0100-01-008846). MUFG Bank’s head office is at 7-1 Marunouchi 2-Chome, Chiyoda-Ku, Tokyo 100-8388, Japan. MUFG Bank’s London branch is at Ropemaker Place, 25 Ropemaker Street, London EC2Y 9AN, and is registered as a UK establishment in the UK register of companies (registered no. BR002013).   MUFG Bank is authorised and regulated by the Japanese Financial Services Agency. MUFG Bank’s London branch is authorised by the UK Prudential Regulation Authority (“PRA”) and regulated by the UK Financial Conduct Authority (“FCA”) with limited regulation by the PRA.
-	MUS(EMEA) is a limited liability company registered in England (company no. 1698498) with its registered office at Ropemaker Place, 25 Ropemaker Street, London, EC2Y 9AJ.  MUS (EMEA) is authorised by the PRA and regulated by the FCA and PRA in the UK.
-	MUFG Inc. is a limited liability stock company incorporated in Japan and registered in the Tokyo Legal Affairs Bureau (company no. 0100-01-073486). MUFG Inc.’s head office is at 7-1 Marunouchi 2-Chome, Chiyoda-Ku, Tokyo 100-8388, Japan.  MUFG Inc.’s London office is at Ropemaker Place, 25 Ropemaker Street, London EC2Y 9AN, and is registered as a UK establishment in the UK register of companies (registered no. BR015994).

Details on how MUFG Bank, London branch and MUS (EMEA) process personal data relating to individuals associated with our clients are on the MUFG EMEA website at: https://www.mufgemea.com/governance/privacy-notice/ 

Unless specifically indicated, this email should not be regarded as an offer, advice, recommendation, confirmation or valuation in relation to any financial products or services and any views expressed are those of the author only. If information in this email constitutes an investment recommendation provided by MUS(EMEA) as defined in EU (MAR) Regulation 596/2014, additional disclosures are available at https://research.musi.com/MUFGSecDisclaimers.aspx. Information in this email may be subject to change without notice.  Emails cannot be guaranteed to be timely, secure or error or virus-free, and members of the MUFG group accept no liability for such matters. Members of the MUFG group may record and monitor emails and disclose them where relevant in litigation or to regulators.



This message has been scanned for malware by Websense. www.websense.com

RE: Karaf 4.3.0: Configuration override of management ports

Posted by Geoffrey Seanor <Ge...@mufgsecurities.com>.
Thanks JB, in debug I noticed that BaseActivator.getString(…) was resolving the serviceUrl property from the cfg file.  It used this in preference to the ‘def’ argument value which was derived from the VM parameters.

I also experimented with using VM parameters to override properties that are commented out but I found that I had to customise the file (i.e. remove the comment mark) before the property’s values became active.  If this were supported, then during a Karaf version upgrade I would for the most part only see the delta due to Karaf since my site specific customisations would be in a smaller set of files.  I was wondering if others would also find this useful?

Kind regards,

GS

From: Jean-Baptiste Onofre [mailto:jb@nanthrax.net]
Sent: 15 April 2021 17:02
To: user
Subject: Re: Karaf 4.3.0: Configuration override of management ports

*** External email: Please be cautious when opening attachments or clicking links. ***
Hi,

I guess it works using org.apache.karaf.management.serviceUrl property directly right ?

Let me check.

Regards
JB


Le 15 avr. 2021 à 11:00, Geoffrey Seanor <Ge...@mufgsecurities.com>> a écrit :

Hi all,

I added the following to Karaf’s setenv.bat file (and the equivalent to the setenv shell script) as described in the docs:

set KARAF_OPTS=^
-Dorg.apache.karaf.management.rmiRegistryPort=1730^
-Dorg.apache.karaf.management.rmiServerPort=44730


So instead of the default serviceUrl value:
service:jmx:rmi://127.0.0.1:44444/jndi/rmi://127.0.0.1:1099/karaf<rmi://127.0.0.1:44444/jndi/rmi:/127.0.0.1:1099/karaf>

I was expecting something like this:
service:jmx:rmi://127.0.0.1:44730/jndi/rmi://127.0.0.1:1730/karaf<rmi://127.0.0.1:44730/jndi/rmi:/127.0.0.1:1730/karaf>


The Activator class resolves the values of rmiRegistryPort and rmiServerPort correctly, however when it resolves serviceUrl it is still taking their values from the org.apache.karaf.management.cfg config file so you get port conflicts when running multiple Karaf instances.
If I add an override for serviceUrl in the setenv scripts you get the expected URL value at runtime.

I was stumped on this for a while.  Now I am wondering if there is a better way to handle this (that does not require instance specific file edits), or if this behaviour likely to change so that one doesn’t need to override the serviceUrl property if you override rmiRegistryPort and/or rmiServerPort?

Thanks,

GS
This email including any attachments is confidential and may be subject to legal privilege. Unless otherwise indicated, you may not disclose or distribute this email to any other person.  If you are not the intended recipient of this email, please delete it and notify the sender immediately.
MUFG Bank, Ltd. (“MUFG Bank”), MUFG Securities EMEA plc ("MUS(EMEA)") and Mitsubishi UFJ Financial Group, Inc. (“MUFG Inc.”) are members of the MUFG group.
MUFG Bank is a limited liability stock company incorporated in Japan and registered in the Tokyo Legal Affairs Bureau (company no. 0100-01-008846). MUFG Bank’s head office is at 7-1 Marunouchi 2-Chome, Chiyoda-Ku, Tokyo 100-8388, Japan. MUFG Bank’s London branch is at Ropemaker Place, 25 Ropemaker Street, London EC2Y 9AN, and is registered as a UK establishment in the UK register of companies (registered no. BR002013).   MUFG Bank is authorised and regulated by the Japanese Financial Services Agency. MUFG Bank’s London branch is authorised by the UK Prudential Regulation Authority (“PRA”) and regulated by the UK Financial Conduct Authority (“FCA”) with limited regulation by the PRA.
MUS(EMEA) is a limited liability company registered in England (company no. 1698498) with its registered office at Ropemaker Place, 25 Ropemaker Street, London, EC2Y 9AJ.  MUS (EMEA) is authorised by the PRA and regulated by the FCA and PRA in the UK.
MUFG Inc. is a limited liability stock company incorporated in Japan and registered in the Tokyo Legal Affairs Bureau (company no. 0100-01-073486). MUFG Inc.’s head office is at 7-1 Marunouchi 2-Chome, Chiyoda-Ku, Tokyo 100-8388, Japan.  MUFG Inc.’s London office is at Ropemaker Place, 25 Ropemaker Street, London EC2Y 9AN, and is registered as a UK establishment in the UK register of companies (registered no. BR015994).
Details on how MUFG Bank, London branch and MUS (EMEA) process personal data relating to individuals associated with our clients are on the MUFG EMEA website at:https://www.mufgemea.com/governance/privacy-notice/
Unless specifically indicated, this email should not be regarded as an offer, advice, recommendation, confirmation or valuation in relation to any financial products or services and any views expressed are those of the author only. If information in this email constitutes an investment recommendation provided by MUS(EMEA) as defined in EU (MAR) Regulation 596/2014, additional disclosures are available at https://research.musi.com/MUFGSecDisclaimers.aspx. Information in this email may be subject to change without notice.  Emails cannot be guaranteed to be timely, secure or error or virus-free, and members of the MUFG group accept no liability for such matters. Members of the MUFG group may record and monitor emails and disclose them where relevant in litigation or to regulators.



This message has been scanned for malware by Websense.  www.websense.com<http://www.websense.com/>



Click here<https://www.mailcontrol.com/sr/OfUnTvAeV23GX2PQPOmvUkBugPZ_3WFCd-apIW75x8By792BPONSs5nEu8p5HfU-DXeaqO9PTRpMob8Srs06FQ==> to report this email as spam.

Re: Karaf 4.3.0: Configuration override of management ports

Posted by Jean-Baptiste Onofre <jb...@nanthrax.net>.
Hi,

I guess it works using org.apache.karaf.management.serviceUrl property directly right ?

Let me check.

Regards
JB

> Le 15 avr. 2021 à 11:00, Geoffrey Seanor <Ge...@mufgsecurities.com> a écrit :
> 
> Hi all,
>  
> I added the following to Karaf’s setenv.bat file (and the equivalent to the setenv shell script) as described in the docs:
>  
> set KARAF_OPTS=^
> -Dorg.apache.karaf.management.rmiRegistryPort=1730^
> -Dorg.apache.karaf.management.rmiServerPort=44730
>  
>  
> So instead of the default serviceUrl value:
> service:jmx:rmi://127.0.0.1:44444/jndi/rmi://127.0.0.1:1099/karaf <rmi://127.0.0.1:44444/jndi/rmi://127.0.0.1:1099/karaf>
>  
> I was expecting something like this:
> service:jmx:rmi://127.0.0.1:44730/jndi/rmi://127.0.0.1:1730/karaf <rmi://127.0.0.1:44730/jndi/rmi://127.0.0.1:1730/karaf>
>  
>  
> The Activator class resolves the values of rmiRegistryPort and rmiServerPort correctly, however when it resolves serviceUrl it is still taking their values from the org.apache.karaf.management.cfg config file so you get port conflicts when running multiple Karaf instances.
> If I add an override for serviceUrl in the setenv scripts you get the expected URL value at runtime.
>  
> I was stumped on this for a while.  Now I am wondering if there is a better way to handle this (that does not require instance specific file edits), or if this behaviour likely to change so that one doesn’t need to override the serviceUrl property if you override rmiRegistryPort and/or rmiServerPort?
>  
> Thanks,
>  
> GS
> This email including any attachments is confidential and may be subject to legal privilege. Unless otherwise indicated, you may not disclose or distribute this email to any other person.  If you are not the intended recipient of this email, please delete it and notify the sender immediately. 
> 
> MUFG Bank, Ltd. (“MUFG Bank”), MUFG Securities EMEA plc ("MUS(EMEA)") and Mitsubishi UFJ Financial Group, Inc. (“MUFG Inc.”) are members of the MUFG group.
> 
> MUFG Bank is a limited liability stock company incorporated in Japan and registered in the Tokyo Legal Affairs Bureau (company no. 0100-01-008846). MUFG Bank’s head office is at 7-1 Marunouchi 2-Chome, Chiyoda-Ku, Tokyo 100-8388, Japan. MUFG Bank’s London branch is at Ropemaker Place, 25 Ropemaker Street, London EC2Y 9AN, and is registered as a UK establishment in the UK register of companies (registered no. BR002013).   MUFG Bank is authorised and regulated by the Japanese Financial Services Agency. MUFG Bank’s London branch is authorised by the UK Prudential Regulation Authority (“PRA”) and regulated by the UK Financial Conduct Authority (“FCA”) with limited regulation by the PRA.
> 
> MUS(EMEA) is a limited liability company registered in England (company no. 1698498) with its registered office at Ropemaker Place, 25 Ropemaker Street, London, EC2Y 9AJ.  MUS (EMEA) is authorised by the PRA and regulated by the FCA and PRA in the UK.
> 
> MUFG Inc. is a limited liability stock company incorporated in Japan and registered in the Tokyo Legal Affairs Bureau (company no. 0100-01-073486). MUFG Inc.’s head office is at 7-1 Marunouchi 2-Chome, Chiyoda-Ku, Tokyo 100-8388, Japan.  MUFG Inc.’s London office is at Ropemaker Place, 25 Ropemaker Street, London EC2Y 9AN, and is registered as a UK establishment in the UK register of companies (registered no. BR015994).
> 
> Details on how MUFG Bank, London branch and MUS (EMEA) process personal data relating to individuals associated with our clients are on the MUFG EMEA website at:https://www.mufgemea.com/governance/privacy-notice/ <https://www.mufgemea.com/governance/privacy-notice/> 
> 
> Unless specifically indicated, this email should not be regarded as an offer, advice, recommendation, confirmation or valuation in relation to any financial products or services and any views expressed are those of the author only. If information in this email constitutes an investment recommendation provided by MUS(EMEA) as defined in EU (MAR) Regulation 596/2014, additional disclosures are available at https://research.musi.com/MUFGSecDisclaimers.aspx <https://research.musi.com/MUFGSecDisclaimers.aspx>. Information in this email may be subject to change without notice.  Emails cannot be guaranteed to be timely, secure or error or virus-free, and members of the MUFG group accept no liability for such matters. Members of the MUFG group may record and monitor emails and disclose them where relevant in litigation or to regulators.
> 
> 
> 
> This message has been scanned for malware by Websense.  www.websense.com <http://www.websense.com/>