Re: Trying to get shiro 2.x working in karaf

2024-05-25 Thread Steinar Bang
> Jean-Baptiste Onofré : > Hi Steinar > as replied on the shiro mailing list, I gonna take a look. Nice! Thanks!

Trying to get shiro 2.x working in karaf

2024-05-24 Thread Steinar Bang
I am trying to get shiro 2.x (snapshot built from the current main) working in karaf: https://lists.apache.org/thread/b7lr44sqc352s4yx65xrjkf25jvhfr92 The current problem is a class not found when parsing the INI files. The INI files are parsed in Shiro filters started as a web whiteboard

Re: OSGi or karaf-specific file storage service?

2024-05-07 Thread Steinar Bang
> Jean-Baptiste Onofré : > Hi Steinar > There's not "core/compendium" services spec about that. > You can create your own easily :) > NB: Cave provided a storage layer for artifacts in the past, if you > wanna take a look. Thanks, JB! I will dig into the Cave code to check it out. :-)

Re: OSGi or karaf-specific file storage service?

2024-05-06 Thread Steinar Bang
> Matt Pavlovich : > Hi Steinar- > No, this is beyond the scope of what OSGi provides as an application runtime. > This would be something provided by an application written in Java and > deployed as an application-level service. Thanks! It's what I thought. But I figured asking always

OSGi or karaf-specific file storage service?

2024-05-06 Thread Steinar Bang
Is there an OSGi, or karaf specific file storage service? I.e. a karaf interface to a part of the file system owned by karaf and used to store files and directories. The only thing I've found when googling is this: https://docs.osgi.org/specification/osgi.cmpn/7.0.0/service.cm.html And that's

Re: Overriding the default realm for SSH, WebConsole, ...

2024-05-05 Thread Steinar Bang
> Cedric Jonas : > Hi, > We currently distribute new versions via tar-ball / ZIPs. > It is intended to be distributed as a Maven dependency which could then be > used as a "template" / platform distribution to be customized again via the > karaf-maven-plugin. But we weren't able to get that

Re: Overriding the default realm for SSH, WebConsole, ...

