Re: Vaadin 8 application on Karaf 4.3.1

2021-04-30 Thread Alex Weirig

Hello,

I'm pretty sure, I've been successfully running a full OSGi Vaadin > 
8.6.0 application in karaf 4.2.x.


The thing is, I had a fix provided by Vaadin that even allowed my to 
define the main UI class as an OSGi service and thus to even use the 
@Reference service injection in the main UI.


That allowed me to use my OSGi backend services in the UI and to 
dynamically compose my UI by getting references to "sub-UI" classes that 
added pages etc to my main UI. That worked really nice and again I'm 
sure that was > 8.6.0.


I don't know how I can send you an archive of the patched Vaadin bundle 
(can't use attachments) and I don't have github.


@JB: can I send you the archive?

Mat frëndleche Gréiss, Mit freundlichen Grüßen, Meilleures 
salutations, Kind regards,

Alex Weirig
Responsable Technique Ville de Luxembourg Service Enseignement Centre 
Technolink *Tel* +352 4796 - 6127  *Fax* +352 42 88 81 
*Email* alex.wei...@technolink.lu www.vdl.lu <http://www.vdl.lu> 2, rue 
Charles de Tornaco L-2623 LUXEMBOURG


//indoors.this.blesses
<https://map.what3words.com/indoors.this.blesses>
//schaufel.besten.kopie
<https://map.what3words.com/schaufel.besten.kopie>
//supposons.levage.venger
<https://map.what3words.com/supposons.levage.venger>
On 30/04/2021 06:38, Jean-Baptiste Onofre wrote:

Hi,

It looks like a regression in Vaadin 8.6.0.

I will try to take a look next week.

Regards
JB

Le 29 avr. 2021 à 22:03, Васил Зорев 
 a écrit :


Does not seem that it was intentional, newer Vaadin 8 release notes 
say there were "improvements in OSGi support".


In my tests on Karaf 4.3.2-SNAPSHOT the last working version is 
8.5.2, it broke with 8.6.0. Possibly with 
https://github.com/vaadin/framework/commit/7e89b5e3348be487110bd8a5c60336ff363cf9d6 
,
although not sure about it. I would suggest to ask on the Vaadin 
forums as well, just in case.


На чт, 29.04.2021 г. в 14:30 ч. Richard Hierlmeier 
 написа:


I have to port a Vaadin 7 applikation to Vaadin 8, so I planned
to used the newest one (8.12.2 or 8.13.0).

I found a workaround for the problem.
When the Vaadin Servlet that hosts the UI has "/VAADIN/*" in the
URL-Patterns, then the Servlet is called when static resource
files from /VAADIN are requested.
You can overwride then in the VaadinServlet the findResourceURL
method and you can search for all OsgiVaadinResourceservices an
ask them for the resources.

Can it be that Vaadin dropped the OSGI support for Vaadin 8.

Regards

  Richard








Am Mi., 28. Apr. 2021 um 23:39 Uhr schrieb Васил Зорев
:

What Vaadin version do you depend on ? I deployed locally the
app by Peter Lehto -�
https://github.com/peterl1084/vaadin-karaf and observed
something kind of strange.

Karaf version is 4.3.2-SNAPSHOT (from 2-3 weeks ago).

On Vaadin version 8.3.0, going to http://localhost:8181/myapp
showed the expected view. (however vaadin-osgi-integration
was 8.13.0 in the pom at that time, by mistake..)

I then changed to Vaadin 8.13.0 and got the same error as you
did:
Failed to load resource: the server responded with a status
of 404 (Not Found)�
http://localhost:8181/vaadin-8.13.0/VAADIN/vaadinBootstrap.js?v=8.13.0
myapp:21 Uncaught ReferenceError: vaadin is not defined
    at myapp:21
vaadin-8.13.0/VAADIN/themes/valo/favicon.ico:1 Failed to load
resource: the server responded with a status of 404 (Not
Found)�
http://localhost:8181/vaadin-8.13.0/VAADIN/themes/valo/favicon.ico

Funny enough, changing back to 8.3.0 got it running again...
I leave it for now, but will try to figure something out
these days.

Regards,
Vassil

На ср, 28.04.2021 г. в 20:03 ч. Васил Зорев
 написа:

Hi Richard,

I cannot give an answer yet as I have no idea yet, but we
are currently running a Vaadin 7 app on Karaf 4.3.1 in my
work environment so I would be very interested to have a
look into your issue.

A few questions. Are you using "stock" Karaf 4.3.1 or you
forked it and built your own? Can you please provide a
sample Vaadin 8 app (the minimal possible version) that
reproduces the error you get that I can deploy locally?
How do you deploy the app to Karaf? Also if needed please
provide a sample web descriptor file (if you don't use
annotations).

Regards,
Vassil

На ср, 28.04.2021 г. в 10:50 ч. Richard Hierlmeier
 написа:


I try to get a simple Vaadin 8 application running on
Karaf 4.3.1.
However it is not working. Vaadin can not load it's
bootstrap Javascr

Re: Dependencies issue?

2021-03-01 Thread Alex Weirig

Hi JB,

yes, that does indeed seem to work.

Thanks

Mat frëndleche Gréiss, Mit freundlichen Grüßen, Meilleures salutations, 
Kind regards,

Alex Weirig
Responsable Technique Ville de Luxembourg Service Enseignement Centre 
Technolink *Tel* +352 4796 - 6127  *Fax* +352 42 88 81 
*Email* alex.wei...@technolink.lu <mailto:alex.wei...@technolink.lu> 
www.vdl.lu <http://www.vdl.lu> // www.technolink.lu 
<http://www.technolink.lu> Centre Technolink 2, rue Charles de Tornaco 
L-2623 LUXEMBOURG


//indoors.this.blesses
<https://map.what3words.com/indoors.this.blesses>
//schaufel.besten.kopie
<https://map.what3words.com/schaufel.besten.kopie>
//supposons.levage.venger
<https://map.what3words.com/supposons.levage.venger>
On 01/03/2021 16:22, Jean-Baptiste Onofre wrote:

Hi,

You have to install JAXB 2.3.0 bundle (Jakarta) for JAXRS Whiteboard 
1.1.0 (JAXRS Whiteboard 1.0.6 works because it uses JAXB 2.2.0).


I can update Karaf 4.3.x core to JAXB 2.3.0 (to have version 
alignement), but it should already work.


On the other hand, we are also working on a new spec features repo 
providing most of the "spec" features (JAXB, and others).


Regards
JB

Le 1 mars 2021 à 16:10, Alex Weirig <mailto:alex.wei...@technolink.lu>> a écrit :


Dear all,

so far with Karaf 4.2.10 I've been using ...

repo-add 
mvn:org.apache.aries.jax.rs/org.apache.aries.jax.rs.features/1.0.6/xml 
<http://org.apache.aries.jax.rs/org.apache.aries.jax.rs.features/1.0.6/xml>
feature:install http-whiteboard aries-jax-rs-whiteboard 
aries-jax-rs-whiteboard-jackson


to install all the required features/bundles to run REST services.

Now I wanted to install a karaf 4.3.0 and thought it might be a good 
idea to get the latest release for theorg.apache.aries.jax.rs 
<http://org.apache.aries.jax.rs/>feature, 1.1.0 if I'm not mistaken.


Unfortunatley the feature:install then fails with dependency issues.

karaf@root()> repo-add 
mvn:org.apache.aries.jax.rs/org.apache.aries.jax.rs.features/1.1.0/xml 
<http://org.apache.aries.jax.rs/org.apache.aries.jax.rs.features/1.1.0/xml> 

Adding feature url 
mvn:org.apache.aries.jax.rs/org.apache.aries.jax.rs.features/1.1.0/xml 
<http://org.apache.aries.jax.rs/org.apache.aries.jax.rs.features/1.1.0/xml>
karaf@root()> feature:install http-whiteboard aries-jax-rs-whiteboard 
aries-jax-rs-whiteboard-jackson
org.apache.felix.resolver.reason.ReasonException: Unable to resolve 
root: missing requirement [root] osgi.identity; 
osgi.identity=aries-jax-rs-whiteboard-jackson; type=karaf.feature; 
version="[1.0.0,1.0.0]"; 
filter:="(&(osgi.identity=aries-jax-rs-whiteboard-jackson)(type=karaf.feature)(version>=1.0.0)(version<=1.0.0))" 
[caused by: Unable to resolve aries-jax-rs-whiteboard-jackson/1.0.0: 
missing requirement [aries-jax-rs-whiteboard-jackson/1.0.0] 
osgi.identity; osgi.identity=org.apache.aries.jax.rs.jackson; 
type=osgi.bundle; version="[1.0.0,1.0.0]"; resolution:=mandatory 
[caused by: Unable to resolve org.apache.aries.jax.rs.jackson/1.0.0: 
missing requirement [org.apache.aries.jax.rs.jackson/1.0.0] 
osgi.implementation; osgi.implementation=osgi.jaxrs; 
filter:="(&(osgi.implementation=osgi.jaxrs)(version>=1.0.0)(!(version>=2.0.0)))" 
[caused by: Unable to resolve 
org.apache.aries.jax.rs.whiteboard/1.1.0: missing requirement 
[org.apache.aries.jax.rs.whiteboard/1.1.0] osgi.wiring.package; 
filter:="(&(osgi.wiring.package=javax.xml.bind)(version>=2.3.0)(!(version>=3.0.0)))"]]]
    at 
org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341)
    at 
org.apache.felix.resolver.ResolverImpl.doResolve(ResolverImpl.java:434)
    at 
org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:421)
    at 
org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:375)
    at 
org.apache.karaf.features.internal.region.SubsystemResolver.resolve(SubsystemResolver.java:257)
    at 
org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:392)
    at 
org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1062)
    at 
org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$13(FeaturesServiceImpl.java:998)

    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)

    at java.lang.Thread.run(Thread.java:748)
Caused by: org.apache.felix.resolver.reason.ReasonException: Unable 
to resolve aries-jax-rs-whiteboard-jackson/1.0.0: missing requirement 
[aries-jax-rs-whiteboard-jackson/1.0.0] osgi.identity; 
osgi.identity=org.apache.aries.jax.rs.jackson; type=osgi.bundle; 
version="[1.0.0,1.0.0]"; resolution:=mandatory [caused 

Dependencies issue?

2021-03-01 Thread Alex Weirig
.package; 
filter:="(&(osgi.wiring.package=javax.xml.bind)(version>=2.3.0)(!(version>=3.0.0)))"
    at 
org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341)

    ... 14 more
Error executing command: Unable to resolve root: missing requirement 
[root] osgi.identity; osgi.identity=aries-jax-rs-whiteboard-jackson; 
type=karaf.feature; version="[1.0.0,1.0.0]"; 
filter:="(&(osgi.identity=aries-jax-rs-whiteboard-jackson)(type=karaf.feature)(version>=1.0.0)(version<=1.0.0))" 
[caused by: Unable to resolve aries-jax-rs-whiteboard-jackson/1.0.0: 
missing requirement [aries-jax-rs-whiteboard-jackson/1.0.0] 
osgi.identity; osgi.identity=org.apache.aries.jax.rs.jackson; 
type=osgi.bundle; version="[1.0.0,1.0.0]"; resolution:=mandatory [caused 
by: Unable to resolve org.apache.aries.jax.rs.jackson/1.0.0: missing 
requirement [org.apache.aries.jax.rs.jackson/1.0.0] osgi.implementation; 
osgi.implementation=osgi.jaxrs; 
filter:="(&(osgi.implementation=osgi.jaxrs)(version>=1.0.0)(!(version>=2.0.0)))" 
[caused by: Unable to resolve org.apache.aries.jax.rs.whiteboard/1.1.0: 
missing requirement [org.apache.aries.jax.rs.whiteboard/1.1.0] 
osgi.wiring.package; 
filter:="(&(osgi.wiring.package=javax.xml.bind)(version>=2.3.0)(!(version>=3.0.0)))"]]]



I'm running karaf 4.3.0 (plain) with Java 1.8.0 OpenJDK on RHEL 8.3 (Red 
Hat Enterprise Linux release 8.3 (Ootpa)).



--

Mat frëndleche Gréiss, Mit freundlichen Grüßen, Meilleures salutations, 
Kind regards,

Alex Weirig
Responsable Technique Ville de Luxembourg Service Enseignement Centre 
Technolink *Tel* +352 4796 - 6127  *Fax* +352 42 88 81 
*Email* alex.wei...@technolink.lu <mailto:alex.wei...@technolink.lu> 
www.vdl.lu <http://www.vdl.lu> // www.technolink.lu 
<http://www.technolink.lu> Centre Technolink 2, rue Charles de Tornaco 
L-2623 LUXEMBOURG


//indoors.this.blesses
<https://map.what3words.com/indoors.this.blesses>
//schaufel.besten.kopie
<https://map.what3words.com/schaufel.besten.kopie>
//supposons.levage.venger
<https://map.what3words.com/supposons.levage.venger>
<>

Re: [X-Mas Gift] Panel discussion about Karaf 5

2020-12-17 Thread Alex Weirig

Hi JB,

sounds great. I'll have to keep an eye on 5 then.

Thanks.

Mat frëndleche Gréiss, Mit freundlichen Grüßen, Meilleures salutations, 
Kind regards,

Alex Weirig
Responsable Technique Ville de Luxembourg Service Enseignement Centre 
Technolink *Tel* +352 4796 - 6127  *Fax* +352 42 88 81 
*Email* alex.wei...@technolink.lu <mailto:alex.wei...@technolink.lu> 
www.vdl.lu <http://www.vdl.lu> // www.technolink.lu 
<http://www.technolink.lu> Centre Technolink 2, rue Charles de Tornaco 
L-2623 LUXEMBOURG


//indoors.this.blesses
<https://map.what3words.com/indoors.this.blesses>
//schaufel.besten.kopie
<https://map.what3words.com/schaufel.besten.kopie>
//supposons.levage.venger
<https://map.what3words.com/supposons.levage.venger>
On 17/12/2020 17:08, Jean-Baptiste Onofre wrote:

Hi,

That’s exactly the purpose of extension in replacement of features: 
Karaf will provides kind of "extension store", with "approved" 
functionalities.


You can see a extensions proto set here:

https://github.com/jbonofre/karaf5/tree/main/extensions 
<https://github.com/jbonofre/karaf5/tree/main/extensions>


It’s exactly what you are describing: you have the extension market 
store, and I will also add "extension bom" for developers (for now, 
extensions are runtime).


Here’s the code to start Karaf with extension:


        KarafConfig config = KarafConfig.builder()
                .homeDirectory("karaf")
                .dataDirectory("karaf/data")
                .cacheDirectory("karaf/data/cache")
                .build();
        karaf = Karaf.build(config);
        karaf.init();
karaf.addExtension("mvn:org.apache.karaf.extensions/log/5.0.0-SNAPSHOT");

Then, you can simple run karaf with java -jar my-karaf.jar

With this approach, it’s very easy to have an UI to create this code.

Regards
JB


Le 17 déc. 2020 à 14:29, Alex Weirig <mailto:alex.wei...@technolink.lu>> a écrit :


Dear all,

imho, one of the biggest issues with (karaf) is that you need to know 
where you get the right bundles/features from. If I want to do JAX-RS 
with Whiteboard, what repo do I need to add? What version? How do I 
even know I need to add a repo and where to find the right address 
for that repo?



I'm sure you all have been through trying to figure out what you need 
to add to karaf in order to have it support the features you need.


Once you've done it, you better take note of it, because next time 
you setup a new karaf instance you might have to figure it out again. 
But maybe in the mean time, Aries has changed a couple of things, 
versions have changed (for sure) etc.



Isn't it so much easier on our smartphones and even computers? ... We 
go to the app store, search for an app and once we've bought it, if 
we want to re-install it, it's still there, probably even with a new 
version.



Now, I'm not asking for a karaf app store but what about a "wizard" 
where you can pick from some of the most common use cases we all love 
to see running in our karaf instances.


This could be some kind of a list:

  * DS
  * Webconsole
  * JAX-RS with Whiteboard
  * JPA ...
  * Blueprint ...
  * your favorites here

and you pick what you need and karaf (somehow) knows what repos to 
add and what to install from the repos.


Seconds later, you get your new karaf instance up and running.


Is there anyone else thinking that this could be useful or am I the 
only one struggling with these issues? That would be my Xmas wish for 
Karaf 5.x.



Merry Xmas and a wonderful healthy Happy New Year 2021 to all of you. 
Take care and stay healthy.


Mat frëndleche Gréiss, Mit freundlichen Grüßen, Meilleures 
salutations, Kind regards,

Alex Weirig
Responsable Technique Ville de Luxembourg Service Enseignement Centre 
Technolink *Tel* +352 4796 - 6127  *Fax* +352 42 88 
81 *Email* alex.wei...@technolink.lu 
<mailto:alex.wei...@technolink.lu> www.vdl.lu <http://www.vdl.lu/> // 
www.technolink.lu <http://www.technolink.lu/> Centre Technolink 2, 
rue Charles de Tornaco L-2623 LUXEMBOURG

//indoors.this.blesses
<https://map.what3words.com/indoors.this.blesses>
//schaufel.besten.kopie
<https://map.what3words.com/schaufel.besten.kopie>
//supposons.levage.venger
<https://map.what3words.com/supposons.levage.venger>
On 15/12/2020 18:32, Jean-Baptiste Onofre wrote:

Hi guys,

Maybe some of you know that I started to work on Karaf 5.

I have something that it’s almost "usable".

Before sending a global discussion thread on the mailing list, I would like to 
evaluate the ideas & big changes I did.

I would like to know if some of you would be interested by a panel discussion 
call to introduce Karaf 5 (limited audience at first step).

The agenda of this call would be:
1. Pros/Cons about Karaf as it is today
2. Concepts in Karaf 5 (module, extension, …)
3. Building & running
4. Live dem

Re: [X-Mas Gift] Panel discussion about Karaf 5

2020-12-17 Thread Alex Weirig

Dear all,

imho, one of the biggest issues with (karaf) is that you need to know 
where you get the right bundles/features from. If I want to do JAX-RS 
with Whiteboard, what repo do I need to add? What version? How do I even 
know I need to add a repo and where to find the right address for that repo?



I'm sure you all have been through trying to figure out what you need to 
add to karaf in order to have it support the features you need.


Once you've done it, you better take note of it, because next time you 
setup a new karaf instance you might have to figure it out again. But 
maybe in the mean time, Aries has changed a couple of things, versions 
have changed (for sure) etc.



Isn't it so much easier on our smartphones and even computers? ... We go 
to the app store, search for an app and once we've bought it, if we want 
to re-install it, it's still there, probably even with a new version.



Now, I'm not asking for a karaf app store but what about a "wizard" 
where you can pick from some of the most common use cases we all love to 
see running in our karaf instances.


This could be some kind of a list:

 * DS
 * Webconsole
 * JAX-RS with Whiteboard
 * JPA ...
 * Blueprint ...
 * your favorites here

and you pick what you need and karaf (somehow) knows what repos to add 
and what to install from the repos.


Seconds later, you get your new karaf instance up and running.


Is there anyone else thinking that this could be useful or am I the only 
one struggling with these issues? That would be my Xmas wish for Karaf 5.x.



Merry Xmas and a wonderful healthy Happy New Year 2021 to all of you. 
Take care and stay healthy.


Mat frëndleche Gréiss, Mit freundlichen Grüßen, Meilleures salutations, 
Kind regards,

Alex Weirig
Responsable Technique Ville de Luxembourg Service Enseignement Centre 
Technolink *Tel* +352 4796 - 6127  *Fax* +352 42 88 81 
*Email* alex.wei...@technolink.lu <mailto:alex.wei...@technolink.lu> 
www.vdl.lu <http://www.vdl.lu> // www.technolink.lu 
<http://www.technolink.lu> Centre Technolink 2, rue Charles de Tornaco 
L-2623 LUXEMBOURG


//indoors.this.blesses
<https://map.what3words.com/indoors.this.blesses>
//schaufel.besten.kopie
<https://map.what3words.com/schaufel.besten.kopie>
//supposons.levage.venger
<https://map.what3words.com/supposons.levage.venger>
On 15/12/2020 18:32, Jean-Baptiste Onofre wrote:

Hi guys,

Maybe some of you know that I started to work on Karaf 5.

I have something that it’s almost "usable".

Before sending a global discussion thread on the mailing list, I would like to 
evaluate the ideas & big changes I did.

I would like to know if some of you would be interested by a panel discussion 
call to introduce Karaf 5 (limited audience at first step).

The agenda of this call would be:
1. Pros/Cons about Karaf as it is today
2. Concepts in Karaf 5 (module, extension, …)
3. Building & running
4. Live demo

It could be recorded/webinar style (not necessary live call) for about 20 
people at first step (both Karaf developers and users).
The purpose is to evaluate the direction.

Thoughts ?
Who would be interested ?

Thanks,
Regards
JB
<>

Re: CNF javax.ws.rs.client.ClientBuilder.newBuilder(ClientBuilder.java:50)

2020-03-15 Thread Alex Weirig

Dear all,

I solved the problem by taken the base specs-jaxrs-api bundle from 
servicemix and by editing the MANIFEST and adding a Provide-Capability.


Then simply deploy the whiteboard bundles and now everything is working.

Thanks for your support on a weekend

Mat frëndleche Gréiss, Mit freundlichen Grüßen, Meilleures salutations, 
Kind regards,

Alex Weirig
Responsable Technique Ville de Luxembourg Service Enseignement Centre 
Technolink *Tel* +352 4796 - 6127  *Fax* +352 42 88 81 
*Email* alex.wei...@technolink.lu <mailto:alex.wei...@technolink.lu> 
www.vdl.lu <http://www.vdl.lu> // www.technolink.lu 
<http://www.technolink.lu> Centre Technolink 2, rue Charles de Tornaco 
L-2623 LUXEMBOURG


//indoors.this.blesses
<https://map.what3words.com/indoors.this.blesses>
//schaufel.besten.kopie
<https://map.what3words.com/schaufel.besten.kopie>
//supposons.levage.venger
<https://map.what3words.com/supposons.levage.venger>
On 14/03/2020 17:46, Jean-Baptiste Onofre wrote:

Hi,

I will publish a SNAPSHOT as I will cut the ServiceMix release.

Regards
JB

Le 14 mars 2020 à 17:29, Alex Weirig <mailto:alex.wei...@technolink.lu>> a écrit :


Hi,

sure whatever helps :-)

I'm finding 2.9.1 in maven. Where could I download the snapshot?

Mat frëndleche Gréiss, Mit freundlichen Grüßen, Meilleures 
salutations, Kind regards,

Alex Weirig
Responsable Technique Ville de Luxembourg Service Enseignement Centre 
Technolink *Tel* +352 4796 - 6127  *Fax* +352 42 88 
81 *Email* alex.wei...@technolink.lu 
<mailto:alex.wei...@technolink.lu> www.vdl.lu <http://www.vdl.lu/> // 
www.technolink.lu <http://www.technolink.lu/> Centre Technolink 2, 
rue Charles de Tornaco L-2623 LUXEMBOURG

//indoors.this.blesses
<https://map.what3words.com/indoors.this.blesses>
//schaufel.besten.kopie
<https://map.what3words.com/schaufel.besten.kopie>
//supposons.levage.venger
<https://map.what3words.com/supposons.levage.venger>
On 14/03/2020 17:17, Freeman Fang wrote:
And for the Provide-Capability requirements, I think we need to 
release jaxrs-api-2.1 from Servicemix which will contain the fix.

So far you can use the snapshot version of it to give it a quick shot.

Freeman

On Sat, Mar 14, 2020 at 12:00 PM Freeman Fang 
mailto:freeman.f...@gmail.com>> wrote:


Hi,

Please see my comments inline

On Sat, Mar 14, 2020 at 11:54 AM Alex Weirig
mailto:alex.wei...@technolink.lu>>
wrote:

Hi Tim,

thanks for your answer, that was what I was looking at to
begin, this was my initial code

        @Reference ClientBuilder clientBuilder;

        Client client = clientBuilder.hostnameVerifier((s,
session) -> true)
             .sslContext(sslContext)
             .register(new JacksonJsonProvider(objectMapper))
             .connectTimeout(10, TimeUnit.MINUTES)
.build();

with but then I faced:

Error executing command: Unable to resolve
lu.tlk.occupation_postes_electronique.services.login-service
[123](R 123.2): missing requirement
[lu.tlk.occupation_postes_electronique.services.login-service
[123](R 123.2)] osgi.wiring.package;
(osgi.wiring.package=javax.ws.rs.client) Unresolved
requirements:
[[lu.tlk.occupation_postes_electronique.services.login-service
[123](R 123.2)] osgi.wiring.package;
(osgi.wiring.package=javax.ws.rs.client)]

I then manually added

bundle:install mvn:javax.ws.rs/javax.ws.rs-api/2.1
<http://javax.ws.rs/javax.ws.rs-api/2.1>

This is the problem, shouldn't use this one, should use

mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.jaxrs-api-2.1/2.9.1
which has OSGi locator enabled.

and then I got Error executing command: Error executing
command on bundles:Error starting bundle 123: Unable to
resolve
lu.tlk.occupation_postes_electronique.services.login-service
[123](R 123.2): missing requirement
[lu.tlk.occupation_postes_electronique.services.login-service
[123](R 123.2)] osgi.contract;
(&(osgi.contract=JavaJAXRS)(version=2.1.0)) Unresolved
requirements:
[[lu.tlk.occupation_postes_electronique.services.login-service
[123](R 123.2)] osgi.contract;
(&(osgi.contract=JavaJAXRS)(version=2.1.0))]So at that point
I tried to revert to the old code I already and I knew was
running back then ... You had a post back in 2018 about this
but it was related to Java 9 ... I'm still on Java 8. I
didn't find anything relevant to this contract issue (except
some stuff about Johnzon JSON-B ...


    Mat frëndleche Gréiss, Mit freundlichen Grüßen, Meilleures
salutations, Kind regards,
Alex Weirig
Responsable Technique Ville de Luxembourg Service
 

Re: CNF javax.ws.rs.client.ClientBuilder.newBuilder(ClientBuilder.java:50)

2020-03-14 Thread Alex Weirig

Hi JB,

will I be able to follow that process?

Thanks

Mat frëndleche Gréiss, Mit freundlichen Grüßen, Meilleures salutations, 
Kind regards,

Alex Weirig
Responsable Technique Ville de Luxembourg Service Enseignement Centre 
Technolink *Tel* +352 4796 - 6127  *Fax* +352 42 88 81 
*Email* alex.wei...@technolink.lu <mailto:alex.wei...@technolink.lu> 
www.vdl.lu <http://www.vdl.lu> // www.technolink.lu 
<http://www.technolink.lu> Centre Technolink 2, rue Charles de Tornaco 
L-2623 LUXEMBOURG


//indoors.this.blesses
<https://map.what3words.com/indoors.this.blesses>
//schaufel.besten.kopie
<https://map.what3words.com/schaufel.besten.kopie>
//supposons.levage.venger
<https://map.what3words.com/supposons.levage.venger>
On 14/03/2020 17:46, Jean-Baptiste Onofre wrote:

Hi,

I will publish a SNAPSHOT as I will cut the ServiceMix release.

Regards
JB

Le 14 mars 2020 à 17:29, Alex Weirig <mailto:alex.wei...@technolink.lu>> a écrit :


Hi,

sure whatever helps :-)

I'm finding 2.9.1 in maven. Where could I download the snapshot?

Mat frëndleche Gréiss, Mit freundlichen Grüßen, Meilleures 
salutations, Kind regards,

