ECF repo alias

2021-09-26 Thread Scott Lewis

Hi,

ECF has a repo alias in Karaf that is currently set to:

Name:  ecf

repo: http://download.eclipse.org/rt/ecf/RELEASE/site.p2/karaf-features.xml

would one of the Karaf committers please change this to (note https):

name:  ecf

repo: https://download.eclipse.org/rt/ecf/RELEASE/site.p2/karaf-features.xml

Thanksinadvance,

Scott




Multiple Kars Install

2021-09-26 Thread Paul Fraser

Hi,

Karaf kar install code offers the option of installing kars without 
bundles being installed and started.


All required kar bundles can then be installed and started together.

Is this a technique the system is designed to use?

Paul Fraser



Re: Karaf 5

2021-09-26 Thread Jean-Baptiste Onofre
Hi

No sure, it’s only class loader issue. I remember this issue in pure spring 
boot with JDK11.

Let me check.

Regards
JB

> Le 26 sept. 2021 à 17:59, jgfrm  a écrit :
> 
> Hi JB,
> 
> Fully understand that it is still work in progress.
> 
> Regarding the .NoClassDefFoundError: org/ietf/jgss/GSSException
> --add-modules java.security.jgss does not solve it?
> Is it a class loader problem?
> 
> Best,
> 
> -- Jaap
> 
> 
> |-Oorspronkelijk bericht-
> |Van: Jean-Baptiste Onofre 
> |Verzonden: zondag 26 september 2021 14:20
> |Aan: user@karaf.apache.org
> |Onderwerp: Re: Karaf 5
> |
> |Hi Jaap,
> |
> |First, maybe I was not clean in my presentation: Karaf 5 is still under
> |development and so, everything is not yet ready.
> |As said, I will “move” the code to Apache Karaf repo as soon as I consider I
> |have something clean and running.
> |
> |Anyway, about your email, I will check. Today my focus is on the
> |OsgiApplicationManager to be Karaf 4 compliant.
> |I also have to improve the Karaf Config service.
> |
> |By the way, you don’t need your own Main, just use the repackage with
> |regular provided Main (you can take a look on the K4 assembly repackage as
> |an example). I will create a gradle/maven plugin with repackage.
> |
> |Regarding your issue, as you are running with JDK11, I guess you have to add 
> --
> |add-modules java.security.jgss to avoid the NoClassDefFoundException.
> |
> |Thanks anyway for your feedback, much appreciated.
> |
> |Regards
> |JB
> |
> |> Le 26 sept. 2021 à 12:00, jgfrm  a écrit :
> |>
> |> Hi Jean-Baptiste,
> |>
> |> I managed to start (well not completely) my spring application.
> |> However, while starting up, I get an exception:
> |>
> |> 11:43:03.148 [main] ERROR o.s.boot.SpringApplication:837 - Application
> |> run failed
> |> org.springframework.context.ApplicationContextException: Unable to
> |> start web server; nested exception is java.lang.NoClassDefFoundError:
> |> org/ietf/jgss/GSSException
> |>
> |> Any ideas?
> |>
> |> Also, I had to make modifications in
> |SpringBootApplicationManagerService/start:
> |>
> |> try {
> |>Thread.currentThread().setContextClassLoader(classLoader);
> |>// disable tomcat stream handler
> |>/* There is no TomcatURLStreamHandlerFactory in my spring jar
> |>final Method tomcat =
> |classLoader.loadClass("org.apache.catalina.webresources.TomcatURLStream
> |HandlerFactory").getMethod("disable");
> |>if (!tomcat.isBridge()) {
> |>tomcat.setAccessible(true);
> |>}
> |>tomcat.invoke(null, null);
> |> */
> |>// invoke spring boot main
> |>final Method main =
> |classLoader.loadClass("org.springframework.boot.loader.JarLauncher").getM
> |ethod("main", String[].class);
> |>main.setAccessible(true);
> |>log.info("Call JarLauncher");
> |>if (properties.get("args") != null) {
> |>log.info("Call JarLauncher with args");
> |>main.invoke(null, new Object[]{ properties.get("args") });
> |>} else {
> |>log.info("Call JarLauncher without args");
> |>main.invoke(null, new Object[]{new String[0]}); // the 
> original invoke
> |did not work for me
> |>}
> |>} finally {
> |>Thread.currentThread().setContextClassLoader(original);
> |>}
> |>
> |> Further details:
> |> - openjdk version "11.0.12" 2021-07-20
> |> - invocation:
> |> java -cp
> |> ../karaf5/assemblies/k4/target/k4-5.0-SNAPSHOT.jar:target/e3web-test-1
> |> .0-SNAPSHOT.jar:../karaf5/services/spring-boot-application-manager/tar
> |> get/spring-boot-application-manager-5.0-SNAPSHOT.jar
> |> -Dkaraf.config=src/main/resources/karaf.json Main
> |>
> |> Main.java:
> |> ###
> |> public class Main {
> |>public static void main(String[] args){
> |>System.out.println("Starting Karaf");
> |>Karaf karaf = Karaf.builder().build();
> |>karaf.start();
> |>}
> |> }
> |> ###
> |>
> |> Best,
> |>
> |> -- Jaap
> |>
> |> |-Oorspronkelijk bericht-
> |> |Van: Jean-Baptiste Onofré 
> |> |Verzonden: vrijdag 24 september 2021 10:34
> |> |Aan: user@karaf.apache.org
> |> |Onderwerp: Re: Karaf 5
> |> |
> |> |Hi Jaap,
> |> |
> |> |The presentation is available here:
> |> |
> |>
> ||https://docs.google.com/presentation/d/1nDqd4oVbrggTDlwrzWc8zEdahKhc
> |S
> |> |VZJjlPk5FPxfBE/edit?usp=sharing
> |> |
> |> |Karaf 5 WIP is available here:
> |> |
> |> |https://github.com/jbonofre/karaf5
> |> |
> |> |I'm available on Slack or by email if you wanna chat about Karaf5.
> |> |
> |> |Regards
> |> |JB
> |> |
> |> |On 24/09/2021 10:06, jgfrm wrote:
> |> |> Hi,
> |> |>
> |> |> I have two questions about Karaf 5:
> |> |> - is the presentation by Onofre at ApacheConf online somewhere?
> |> |> - is it possible to explore Karaf 5 (or: what is there right now)?
> |> |> I am in particular interested in the 