2024-04-30 Thread Steinar Bang
> Cedric Jonas : > Our goal was to customize the existing Karaf configuration files so that we > do not have to spend additional sync efforts each time we update to a new > version of Karaf (at least, we need to check if the default configuration > file didn't change). > Is there any good

Re: Vertx SPI

2024-03-30 Thread Steinar Bang
>>>>> Steinar Bang : >>>>> Michael Elbaz : > Note that if you are piggy-backing karaf feature generation on your OSGi > bundles, then you can add feature run time dependencies like the one > about, by adding it as a compile scope (the default) maven depende

Re: Vertx SPI

2024-03-30 Thread Steinar Bang
> Michael Elbaz : > Ok i finally made this work ! (was so paintfull) Thanks for the help ! > what i was missed is installing this one => > mvn:org.apache.aries.spifly/org.apache.aries.spifly.dynamic.bundle/1.3.7 Glad you got it working! Note that if you are piggy-backing karaf feature

Re: Vertx SPI

2024-03-26 Thread Steinar Bang
> Cesar Garcia : > Hello, > Definitely for that problem it helps: > https://aries.apache.org/documentation/modules/spi-fly.html > You must clearly define in your poms which export services with > "SPI-Provider: *" or import services with "SPI-Consumer: *", this is done > in your pom.xml

Re: Vertx SPI

2024-03-26 Thread Steinar Bang
> Michael Elbaz : > Thanks answering me but still not working i didn't even have a clue of > wich bundle need to be modified the one from wich the code is called i > suppose any other proposition ? Well I don't know vertex-auth-common, but I think it is likely that it has some sort of

Re: Vertx SPI

2024-03-26 Thread Steinar Bang
> Michael Elbaz : > Hello i use vertx (wraping as a bundle) inside karaf i'm facing a > problem because vertx-auth-common use SPI mecanism internally to load > some classes >

Re: Programmatically restart bundle and/or component?

2024-03-18 Thread Steinar Bang
> Jean-Baptiste Onofré : > You can create a controller for instance by leveraging event admin (to > send an event triggering the reload, and the bundle decides what he > wants to reload). Pros, you control exactly what you want to reload. > Cons, you need to implement your Event handler. >

Re: Can a DS component expose multiple services?

2024-03-18 Thread Steinar Bang
> Jean-Baptiste Onofré : > Yes, it' possible to have several services by component (imho, it > should be avoided when possible to avoid unexpected cascading > refresh). > A component can implement multiple interfaces, and the @Component > annotation accepts the list of exposed interfaces.

Re: Programmatically restart bundle and/or component?

2024-03-16 Thread Steinar Bang
>>>>> Steinar Bang : >> The version of the filter does runtime reconfiguration hasn't been >> pushed yet, but it will look like this: >> >> https://gist.github.com/steinarb/1c16c1ce4f6148b47581019de1d23e40#file-oldalbumshirofilter-java-L66 >> He

Re: Can a DS component expose multiple services?

2024-03-16 Thread Steinar Bang
So, update: Yes a DS component can expose multiple services This worked: https://gist.github.com/steinarb/39e9b4de1ee2ab6da57eea4c7df9e5b5#file-oldalbumshirofilter-java-L39 Filter is picked up fine by the OSGi web whiteboard (verified that I get a login prompt when I expect to get it). And

Can a DS component expose multiple services?

2024-03-16 Thread Steinar Bang
Can a Java class implementing a DS component expose more than one OSGi service? My usecase is that I have a DS component implementing a servlet Filter, plugging into the web whiteboard.

Re: Programmatically restart bundle and/or component?

2024-03-15 Thread Steinar Bang
>>>>> Steinar Bang : > The version of the filter does runtime reconfiguration hasn't been > pushed yet, but it will look like this: > > https://gist.github.com/steinarb/1c16c1ce4f6148b47581019de1d23e40#file-oldalbumshirofilter-java-L66 > Here an OldalbumS

Re: Programmatically restart bundle and/or component?

2024-03-15 Thread Steinar Bang
> João Assunção : > Hi Steinar > A few years ago I implemented a servlet filter to handle CORS. The filter > was a DS component and it accepted a configuration via activate. Everytime > the config was changed, it would restart and update the filter. You wouldn't happen to be able to share

Programmatically restart bundle and/or component?

2024-03-15 Thread Steinar Bang
I have this bundle: https://github.com/steinarb/oldalbum/tree/master/oldalbum.web.security which contains two DS/SCR components: 1. A component implementing ServletContextHelper used to define the servlet context

Re: How do I find shiro WebEnvironment in karaf?

2024-03-08 Thread Steinar Bang
>>>>> Steinar Bang : > This filter already knows the WebEnvironment > > https://github.com/steinarb/oldalbum/blob/master/oldalbum.web.security/src/main/java/no/priv/bang/oldalbum/web/security/OldAlbumShiroFilter.java#L58 > It knows nothing about the database st

Re: How do I find shiro WebEnvironment in karaf?

2024-03-08 Thread Steinar Bang
>>>>> Steinar Bang : > 2. Then I create a component creating ShiroFilter plugging into the > servlet context created by the ServletContextHelper > > https://github.com/steinarb/oldalbum/blob/master/oldalbum.web.security/src/main/java/no/priv

Re: How do I find shiro WebEnvironment in karaf?

2024-03-08 Thread Steinar Bang
> Francois Papon : > Yes you can register whatever instance class you want in the service > registry with related properties. Thanks, but I was wondering if it was possible to go the other way, so to speak...? I.e. is it possible to have an existing shiro WebEnviroment belonging to a

How do I find shiro WebEnvironment in karaf?

2024-03-07 Thread Steinar Bang
What's the easiest way to find the Shiro WebEnvironment from a Declarative Services component running in karaf? Does anyone know? Can the WebEnvironment be injected as an OSGi service? Or may there be multiple WebEnvironments inside a karaf instance if there are multiple web applications each

Re: How do I protect a OSGi JAX-RS whiteboard REST service using Basic Authentication?

2024-03-04 Thread Steinar Bang
This one may be of interest? https://lists.apache.org/thread/pso52wffvjqvt8myb4qh2wdqropdxslo I managed to use shiro-jaxrs so that I can now use the annotations @RequiresUser, @RequiresRoles and @RequiresPermissions directly on the JAX-RS resource classes

Re: Using environment variable to install features..

2024-02-14 Thread Steinar Bang
> Ryan Moquin : > I've struggling figuring out how I can use environment variables to add > feature repositories and also boot features via environment variables > before starting Karaf.. I was looking at the documentation and I tried the > example for adding a feature repository, but

Re: How do I protect a OSGi JAX-RS whiteboard REST service using Basic Authentication?

2024-01-30 Thread Steinar Bang
> fpapon : > Hi, > Thanks for the issue on Shiro, I will take a look. This was quick, thanks! :-)

Re: How do I protect a OSGi JAX-RS whiteboard REST service using Basic Authentication?