Alex Weirig
Responsable Technique Ville de Luxembourg Service Enseignement Centre 
Technolink *Tel* +352 4796 - 6127  *Fax* +352 42 88 
81 *Email* alex.wei...@technolink.lu 
<mailto:alex.wei...@technolink.lu> www.vdl.lu <http://www.vdl.lu/> // 
www.technolink.lu <http://www.technolink.lu/> Centre Technolink 2, 
rue Charles de Tornaco L-2623 LUXEMBOURG

//indoors.this.blesses
<https://map.what3words.com/indoors.this.blesses>
//schaufel.besten.kopie
<https://map.what3words.com/schaufel.besten.kopie>
//supposons.levage.venger
<https://map.what3words.com/supposons.levage.venger>
On 14/03/2020 17:17, Freeman Fang wrote:
And for the Provide-Capability requirements, I think we need to 
release jaxrs-api-2.1 from Servicemix which will contain the fix.

So far you can use the snapshot version of it to give it a quick shot.

Freeman

On Sat, Mar 14, 2020 at 12:00 PM Freeman Fang 
mailto:freeman.f...@gmail.com>> wrote:


Hi,

Please see my comments inline

On Sat, Mar 14, 2020 at 11:54 AM Alex Weirig
mailto:alex.wei...@technolink.lu>>
wrote:

Hi Tim,

thanks for your answer, that was what I was looking at to
begin, this was my initial code

        @Reference ClientBuilder clientBuilder;

        Client client = clientBuilder.hostnameVerifier((s,
session) -> true)
             .sslContext(sslContext)
             .register(new JacksonJsonProvider(objectMapper))
             .connectTimeout(10, TimeUnit.MINUTES)
.build();

with but then I faced:

Error executing command: Unable to resolve
lu.tlk.occupation_postes_electronique.services.login-service
[123](R 123.2): missing requirement
[lu.tlk.occupation_postes_electronique.services.login-service
[123](R 123.2)] osgi.wiring.package;
(osgi.wiring.package=javax.ws.rs.client) Unresolved
requirements:
[[lu.tlk.occupation_postes_electronique.services.login-service
[123](R 123.2)] osgi.wiring.package;
(osgi.wiring.package=javax.ws.rs.client)]

I then manually added

bundle:install mvn:javax.ws.rs/javax.ws.rs-api/2.1
<http://javax.ws.rs/javax.ws.rs-api/2.1>

This is the problem, shouldn't use this one, should use

mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.jaxrs-api-2.1/2.9.1
which has OSGi locator enabled.

and then I got Error executing command: Error executing
command on bundles:Error starting bundle 123: Unable to
resolve
lu.tlk.occupation_postes_electronique.services.login-service
[123](R 123.2): missing requirement
[lu.tlk.occupation_postes_electronique.services.login-service
[123](R 123.2)] osgi.contract;
(&(osgi.contract=JavaJAXRS)(version=2.1.0)) Unresolved
requirements:
[[lu.tlk.occupation_postes_electronique.services.login-service
[123](R 123.2)] osgi.contract;
(&(osgi.contract=JavaJAXRS)(version=2.1.0))]So at that point
I tried to revert to the old code I already and I knew was
running back then ... You had a post back in 2018 about this
but it was related to Java 9 ... I'm still on Java 8. I
didn't find anything relevant to this contract issue (except
some stuff about Johnzon JSON-B ...


    Mat frëndleche Gréiss, Mit freundlichen Grüßen, Meilleures
salutations, Kind regards,
Alex Weirig
Responsable Technique Ville de Luxembourg Service
Enseignement Centre Technolink *Tel* +352 4796 - 6127
 *Fax* +352 42 88 81 *Email*
alex.wei...@technolink.lu <mailto:alex.wei...@technolink.lu>
www.vdl.lu <http://www.vdl.l

Re: CNF javax.ws.rs.client.ClientBuilder.newBuilder(ClientBuilder.java:50)

2020-03-14 Thread Alex Weirig

Hi,

sure whatever helps :-)

I'm finding 2.9.1 in maven. Where could I download the snapshot?

Mat frëndleche Gréiss, Mit freundlichen Grüßen, Meilleures salutations, 
Kind regards,

Alex Weirig
Responsable Technique Ville de Luxembourg Service Enseignement Centre 
Technolink *Tel* +352 4796 - 6127  *Fax* +352 42 88 81 
*Email* alex.wei...@technolink.lu <mailto:alex.wei...@technolink.lu> 
www.vdl.lu <http://www.vdl.lu> // www.technolink.lu 
<http://www.technolink.lu> Centre Technolink 2, rue Charles de Tornaco 
L-2623 LUXEMBOURG


//indoors.this.blesses
<https://map.what3words.com/indoors.this.blesses>
//schaufel.besten.kopie
<https://map.what3words.com/schaufel.besten.kopie>
//supposons.levage.venger
<https://map.what3words.com/supposons.levage.venger>
On 14/03/2020 17:17, Freeman Fang wrote:
And for the Provide-Capability requirements, I think we need to 
release jaxrs-api-2.1 from Servicemix which will contain the fix.

So far you can use the snapshot version of it to give it a quick shot.

Freeman

On Sat, Mar 14, 2020 at 12:00 PM Freeman Fang <mailto:freeman.f...@gmail.com>> wrote:


Hi,

Please see my comments inline

    On Sat, Mar 14, 2020 at 11:54 AM Alex Weirig
mailto:alex.wei...@technolink.lu>> wrote:

Hi Tim,

thanks for your answer, that was what I was looking at to
begin, this was my initial code

        @Reference ClientBuilder clientBuilder;

        Client client = clientBuilder.hostnameVerifier((s,
session) -> true)
 .sslContext(sslContext)
 .register(new JacksonJsonProvider(objectMapper))
 .connectTimeout(10, TimeUnit.MINUTES)
                                 .build();

with but then I faced:

Error executing command: Unable to resolve
lu.tlk.occupation_postes_electronique.services.login-service
[123](R 123.2): missing requirement
[lu.tlk.occupation_postes_electronique.services.login-service
[123](R 123.2)] osgi.wiring.package;
(osgi.wiring.package=javax.ws.rs.client) Unresolved
requirements:
[[lu.tlk.occupation_postes_electronique.services.login-service
[123](R 123.2)] osgi.wiring.package;
(osgi.wiring.package=javax.ws.rs.client)]

I then manually added

bundle:install mvn:javax.ws.rs/javax.ws.rs-api/2.1
<http://javax.ws.rs/javax.ws.rs-api/2.1>

This is the problem, shouldn't use this one, should use

mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.jaxrs-api-2.1/2.9.1
which has OSGi locator enabled.

and then I got Error executing command: Error executing
command on bundles:Error starting bundle 123: Unable to
resolve
lu.tlk.occupation_postes_electronique.services.login-service
[123](R 123.2): missing requirement
[lu.tlk.occupation_postes_electronique.services.login-service
[123](R 123.2)] osgi.contract;
(&(osgi.contract=JavaJAXRS)(version=2.1.0)) Unresolved
requirements:
[[lu.tlk.occupation_postes_electronique.services.login-service
[123](R 123.2)] osgi.contract;
(&(osgi.contract=JavaJAXRS)(version=2.1.0))]So at that point I
tried to revert to the old code I already and I knew was
running back then ... You had a post back in 2018 about this
but it was related to Java 9 ... I'm still on Java 8. I didn't
find anything relevant to this contract issue (except some
stuff about Johnzon JSON-B ...


Mat frëndleche Gréiss, Mit freundlichen Grüßen, Meilleures
salutations, Kind regards,
Alex Weirig
Responsable Technique Ville de Luxembourg Service Enseignement
Centre Technolink *Tel* +352 4796 - 6127 
*Fax* +352 42 88 81 *Email* alex.wei...@technolink.lu
<mailto:alex.wei...@technolink.lu> www.vdl.lu
<http://www.vdl.lu> // www.technolink.lu
<http://www.technolink.lu> Centre Technolink 2, rue Charles de
Tornaco L-2623 LUXEMBOURG

indoors.this.blesses
<https://map.what3words.com/indoors.this.blesses>
schaufel.besten.kopie
<https://map.what3words.com/schaufel.besten.kopie>
supposons.levage.venger
<https://map.what3words.com/supposons.levage.venger>
On 14/03/2020 16:20, Tim Ward wrote:

Have you considered creating the clients as described in the
JAX-RS Whiteboard specification

(https://osgi.org/specification/osgi.cmpn/7.0.0/service.jaxrs.html#d0e134114)?
This avoids the reflective loading pain that you’re hitting
in a reliable way.

    All the best,

Tim

Sent from my iPhone

On 14 Mar 2020, at 15:05, Alex Weirig
mailto:alex.wei...@technolink.lu>> wrote:


BTW:

from my docs it looks like I did t

Re: CNF javax.ws.rs.client.ClientBuilder.newBuilder(ClientBuilder.java:50)

2020-03-14 Thread Alex Weirig

Hi Tim,

thanks for your answer, that was what I was looking at to begin, this 
was my initial code


        @Reference ClientBuilder clientBuilder;

        Client client = clientBuilder.hostnameVerifier((s, session) -> 
true)

 .sslContext(sslContext)
                                     .register(new 
JacksonJsonProvider(objectMapper))

                                     .connectTimeout(10, TimeUnit.MINUTES)
                                 .build();

with but then I faced:

Error executing command: Unable to resolve 
lu.tlk.occupation_postes_electronique.services.login-service [123](R 
123.2): missing requirement 
[lu.tlk.occupation_postes_electronique.services.login-service [123](R 
123.2)] osgi.wiring.package; (osgi.wiring.package=javax.ws.rs.client) 
Unresolved requirements: 
[[lu.tlk.occupation_postes_electronique.services.login-service [123](R 
123.2)] osgi.wiring.package; (osgi.wiring.package=javax.ws.rs.client)]


I then manually added

bundle:install mvn:javax.ws.rs/javax.ws.rs-api/2.1 and then I got Error 
executing command: Error executing command on bundles:Error starting 
bundle 123: Unable to resolve 
lu.tlk.occupation_postes_electronique.services.login-service [123](R 
123.2): missing requirement 
[lu.tlk.occupation_postes_electronique.services.login-service [123](R 
123.2)] osgi.contract; (&(osgi.contract=JavaJAXRS)(version=2.1.0)) 
Unresolved requirements: 
[[lu.tlk.occupation_postes_electronique.services.login-service [123](R 
123.2)] osgi.contract; (&(osgi.contract=JavaJAXRS)(version=2.1.0))]So at 
that point I tried to revert to the old code I already and I knew was 
running back then ... You had a post back in 2018 about this but it was 
related to Java 9 ... I'm still on Java 8. I didn't find anything 
relevant to this contract issue (except some stuff about Johnzon JSON-B ...



Mat frëndleche Gréiss, Mit freundlichen Grüßen, Meilleures salutations, 
Kind regards,

Alex Weirig
Responsable Technique Ville de Luxembourg Service Enseignement Centre 
Technolink *Tel* +352 4796 - 6127  *Fax* +352 42 88 81 
*Email* alex.wei...@technolink.lu <mailto:alex.wei...@technolink.lu> 
www.vdl.lu <http://www.vdl.lu> // www.technolink.lu 
<http://www.technolink.lu> Centre Technolink 2, rue Charles de Tornaco 
L-2623 LUXEMBOURG


//indoors.this.blesses
<https://map.what3words.com/indoors.this.blesses>
//schaufel.besten.kopie
<https://map.what3words.com/schaufel.besten.kopie>
//supposons.levage.venger
<https://map.what3words.com/supposons.levage.venger>
On 14/03/2020 16:20, Tim Ward wrote:
Have you considered creating the clients as described in the JAX-RS 
Whiteboard specification 
(https://osgi.org/specification/osgi.cmpn/7.0.0/service.jaxrs.html#d0e134114)? 
This avoids the reflective loading pain that you’re hitting in a 
reliable way.


All the best,

Tim

Sent from my iPhone

On 14 Mar 2020, at 15:05, Alex Weirig <mailto:alex.wei...@technolink.lu>> wrote:



BTW:

from my docs it looks like I did that in the past using cxf 3.2.4.

Have there been any significant breaking changes since 3.2.4?

Mat frëndleche Gréiss, Mit freundlichen Grüßen, Meilleures 
salutations, Kind regards,

Alex Weirig
Responsable Technique Ville de Luxembourg Service Enseignement Centre 
Technolink *Tel* +352 4796 - 6127  *Fax* +352 42 88 
81 *Email* alex.wei...@technolink.lu 
<mailto:alex.wei...@technolink.lu> www.vdl.lu <http://www.vdl.lu> // 
www.technolink.lu <http://www.technolink.lu> Centre Technolink 2, rue 
Charles de Tornaco L-2623 LUXEMBOURG

//indoors.this.blesses
<https://map.what3words.com/indoors.this.blesses>
//schaufel.besten.kopie
<https://map.what3words.com/schaufel.besten.kopie>
//supposons.levage.venger
<https://map.what3words.com/supposons.levage.venger>
On 14/03/2020 15:59, Alex Weirig wrote:


Hi,

I'm trying to develop a JAX-RS client on karaf 4.2.8.

I've installed the usual suspects:

feature:install scr webconsole

and I've added the cxf repo

cxf-3.3.5 │ 
mvn:org.apache.cxf.karaf/apache-cxf/RELEASE/xml/features


and installed following features:

feature:install cxf-jaxrs cxf-core cxf-commands cxf-http-client 
cxf-jackson


and I've installed my bundles. Everything is starting up as expected 
...


When I try to create a webclient in my code

        Client client = 
ClientBuilder.newBuilder().hostnameVerifier((s, session) -> true)

.sslContext(sslContext)
.register(new JacksonJsonProvider(objectMapper))
.connectTimeout(10, TimeUnit.MINUTES)
.build();

I get a CNF exception.

java.lang.RuntimeException: java.lang.ClassNotFoundException
    at 
javax.ws.rs.client.ClientBuilder.newBuilder(ClientBuilder.java:50) 
~[?:?]
    at 
tlk.occupation_postes_electronique.services.login_service.impl.LoginServiceImpl.authenticate(LoginServiceImpl.java:92) 
~[?:?]
    at 
lu.tlk.occupation_postes_electronique.serv

Re: CNF javax.ws.rs.client.ClientBuilder.newBuilder(ClientBuilder.java:50)

2020-03-14 Thread Alex Weirig

Hi Freeman,

thanks for you answer, this is what I'm getting:

find-class javax.ws.rs.client.ClientFinder

login-service (123)
javax/ws/rs/client/ClientFinder.class

Apache CXF Runtime JAX-RS Frontend (171)
javax/ws/rs/client/ClientFinder.class

Apache CXF JAX-RS Client (173)
javax/ws/rs/client/ClientFinder.class

Mat frëndleche Gréiss, Mit freundlichen Grüßen, Meilleures salutations, 
Kind regards,

Alex Weirig
Responsable Technique Ville de Luxembourg Service Enseignement Centre 
Technolink *Tel* +352 4796 - 6127  *Fax* +352 42 88 81 
*Email* alex.wei...@technolink.lu <mailto:alex.wei...@technolink.lu> 
www.vdl.lu <http://www.vdl.lu> // www.technolink.lu 
<http://www.technolink.lu> Centre Technolink 2, rue Charles de Tornaco 
L-2623 LUXEMBOURG


//indoors.this.blesses
<https://map.what3words.com/indoors.this.blesses>
//schaufel.besten.kopie
<https://map.what3words.com/schaufel.besten.kopie>
//supposons.levage.venger
<https://map.what3words.com/supposons.levage.venger>
On 14/03/2020 16:26, Freeman Fang wrote:

Hi,

This
javax.ws.rs.client.ClientFinder
is suspicious. Could you please use
find-class javax.ws.rs.client.ClientFinder to see which bundle 
contains this class?


In CXF, we use Servicemix wrapped jaxrs spec bundle which doesn't use 
javax.ws.rs.client.ClientFinder at all.


My gut is that somehow you use an incorrect version of jaxrs api 
bundle in your environment.


Freeman

On Sat, Mar 14, 2020 at 10:59 AM Alex Weirig 
mailto:alex.wei...@technolink.lu>> wrote:


Hi,

I'm trying to develop a JAX-RS client on karaf 4.2.8.

I've installed the usual suspects:

feature:install scr webconsole

and I've added the cxf repo

cxf-3.3.5 │
mvn:org.apache.cxf.karaf/apache-cxf/RELEASE/xml/features

and installed following features:

feature:install cxf-jaxrs cxf-core cxf-commands cxf-http-client
cxf-jackson

and I've installed my bundles. Everything is starting up as
expected ...

When I try to create a webclient in my code

        Client client =
ClientBuilder.newBuilder().hostnameVerifier((s, session) -> true)
.sslContext(sslContext)
.register(new JacksonJsonProvider(objectMapper))
.connectTimeout(10, TimeUnit.MINUTES)
.build();

I get a CNF exception.

java.lang.RuntimeException: java.lang.ClassNotFoundException
    at
javax.ws.rs.client.ClientBuilder.newBuilder(ClientBuilder.java:50)
~[?:?]
    at

tlk.occupation_postes_electronique.services.login_service.impl.LoginServiceImpl.authenticate(LoginServiceImpl.java:92)
~[?:?]
    at

lu.tlk.occupation_postes_electronique.services.login_service_test.cmd.LoginServiceTestCommands.testLogin(LoginServiceTestCommands.java:22)
~[?:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method) ~[?:1.8.0_212]
    at

sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
~[?:1.8.0_212]
    at

sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
~[?:1.8.0_212]
    at java.lang.reflect.Method.invoke(Method.java:498)
~[?:1.8.0_212]
    at
org.apache.felix.gogo.runtime.Reflective.invoke(Reflective.java:143)
~[?:?]
    at
org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:91)
~[?:?]
    at

org.apache.karaf.shell.impl.console.osgi.CommandTracker$1.execute(CommandTracker.java:112)
~[?:?]
    at

org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:68)
~[?:?]
    at

org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:86)
~[?:?]
    at
org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:599)
~[?:?]
    at