RE: Karaf 5

2021-09-26 Thread jgfrm
Hi JB,

Fully understand that it is still work in progress.

Regarding the .NoClassDefFoundError: org/ietf/jgss/GSSException
--add-modules java.security.jgss does not solve it?
Is it a class loader problem?

Best,

-- Jaap


|-Oorspronkelijk bericht-
|Van: Jean-Baptiste Onofre 
|Verzonden: zondag 26 september 2021 14:20
|Aan: user@karaf.apache.org
|Onderwerp: Re: Karaf 5
|
|Hi Jaap,
|
|First, maybe I was not clean in my presentation: Karaf 5 is still under
|development and so, everything is not yet ready.
|As said, I will “move” the code to Apache Karaf repo as soon as I consider I
|have something clean and running.
|
|Anyway, about your email, I will check. Today my focus is on the
|OsgiApplicationManager to be Karaf 4 compliant.
|I also have to improve the Karaf Config service.
|
|By the way, you don’t need your own Main, just use the repackage with
|regular provided Main (you can take a look on the K4 assembly repackage as
|an example). I will create a gradle/maven plugin with repackage.
|
|Regarding your issue, as you are running with JDK11, I guess you have to add --
|add-modules java.security.jgss to avoid the NoClassDefFoundException.
|
|Thanks anyway for your feedback, much appreciated.
|
|Regards
|JB
|
|> Le 26 sept. 2021 à 12:00, jgfrm  a écrit :
|>
|> Hi Jean-Baptiste,
|>
|> I managed to start (well not completely) my spring application.
|> However, while starting up, I get an exception:
|>
|> 11:43:03.148 [main] ERROR o.s.boot.SpringApplication:837 - Application
|> run failed
|> org.springframework.context.ApplicationContextException: Unable to
|> start web server; nested exception is java.lang.NoClassDefFoundError:
|> org/ietf/jgss/GSSException
|>
|> Any ideas?
|>
|> Also, I had to make modifications in
|SpringBootApplicationManagerService/start:
|>
|> try {
|>Thread.currentThread().setContextClassLoader(classLoader);
|>// disable tomcat stream handler
|>/* There is no TomcatURLStreamHandlerFactory in my spring jar
|>final Method tomcat =
|classLoader.loadClass("org.apache.catalina.webresources.TomcatURLStream
|HandlerFactory").getMethod("disable");
|>if (!tomcat.isBridge()) {
|>tomcat.setAccessible(true);
|>}
|>tomcat.invoke(null, null);
|> */
|>// invoke spring boot main
|>final Method main =
|classLoader.loadClass("org.springframework.boot.loader.JarLauncher").getM
|ethod("main", String[].class);
|>main.setAccessible(true);
|>log.info("Call JarLauncher");
|>if (properties.get("args") != null) {
|>log.info("Call JarLauncher with args");
|>main.invoke(null, new Object[]{ properties.get("args") });
|>} else {
|>log.info("Call JarLauncher without args");
|>main.invoke(null, new Object[]{new String[0]}); // the 
original invoke
|did not work for me
|>}
|>} finally {
|>Thread.currentThread().setContextClassLoader(original);
|>}
|>
|> Further details:
|> - openjdk version "11.0.12" 2021-07-20
|> - invocation:
|> java -cp
|> ../karaf5/assemblies/k4/target/k4-5.0-SNAPSHOT.jar:target/e3web-test-1
|> .0-SNAPSHOT.jar:../karaf5/services/spring-boot-application-manager/tar
|> get/spring-boot-application-manager-5.0-SNAPSHOT.jar
|> -Dkaraf.config=src/main/resources/karaf.json Main
|>
|> Main.java:
|> ###
|> public class Main {
|>public static void main(String[] args){
|>System.out.println("Starting Karaf");
|>Karaf karaf = Karaf.builder().build();
|>karaf.start();
|>}
|> }
|> ###
|>
|> Best,
|>
|> -- Jaap
|>
|> |-Oorspronkelijk bericht-
|> |Van: Jean-Baptiste Onofré 
|> |Verzonden: vrijdag 24 september 2021 10:34
|> |Aan: user@karaf.apache.org
|> |Onderwerp: Re: Karaf 5
|> |
|> |Hi Jaap,
|> |
|> |The presentation is available here:
|> |
|>
||https://docs.google.com/presentation/d/1nDqd4oVbrggTDlwrzWc8zEdahKhc
|S
|> |VZJjlPk5FPxfBE/edit?usp=sharing
|> |
|> |Karaf 5 WIP is available here:
|> |
|> |https://github.com/jbonofre/karaf5
|> |
|> |I'm available on Slack or by email if you wanna chat about Karaf5.
|> |
|> |Regards
|> |JB
|> |
|> |On 24/09/2021 10:06, jgfrm wrote:
|> |> Hi,
|> |>
|> |> I have two questions about Karaf 5:
|> |> - is the presentation by Onofre at ApacheConf online somewhere?
|> |> - is it possible to explore Karaf 5 (or: what is there right now)?
|> |> I am in particular interested in the Spring Boot functionality, as
|> |> I have a Spring Boot application that I want to port to Karaf to
|> |> support dynamic loading of components. I have found the github repo
|> |> of Onofre, but it is unclear to me how e.g. to start Karaf.
|> |>
|> |> Best,
|> |>
|> |> -- Jaap
|> |>
|>