2024-01-30 Thread Steinar Bang
> Paul Spencer : > Apologies for misspelling your name. No worries! :-) (but since I'm a nit picker I couldn't help myself when I saw it the second time, sorry about that!) > I have not opened an issue related to the dependencies. https://github.com/apache/shiro/issues/1300

Re: How do I protect a OSGi JAX-RS whiteboard REST service using Basic Authentication?

2024-01-30 Thread Steinar Bang
> Paul Spencer : > Steiner, (ps last "e" is an "a", "Steinar", approximate pronounciation "Stay-nahr" (with the "r" rolling as in Scots or Spanish or Italian)) ;-) > I installed the feature shiro-core and had to add had to install the > following bundles. >

Re: How do I protect a OSGi JAX-RS whiteboard REST service using Basic Authentication?

2024-01-30 Thread Steinar Bang
FWIW what I do (in all of the examples I listed), is to create a DS @Component providing a ServletContextHelper service, like so: https://github.com/steinarb/oldalbum/blob/master/oldalbum.web.security/src/main/java/no/priv/bang/oldalbum/web/security/OldAlbumServletContextHelper.java#L22 Then I

Re: How do I protect a OSGi JAX-RS whiteboard REST service using Basic Authentication?

2024-01-30 Thread Steinar Bang
> Paul Spencer : > Steiner, > Just a followup: > - The Shiro 1.13.0 feature is missing required Shiro and Apache commons > bundles, which may be resolved in 2.0 alpha, as well as the config package is > split across multiple bundles, described in SHIRO-654 and also resolved in > 2.0

Re: How do I protect a OSGi JAX-RS whiteboard REST service using Basic Authentication?

2024-01-24 Thread Steinar Bang
> Paul Spencer : > Karaf 4.4.5 > How do I protect a OSGi JAX-RS whiteboard REST service using Basic > Authentication? Apache Shiro can do basic auth (among other things). https://shiro.apache.org This project is a shiro realm with a simple JDBC database and a react.js frontend to to user

[ANN] Debian package of karaf 4.4.5 is out

2024-01-12 Thread Steinar Bang
I have made a debian package of karaf 4.4.5. The package has been tested with java-17 on debian 12.4 "bookworm" on amd64. https://steinar.bang.priv.no/2018/01/23/installing-apache-karaf-on-debian/comment-page-1/#comment-16130 To use it, you will need to add my private maven repository as an

Re: Is the karaf 4.4.4 docker image arm only?

2024-01-09 Thread Steinar Bang
> Jean-Baptiste Onofré : > yes, the docker image is arm based. I'm adding multi-arch image > support (to have x86 images as well). > I will upload new images soon. Great! Thanks, JB!

Re: Is the karaf 4.4.4 docker image arm only?

2024-01-09 Thread Steinar Bang
> Francois Papon : > It means that your docker image is not immutable and after starting > the Karaf instance, it will download the updated dependencies features > at startup right? Correct! :-) > It's not the common design for docker image and I think it's better to > have a custom Karaf

Re: Is the karaf 4.4.4 docker image arm only?

2024-01-08 Thread Steinar Bang
> Francois Papon : > Why not using Jib? > https://github.com/GoogleContainerTools/jib/tree/master Unless I'm very mistaken that doesn't do what I want to do. Jib looks like it is for containering a Java application? What I'm doing is something different: 1. I start out with a standard

Re: Is the karaf 4.4.4 docker image arm only?

2024-01-08 Thread Steinar Bang
> Jean-Baptiste Onofré : > Hi Steinar > Let me check about the image type. Did you find out anything? The docker-maven-plugin I've been using (the one created by spotify), was abandoned a couple of years back: https://github.com/spotify/docker-maven-plugin So I've been trying to to use a

Re: Is the karaf 4.4.4 docker image arm only?

2023-12-22 Thread Steinar Bang
>>>>> Steinar Bang : [snip!] > Or try out the, completely different, docker-maven-plugin that comes up > first on google searches? > https://github.com/fabric8io/docker-maven-plugin > I guess try out the new one. Not much luck with the new one, so far: https://github

Re: Is the karaf 4.4.4 docker image arm only?

2023-12-22 Thread Steinar Bang
I just noticed that I'm using an archived and dead docker-maven-plugin https://github.com/steinarb/sonar-collector/blob/b0d6cedb35648df11ef1554b9fb8fbe669e94640/docker/pom.xml#L32 https://github.com/spotify/docker-maven-plugin?tab=readme-ov-file Archived on March 21 2022 and last commit from