org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:526)
~[?:?]
    at
org.apache.felix.gogo.runtime.Closure.execute(Closure.java:415) ~[?:?]
    at
org.apache.felix.gogo.runtime.Pipe.doCall(Pipe.java:416) ~[?:?]
    at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:229)
~[?:?]
    at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:59)
~[?:?]
    at
java.util.concurrent.FutureTask.run(FutureTask.java:266)
~[?:1.8.0_212]
    at

java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
~[?:1.8.0_212]
    at

java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
~[?:1.8.0_212]
    at java.lang.Thread.run(Thread.java:748) [?:1.8.0_212]
Caused by: java.lang.ClassNotFoundException
    at
javax.ws.rs.client.ClientFinder.newInstance(ClientFinder.java:120)
~[?:?]
    at
javax.ws.rs.

Re: CNF javax.ws.rs.client.ClientBuilder.newBuilder(ClientBuilder.java:50)

2020-03-14 Thread Alex Weirig

BTW:

from my docs it looks like I did that in the past using cxf 3.2.4.

Have there been any significant breaking changes since 3.2.4?

Mat frëndleche Gréiss, Mit freundlichen Grüßen, Meilleures salutations, 
Kind regards,

Alex Weirig
Responsable Technique Ville de Luxembourg Service Enseignement Centre 
Technolink *Tel* +352 4796 - 6127  *Fax* +352 42 88 81 
*Email* alex.wei...@technolink.lu <mailto:alex.wei...@technolink.lu> 
www.vdl.lu <http://www.vdl.lu> // www.technolink.lu 
<http://www.technolink.lu> Centre Technolink 2, rue Charles de Tornaco 
L-2623 LUXEMBOURG


//indoors.this.blesses
<https://map.what3words.com/indoors.this.blesses>
//schaufel.besten.kopie
<https://map.what3words.com/schaufel.besten.kopie>
//supposons.levage.venger
<https://map.what3words.com/supposons.levage.venger>
On 14/03/2020 15:59, Alex Weirig wrote:


Hi,

I'm trying to develop a JAX-RS client on karaf 4.2.8.

I've installed the usual suspects:

feature:install scr webconsole

and I've added the cxf repo

cxf-3.3.5 │ 
mvn:org.apache.cxf.karaf/apache-cxf/RELEASE/xml/features


and installed following features:

feature:install cxf-jaxrs cxf-core cxf-commands cxf-http-client 
cxf-jackson


and I've installed my bundles. Everything is starting up as expected ...

When I try to create a webclient in my code

        Client client = 
ClientBuilder.newBuilder().hostnameVerifier((s, session) -> true)

.sslContext(sslContext)
.register(new JacksonJsonProvider(objectMapper))
.connectTimeout(10, TimeUnit.MINUTES)
                                           .build();

I get a CNF exception.

java.lang.RuntimeException: java.lang.ClassNotFoundException
    at 
javax.ws.rs.client.ClientBuilder.newBuilder(ClientBuilder.java:50) ~[?:?]
    at 
tlk.occupation_postes_electronique.services.login_service.impl.LoginServiceImpl.authenticate(LoginServiceImpl.java:92) 
~[?:?]
    at 
lu.tlk.occupation_postes_electronique.services.login_service_test.cmd.LoginServiceTestCommands.testLogin(LoginServiceTestCommands.java:22) 
~[?:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
~[?:1.8.0_212]
    at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
~[?:1.8.0_212]
    at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
~[?:1.8.0_212]

    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_212]
    at 
org.apache.felix.gogo.runtime.Reflective.invoke(Reflective.java:143) 
~[?:?]
    at 
org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:91) 
~[?:?]
    at 
org.apache.karaf.shell.impl.console.osgi.CommandTracker$1.execute(CommandTracker.java:112) 
~[?:?]
    at 
org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:68) 
~[?:?]
    at 
org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:86) 
~[?:?]
    at 
org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:599) ~[?:?]
    at 
org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:526) 
~[?:?]
    at 
org.apache.felix.gogo.runtime.Closure.execute(Closure.java:415) ~[?:?]

    at org.apache.felix.gogo.runtime.Pipe.doCall(Pipe.java:416) ~[?:?]
    at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:229) ~[?:?]
    at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:59) ~[?:?]
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
~[?:1.8.0_212]
    at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) 
~[?:1.8.0_212]
    at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) 
~[?:1.8.0_212]

    at java.lang.Thread.run(Thread.java:748) [?:1.8.0_212]
Caused by: java.lang.ClassNotFoundException
    at 
javax.ws.rs.client.ClientFinder.newInstance(ClientFinder.java:120) ~[?:?]
    at javax.ws.rs.client.ClientFinder.find(ClientFinder.java:96) 
~[?:?]
    at 
javax.ws.rs.client.ClientBuilder.newBuilder(ClientBuilder.java:44) ~[?:?]

    ... 21 more
Caused by: java.lang.InstantiationException
    at 
sun.reflect.InstantiationExceptionConstructorAccessorImpl.newInstance(InstantiationExceptionConstructorAccessorImpl.java:48) 
~[?:1.8.0_212]
    at 
java.lang.reflect.Constructor.newInstance(Constructor.java:423) 
~[?:1.8.0_212]

    at java.lang.Class.newInstance(Class.java:442) ~[?:1.8.0_212]
    at 
javax.ws.rs.client.ClientFinder.newInstance(ClientFinder.java:116) ~[?:?]
    at javax.ws.rs.client.ClientFinder.find(ClientFinder.java:96) 
~[?:?]
    at 
javax.ws.rs.client.ClientBuilder.newBuilder(ClientBuilder.java:44) ~[?:?]

    ... 21 more

I'm pretty sure I had something similar running in an older version of 
karaf but I can't figure out what I'm missing today...


Many thanks in advance

--
Mat frëndleche Gréiss, Mit freundliche

CNF javax.ws.rs.client.ClientBuilder.newBuilder(ClientBuilder.java:50)

2020-03-14 Thread Alex Weirig

Hi,

I'm trying to develop a JAX-RS client on karaf 4.2.8.

I've installed the usual suspects:

feature:install scr webconsole

and I've added the cxf repo

cxf-3.3.5 │ 
mvn:org.apache.cxf.karaf/apache-cxf/RELEASE/xml/features


and installed following features:

feature:install cxf-jaxrs cxf-core cxf-commands cxf-http-client cxf-jackson

and I've installed my bundles. Everything is starting up as expected ...

When I try to create a webclient in my code

        Client client = ClientBuilder.newBuilder().hostnameVerifier((s, 
session) -> true)

.sslContext(sslContext)
                                           .register(new 
JacksonJsonProvider(objectMapper))

.connectTimeout(10, TimeUnit.MINUTES)
                                           .build();

I get a CNF exception.

java.lang.RuntimeException: java.lang.ClassNotFoundException
    at 
javax.ws.rs.client.ClientBuilder.newBuilder(ClientBuilder.java:50) ~[?:?]
    at 
tlk.occupation_postes_electronique.services.login_service.impl.LoginServiceImpl.authenticate(LoginServiceImpl.java:92) 
~[?:?]
    at 
lu.tlk.occupation_postes_electronique.services.login_service_test.cmd.LoginServiceTestCommands.testLogin(LoginServiceTestCommands.java:22) 
~[?:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
~[?:1.8.0_212]
    at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
~[?:1.8.0_212]
    at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
~[?:1.8.0_212]

    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_212]
    at 
org.apache.felix.gogo.runtime.Reflective.invoke(Reflective.java:143) ~[?:?]
    at 
org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:91) 
~[?:?]
    at 
org.apache.karaf.shell.impl.console.osgi.CommandTracker$1.execute(CommandTracker.java:112) 
~[?:?]
    at 
org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:68) 
~[?:?]
    at 
org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:86) 
~[?:?]
    at 
org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:599) ~[?:?]
    at 
org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:526) 
~[?:?]
    at 
org.apache.felix.gogo.runtime.Closure.execute(Closure.java:415) ~[?:?]

    at org.apache.felix.gogo.runtime.Pipe.doCall(Pipe.java:416) ~[?:?]
    at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:229) ~[?:?]
    at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:59) ~[?:?]
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
~[?:1.8.0_212]
    at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) 
~[?:1.8.0_212]
    at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) 
~[?:1.8.0_212]

    at java.lang.Thread.run(Thread.java:748) [?:1.8.0_212]
Caused by: java.lang.ClassNotFoundException
    at 
javax.ws.rs.client.ClientFinder.newInstance(ClientFinder.java:120) ~[?:?]
    at javax.ws.rs.client.ClientFinder.find(ClientFinder.java:96) 
~[?:?]
    at 
javax.ws.rs.client.ClientBuilder.newBuilder(ClientBuilder.java:44) ~[?:?]

    ... 21 more
Caused by: java.lang.InstantiationException
    at 
sun.reflect.InstantiationExceptionConstructorAccessorImpl.newInstance(InstantiationExceptionConstructorAccessorImpl.java:48) 
~[?:1.8.0_212]
    at 
java.lang.reflect.Constructor.newInstance(Constructor.java:423) 
~[?:1.8.0_212]

    at java.lang.Class.newInstance(Class.java:442) ~[?:1.8.0_212]
    at 
javax.ws.rs.client.ClientFinder.newInstance(ClientFinder.java:116) ~[?:?]
    at javax.ws.rs.client.ClientFinder.find(ClientFinder.java:96) 
~[?:?]
    at 
javax.ws.rs.client.ClientBuilder.newBuilder(ClientBuilder.java:44) ~[?:?]

    ... 21 more

I'm pretty sure I had something similar running in an older version of 
karaf but I can't figure out what I'm missing today...


Many thanks in advance

--

Mat frëndleche Gréiss, Mit freundlichen Grüßen, Meilleures salutations, 
Kind regards,

Alex Weirig
Responsable Technique Ville de Luxembourg Service Enseignement Centre 
Technolink *Tel* +352 4796 - 6127  *Fax* +352 42 88 81 
*Email* alex.wei...@technolink.lu <mailto:alex.wei...@technolink.lu> 
www.vdl.lu <http://www.vdl.lu> // www.technolink.lu 
<http://www.technolink.lu> Centre Technolink 2, rue Charles de Tornaco 
L-2623 LUXEMBOURG