Re: How to detect Feature or Kar install is complete

2021-09-26 Thread Jean-Baptiste Onofre
Hi,

You can use the verify goal on the feature, you will be able to see the 
requirements of a feature (including required services).

Is it what you mean ?

Regards
JB

> Le 26 sept. 2021 à 09:29, Paul Fraser  a écrit :
> 
> Hi,
> 
> What methods are available to detect Feature or Kar install is complete if a 
> system needs to wait for completion of a previous feature or kar?
> 
> OpenHAB inspects the list returned from FeatureService or KarService to find 
> if the required addon is in the list.
> 
> Any other method suggestions?
> 
> Paul Fraser
> 
> 



Re: Karaf 5

2021-09-26 Thread Jean-Baptiste Onofre
Hi Jaap,

First, maybe I was not clean in my presentation: Karaf 5 is still under 
development and so, everything is not yet ready.
As said, I will “move” the code to Apache Karaf repo as soon as I consider I 
have something clean and running.

Anyway, about your email, I will check. Today my focus is on the 
OsgiApplicationManager to be Karaf 4 compliant.
I also have to improve the Karaf Config service.

By the way, you don’t need your own Main, just use the repackage with regular 
provided Main (you can take a look on the K4 assembly repackage as an example). 
I will create a gradle/maven plugin with repackage.