Re: Is the karaf 4.4.4 docker image arm only?

2023-12-21 Thread Steinar Bang
FWIW The reason that I'm trying to update sonar-collector's docker image is that I discovered that sonar-collector actually has a user, and that user uses the docker image which suddenly stopped working: https://github.com/steinarb/sonar-collector/issues/5 The way I've created the docker image

Is the karaf 4.4.4 docker image arm only?

2023-12-20 Thread Steinar Bang
I'm trying to build an updated docker image for my sonar-collector project, based on the official karaf 4.4.4 image: https://github.com/steinarb/sonar-collector However even though I'm building the docker image on an amd64 debian 12.4 "bookworm" system, the resulting docker image seems to be an

Re: liquibase karaf feature version >= 4.23.1 fails in pax exam test but works in karaf

2023-12-12 Thread Steinar Bang
For those that follows this thread: I found a workaround that was replacing derby with h2 in the pax exam test (running the test with both PostgreSQL and h2 worked fine, but PostgreSQL was a bit impractical for a test, so...). And then, since I need someone should look into it, I opened a github

Re: How to change the karaf.log log level in a pax exam karaf test?

2023-11-21 Thread Steinar Bang
>>>>> Steinar Bang : >>>>> Eric Lilja : >> A Pax Exam test that is using a Karaf container (which is a forked >> container), often has two log configurations. One for the test itself >> (for me that would be a log4j2-test

Re: How to change the karaf.log log level in a pax exam karaf test?

2023-11-21 Thread Steinar Bang
> Eric Lilja : > A Pax Exam test that is using a Karaf container (which is a forked > container), often has two log configurations. One for the test itself (for > me that would be a log4j2-test.xml), and one for the container. You can use > KarafDistributionOption.replaceConfigurationFile()

How to change the karaf.log log level in a pax exam karaf test?

2023-11-20 Thread Steinar Bang
I wanted to switch the log leven from INFO to FINE in a pax exam karaf test. So I took the org.ops4j.pax.logging.cfg file from a karaf 4.4.4 etc directory and changed the rootlogger, i.e. log4j2.rootLogger.level = FINE And then I dumped the resulting file into src/test/resources/etc of the pax

Re: liquibase karaf feature version >= 4.23.1 fails in pax exam test but works in karaf

2023-11-17 Thread Steinar Bang
Could my situation, where the feature loads without problems in a karaf instance but fails in the pax exam test, be caused by pax exam forking the JVM to start karaf? The database is in memory after all, so the problem could be that the database disappears in mid test? (But if this is the case,

Re: Debugging karaf feature pax exam test in eclipse, possible?

2023-11-11 Thread Steinar Bang
(hm... I never responded to this one, looks like...? Sorry about that!) > Eric Lilja : > Yeah, as JB mentioned, Karaf mode in Pax Exam is forked so the classpath > from the test bootstrap itself does not spill over into the container (for > native pax exam, you can choose between forked mode

liquibase karaf feature version >= 4.23.1 fails in pax exam test but works in karaf

2023-11-11 Thread Steinar Bang
I maintain a karaf feature that loads the liquibase[1] database migration system. With version 4.23.0 of liquibase my liquibase karaf feature[2] loaded fine in both karaf and the feature's pax exam test. But from version 4.23.1 of liquibase the feature still loads fine in karaf, but fails in the

Re: Need help with and (OSGi-fication of TwelweMonkeys)

2023-09-21 Thread Steinar Bang
>>>>> Steinar Bang : > I now have some success: I created a DS component that listens for the > OSGi services created by Aries spyfly, from the Twelvemonkeys SPI > services, and registers the injected services with the imageio > ServiceRegistry. [snip!] >

Re: Need help with and (OSGi-fication of TwelweMonkeys)

2023-09-20 Thread Steinar Bang
>>>>> Steinar Bang : > Aries Spifly was logging very little, so it was hard to debug. > Figuring out where the log level should be upped, turned out to be > surprisingly easy, however... > > https://github.com/apache/karaf/blob/main/assemblies/features/base/sr

Re: Need help with and (OSGi-fication of TwelweMonkeys)

2023-09-16 Thread Steinar Bang
Aries Spifly was logging very little, so it was hard to debug. Figuring out where the log level should be upped, turned out to be surprisingly easy, however... https://github.com/apache/karaf/blob/main/assemblies/features/base/src/main/resources/resources/etc/org.ops4j.pax.logging.cfg#L51 So

Re: Need help with and (OSGi-fication of TwelweMonkeys)

2023-09-12 Thread Steinar Bang
An update on this thread: 1. I have created a github issue for TwelveMonkeys for making TwelveMonkeys be an OSGi bundle https://github.com/haraldk/TwelveMonkeys/issues/794 2. I have created a fork of TwelveMonkeys https://github.com/steinarb/TwelveMonkeys 3. I have created a

Re: Apace aries spifly reports "No common superclass" on two unrelated classes

2023-08-15 Thread Steinar Bang
>>>>> Steinar Bang : > I opened a Jira on Apache Aries spi fly for this: > https://issues.apache.org/jira/browse/ARIES-2110 Though I myself is probably to blame for the use of the Dynamic Weaving Bundle. Before I load anything in karaf, it has the following Arie

Re: Need help with and (OSGi-fication of TwelweMonkeys)

2023-08-15 Thread Steinar Bang
> Łukasz Dywicki : > I haven't dug into spi-fly for a while, can you point me which part of > its code handle declared capabilities so I can have a look? Well, I have never looked into the spi-fly source code, so pointing you there is not something I can do, without a lot of effort. :-) But

Re: Apace aries spifly reports "No common superclass" on two unrelated classes

2023-08-14 Thread Steinar Bang
I opened a Jira on Apache Aries spi fly for this: https://issues.apache.org/jira/browse/ARIES-2110

Re: Apace aries spifly reports "No common superclass" on two unrelated classes

2023-08-14 Thread Steinar Bang
>>>>> Steinar Bang : > When I pull in Apache Aries spifly on one of my bundles I get a weird > error in karaf.log: > java.lang.RuntimeException: No Common > Superclass:no/priv/bang/oldalbum/services/bean/AlbumEntry java/sql/ResultSet > Here's the error: > &

Apace aries spifly reports "No common superclass" on two unrelated classes

2023-08-14 Thread Steinar Bang
When I pull in Apache Aries spifly on one of my bundles I get a weird error in karaf.log: java.lang.RuntimeException: No Common Superclass:no/priv/bang/oldalbum/services/bean/AlbumEntry java/sql/ResultSet Here's the error:

Re: Need help with and (OSGi-fication of TwelweMonkeys)

2023-08-13 Thread Steinar Bang
>>>>> Steinar Bang : > Still doesn't work: > https://gist.github.com/steinarb/8bb77c64562bd853fc95a3fb19cfb5cf > But when I look closer at those error message it may be as simple as > lacking a run time dependency that can provide the package > com.twelvemonkeys

Re: Need help with and (OSGi-fication of TwelweMonkeys)

2023-08-13 Thread Steinar Bang
> Christian Lutz : > Not sure, but you need the first part auf the required, as well. Hm... this is a for the serviceloader itself in the bundle that provides the capability? > Or am I wrong? I have absolutely no idea! :-) But I will try!

Need help with and (OSGi-fication of TwelweMonkeys)

2023-08-13 Thread Steinar Bang
I am trying to make a PR for OSGi-ifying the TwelveMonkeys library. https://github.com/haraldk/TwelveMonkeys/issues/794 TwelveMonkeys is a pure-java implementation of image format readers and writers for many graphics formats. TwelveMonkeys plugs into the Java runtime ImageIO system, using the

Re: Are released features picked over SNAPSHOT when installing features from maven?

2023-07-01 Thread Steinar Bang
>>>>> Steinar Bang : > I am working on version 1.15.8-SNAPSHOT of authservice: > https://github.com/steinarb/authservice > My problem with testing release 1.15.8-SNAPSHOT is that 1.15.7 is picked > instead, when I load feature repositories from maven using version

Re: Are released features picked over SNAPSHOT when installing features from maven?

2023-06-29 Thread Steinar Bang
> Jean-Baptiste Onofré : > Hi Steinar, > do you use the default etc/org.ops4j.pax.maven.url.cfg ? etc/org.ops4j.pax.url.mvn.cfg? Yes. From an apache-4.3.3 unpackaged from the binary tar.gz. Here are org.ops4j.pax.url.mvn.repositories from that file: org.ops4j.pax.url.mvn.repositories= \

Are released features picked over SNAPSHOT when installing features from maven?

2023-06-28 Thread Steinar Bang
I am working on version 1.15.8-SNAPSHOT of authservice: https://github.com/steinarb/authservice My problem with testing release 1.15.8-SNAPSHOT is that 1.15.7 is picked instead, when I load feature repositories from maven using version LATEST. Version 1.15.7 is found on external repos (maven

Re: Persist bundle status in karaf

2023-06-17 Thread Steinar Bang
> "jose.garnica.lomeli" : > Currently I have some bundles in my karaf solution starting by default > as resolved, in just in specific scenarios when we need active them we > execute the command bundle:start but we want a find a option > to persisit that configuration, to avoid re-start the

Re: Debugging karaf feature pax exam test in eclipse, possible?

2023-06-06 Thread Steinar Bang
> Jean-Baptiste Onofré : > As pax-exam can fork the JVM to start Karaf, you need remote debugger. Hm... but does it fork the JUnit test also? That's where I'm trying to debug...? Ah, but you're right! To be able to run the way it does, i.e. access OSGi services created in karaf as Java

Re: How to add jackson runtime to a pax exam integration test?

2023-06-04 Thread Steinar Bang
>>>>> Steinar Bang : >>>>> Eric Lilja : >> You can also provision using mavenBundle()-API in Pax Exam > Yeah, but it seemed simple to just add them as maven dependencies in a > feature that was loaded (except it didn't work, because I bungled the &

Re: How to add jackson runtime to a pax exam integration test?

2023-06-03 Thread Steinar Bang
> Eric Lilja : > You have databind twice there, I believe you will be needing annotations, > core, and databind. Indeed I do! Bad copy/paste it looks like... well spotted! Thanks! I'm past needing the debug trace (I figured how to use a ScopeRunner with ThreadLocalScopeManager in place of

Re: How to add jackson runtime to a pax exam integration test?

2023-06-03 Thread Steinar Bang
>>>>> Steinar Bang : [snip!] > I have added the following compile scope dependencies to the integration > test project itself. > I have also added these dependencies to the project containing the test > feature loaded by the integration test, causing the ja

How to add jackson runtime to a pax exam integration test?

2023-06-03 Thread Steinar Bang
Platform: debian 11.7 "bullseye", amd64 openjdk-17-jdk:amd64 17.0.6+10-1~deb11u1 (ie. java 17) karaf 4.4.3 pax-exam 4.13.5 Since I was unable to debug into my pax exam integration test (see other posting on this list), I decided to try the good old way of adding

Debugging karaf feature pax exam test in eclipse, possible?

2023-06-03 Thread Steinar Bang
Platform: debian 11.7 "bullseye", amd64 openjdk-17-jdk:amd64 17.0.6+10-1~deb11u1 (ie. java 17) karaf 4.4.3 pax-exam 4.13.5 eclipse 2023-03 (4.27.0) When I set breakpoints in a pax exam test and run the test in debug in eclipse, the breakpoints are never

Only one of the features/xml dependencies are added to generated feature file

2023-05-19 Thread Steinar Bang
I have the following in dependencies for a maven bundle project that uses karaf-maven-plugin to generate a feature repository: no.priv.bang.karaf karaf.liquibase.sample.services ${project.version} provided

Moving features-generate-descriptor execution from package to validate gives m2e problems

2023-04-15 Thread Steinar Bang
I had the following execution in the config for karaf-maven-plugin in my pom files: generate-features-file package features-generate-descriptor But when I wanted to use a github task to build and publish javadoc to github pages, the javadoc

Re: Is it possible to have multiple tests in a KarafTestSupport test class, all using the same service?

2023-03-26 Thread Steinar Bang
> Jean-Baptiste Onofré : > Yes, it sounds good to me :) > The purpose of providing KarafTestSupport is to simplify the > dependency (a kind of bom) and use. It's safe to say that you have reached your goal here. :-) Here's the diff, which may be clearer than what I tried to put into words:

Re: Is it possible to have multiple tests in a KarafTestSupport test class, all using the same service?

2023-03-24 Thread Steinar Bang
>>>>> Steinar Bang : > No, provisioning once with @Configuration will be fine, if that > actually loads the feature I'm adding. > I just wasn't sure if @Configuration would work here, since the base > class was different, and the example didn't use it, and I ha

Re: Is it possible to have multiple tests in a KarafTestSupport test class, all using the same service?

2023-03-24 Thread Steinar Bang
> Eric Lilja : > The reactor strategy decides if a new container should be spawned per > method or per class. If I have a bunch of different tests in the same > class, I would not want to spawn the container more than once, if I > could avoid it, since it's expensive. The provisioned bundles

Re: Is it possible to have multiple tests in a KarafTestSupport test class, all using the same service?

2023-03-24 Thread Steinar Bang
> Jean-Baptiste Onofré : > Like this one: > https://github.com/apache/karaf/blob/main/itests/test/src/test/java/org/apache/karaf/itests/DiagnosticTest.java > For example, in this class we have several tests using a single Karaf > instance (depending of the

Is it possible to have multiple tests in a KarafTestSupport test class, all using the same service?

2023-03-23 Thread Steinar Bang
I am trying to rewrite an old pax exam test into being based on KarafTestSupport. The old test fired up a karaf instance with a feature that exposes a service, and then injected that service into the test class and used the service in multiple @Test methods. However the class based on

Re: Logging service 1.5.0 not exported in karaf 4.4.2

2022-11-06 Thread Steinar Bang
> Jean-Baptiste Onofré : > Hi Steinar, > My bad, I forgot to include it in 4.4.2. Can you please create a Jira > about that ? I will submit 4.4.3 to vote soon including this. Here it is: https://issues.apache.org/jira/browse/KARAF-7605 And thanks! :-)

Logging service 1.5.0 not exported in karaf 4.4.2 (Was: Logging service 1.5.0 not exported in karaf 4.4.1)

2022-11-04 Thread Steinar Bang
> Jean-Baptiste Onofré : > My bad, I forgot to include this change in Pax logging for Karaf > 4.4.1. I will tackle Pax Logging issue #410 asap. Hm... this is still an issue in the karaf 4.4.2 BOM. Recap: Using the karaf BOM I get an org.osgi.service.log with 1.5.0 as the lower bound, while

Re: Is it possible to access a BundleContext in a karaf @Command?

2022-10-29 Thread Steinar Bang
>>>>> Steinar Bang : > So I need to rethink: either back off from replacing > ClassLoaderResourceAccessor > with OSGiResourceAccessor, or turn the library bundle into a component? And I think maybe I misinterpreted the error message...? Because after switching

Re: Is it possible to access a BundleContext in a karaf @Command?

2022-10-28 Thread Steinar Bang
> Jean-Baptiste Onofré : > Hi Steinar, > you have an example here: > https://github.com/apache/karaf/blob/main/bundle/core/src/main/java/org/apache/karaf/bundle/command/BundleCommand.java#L45 > Basically, just add @Reference on BundleContext field and you will > have it injected. Thanks!

Re: Is it possible to access a BundleContext in a karaf @Command?

2022-10-27 Thread Steinar Bang
>>>>> Steinar Bang : >>>>> Jean-Baptiste Onofré : >> Hi >> You can @inject BundleContext, I can find couple of examples ? > Yes, please! Thanks! > I tried googling for examples, but everything I found was for older versions > of kar

Re: Is it possible to access a BundleContext in a karaf @Command?

2022-10-27 Thread Steinar Bang
> Jean-Baptiste Onofré : > Hi > You can @inject BundleContext, I can find couple of examples ? Yes, please! Thanks! I tried googling for examples, but everything I found was for older versions of karaf.

Is it possible to access a BundleContext in a karaf @Command?

2022-10-27 Thread Steinar Bang
I have this command, not touched since 2017 (because I stopped needing it). Is it possible to inject/access the BundleContext of the current bundle in this class? @Command(scope="ukelonn", name="release-liquibase-lock", description = "Forcibly release the Liquibase changelog lock") @Service

Not catching exception from the "wrong" version of a bundle

2022-09-30 Thread Steinar Bang
I have this code[1]: try { no.priv.bang.osgiservice.users.User user = useradmin.getUser(username); return Account.with() .accountid(results.getInt("account_id")) .username(username) .firstName(user.getFirstname())

Re: pax exam test works locally but fails on github actions

2022-09-21 Thread Steinar Bang
>>>>> Steinar Bang : > This integration test works locally but fails on github actions: > https://github.com/steinarb/sampleapp/tree/master/sampleapp.tests > The error message is: > https://gist.github.com/steinarb/98cc1dda6e53472504dce9f49eebe03c > Anyone have a

Re: pax exam test works locally but fails on github actions

2022-09-19 Thread Steinar Bang
>>>>> Steinar Bang : > Do I somehow need to specify the feature version when loading the > feature? Ie. is the "/0" in the error message significant? I tried specifying the version explicit, ie @Test public void testLoadFeature() throws Exception { // N

pax exam test works locally but fails on github actions

2022-09-19 Thread Steinar Bang
This integration test works locally but fails on github actions: https://github.com/steinarb/sampleapp/tree/master/sampleapp.tests The error message is: https://gist.github.com/steinarb/98cc1dda6e53472504dce9f49eebe03c Anyone have an idea why this is? Is it because I'm actually loading a

Re: Need web whiteboard debugging tips

2022-08-29 Thread Steinar Bang
>>>>> Steinar Bang : > The web context is defined like this: > > https://github.com/steinarb/frontend-karaf-demo/blob/master/src/main/java/no/priv/bang/demos/frontendkarafdemo/FrontendDemoServletContextHelper.java#L8 > The top servlet is defined like this >

Need web whiteboard debugging tips

2022-08-29 Thread Steinar Bang
Platform: java 11, karaf 4.4.1, OSGi 8 I have a small karaf web whiteboard demo application that used to work, that doesn't work anymore https://github.com/steinarb/frontend-karaf-demo I need some useful tips for debugging this demo application. I can debug into karaf, is there a place I could

Ann: Version 4.15.0 of the liquibase karaf feature is released (Was: Problems with logging to karaf.log from liquibase >3)

2022-08-20 Thread Steinar Bang
I'm happy to say that I've made the first release of my liquibase karaf feature in nearly three years (the previous release was liquibase 3.8.0 in November 2019). The current version is 4.15.0 https://github.com/steinarb/liquibase-karaf-feature#release-history I've summarized the things needed

Re: Problems with logging to karaf.log from liquibase >3

2022-08-14 Thread Steinar Bang
>>>>> Steinar Bang : > Heh... looking at the karaf.log of the integration test, it seems to actually > work: > > https://gist.github.com/steinarb/445699fc4277c36a0f9b94a799da69b1#file-karaf-log-L415 > But the "No common superclass" still happens, prio

Re: Problems with logging to karaf.log from liquibase >3

2022-08-14 Thread Steinar Bang
>>>>> Steinar Bang : >>> (I noticed I've added an empty >>> src\main\resources\META-INF\servicesliquibase.license.LicenseService as >>> well, maybe that fixes the encryption exception) >> Ah! Thanks again! I'll try that! Heh... looking at

Re: Problems with logging to karaf.log from liquibase >3

2022-08-14 Thread Steinar Bang
>>>>> Steinar Bang : >>>>> Steven Huypens : >> (I noticed I've added an empty >> src\main\resources\META-INF\servicesliquibase.license.LicenseService as >> well, maybe that fixes the encryption exception) > Ah! Thanks again! I'll try that!

Re: Problems with logging to karaf.log from liquibase >3

2022-08-14 Thread Steinar Bang
> Steven Huypens : > Hi Steinar, > May I suggest you re-open/recreate the issue on the Liquibase bugtracker ? I'd rather create a new issue suggesting a more OSGi-approach: 1. Define all of the service interfaces in a separate osgi bundle 2. Instead of using ServiceLoader through the

Re: Problems with logging to karaf.log from liquibase >3

2022-08-14 Thread Steinar Bang
> Steven Huypens : > Hi Steinar, > The xsd stacktrace can be explained by this liquibase-issue I think : > https://github.com/liquibase/liquibase/issues/2817 > They closed it incorrectly imho The "fix" was just changed wording in the exception message...? (unless I'm missing something...?

How to set jax properties in OSGi bundles?

2022-08-14 Thread Steinar Bang
How can I set the javax.xml.accessExternalSchema property in an OSGi bundle, so that a Liquibase XML parser running inside that bundle will pick it up? Is it enough to drop a jaxb.properties file into src/resources/ of the bundle maven project? Thanks! - Steinar

Re: Problems with logging to karaf.log from liquibase >3

2022-08-14 Thread Steinar Bang
> Steven Huypens : > 1) The exception "No Common Superclass:javax/crypto/SecretKey > javax/crypto/SecretKeyFactory" is from the liquibase pro package, as > you can see in the stacktrace. But I do not understand that, because > that package is not part of the 4.9.1 liquibase-core.jar. It might

Re: Problems with logging to karaf.log from liquibase >3

2022-08-13 Thread Steinar Bang
>>>>> Steinar Bang : > Hm... I removed the liquibase-slf4j bundle from the feature.xml and then > I got a different karaf.log > https://gist.github.com/steinarb/c04967029621509053f0b6c5903f5fcf The important stack trace here, is: https://

Re: Problems with logging to karaf.log from liquibase >3

2022-08-12 Thread Steinar Bang
>>>>> Steinar Bang : >> What I was trying to tell you, is that by replacing your >> spifly-feature with the aries-proxy-feature and a single spifly >> bundle, the classloading issue might be fixed. Liquibase is able to >> find the Default Log Service,

  1   2   3   4   5   6   >