//indoors.this.blesses
<https://map.what3words.com/indoors.this.blesses>
//schaufel.besten.kopie
<https://map.what3words.com/schaufel.besten.kopie>
//supposons.levage.venger
<https://map.what3words.com/supposons.levage.venger>
<>

Re: JAXRS whiteboard service with client certificate authentication

2020-03-04 Thread Alex Weirig

Hi Tim,

thank you very much ... more stuff to look at.

Mat frëndleche Gréiss, Mit freundlichen Grüßen, Meilleures salutations, 
Kind regards,

Alex Weirig
Responsable Technique Ville de Luxembourg Service Enseignement Centre 
Technolink *Tel* +352 4796 - 6127  *Fax* +352 42 88 81 
*Email* alex.wei...@technolink.lu <mailto:alex.wei...@technolink.lu> 
www.vdl.lu <http://www.vdl.lu> // www.technolink.lu 
<http://www.technolink.lu> Centre Technolink 2, rue Charles de Tornaco 
L-2623 LUXEMBOURG


//indoors.this.blesses
<https://map.what3words.com/indoors.this.blesses>
//schaufel.besten.kopie
<https://map.what3words.com/schaufel.besten.kopie>
//supposons.levage.venger
<https://map.what3words.com/supposons.levage.venger>
On 04/03/2020 11:20, Tim Ward wrote:

Hi Alex,

Did you consider using something like Apache Shiro? The Apache Aries 
JAX-RS whiteboard has a number of integration projects for relevant 
technologies, and one of them adds support for Apache Shiro 
<https://github.com/apache/aries-jax-rs-whiteboard/tree/master/integrations/shiro>.


What I would then do is add the Shiro authentication and authorization 
features to my whiteboard (configured appropriately) and then make 
sure that my whiteboard resource(s) that needed Shiro had the relevant 
extension select 
<https://osgi.org/specification/osgi.cmpn/7.0.0/service.jaxrs.html#d0e133663> filter 
defined.


I hope that helps you with your research.

All the best,

Tim

On 4 Mar 2020, at 08:00, Alex Weirig <mailto:alex.wei...@technolink.lu>> wrote:


Hi Mike,

thanks for the info.


Mat frëndleche Gréiss, Mit freundlichen Grüßen, Meilleures 
salutations, Kind regards,

Alex Weirig
Responsable Technique Ville de Luxembourg Service Enseignement Centre 
Technolink *Tel* +352 4796 - 6127  *Fax* +352 42 88 
81 *Email* alex.wei...@technolink.lu 
<mailto:alex.wei...@technolink.lu> www.vdl.lu <http://www.vdl.lu/> // 
www.technolink.lu <http://www.technolink.lu/> Centre Technolink 2, 
rue Charles de Tornaco L-2623 LUXEMBOURG

//indoors.this.blesses
<https://map.what3words.com/indoors.this.blesses>
//schaufel.besten.kopie
<https://map.what3words.com/schaufel.besten.kopie>
//supposons.levage.venger
<https://map.what3words.com/supposons.levage.venger>
On 04/03/2020 08:59, Mike Hummel wrote:

Hello Alex,

this is not solving your problem... but we use a dedicated web 
server (apache) with http proxy to do all the ssl/tls stuff (this 
has also more performance). Also it checks the client certificate 
and it's possible to add the certificate owner in the http header.


Best Regards, Mike


On 4. Mar 2020, at 08:02, Alex Weirig <mailto:alex.wei...@technolink.lu>> wrote:


Hello,

I have multiple REST webservices running in karaf using Apache 
Aries JAX-RS Whiteboard.


Now I'd need to create a webservice that should require a client 
certificate authentication.


Is there an example somewhere on how to implement this 
authentication (filter, ...?) is an KISS OSGi approach?


I found some code samples using google but they all seem relatively 
complicated or relying on other frameworks (Spring ...).


Many thanks in advance for your help

--
Mat frëndleche Gréiss, Mit freundlichen Grüßen, Meilleures 
salutations, Kind regards,

Alex Weirig
Responsable Technique Ville de Luxembourg Service Enseignement 
Centre Technolink *Tel* +352 4796 - 6127  *Fax* 
+352 42 88 81 *Email* alex.wei...@technolink.lu 
<mailto:alex.wei...@technolink.lu> www.vdl.lu <http://www.vdl.lu/> 
// www.technolink.lu <http://www.technolink.lu/> Centre Technolink 
2, rue Charles de Tornaco L-2623 LUXEMBOURG

//indoors.this.blesses
<https://map.what3words.com/indoors.this.blesses>
//schaufel.besten.kopie
<https://map.what3words.com/schaufel.besten.kopie>
//supposons.levage.venger
<https://map.what3words.com/supposons.levage.venger>



--
This email was Anti Virus checked by SOPHOS UTM




<>

Re: JAXRS whiteboard service with client certificate authentication

2020-03-04 Thread Alex Weirig

Hi Mike,

thanks for the info.


Mat frëndleche Gréiss, Mit freundlichen Grüßen, Meilleures salutations, 
Kind regards,

Alex Weirig
Responsable Technique Ville de Luxembourg Service Enseignement Centre 
Technolink *Tel* +352 4796 - 6127  *Fax* +352 42 88 81 
*Email* alex.wei...@technolink.lu <mailto:alex.wei...@technolink.lu> 
www.vdl.lu <http://www.vdl.lu> // www.technolink.lu 
<http://www.technolink.lu> Centre Technolink 2, rue Charles de Tornaco 
L-2623 LUXEMBOURG


//indoors.this.blesses
<https://map.what3words.com/indoors.this.blesses>
//schaufel.besten.kopie
<https://map.what3words.com/schaufel.besten.kopie>
//supposons.levage.venger
<https://map.what3words.com/supposons.levage.venger>
On 04/03/2020 08:59, Mike Hummel wrote:

Hello Alex,

this is not solving your problem... but we use a dedicated web server 
(apache) with http proxy to do all the ssl/tls stuff (this has also 
more performance). Also it checks the client certificate and it's 
possible to add the certificate owner in the http header.


Best Regards, Mike


On 4. Mar 2020, at 08:02, Alex Weirig <mailto:alex.wei...@technolink.lu>> wrote:


Hello,

I have multiple REST webservices running in karaf using Apache Aries 
JAX-RS Whiteboard.


Now I'd need to create a webservice that should require a client 
certificate authentication.


Is there an example somewhere on how to implement this authentication 
(filter, ...?) is an KISS OSGi approach?


I found some code samples using google but they all seem relatively 
complicated or relying on other frameworks (Spring ...).


Many thanks in advance for your help

--
Mat frëndleche Gréiss, Mit freundlichen Grüßen, Meilleures 
salutations, Kind regards,

Alex Weirig
Responsable Technique Ville de Luxembourg Service Enseignement Centre 
Technolink *Tel* +352 4796 - 6127  *Fax* +352 42 88 
81 *Email* alex.wei...@technolink.lu 
<mailto:alex.wei...@technolink.lu> www.vdl.lu <http://www.vdl.lu/> // 
www.technolink.lu <http://www.technolink.lu/> Centre Technolink 2, 
rue Charles de Tornaco L-2623 LUXEMBOURG

//indoors.this.blesses
<https://map.what3words.com/indoors.this.blesses>
//schaufel.besten.kopie
<https://map.what3words.com/schaufel.besten.kopie>
//supposons.levage.venger
<https://map.what3words.com/supposons.levage.venger>



--
This email was Anti Virus checked by SOPHOS UTM
<>

JAXRS whiteboard service with client certificate authentication

2020-03-03 Thread Alex Weirig

Hello,

I have multiple REST webservices running in karaf using Apache Aries 
JAX-RS Whiteboard.


Now I'd need to create a webservice that should require a client 
certificate authentication.


Is there an example somewhere on how to implement this authentication 
(filter, ...?) is an KISS OSGi approach?


I found some code samples using google but they all seem relatively 
complicated or relying on other frameworks (Spring ...).


Many thanks in advance for your help

--

Mat frëndleche Gréiss, Mit freundlichen Grüßen, Meilleures salutations, 
Kind regards,

Alex Weirig
Responsable Technique Ville de Luxembourg Service Enseignement Centre 
Technolink *Tel* +352 4796 - 6127  *Fax* +352 42 88 81 
*Email* alex.wei...@technolink.lu <mailto:alex.wei...@technolink.lu> 
www.vdl.lu <http://www.vdl.lu> // www.technolink.lu 
<http://www.technolink.lu> Centre Technolink 2, rue Charles de Tornaco 
L-2623 LUXEMBOURG


//indoors.this.blesses
<https://map.what3words.com/indoors.this.blesses>
//schaufel.besten.kopie
<https://map.what3words.com/schaufel.besten.kopie>
//supposons.levage.venger
<https://map.what3words.com/supposons.levage.venger>
<>

Re: 4.3.0??

2019-12-13 Thread Alex Weirig

Hi JB,

sorry, I must really have missed that one.

Looking forward for 4.3.0 !!


Mat frëndleche Gréiss, Mit freundlichen Grüßen, Meilleures salutations, 
Kind regards,

Alex Weirig
Responsable Technique Ville de Luxembourg Service Enseignement Centre 
Technolink *Tel* +352 4796 - 6127  *Fax* +352 42 88 81 
*Email* alex.wei...@technolink.lu <mailto:alex.wei...@technolink.lu> 
www.vdl.lu <http://www.vdl.lu> // www.technolink.lu 
<http://www.technolink.lu> Centre Technolink 2, rue Charles de Tornaco 
L-2623 LUXEMBOURG


//indoors.this.blesses
<https://map.what3words.com/indoors.this.blesses>
//schaufel.besten.kopie
<https://map.what3words.com/schaufel.besten.kopie>
//supposons.levage.venger
<https://map.what3words.com/supposons.levage.venger>
On 13/12/2019 14:30, Jean-Baptiste Onofré wrote:

Hi Alex,

Maybe you missed my latest message about release schedule.

4.3.0.RC1 is plan before the end of this year.

It's already in good shape on my PR:

https://github.com/apache/karaf/pull/995

The assembly/distribution is working with R7.

To be able to merge the PR and move forward on 4.3.0.RC1 release, I have
to fix some tests (utests/itests).

Regards
JB

On 13/12/2019 14:13, Alex Weirig wrote:

Hello,

is there any chance we'll still see 4.3.0 this year?  It had already
been postponed from June to October. At the same time 4.2.x has seen a
couple of updates.

It's been quite a while since R7 was released and still our most
favorite and beloved runtime is still not officially compliant yet.

--

Mat frëndleche Gréiss, Mit freundlichen Grüßen, Meilleures salutations,
Kind regards,
Alex Weirig
Responsable Technique Ville de Luxembourg Service Enseignement Centre
Technolink *Tel* +352 4796 - 6127  *Fax* +352 42 88 81
*Email* alex.wei...@technolink.lu <mailto:alex.wei...@technolink.lu>
www.vdl.lu <http://www.vdl.lu> // www.technolink.lu
<http://www.technolink.lu> Centre Technolink 2, rue Charles de Tornaco
L-2623 LUXEMBOURG

//indoors.this.blesses
<https://map.what3words.com/indoors.this.blesses>
//schaufel.besten.kopie
<https://map.what3words.com/schaufel.besten.kopie>
//supposons.levage.venger
<https://map.what3words.com/supposons.levage.venger>
<>

4.3.0??

2019-12-13 Thread Alex Weirig

Hello,

is there any chance we'll still see 4.3.0 this year?  It had already 
been postponed from June to October. At the same time 4.2.x has seen a 
couple of updates.


It's been quite a while since R7 was released and still our most 
favorite and beloved runtime is still not officially compliant yet.


--

Mat frëndleche Gréiss, Mit freundlichen Grüßen, Meilleures salutations, 
Kind regards,

Alex Weirig
Responsable Technique Ville de Luxembourg Service Enseignement Centre 
Technolink *Tel* +352 4796 - 6127  *Fax* +352 42 88 81 
*Email* alex.wei...@technolink.lu <mailto:alex.wei...@technolink.lu> 
www.vdl.lu <http://www.vdl.lu> // www.technolink.lu 
<http://www.technolink.lu> Centre Technolink 2, rue Charles de Tornaco 
L-2623 LUXEMBOURG


//indoors.this.blesses
<https://map.what3words.com/indoors.this.blesses>
//schaufel.besten.kopie
<https://map.what3words.com/schaufel.besten.kopie>
//supposons.levage.venger
<https://map.what3words.com/supposons.levage.venger>
<>

Re: Bndtools & Karaf : the right way

2019-02-15 Thread Alex Weirig

Hi Christian,

I'm not sure if I'm missing something obvious ... in my project I have a 
few bundles that have to be maven based (Vaadin related projects, so 
they need to build using maven).


When I change code in my regular bndtools workspace related projects, 
whenever I save code it get's automatically build and deployed to my 
local maven repository.


This is unfortunately not the case with the maven projects, I always 
have to manually build the project in order to make it deploy ... and 
the maven build is way slower than the bnd(tools) build... As I only 
have a couple of hours per week to focus on development, I don't want to 
spend that time waiting for maven :-)


Is that different with the "maven build of bndtools" enroute is using... 
I'm ashamed but I still couldn't find the time to look into that new 
approach after Eclipse/OSGi Con last year ... so maybe I'm still 
complaining about things that are actually solved.


Thanks

Mat frëndleche Gréiss, Mit freundlichen Grüßen, Meilleures salutations, 
Kind regards,

Alex Weirig
Responsable Technique Ville de Luxembourg Service Enseignement Centre 
Technolink *Tel* +352 4796 - 6127  *Fax* +352 42 88 81 
*Email* alex.wei...@technolink.lu <mailto:alex.wei...@technolink.lu> 
www.vdl.lu <http://www.vdl.lu> // www.technolink.lu 
<http://www.technolink.lu> Centre Technolink 2, rue Charles de Tornaco 
L-2623 LUXEMBOURG