Regarding your issue, as you are running with JDK11, I guess you have to add 
--add-modules java.security.jgss to avoid the NoClassDefFoundException.

Thanks anyway for your feedback, much appreciated.

Regards
JB

> Le 26 sept. 2021 à 12:00, jgfrm  a écrit :
> 
> Hi Jean-Baptiste,
> 
> I managed to start (well not completely) my spring application.
> However, while starting up, I get an exception:
> 
> 11:43:03.148 [main] ERROR o.s.boot.SpringApplication:837 - Application run 
> failed
> org.springframework.context.ApplicationContextException: Unable to start web 
> server; nested exception is java.lang.NoClassDefFoundError: 
> org/ietf/jgss/GSSException
> 
> Any ideas?
> 
> Also, I had to make modifications in 
> SpringBootApplicationManagerService/start:
> 
> try {
>Thread.currentThread().setContextClassLoader(classLoader);
>// disable tomcat stream handler
>/* There is no TomcatURLStreamHandlerFactory in my spring jar
>final Method tomcat = 
> classLoader.loadClass("org.apache.catalina.webresources.TomcatURLStreamHandlerFactory").getMethod("disable");
>if (!tomcat.isBridge()) {
>tomcat.setAccessible(true);
>}
>tomcat.invoke(null, null);
> */
>// invoke spring boot main
>final Method main = 
> classLoader.loadClass("org.springframework.boot.loader.JarLauncher").getMethod("main",
>  String[].class);
>main.setAccessible(true);
>log.info("Call JarLauncher");
>if (properties.get("args") != null) {
>log.info("Call JarLauncher with args");
>main.invoke(null, new Object[]{ properties.get("args") });
>} else {
>log.info("Call JarLauncher without args");
>main.invoke(null, new Object[]{new String[0]}); // the 
> original invoke did not work for me
>}
>} finally {
>Thread.currentThread().setContextClassLoader(original);
>}
> 
> Further details:
> - openjdk version "11.0.12" 2021-07-20
> - invocation:
> java -cp 
> ../karaf5/assemblies/k4/target/k4-5.0-SNAPSHOT.jar:target/e3web-test-1.0-SNAPSHOT.jar:../karaf5/services/spring-boot-application-manager/target/spring-boot-application-manager-5.0-SNAPSHOT.jar
>  -Dkaraf.config=src/main/resources/karaf.json Main
> 
> Main.java:
> ###
> public class Main {
>public static void main(String[] args){
>System.out.println("Starting Karaf");
>Karaf karaf = Karaf.builder().build();
>karaf.start();
>}
> }
> ###
> 
> Best,
> 
> -- Jaap
> 
> |-Oorspronkelijk bericht-
> |Van: Jean-Baptiste Onofré 
> |Verzonden: vrijdag 24 september 2021 10:34
> |Aan: user@karaf.apache.org
> |Onderwerp: Re: Karaf 5
> |
> |Hi Jaap,
> |
> |The presentation is available here:
> |
> |https://docs.google.com/presentation/d/1nDqd4oVbrggTDlwrzWc8zEdahKhcS
> |VZJjlPk5FPxfBE/edit?usp=sharing
> |
> |Karaf 5 WIP is available here:
> |
> |https://github.com/jbonofre/karaf5
> |
> |I'm available on Slack or by email if you wanna chat about Karaf5.
> |
> |Regards
> |JB
> |
> |On 24/09/2021 10:06, jgfrm wrote:
> |> Hi,
> |>
> |> I have two questions about Karaf 5:
> |> - is the presentation by Onofre at ApacheConf online somewhere?
> |> - is it possible to explore Karaf 5 (or: what is there right now)? I
> |> am in particular interested in the Spring Boot functionality, as I
> |> have a Spring Boot application that I want to port to Karaf to support
> |> dynamic loading of components. I have found the github repo of Onofre,
> |> but it is unclear to me how e.g. to start Karaf.
> |>
> |> Best,
> |>
> |> -- Jaap
> |>
> 



