Hi Karsten,

Have you tried exporting interface org.jasypt.encryption.StringEncryptor?

I export this interface using a dedicated blueprint bundle and pass it the 
decryption password from the environment.  This service is then used by 
pax-jdbc, and also referenced by other blueprint bundles which need to import 
the jasypt namespace and use a property-placeholder to resolve the encrypted 
entries.

Kind regards,

Geoff

-----Original Message-----
From: Jean-Baptiste Onofré <[email protected]> 
Sent: 04 April 2022 08:49
To: [email protected]
Subject: Re: Exporting an instance of a 3rd party library as service

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


Hi,

What do you mean by "not finding the service" ?
You mean at runtime (looking for service reference) or at deployment time (the 
maven-bundle-plugin is generated req/cap for service, so it might be your 
issue) ?

If you can share the message you have, it would be helpful.

Regards
JB

On Mon, Apr 4, 2022 at 9:06 AM Karsten Blume <[email protected]> wrote:
>
> Hello everybody,
>
> i come up with a issue, which might be easily answered in the OSGI world, 
> though I have not yet found a solution in the WWW.
>
>
>
> Running
>
> Karaf 3.0.7, Java8, Blueprint
>
>
>
> Objective
>
> Any bundle (own or e.g. pax-jdbc-config) should be able to use the same 
> configured StringEncryptor.
>
>
>
> How
>
> I configure and create an instance of 
> org.jasypt.encryption.pbe.StandardPBEStringEncryptor  and export this 
> instance as a service of interface org.jasypt.encryption.StringEncryption. in 
> one of my base bundles.
>
> All other bundles reference the interface to get the service.
>
>
>
> Problem
>
> If I export the original interface as service the others are not  finding 
> this service (having modified the Maven bundle plugin properly).
>
> Do I need to wrap the StringEncryptor in a delegate pattern, so I export my 
> own interface?
>
>
>
> Any help is appreciated,
>
> Thx Karsten
>
>

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

Reply via email to