On 15/02/2019 13:03, Christian Schneider wrote:
I agree with Alex about using bundle:watch. It gives you a similar 
experience like bndtools once your bundles are running in karaf.
To get the bundles running easier I propose you also create a karaf 
feature in your build.


I also propose you move away from the bndtools workspace model and 
instead use the maven build of bndtools like enroute now shows. It is 
much nearer to how karaf projects are built.


One other thing that might come handy is to start karaf with the 
"debug" argument. This opens karaf for remote debugging and allows you 
to also  debug your bundles easily. Basically it is like running the 
bndtools starter in debug mode.


Christian

Am Fr., 15. Feb. 2019 um 12:55 Uhr schrieb Alex Weirig 
mailto:alex.wei...@technolink.lu>>:


Hi Kamil,

let me try and see if this can already help you, it's very basic
but works really fine depending on the scope / size of your
development project ... this is based on bnd(tools) 4.0.0 but
should still be valid in 4.1.0 I guess.

If you look at your build.bnd file in your bndtools workspace,
make sure you have the following plugin defined:

-plugin.5.LocalMaven: \
aQute.bnd.repository.maven.provider.MavenBndRepository; \
        name = *LocalMaven*

then you define the buildRepo:

-buildrepo: \
*LocalMaven*

finally set some maven data:

-pom: \
    groupid    = *your.group*,\
    version = ${versionmask;===;${@version}}-SNAPSHOT