RE: Karaf 5

2021-09-26 Thread jgfrm
Hi Jean-Baptiste,

I managed to start (well not completely) my spring application.
However, while starting up, I get an exception:

11:43:03.148 [main] ERROR o.s.boot.SpringApplication:837 - Application run 
failed
org.springframework.context.ApplicationContextException: Unable to start web 
server; nested exception is java.lang.NoClassDefFoundError: 
org/ietf/jgss/GSSException

Any ideas?

Also, I had to make modifications in SpringBootApplicationManagerService/start:

try {
Thread.currentThread().setContextClassLoader(classLoader);
// disable tomcat stream handler
/* There is no TomcatURLStreamHandlerFactory in my spring jar
final Method tomcat = 
classLoader.loadClass("org.apache.catalina.webresources.TomcatURLStreamHandlerFactory").getMethod("disable");
if (!tomcat.isBridge()) {
tomcat.setAccessible(true);
}
tomcat.invoke(null, null);
 */
// invoke spring boot main
final Method main = 
classLoader.loadClass("org.springframework.boot.loader.JarLauncher").getMethod("main",
 String[].class);
main.setAccessible(true);
log.info("Call JarLauncher");
if (properties.get("args") != null) {
log.info("Call JarLauncher with args");
main.invoke(null, new Object[]{ properties.get("args") });
} else {
log.info("Call JarLauncher without args");
main.invoke(null, new Object[]{new String[0]}); // the original 
invoke did not work for me
}
} finally {
Thread.currentThread().setContextClassLoader(original);
}

Further details:
- openjdk version "11.0.12" 2021-07-20
- invocation:
java -cp 
../karaf5/assemblies/k4/target/k4-5.0-SNAPSHOT.jar:target/e3web-test-1.0-SNAPSHOT.jar:../karaf5/services/spring-boot-application-manager/target/spring-boot-application-manager-5.0-SNAPSHOT.jar
 -Dkaraf.config=src/main/resources/karaf.json Main

Main.java:
###
public class Main {
public static void main(String[] args){
System.out.println("Starting Karaf");
Karaf karaf = Karaf.builder().build();
karaf.start();
}
}
###

Best,

-- Jaap

|-Oorspronkelijk bericht-
|Van: Jean-Baptiste Onofré 
|Verzonden: vrijdag 24 september 2021 10:34
|Aan: user@karaf.apache.org
|Onderwerp: Re: Karaf 5
|
|Hi Jaap,
|
|The presentation is available here:
|
|https://docs.google.com/presentation/d/1nDqd4oVbrggTDlwrzWc8zEdahKhcS
|VZJjlPk5FPxfBE/edit?usp=sharing
|
|Karaf 5 WIP is available here:
|
|https://github.com/jbonofre/karaf5
|
|I'm available on Slack or by email if you wanna chat about Karaf5.
|
|Regards
|JB
|
|On 24/09/2021 10:06, jgfrm wrote:
|> Hi,
|>
|> I have two questions about Karaf 5:
|> - is the presentation by Onofre at ApacheConf online somewhere?
|> - is it possible to explore Karaf 5 (or: what is there right now)? I
|> am in particular interested in the Spring Boot functionality, as I
|> have a Spring Boot application that I want to port to Karaf to support
|> dynamic loading of components. I have found the github repo of Onofre,
|> but it is unclear to me how e.g. to start Karaf.
|>
|> Best,
|>
|> -- Jaap
|>



How to detect Feature or Kar install is complete

2021-09-26 Thread Paul Fraser

Hi,

What methods are available to detect Feature or Kar install is complete 
if a system needs to wait for completion of a previous feature or kar?


OpenHAB inspects the list returned from FeatureService or KarService to 
find if the required addon is in the list.


Any other method suggestions?

Paul Fraser