Now when bnd(tools) builds your project it should end up in your
local maven repository (your home
folder/.m2/repository/*your/group*). So no need to gradle here.

You can now run a karaf on your local machine and install your
bundles using:

bundle:install mvn:your.group/your bundle name here/version here

as you're doing right now.

Now you can tell karaf to monitor your bundles:

bundle:watch --start *

Thus, whenever you change any line of code in your Eclipse,
bnd(tools) will compile the code, build the bundle and deploy it
to your local maven repo. Karaf will notice the change and update
the bundle to the latest version. You can return to karaf and
immediately test your updated code.

I find this is a really nice and efficient way to do development
without too much overhead (well you need to run the bundle:watch
--start * after every restart of karaf but maybe there's also a
way to work around it.

You don't have to deal with maven (which I am convinced is more of
a problem than a solution), except for setting your groupid and
version pattern and having the build bundles deployed in your
local maven repository.

I'm sure this is not a valid approach if you're working with a
large team where everybody needs to rely on somebody else's code
and you have a complete CI chain etc etc.


You can improve deployment by building a karaf feature
(https://karaf.apache.org/manual/latest/provisioning), that's
merely an xml file using your local maven repo to retrieve the bundle.

You create your feature_file.xml, copy it to the "deploy" folder
in karaf and then run a feature:install your_feature_name to
install one of the features containing the different bundles.

Hope it helps ... hope it is not too basic for your needs.

Mat frëndleche Gréiss, Mit freundlichen Grüßen, Meilleures
salutations, Kind regards,
Alex Weirig
Responsable Technique Ville de

Re: Bndtools & Karaf : the right way

2019-02-15 Thread Alex Weirig

Hi Kamil,

let me try and see if this can already help you, it's very basic but 
works really fine depending on the scope / size of your development 
project ... this is based on bnd(tools) 4.0.0 but should still be valid 
in 4.1.0 I guess.


If you look at your build.bnd file in your bndtools workspace, make sure 
you have the following plugin defined:


-plugin.5.LocalMaven: \
aQute.bnd.repository.maven.provider.MavenBndRepository; \
        name = *LocalMaven*

then you define the buildRepo:

-buildrepo: \
*LocalMaven*

finally set some maven data:

-pom: \
    groupid    = *your.group*,\
    version =    ${versionmask;===;${@version}}-SNAPSHOT


Now when bnd(tools) builds your project it should end up in your local 
maven repository (your home folder/.m2/repository/*your/group*). So no 
need to gradle here.


You can now run a karaf on your local machine and install your bundles 
using:


bundle:install mvn:your.group/your bundle name here/version here

as you're doing right now.

Now you can tell karaf to monitor your bundles:

bundle:watch --start *

Thus, whenever you change any line of code in your Eclipse, bnd(tools) 
will compile the code, build the bundle and deploy it to your local 
maven repo. Karaf will notice the change and update the bundle to the 
latest version. You can return to karaf and immediately test your 
updated code.


I find this is a really nice and efficient way to do development without 
too much overhead (well you need to run the bundle:watch --start * after 
every restart of karaf but maybe there's also a way to work around it.


You don't have to deal with maven (which I am convinced is more of a 
problem than a solution), except for setting your groupid and version 
pattern and having the build bundles deployed in your local maven 
repository.


I'm sure this is not a valid approach if you're working with a large 
team where everybody needs to rely on somebody else's code and you have 
a complete CI chain etc etc.



You can improve deployment by building a karaf feature 
(https://karaf.apache.org/manual/latest/provisioning), that's merely an 
xml file using your local maven repo to retrieve the bundle.


You create your feature_file.xml, copy it to the "deploy" folder in 
karaf and then run a feature:install your_feature_name to install one of 
the features containing the different bundles.


Hope it helps ... hope it is not too basic for your needs.

Mat frëndleche Gréiss, Mit freundlichen Grüßen, Meilleures salutations, 
Kind regards,

Alex Weirig
Responsable Technique Ville de Luxembourg Service Enseignement Centre 
Technolink *Tel* +352 4796 - 6127  *Fax* +352 42 88 81 
*Email* alex.wei...@technolink.lu <mailto:alex.wei...@technolink.lu> 
www.vdl.lu <http://www.vdl.lu> // www.technolink.lu 
<http://www.technolink.lu> Centre Technolink 2, rue Charles de Tornaco 
L-2623 LUXEMBOURG


On 15/02/2019 12:29, Kamil Paśko wrote:

Dear JB,

> Do you already know what you have in mind (if you could describe the use
case, that would be great) ?

I know that this could be silly problem, but I'm new to Karaf, new to 
Bndtools and new to OSGi (I begun my research week ago).

That is why I decided to search for tutorials and examples first.
But if you ask (it's very kind), then I have two use cases:

Case 1:
Background:
I've learnt how to use Bndtools workspace in Eclipse and how to run 
examples directly in Eclipse IDE (https://bndtools.org/tutorial.html).

Unfortunatelly, default OSGi runtime is Felix with Gogo shell.
Problem:
How to configure Bndtools workspace to use Karaf (that I have 
somewhere in my filesystem) instead of default Felix runtime?


Case 2:
Background
I've learn how to use Bnd Gradle plugin 
(https://github.com/bndtools/bnd/tree/master/biz.aQute.bnd.gradle#replacing-use-of-gradles-deprecated-osgi-plugin) 
to create bundles and I used Gradle's maven publish plugin to publish 
them to Maven's local repo. Then I install them in Karaf one by one 
using bundle:install mvn:xxx/yyy/zzz command

Problem:
a) How to create set of bundles (feature) in Bnd?
b) How to deploy this to Karaf without manually executing 
bundle:install commands?


Thank you in advance,
Kamil


On Thu, Feb 14, 2019 at 1:37 PM Jean-Baptiste Onofré <mailto:j...@nanthrax.net>> wrote:


Hi,

We didn't move forward a lot. I remember there was some discussion to
have a "Karaf exporter" in bndtools and I proposed my help on this.
I didn't move forward yet.

Do you already know what you have in mind (if you could describe
the use
case, that would be great) ?

Regards
JB

On 14/02/2019 13:20, kamilantlgc wrote:
> Dear Karaf User group,
>
> I have stumbled upon the exact problem - how to join Karaf and
Bndtools
> together "the right way" (this conversation is the first result
in Google by
> the way: https://www.google.com/search?q=karaf+bnd).
>
&g

Re: Karaf Cave Release addressing KARAF-5555

2018-08-28 Thread Alex Weirig

Hello,

is there anything new in regards to this issue?

Has a fix been released yet that I might have missed?

Many thanks in advance

Mat frëndleche Gréiss, Mit freundlichen Grüßen, Meilleures salutations, 
Kind regards,

Alex Weirig
Responsable Technique Ville de Luxembourg Service Enseignement Centre 
Technolink *Tel* +352 4796 - 6127  *Fax* +352 42 88 81 
*Email* alex.wei...@technolink.lu <mailto:alex.wei...@technolink.lu> 
www.vdl.lu <http://www.vdl.lu> // www.technolink.lu 
<http://www.technolink.lu> Centre Technolink 2, rue Charles de Tornaco 
L-2623 LUXEMBOURG


On 10/03/2018 20:13, Jean-Baptiste Onofré wrote:

Hi

Yes but I have other fixes and new features on the fly. I will cut a 
release as soon as it's done. Roughly I plan a release in a couple of 
weeks.


Regards
JB
Le 10 mars 2018, à 12:02, ivoleitao <mailto:ivo.lei...@gmail.com>> a écrit:


Hi,

Sorry JB missed that one. Any plans for cutting a new release ?

Regards and once more thank you for your help,
Ivo Leitão




--
Sent from:http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html

<>

Re: REST - Declarative Services

2018-05-29 Thread Alex Weirig

BTW: these should be the features I installed in karaf ...

feature:repo-add cxf-dosgi
feature:install cxf-dosgi-provider-rs


Mat frëndleche Gréiss, Mit freundlichen Grüßen, Meilleures salutations, 
Kind regards,

Alex Weirig
Responsable Technique Ville de Luxembourg Service Enseignement Centre 
Technolink *Tel* +352 4796 - 6127  *Fax* +352 42 88 81 
*Email* alex.wei...@technolink.lu <mailto:alex.wei...@technolink.lu> 
www.vdl.lu <http://www.vdl.lu> // www.technolink.lu 
<http://www.technolink.lu> Centre Technolink 2, rue Charles de Tornaco 
L-2623 LUXEMBOURG


On 29/05/2018 08:36, Alex Weirig wrote:


I'm using the approach Christian is referring to and I can confirm 
that it's really easy and convenient.


I'm creating DS services to expose selected backend services with a 
REST API


@Component(
        immediate = true
        , property = {
                "service.exported.interfaces=*",
                "service.exported.configs=org.apache.cxf.rs",
                "org.apache.cxf.rs.address=/room-service"
        }
        , service = GestionInfrastructuresREST.class
)
public class GestionInfrastructuresRESTImpl implements 
GestionInfrastructuresREST {


    @Reference private LogService logger;
    @Reference private GestionInfrastructuresService service;     // 
my backend service


    ...


    @Override
    public Response getAllRooms() {
        List allRooms = 
service.getAllRooms();    // call to the backend service


        ... // process the result from the backend service

   return Response.ok(json, 
MediaType.APPLICATION_JSON).build();    // if result is OK


        ...  // do some error processing and return some error  e.g.
        return Response.serverError().build();
    }

}

Mat frëndleche Gréiss, Mit freundlichen Grüßen, Meilleures 
salutations, Kind regards,

Alex Weirig
Responsable Technique Ville de Luxembourg Service Enseignement Centre 
Technolink *Tel* +352 4796 - 6127  *Fax* +352 42 88 
81 *Email* alex.wei...@technolink.lu 
<mailto:alex.wei...@technolink.lu> www.vdl.lu <http://www.vdl.lu> // 
www.technolink.lu <http://www.technolink.lu> Centre Technolink 2, rue 
Charles de Tornaco L-2623 LUXEMBOURG

On 28/05/2018 23:01, Christian Schneider wrote:
Aries JAX-RS should work. It is not yet released though. So currently 
there is only a snapshot. A release should follow soon.


Another option is to use CXF-DOSGi. You can find an example below. It 
is similar to Aries JAX-RS so a later switch should be easy.


https://github.com/apache/cxf-dosgi/tree/master/samples/rest

Christian

2018-05-28 19:40 GMT+02:00 Guenther Schmidt <mailto:schmi...@gmail.com>>:


Hello All,

I’ve been developing services using Declarative Services for
dependency injection and it was a breeze so far. Now I want to
expose some of the functionality via a REST API and I’m stuck. So
far I’ve deployed my bundles through bundle:install -s man: ….
all very easy. But what should be simple, exposing this through
REST is becoming difficult. There are tips out there suggesting
to use Blueprint, which I don’t want, others seem to suggest that
I need to create a “feature” package.

Then there’s also the requirements to “feature” install cxf.
That’s OK btw, I only have to do that once. But is there really
no simple way to create a simple REST service using merely DS?

Guenther





--
--
Christian Schneider
http://www.liquid-reality.de

Computer Scientist
http://www.adobe.com

--
This email was Anti Virus checked by SOPHOS UTM




<>

Re: REST - Declarative Services

2018-05-29 Thread Alex Weirig
I'm using the approach Christian is referring to and I can confirm that 
it's really easy and convenient.


I'm creating DS services to expose selected backend services with a REST API

@Component(
        immediate = true
        , property = {
                "service.exported.interfaces=*",
                "service.exported.configs=org.apache.cxf.rs",
                "org.apache.cxf.rs.address=/room-service"
        }
        , service = GestionInfrastructuresREST.class
)
public class GestionInfrastructuresRESTImpl implements 
GestionInfrastructuresREST {


    @Reference private LogService logger;
    @Reference private GestionInfrastructuresService service;     // my 
backend service


    ...


    @Override
    public Response getAllRooms() {
        List allRooms = 
service.getAllRooms();    // call to the backend service


        ... // process the result from the backend service

   return Response.ok(json, MediaType.APPLICATION_JSON).build();    
// if result is OK


        ...  // do some error processing and return some error  e.g.
        return Response.serverError().build();
    }

}

Mat frëndleche Gréiss, Mit freundlichen Grüßen, Meilleures salutations, 
Kind regards,

Alex Weirig
Responsable Technique Ville de Luxembourg Service Enseignement Centre 
Technolink *Tel* +352 4796 - 6127  *Fax* +352 42 88 81 
*Email* alex.wei...@technolink.lu <mailto:alex.wei...@technolink.lu> 
www.vdl.lu <http://www.vdl.lu> // www.technolink.lu 
<http://www.technolink.lu> Centre Technolink 2, rue Charles de Tornaco 
L-2623 LUXEMBOURG


On 28/05/2018 23:01, Christian Schneider wrote:
Aries JAX-RS should work. It is not yet released though. So currently 
there is only a snapshot. A release should follow soon.


Another option is to use CXF-DOSGi. You can find an example below. It 
is similar to Aries JAX-RS so a later switch should be easy.


https://github.com/apache/cxf-dosgi/tree/master/samples/rest

Christian

2018-05-28 19:40 GMT+02:00 Guenther Schmidt <mailto:schmi...@gmail.com>>:


Hello All,

I’ve been developing services using Declarative Services for
dependency injection and it was a breeze so far. Now I want to
expose some of the functionality via a REST API and I’m stuck. So
far I’ve deployed my bundles through bundle:install -s man: …. all
very easy. But what should be simple, exposing this through REST
is becoming difficult. There are tips out there suggesting to use
Blueprint, which I don’t want, others seem to suggest that I need
to create a “feature” package.

Then there’s also the requirements to “feature” install cxf.
That’s OK btw, I only have to do that once. But is there really no
simple way to create a simple REST service using merely DS?

Guenther





--
--
Christian Schneider
http://www.liquid-reality.de

Computer Scientist
http://www.adobe.com

--
This email was Anti Virus checked by SOPHOS UTM


<>

NPE if "PROTOTYPE" bundle is updated

2018-05-04 Thread Alex Weirig

Hello,

I'm getting the attached NPE stacktrace in Karaf 4.2.0 when I update a 
bundle containing PROTOTYPE based components, e.g.


@Component(scope = ServiceScope.PROTOTYPE, service = Module.class, 
property = { "view=Application" })



I develop my bundles using Eclipse and BND(tools). The bndtools build 
deploys the bundles to my local .m2 repository.


I install the bundles in Karaf using bundle:install mvn:  and I use 
bundle:watch --start * to watch for bundle changes.


It looks like the NPE isn't a show stopper, so Karaf continues to work 
but it's annoying to always see the stacktraces.



--

Mat frëndleche Gréiss, Mit freundlichen Grüßen, Meilleures salutations, 
Kind regards,

Alex Weirig
Responsable Technique Ville de Luxembourg Service Enseignement Centre 
Technolink *Tel* +352 4796 - 6127 <tel:+35247966127> *Fax* +352 42 88 81 
*Email* alex.wei...@technolink.lu <mailto:alex.wei...@technolink.lu> 
www.vdl.lu <http://www.vdl.lu> // www.technolink.lu 
<http://www.technolink.lu> Centre Technolink 2, rue Charles de Tornaco 
L-2623 LUXEMBOURG


tration.modules.welcome [196] EventDispatcher: Error during dispatch. 
(java.lang.NullPointerException)
java.lang.NullPointerException: null
at 
java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:936) ~[?:?]
at 
org.apache.felix.scr.impl.manager.MultiplePrototypeRefPair.unsetServiceObject(MultiplePrototypeRefPair.java:67)
 ~[?:?]
at 
org.apache.felix.scr.impl.manager.DependencyManager$AbstractCustomizer.ungetService(DependencyManager.java:222)
 ~[?:?]
at 
org.apache.felix.scr.impl.manager.DependencyManager$MultipleDynamicCustomizer.removedService(DependencyManager.java:392)
 ~[?:?]
at 
org.apache.felix.scr.impl.manager.DependencyManager$MultipleDynamicCustomizer.removedService(DependencyManager.java:291)
 ~[?:?]
at 
org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.customizerRemoved(ServiceTracker.java:1242)
 ~[?:?]
at 
org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.customizerRemoved(ServiceTracker.java:1137)
 ~[?:?]
at 
org.apache.felix.scr.impl.manager.ServiceTracker$AbstractTracked.untrack(ServiceTracker.java:997)
 ~[?:?]
at 
org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:1176)
 ~[?:?]
at 
org.apache.felix.scr.impl.BundleComponentActivator$ListenerInfo.serviceChanged(BundleComponentActivator.java:127)
 ~[?:?]
at 
org.apache.felix.framework.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:990)
 ~[?:?]
at 
org.apache.felix.framework.EventDispatcher.fireEventImmediately(EventDispatcher.java:838)
 [?:?]
at 
org.apache.felix.framework.EventDispatcher.fireServiceEvent(EventDispatcher.java:545)
 [?:?]
at org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:4595) 
[?:?]
at org.apache.felix.framework.Felix.access$000(Felix.java:106) [?:?]
at org.apache.felix.framework.Felix$1.serviceChanged(Felix.java:420) 
[?:?]
at 
org.apache.felix.framework.ServiceRegistry.unregisterService(ServiceRegistry.java:170)
 [?:?]
at 
org.apache.felix.framework.ServiceRegistrationImpl.unregister(ServiceRegistrationImpl.java:144)
 [?:?]
at 
org.apache.felix.scr.impl.manager.AbstractComponentManager$3.unregister(AbstractComponentManager.java:925)
 [48:org.apache.felix.scr:2.0.14]
at 
org.apache.felix.scr.impl.manager.AbstractComponentManager$3.unregister(AbstractComponentManager.java:890)
 [48:org.apache.felix.scr:2.0.14]
at 
org.apache.felix.scr.impl.manager.RegistrationManager.changeRegistration(RegistrationManager.java:139)
 [48:org.apache.felix.scr:2.0.14]
at 
org.apache.felix.scr.impl.manager.AbstractComponentManager.unregisterService(AbstractComponentManager.java:967)
 [48:org.apache.felix.scr:2.0.14]
at 
org.apache.felix.scr.impl.manager.AbstractComponentManager.doDeactivate(AbstractComponentManager.java:822)
 [48:org.apache.felix.scr:2.0.14]
at 
org.apache.felix.scr.impl.manager.AbstractComponentManager.deactivateInternal(AbstractComponentManager.java:804)
 [48:org.apache.felix.scr:2.0.14]
at 
org.apache.felix.scr.impl.manager.DependencyManager.deactivateComponentManager(DependencyManager.java:2230)
 [48:org.apache.felix.scr:2.0.14]
at 
org.apache.felix.scr.impl.manager.DependencyManager.access$500(DependencyManager.java:55)
 [48:org.apache.felix.scr:2.0.14]
at 
org.apache.felix.scr.impl.manager.DependencyManager$SingleDynamicCustomizer.removedService(DependencyManager.java:890)
 [48:org.apache.felix.scr:2.0.14]
at 
org.apache.felix.scr.impl.manager.DependencyManager$SingleDynamicCustomizer.removedService(DependencyManager.java:743)
 [48:org.apache.felix.scr:2.0.14]
at 
org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.customizerRemoved(ServiceTracker.java:1242

Re: Using jasypt in Karaf 4.1.4 without Blueprint?

2018-02-19 Thread Alex Weirig

OK then it might make sense to add the decrypt support.


Schéin Gréiss, Mit freundlichen Grüßen, Meilleures salutations, Kind 
regards,


Alex Weirig
Responsable Technique

Ville de Luxembourg - Centre Technolink 2, rue Charles de Tornaco L - 
2623 LUXEMBOURG alex.wei...@technolink.lu 
<mailto:alex.wei...@technolink.lu> Tel: +352 4796 - 6127 Fax: +352 42 88 
81 www.technolink.lu <http://www.technolink.lu>


On 19/02/2018 15:20, Jean-Baptiste Onofré wrote:

As most of Karaf committers are also Pax * projects contributors, I think it's a
fair request.

However, Pax JDBC already provides such feature: it's part of pax-jdbc-config
already (in the DataSourceConfigManager). It uses an embedded encryption service
(not the one provided by Karaf), but it's basically what you need.

My point was more for your application or finding a generic way.

Regards
JB

On 02/19/2018 03:05 PM, Alex Weirig wrote:

Before we go ahead and add the decrypt feature, would the maintainers of e.g.
PAX JDBC etc be interested in adding support for this in their services?


Schéin Gréiss, Mit freundlichen Grüßen, Meilleures salutations, Kind regards,

Alex Weirig
Responsable Technique

Ville de Luxembourg - Centre Technolink 2, rue Charles de Tornaco L - 2623
LUXEMBOURG alex.wei...@technolink.lu <mailto:alex.wei...@technolink.lu> Tel:
+352 4796 - 6127 Fax: +352 42 88 81 www.technolink.lu <http://www.technolink.lu>

On 19/02/2018 14:03, Jean-Baptiste Onofré wrote:

Yes, that would work but it requires:

1. either a change at ConfigAdmin layer (difficult and not accurate IMHO)
2. a Karaf service that application (like Pax JDBC) can leverage when a
{CRYPT}hash{CRYPT} property value pattern is detected.

Karaf JAAS already has EncryptionService providing encryption only. We have two
implementation of this service:
- Basic (BasicEncryptionService)
- Jasypt (JasyptEncryptionService)

I can extend the EncryptionService to also provide decrypt and check.

Regards
JB

On 02/19/2018 01:56 PM, Alex Weirig wrote:

That's correct and that's what I'm trying to solve (or work around).

E.g.

I need to store my mysql password in the config file. The password is 1234pwd.

Imagine we have a karaf command that's config:encrypt.

I use config:encrypt 1234pwd and it returns a hash, this hash would computed
using a master password that would be different for each karaf instance based on
it's "environment".

Now when ConfigAdmin reads the configuration file it will know how to compute
the master password and decrypt the password and use the decrypted password
(1234pwd) with the datasource or JDBC connection.

Since there would be no "API" to do this decryption "by hand" nobody would
"easily" be able to get access to the decrypted password.

I'm currently looking if each karaf instance has some kind of a GUID or if there
is some kind of GUID available from the system or something else that could be
used to compute the instance related master password.

So basically the idea is to make the decryption "configuration" a system 
feature?

Schéin Gréiss, Mit freundlichen Grüßen, Meilleures salutations, Kind regards,

Alex Weirig
Responsable Technique

Ville de Luxembourg - Centre Technolink 2, rue Charles de Tornaco L - 2623
LUXEMBOURG alex.wei...@technolink.lu <mailto:alex.wei...@technolink.lu> Tel:
+352 4796 - 6127 Fax: +352 42 88 81 www.technolink.lu <http://www.technolink.lu>

On 19/02/2018 13:44, Jean-Baptiste Onofré wrote:

Hi Alex,

The problem is the "direction".

Let me take an example: the encryption service we have to crypt passwords in
etc/users.properties.
Here's the direction is pretty simple: the user provides the password, we
encrypt the password using the configuration defined in
etc/org.apache.karaf.jaas.cfg and we compare the hashes: if the hash is the same
as the one contained in the etc/users.properties, then, it's OK.

But the user provides his password.

In any cfg configurations, it's the opposite: the application (let's say
pax-jdbc or your own application) expects the property value in clear text
whereas it's stored encrypted. So, it means that somehow we have to start from
the encrypted property value to provide the clear text one.
For instance, you are using pax-jdbc for datasources. You want to store the
database password encrypted in the cfg file. However, to actually establish the
connection, we have to use the password in clear text. So, we have to decrypt.

So a generic solution at ConfigAdmin layer would require decrypt->clear
direction which obviously require the decryption "configuration".

Regards
JB

On 02/19/2018 01:31 PM, Alex Weirig wrote:

Hi Jean-Baptiste,

that sounds like an interesting idea but you are pointing at an obvious drawback
with these solutions...

If we're using a "master password" (like jasypt) we need to provide this master
password in order to allow decryption of the password. Tha

Re: Using jasypt in Karaf 4.1.4 without Blueprint?

2018-02-19 Thread Alex Weirig
Before we go ahead and add the decrypt feature, would the maintainers of 
e.g. PAX JDBC etc be interested in adding support for this in their 
services?



Schéin Gréiss, Mit freundlichen Grüßen, Meilleures salutations, Kind 
regards,


Alex Weirig
Responsable Technique

Ville de Luxembourg - Centre Technolink 2, rue Charles de Tornaco L - 
2623 LUXEMBOURG alex.wei...@technolink.lu 
<mailto:alex.wei...@technolink.lu> Tel: +352 4796 - 6127 Fax: +352 42 88 
81 www.technolink.lu <http://www.technolink.lu>


On 19/02/2018 14:03, Jean-Baptiste Onofré wrote:

Yes, that would work but it requires:

1. either a change at ConfigAdmin layer (difficult and not accurate IMHO)
2. a Karaf service that application (like Pax JDBC) can leverage when a
{CRYPT}hash{CRYPT} property value pattern is detected.

Karaf JAAS already has EncryptionService providing encryption only. We have two
implementation of this service:
- Basic (BasicEncryptionService)
- Jasypt (JasyptEncryptionService)

I can extend the EncryptionService to also provide decrypt and check.

Regards
JB

On 02/19/2018 01:56 PM, Alex Weirig wrote:

That's correct and that's what I'm trying to solve (or work around).

E.g.

I need to store my mysql password in the config file. The password is 1234pwd.

Imagine we have a karaf command that's config:encrypt.

I use config:encrypt 1234pwd and it returns a hash, this hash would computed
using a master password that would be different for each karaf instance based on
it's "environment".

Now when ConfigAdmin reads the configuration file it will know how to compute
the master password and decrypt the password and use the decrypted password
(1234pwd) with the datasource or JDBC connection.

Since there would be no "API" to do this decryption "by hand" nobody would
"easily" be able to get access to the decrypted password.

I'm currently looking if each karaf instance has some kind of a GUID or if there
is some kind of GUID available from the system or something else that could be
used to compute the instance related master password.

So basically the idea is to make the decryption "configuration" a system 
feature?

Schéin Gréiss, Mit freundlichen Grüßen, Meilleures salutations, Kind regards,

Alex Weirig
Responsable Technique

Ville de Luxembourg - Centre Technolink 2, rue Charles de Tornaco L - 2623
LUXEMBOURG alex.wei...@technolink.lu <mailto:alex.wei...@technolink.lu> Tel:
+352 4796 - 6127 Fax: +352 42 88 81 www.technolink.lu <http://www.technolink.lu>

On 19/02/2018 13:44, Jean-Baptiste Onofré wrote:

Hi Alex,

The problem is the "direction".

Let me take an example: the encryption service we have to crypt passwords in
etc/users.properties.
Here's the direction is pretty simple: the user provides the password, we
encrypt the password using the configuration defined in
etc/org.apache.karaf.jaas.cfg and we compare the hashes: if the hash is the same
as the one contained in the etc/users.properties, then, it's OK.

But the user provides his password.

In any cfg configurations, it's the opposite: the application (let's say
pax-jdbc or your own application) expects the property value in clear text
whereas it's stored encrypted. So, it means that somehow we have to start from
the encrypted property value to provide the clear text one.
For instance, you are using pax-jdbc for datasources. You want to store the
database password encrypted in the cfg file. However, to actually establish the
connection, we have to use the password in clear text. So, we have to decrypt.

So a generic solution at ConfigAdmin layer would require decrypt->clear
direction which obviously require the decryption "configuration".

Regards
JB

On 02/19/2018 01:31 PM, Alex Weirig wrote:

Hi Jean-Baptiste,

that sounds like an interesting idea but you are pointing at an obvious drawback
with these solutions...

If we're using a "master password" (like jasypt) we need to provide this master
password in order to allow decryption of the password. That master password has
to be available in clear text but then, at the end of day you're only protecting
your environment against "hackers" that are able to "hack" you systems but "too
stupid" to decrypt the password using the master password.

Possibly storing the password in a file with limited ownership access rights
might help a little bit but if the hacker has (root) access he will get around
that too.

I was thinking if it would be possible to create a "karaf password encryption
feature" where each karaf instance would have it's own computable (since we
can't store it) "master password" (maybe based on a machine identifier) and
would allow you to encrypt the password but there would be no "API or utility"
to allow the user to decrypt the password.

Now the "hacker" would need more knowledge to get access to the passwords ...

Sché

Re: Using jasypt in Karaf 4.1.4 without Blueprint?

2018-02-19 Thread Alex Weirig

That's correct and that's what I'm trying to solve (or work around).

E.g.

I need to store my mysql password in the config file. The password is 
1234pwd.


Imagine we have a karaf command that's config:encrypt.

I use config:encrypt 1234pwd and it returns a hash, this hash would 
computed using a master password that would be different for each karaf 
instance based on it's "environment".


Now when ConfigAdmin reads the configuration file it will know how to 
compute the master password and decrypt the password and use the 
decrypted password (1234pwd) with the datasource or JDBC connection.


Since there would be no "API" to do this decryption "by hand" nobody 
would "easily" be able to get access to the decrypted password.


I'm currently looking if each karaf instance has some kind of a GUID or 
if there is some kind of GUID available from the system or something 
else that could be used to compute the instance related master password.


So basically the idea is to make the decryption "configuration" a system 
feature?


Schéin Gréiss, Mit freundlichen Grüßen, Meilleures salutations, Kind 
regards,


Alex Weirig
Responsable Technique

Ville de Luxembourg - Centre Technolink 2, rue Charles de Tornaco L - 
2623 LUXEMBOURG alex.wei...@technolink.lu 
<mailto:alex.wei...@technolink.lu> Tel: +352 4796 - 6127 Fax: +352 42 88 
81 www.technolink.lu <http://www.technolink.lu>


On 19/02/2018 13:44, Jean-Baptiste Onofré wrote:

Hi Alex,

The problem is the "direction".

Let me take an example: the encryption service we have to crypt passwords in
etc/users.properties.
Here's the direction is pretty simple: the user provides the password, we
encrypt the password using the configuration defined in
etc/org.apache.karaf.jaas.cfg and we compare the hashes: if the hash is the same
as the one contained in the etc/users.properties, then, it's OK.

But the user provides his password.

In any cfg configurations, it's the opposite: the application (let's say
pax-jdbc or your own application) expects the property value in clear text
whereas it's stored encrypted. So, it means that somehow we have to start from
the encrypted property value to provide the clear text one.
For instance, you are using pax-jdbc for datasources. You want to store the
database password encrypted in the cfg file. However, to actually establish the
connection, we have to use the password in clear text. So, we have to decrypt.

So a generic solution at ConfigAdmin layer would require decrypt->clear
direction which obviously require the decryption "configuration".

Regards
JB

On 02/19/2018 01:31 PM, Alex Weirig wrote:

Hi Jean-Baptiste,

that sounds like an interesting idea but you are pointing at an obvious drawback
with these solutions...

If we're using a "master password" (like jasypt) we need to provide this master
password in order to allow decryption of the password. That master password has
to be available in clear text but then, at the end of day you're only protecting
your environment against "hackers" that are able to "hack" you systems but "too
stupid" to decrypt the password using the master password.

Possibly storing the password in a file with limited ownership access rights
might help a little bit but if the hacker has (root) access he will get around
that too.

I was thinking if it would be possible to create a "karaf password encryption
feature" where each karaf instance would have it's own computable (since we
can't store it) "master password" (maybe based on a machine identifier) and
would allow you to encrypt the password but there would be no "API or utility"
to allow the user to decrypt the password.

Now the "hacker" would need more knowledge to get access to the passwords ...

Schéin Gréiss, Mit freundlichen Grüßen, Meilleures salutations, Kind regards,

Alex Weirig
Responsable Technique

Ville de Luxembourg - Centre Technolink 2, rue Charles de Tornaco L - 2623
LUXEMBOURG alex.wei...@technolink.lu <mailto:alex.wei...@technolink.lu> Tel:
+352 4796 - 6127 Fax: +352 42 88 81 www.technolink.lu <http://www.technolink.lu>

On 19/02/2018 08:03, Jean-Baptiste Onofré wrote:

Hi Alex,

We can imagine to add a feature that detect property values with a pattern
(for instance {CRYPT}hash{CRYPT}) and decrypt the value (so it has to be a
symetric encryption to allow to decrypt).

I already thought about a Karaf ConfigAdmin "interceptor" to do that. But it
has to be at ConfigAdmin level to be reliable.

Jasypt works that way assuming you are in blueprint (it provides a blueprint
specific namespace that decrypt the property values at blueprint:cm level).

Regards
JB

On 19/02/2018 07:52, Alex Weirig wrote:

Thank you very much to everybody who responded to my question.

I will have a look at your recommended approaches.

Schéin Gréiss, Mit fr

Re: Using jasypt in Karaf 4.1.4 without Blueprint?

2018-02-19 Thread Alex Weirig

Hi Jean-Baptiste,

that sounds like an interesting idea but you are pointing at an obvious 
drawback with these solutions...


If we're using a "master password" (like jasypt) we need to provide this 
master password in order to allow decryption of the password. That 
master password has to be available in clear text but then, at the end 
of day you're only protecting your environment against "hackers" that 
are able to "hack" you systems but "too stupid" to decrypt the password 
using the master password.


Possibly storing the password in a file with limited ownership access 
rights might help a little bit but if the hacker has (root) access he 
will get around that too.


I was thinking if it would be possible to create a "karaf password 
encryption feature" where each karaf instance would have it's own 
computable (since we can't store it) "master password" (maybe based on a 
machine identifier) and would allow you to encrypt the password but 
there would be no "API or utility" to allow the user to decrypt the 
password.


Now the "hacker" would need more knowledge to get access to the 
passwords ...


Schéin Gréiss, Mit freundlichen Grüßen, Meilleures salutations, Kind 
regards,


Alex Weirig
Responsable Technique

Ville de Luxembourg - Centre Technolink 2, rue Charles de Tornaco L - 
2623 LUXEMBOURG alex.wei...@technolink.lu 
<mailto:alex.wei...@technolink.lu> Tel: +352 4796 - 6127 Fax: +352 42 88 
81 www.technolink.lu <http://www.technolink.lu>


On 19/02/2018 08:03, Jean-Baptiste Onofré wrote:

Hi Alex,

We can imagine to add a feature that detect property values with a 
pattern (for instance {CRYPT}hash{CRYPT}) and decrypt the value (so it 
has to be a symetric encryption to allow to decrypt).


I already thought about a Karaf ConfigAdmin "interceptor" to do that. 
But it has to be at ConfigAdmin level to be reliable.


Jasypt works that way assuming you are in blueprint (it provides a 
blueprint specific namespace that decrypt the property values at 
blueprint:cm level).


Regards
JB

On 19/02/2018 07:52, Alex Weirig wrote:

Thank you very much to everybody who responded to my question.

I will have a look at your recommended approaches.

Schéin Gréiss, Mit freundlichen Grüßen, Meilleures salutations, Kind 
regards,


Alex Weirig
Responsable Technique

Ville de Luxembourg - Centre Technolink 2, rue Charles de Tornaco L - 
2623 LUXEMBOURG alex.wei...@technolink.lu 
<mailto:alex.wei...@technolink.lu> Tel: +352 4796 - 6127 Fax: +352 42 
88 81 www.technolink.lu <http://www.technolink.lu>


On 10/02/2018 21:06, Jean-Baptiste Onofré wrote:

True, but jasypt namespace is blueprint specific.

Outside of blueprint (directly in ConfigAdmin), you have to use your 
own wrapper.


Regards
JB

On 02/10/2018 05:32 PM, Ryan Moquin wrote:
You can still put the placeholders in a config file without using 
blueprint, but
you need them injected into something that will resolve those 
placeholders.  In
this case, the only thing I can suggest offhand (and it's not 
hard), would be to
use a Configuration listener (I think that's the name of the 
interface, it's for
listening to when. PID is available in configuration admin), then 
when your
config becomes available, you check for the encrypted properties 
and decrypt
them.  You'd have to retrieve the encryption service via your 
listener.  That is

probably how Blueprint does it.

Ryan


On Sat, Feb 10, 2018, 9:22 AM Weirig, Alex <alex.wei...@technolink.lu
<mailto:alex.wei...@technolink.lu>> wrote:

 Hello,

 I wonder if there is a way to use the jasypt feature in Karaf 
4.1.4 to
 encrypt passwords in configuration files without having to 
define the
 placeholders using Blueprint but rather using a cfg file in 
/etc/?


 All the examples I've found so far are rather "old" and still 
rely on
 Blueprint ... I'm not using Blueprint at all in my 
applications and I would
 appreciate if I didn't have to use it just for this 
configuration.


 If it was possible to define these placeholders in a cfg file 
in /etc/ it
 would make things easier ... or is there even an easier way to 
support

 encrypted properties with the current Karaf releases?

 Thank you very much for your support

 ---

 Schéin Gréiss,
 Mit freundlichen Grüßen,
 Meilleures salutations,
 Kind regards,

 Alex Weirig
 Responsable Technique

 Ville de Luxembourg - Centre Technolink
 2, rue Charles de Tornaco
<https://maps.google.com/?q=2,+rue+Charles+de+Tornaco=gmail=g>
 L - 2623 LUXEMBOURG
 alex.wei...@technolink.lu <mailto:alex.wei...@technolink.lu>

 Tel: +352 4796 - 6127
 Fax: +352 42 88 81
 www.technolink.lu  <http://www.technolink.lu>








Re: Using jasypt in Karaf 4.1.4 without Blueprint?

2018-02-18 Thread Alex Weirig

Thank you very much to everybody who responded to my question.

I will have a look at your recommended approaches.

Schéin Gréiss, Mit freundlichen Grüßen, Meilleures salutations, Kind 
regards,


Alex Weirig
Responsable Technique

Ville de Luxembourg - Centre Technolink 2, rue Charles de Tornaco L - 
2623 LUXEMBOURG alex.wei...@technolink.lu 
<mailto:alex.wei...@technolink.lu> Tel: +352 4796 - 6127 Fax: +352 42 88 
81 www.technolink.lu <http://www.technolink.lu>


On 10/02/2018 21:06, Jean-Baptiste Onofré wrote:

True, but jasypt namespace is blueprint specific.

Outside of blueprint (directly in ConfigAdmin), you have to use your own 
wrapper.

Regards
JB

On 02/10/2018 05:32 PM, Ryan Moquin wrote:

You can still put the placeholders in a config file without using blueprint, but
you need them injected into something that will resolve those placeholders.  In
this case, the only thing I can suggest offhand (and it's not hard), would be to
use a Configuration listener (I think that's the name of the interface, it's for
listening to when. PID is available in configuration admin), then when your
config becomes available, you check for the encrypted properties and decrypt
them.  You'd have to retrieve the encryption service via your listener.  That is
probably how Blueprint does it.

Ryan


On Sat, Feb 10, 2018, 9:22 AM Weirig, Alex <alex.wei...@technolink.lu
<mailto:alex.wei...@technolink.lu>> wrote:

 Hello,

 I wonder if there is a way to use the jasypt feature in Karaf 4.1.4 to
 encrypt passwords in configuration files without having to define the
 placeholders using Blueprint but rather using a cfg file in /etc/?

 All the examples I've found so far are rather "old" and still rely on
 Blueprint ... I'm not using Blueprint at all in my applications and I would
 appreciate if I didn't have to use it just for this configuration.

 If it was possible to define these placeholders in a cfg file in /etc/ it
 would make things easier ... or is there even an easier way to support
 encrypted properties with the current Karaf releases?

 Thank you very much for your support

 ---

 Schéin Gréiss,
 Mit freundlichen Grüßen,
 Meilleures salutations,
     Kind regards,

 Alex Weirig
 Responsable Technique

 Ville de Luxembourg - Centre Technolink
 2, rue Charles de Tornaco
 <https://maps.google.com/?q=2,+rue+Charles+de+Tornaco=gmail=g>
 L - 2623 LUXEMBOURG
 alex.wei...@technolink.lu <mailto:alex.wei...@technolink.lu>

 Tel: +352 4796 - 6127
 Fax: +352 42 88 81
 www.technolink.lu <http://www.technolink.lu>