Re: SCR duplicating service PIDs

2020-12-02 Thread Raymond Auge
On Wed, Dec 2, 2020 at 6:09 PM Pavel Horal  wrote:

> ---
>
> My sample component:
>
> @Component(
> name = "hello",
> property = "service.pid=hello",
>

This is not quite correct actually. I would have expected SCR to complain
about this because service.pid should be one of the "managed" component
properties. (i.e. never pass service.pid as a property)

Since you have set _name_ property, what you want is simply:

> @Component(
> name = "hello",

immediate = true)
> public class HelloComponent { ... }
>

... without setting _configurationPid_ property, 'service.pid' is implied
from _name_.

With that, you should notice that your component responds as you expect
when a configuration with pid "hello" appears.

HTH

PS: _All components are configurable_ (even ones you never anticipated
passing configuration to) because they always infer at least their
component name as a service.pid (AFAIC this is one of the most understated
wonders of DS.)

-- 
*Raymond Augé* (@rotty3000)
Senior Software Architect *Liferay, Inc.* (@Liferay)
OSGi Fellow


Re: ERROR StatusLogger Log4j2 could not find a logging implementation.

2020-11-25 Thread Raymond Auge
Could we maybe get a link to a project repo that has this behaviour?

- Ray

On Wed, Nov 25, 2020 at 6:00 AM Jean-Baptiste Onofre 
wrote:

> Hi Florian,
>
> As you using directly log2j or via pax-logging ?
>
> Regards
> JB
>
> > Le 25 nov. 2020 à 11:55, Florian Pattke  a écrit :
> >
> > Hello everyone,
> >
> > I am having trouble getting Log4J2 to work because it can not find the
> > core and I can't find resources that help me.
> >
> > I'm running the whole project through IntelliJ IDEA + Gradle
> > (build.gradle:
> > https://gist.github.com/cap5lut/bd1c6cf340f7d70e82c9a30f674b5fea)
> > I am using AdoptOpenJdk 11.0.4 as runtime and Apache Felix 6.0.3 as OSGi
> > container.
> >
> > Here is the small Apache Felix configuration file:
> > https://gist.github.com/f09ecdbc0e5ce7da1f75854d646b44ae
> >
> > To test if Log4J2 actually works I wrote a small test bundle containing
> > only the bundle activator
> > (https://gist.github.com/7d88596eae97471584c38377cc6174a1)
> >
> > Once I start the application all bundles are started (or for the
> > fragment bundles resolved):
> > START LEVEL 1
> >ID|State  |Level|Name
> > 0|Active |0|System Bundle (6.0.3)|6.0.3
> > 1|Active |1|org.objectweb.asm (9.0.0)|9.0.0
> > 2|Active |1|org.objectweb.asm.tree.analysis (9.0.0)|9.0.0
> > 3|Active |1|org.objectweb.asm.commons (9.0.0)|9.0.0
> > 4|Active |1|org.objectweb.asm.tree (9.0.0)|9.0.0
> > 5|Active |1|org.objectweb.asm.util (9.0.0)|9.0.0
> > 6|Active |1|cap5lut-service-test
> > (1.0.0.SNAPSHOT)|1.0.0.SNAPSHOT
> > 7|Active |1|JLine Bundle (3.7.0)|3.7.0
> > 8|Active |1|Apache Log4j API (2.14.0)|2.14.0
> > 9|Active |1|Apache Log4j Core (2.14.0)|2.14.0
> >10|Active |1|Apache Aries SPI Fly Dynamic Weaving Bundle
> > (1.3.2)|1.3.2
> >11|Resolved   |1|Apache Aries SPI Fly Dynamic Weaving Framework
> > Extension (1.3.2)|1.3.2
> >12|Active |1|Apache Felix Gogo Command (1.1.0)|1.1.0
> >13|Active |1|Apache Felix Gogo JLine Shell (1.1.0)|1.1.0
> >14|Active |1|Apache Felix Gogo Runtime (1.1.0)|1.1.0
> >
> > But I still get the error ERROR StatusLogger Log4j2 could not find a
> > logging implementation. Please add log4j-core to the classpath. Using
> > SimpleLogger to log to the console...
> >
> > From my little understanding of the OSGi logs I thought everything
> > would be wired correctly as I dont see any warnings or errors, but that
> > doesnt seem to be the case.
> > So here are the complete logs
> > https://gist.github.com/edfebf1663103b2415d2890d8cf151a7
> >
> > What do I do wrong?
> >
> > Regards,
> > cap5lut
> >
> >
> > --
> > Diese E-Mail wurde von Avast Antivirus-Software auf Viren geprüft.
> > https://www.avast.com/antivirus
> >
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
> > For additional commands, e-mail: users-h...@felix.apache.org
> >
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
> For additional commands, e-mail: users-h...@felix.apache.org
>
>

-- 
*Raymond Augé* (@rotty3000)
Senior Software Architect *Liferay, Inc.* (@Liferay)
OSGi Fellow


Re: Updating OSGI weaving hooks at runtime

2020-08-10 Thread Raymond Auge
It is not possible to reload a weaving hook without restarting affected
bundles because in order for the weaving to act the classloader has to be
thrown away and recreated with the hook in place.

Sincerely,
- Ray

On Mon, Aug 10, 2020 at 11:21 AM Roy Teeuwen  wrote:

> Trying it out here if there may be more response
>
> > Begin forwarded message:
> >
> > From: Roy Teeuwen 
> > Subject: Updating OSGI weaving hooks at runtime
> > Date: 5 August 2020 at 08:49:09 CEST
> > To: Apache Felix Developer List 
> >
> > Hey devs,
> >
> > I found a repo with some weaving hooks examples (
> https://github.com/bdelacretaz/OSGi-weaving-hook-examples/blob/master/src/main/java/ch/x42/osgi/weavinghook/LogMethodCallsHook.java
> <
> https://github.com/bdelacretaz/OSGi-weaving-hook-examples/blob/master/src/main/java/ch/x42/osgi/weavinghook/LogMethodCallsHook.java>,
> even though it is pretty old) and found it interesting. What I would like
> to try out is to mimick the behaviour of Rookout (
> https://www.rookout.com/  ). Rookout allows
> (read-only) debugging of a production instance by adding a java agent that
> is able to get object field values at runtime without attaching a real java
> remote debugging instance.
> >
> > How I would like to mimick this is by creating an OSGi Weaving Hook,
> based on the LogMethodCallsHook class, that would allow you to create an
> OSGi weaving hook at runtime by creating for example an OSGi configuration
> factory that registers a weaving hook for a class with a method in a
> specific bundle. Do you see this feasible? Is it possible to register a
> weaving hook without having to reload the entire bundle again and going
> through the Activator method again?
> >
> > I already had a comment from the repo owner himself and he doesn’t think
> its feasable but he gave me the remark to ask here as well! (
> https://github.com/bdelacretaz/OSGi-weaving-hook-examples/issues/1 <
> https://github.com/bdelacretaz/OSGi-weaving-hook-examples/issues/1>)
> >
> > Thanks!
> > Roy
>
>

-- 
*Raymond Augé* 
 (@rotty3000)
Senior Software Architect *Liferay, Inc.* 
 (@Liferay)


Re: maven-bundle-plugin: Exclude Specific Class in Export-package

2020-07-31 Thread Raymond Auge
On Fri., Jul. 31, 2020, 3:56 a.m. Huizhi Lu,  wrote:

> Hello Felix Community,
>
> I have a question regarding using maven-bundle-plugin. I have a case like
> this:
> abc.jar has org.apache.felix.abc.A.class
> module xyz depends on module abc, module xyz also has
> org.apache.felix.abc.B.class
>

Doesn't this create a split-package scenario where both module abc and
module xyz export the same package
org.apache.felix.abc ?


What I would like to do is
> 
> !org.apache.felix.abc.A.class,   // this doesn't work.
> org.apache.felix.abc
> 
>
> I would like to exclude a specific class in export-package,


Could you not make org.apache.felix.abc.B package private?

- Ray

but it seems
> the negation mark(!) only excludes a package, right? Do you have an idea
> that I could exclude A.class in xyz.jar?
>
> Thanks!
>
> -Huizhi
>


Re: How to make HttpService reference ready when bundleContext.registerService() is called

2020-07-23 Thread Raymond Auge
On Thu, Jul 23, 2020 at 8:59 AM Justin Li  wrote:

> Our development requirement needs us to get
> the org.osgi.service.http.HttpService reference during the activation of
> our bundle, but the tests show the HttpService reference is always null if
> we want to locate it from the bundle context.
>

You appear to be mixing HttpService and Http Whiteboard modes. Why do you
need HttpService if you are registering your servlet as a service using
bundleContext.registerService(Servlet.class, myServlet, params) ?

- Ray


> The following is an example. "myServlet" is registered by calling
> "bundleContext.registerService" with whiteboard pattern. According to
> tests, we do get the org.osgi.service.http.HttpService reference by
> registering a ServiceListener ,  but the HttpService reference is not ready
> unless we REALLY make a web call to the web service itself. Actually the
> dumped HttpService is an org.apache.felix.http.base.internal.service.
> *PerBundleHttpServiceImpl* object. So, it seems the HttpService is lazy
> started.
>
> We do not want the HttpService to be lazy started. The question is, is
> there any config or setting can be used so that when
> bundleContext.registerService() is called the HttpService reference will
> also be ready?
>
>
>
> @Activate
> public void activate(ComponentContext ctx)
>
> {
>
>... ...
>
>  BundleContext bundleContext = ctx.getBundleContext();
>
>   Hashtable params = new Hashtable<>();
>
>   params.put(HttpWhiteboardConstants.HTTP_WHITEBOARD_FILTER_PATTERN,
> "/currentView.*");
>
>  ... ...
>
>   bundleContext.registerService(Servlet.class, myServlet, params);
>
>  ... ...
>
> }
>
>
>
> Thanks.
>
> Justin
>
>
>
> *Justin Li*
> Sr. Software Developer
>
>
>
>
> *Kofax Canada, ULC*460 Phillip Street
> Waterloo, ON N2L 5J2
>
> Tel: +1 519 880 7543
> justin...@kofax.com
>
>
> --
>
> This communication is only for the use of the intended recipient. It may
> contain confidential or proprietary information. If you are not the
> intended recipient or have received this communication in error, please
> notify the sender via phone and destroy this communication immediately.
>
>

-- 
*Raymond Augé* 
 (@rotty3000)
Senior Software Architect *Liferay, Inc.* 
 (@Liferay)


[ANN] Felix maven-bundle-plugin version 5.1.1 Released

2020-07-14 Thread Raymond Auge
The Felix team is pleased to announce the release of Felix
maven-bundle-plugin version 5.1.1

The release updates the dependency of bndlib to 5.1.1 and fixes the
following issues:
https://issues.apache.org/jira/projects/FELIX/versions/12346016

This release is available from https://felix.apache.org/site/downloads.cgi
and Maven:

  
org.apache.felix
maven-bundle-plugin
5.1.1
  

Enjoy!

-The Felix team


Re: javax.annotate called as a private reference

2020-05-21 Thread Raymond Auge
Hello Juan,

Sorry you are having problems. Could you provide a little more detail? Do
you know which Felix component is involved? Perhaps some of the log output
would help, if there are stacktraces could you provide them in full?

Sincerely,
- Ray

On Wed, May 20, 2020 at 7:10 PM juan diego morera chaves <
moreraj...@gmail.com> wrote:

> Hello I'm working in a AEM project and when running build the
> javax.annotate is called as a private reference warning , which should not
> happen
> Several of the Sling Models used in the project ose that for
> the @Postconsturct annotation. I'm not sure if this happens to other
> developers, but should not
> Regards
>
> --
>


-- 
*Raymond Augé* 
 (@rotty3000)
Senior Software Architect *Liferay, Inc.* 
 (@Liferay)


Re: Resolution and CNFE problems with Configurator 1.0.10

2020-05-19 Thread Raymond Auge
@Neil Bartlett 
the issue is with start ordering. Because configurator doesn't explicitly
use the Service Loader Mediator to describe a dependency on a _provider_ of
the Json API, if the provider isn't _resolved_ before the JSON API when the
lookup happens it will fail.

The solution is to start the provider earlier.

- Ray



On Tue, May 19, 2020 at 5:04 AM Neil Bartlett  wrote:

> I have raised a JIRA for this issue:
> https://issues.apache.org/jira/browse/FELIX-6277
>
> Cheers,
> Neil
>
> On Tue, 19 May 2020 at 08:58, Neil Bartlett  wrote:
>
> > Hi Apache devs,
> >
> > I'm trying to use org.apache.felix.configurator version 1.0.10 in an OSGi
> > enRoute project. EnRoute uses 1.0.6 by default, but I'm trying to bump
> the
> > version to see if it addresses what might be a lifecycle bug (that's a
> > topic for a separate email).
> >
> > Initially there were some problems resolving the bundle, so 1.0.10 has an
> > import that was not required in 1.0.6:
> >
> > [ERROR] Resolution failed. Capabilities satisfying the following
> > requirements could not be found:
> > [<>]
> >   ⇒ osgi.identity: (osgi.identity=org.example.app)
> >   ⇒ [org.example.app version=0.0.1.202005190718]
> >   ⇒ osgi.extender:
> > (&(osgi.extender=osgi.configurator)(version>=1.0.0)(!(version>=2.0.0)))
> >   ⇒ [org.apache.felix.configurator version=1.0.10]
> >   ⇒ osgi.wiring.package:
> > (&(osgi.wiring.package=javax.json)(&(version>=1.0.0)(!(version>=2.0.0
> >
> > I tried adding org.apache.geronimo.specs:geronimo-json_1.0_spec (which is
> > listed as a provided scope dependency of configurator) to the resolver
> > input as follows:
> >
> > 
> > org.apache.geronimo.specs
> > geronimo-json_1.0_spec
> > 1.0-alpha-1
> > runtime
> > 
> >
> > This successfully resolves, but the Configurator now throws a CNFE from
> > its activator:
> >
> > ! Failed to start bundle org.apache.felix.configurator-1.0.10, exception
> > activator error org.apache.johnzon.core.JsonProviderImpl not found from:
> > javax.json.spi.JsonProvider:doLoadProvider#132
> > org.osgi.framework.BundleException: Exception in
> > org.apache.felix.configurator.impl.Activator.start() of bundle
> > org.apache.felix.configurator.
> > at
> >
> org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:803)
> > at
> >
> org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:732)
> > at
> >
> org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:1005)
> > at
> >
> org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:357)
> > ...
> > Caused by: javax.json.JsonException:
> > org.apache.johnzon.core.JsonProviderImpl not found
> > at
> > javax.json.spi.JsonProvider.doLoadProvider(JsonProvider.java:132)
> > at javax.json.spi.JsonProvider.provider(JsonProvider.java:64)
> > at javax.json.Json.createReader(Json.java:68)
> > at
> >
> org.apache.felix.configurator.impl.json.JSONUtil.parseJSON(JSONUtil.java:329)
> > at
> >
> org.apache.felix.configurator.impl.json.JSONUtil.readJSON(JSONUtil.java:161)
> > at
> >
> org.apache.felix.configurator.impl.json.JSONUtil.readJSON(JSONUtil.java:122)
> > at
> >
> org.apache.felix.configurator.impl.json.JSONUtil.readConfigurationsFromBundle(JSONUtil.java:86)
> > at
> >
> org.apache.felix.configurator.impl.Configurator.processAddBundle(Configurator.java:315)
> > ...
> > Caused by: java.lang.ClassNotFoundException:
> > org.apache.johnzon.core.JsonProviderImpl
> > at
> >
> java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
> > at
> >
> java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
> > at
> java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
> > at
> >
> org.eclipse.osgi.internal.framework.ContextFinder.loadClass(ContextFinder.java:135)
> > at
> java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
> > at
> > javax.json.spi.JsonProvider.doLoadProvider(JsonProvider.java:129)
> > ...
> >
> > I am running on Java 11 (AdoptOpenJDK build 11.0.7+10). What combination
> > of bundles does Configurator actually require? Why does this bundle
> allow a
> > correct resolution of imports but then throw a CNFE at runtime? Note that
> > configurator 1.0.6 embeds geronimo-json_1.0_spec-1.0-alpha-1.jar,
> > johnzon-core-1.0.0.jar and org.apache.felix.converter-1.0.0.jar using
> > Bundle-ClassPath, but this is no longer the case in 1.0.10. That seems
> like
> > an error.
> >
> > Regards,
> > Neil
> >
>


-- 
*Raymond Augé* 
 (@rotty3000)
Senior Software Architect *Liferay, Inc.* 
 

Re: [healthcheck] Equivalent of SystemReady service?

2020-03-19 Thread Raymond Auge
Hey guys, I know this is likely premature for what you need, but I wanted
to also point you to the OSGi Condition Service RFC [1] which attempts to
address exactly these types of scenarios.

[1]
https://github.com/osgi/design/blob/master/rfcs/rfc0242/rfc-0242-Condition-Service.pdf

Sincerely,
- Ray

On Thu, Mar 19, 2020 at 8:48 AM Andrei Dulvac  wrote:

> Hi Robert.
>
> Apologies for the long delay.
>
> I had a look as well as the Felix HCs and AFAICT there is no such "marker"
> service registered that you can listen for. The original design for HCs was
> not for readiness, but for more generic checks.
> You might be stuck with a listener of sorts on all checks using this tag:
>
> https://github.com/apache/felix-dev/blob/master/healthcheck/generalchecks/src/main/java/org/apache/felix/hc/generalchecks/FrameworkStartCheck.java#L46
> Maybe Georg can help with more clear instructions.
>
> We should also add a systemready tag to the Felix HCs.
>
> Personally, I think we need to have systemready implemented with HCs but
> keep the current API or merge the two properly.
>
> Sorry I couldn't be more helpful.
> - Andrei
>
> On Fri, Mar 13, 2020 at 6:47 PM Robert Munteanu 
> wrote:
>
> > Hi,
> >
> > I am using the old systemready bundle and I configured a component to
> > react a component when the system ready by reacting when the
> > SystemReady service becomes available.
> >
> > How can I do the same with the new healtchecks bundle? I tried the
> > README [1] and the migration guide [2] but got no ideas.
> >
> > BTW, the page at [3] points to a missing README file.
> >
> > Thanks,
> > Robert
> >
> > [1]:
> https://github.com/apache/felix-dev/blob/master/healthcheck/README.md
> > [2]:
> >
> https://sling.apache.org/documentation/bundles/sling-health-check-tool.html
> > [3]:
> >
> http://felix.apache.org/documentation/subprojects/apache-felix-healthchecks.html
> >
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
> > For additional commands, e-mail: users-h...@felix.apache.org
> >
> >
>


-- 
*Raymond Augé* 
 (@rotty3000)
Senior Software Architect *Liferay, Inc.* 
 (@Liferay)


Re: Gogo shell + telnet without a local TTY

2020-02-13 Thread Raymond Auge
I'm not sure this is useful for you, but you say you are on a container
platform. Have you tried to forward the port for gogo outside the container?

For docker this is with the -p flag.

e.g.
-p : -p : -p ...

HTH
- Ray

On Thu, Feb 13, 2020 at 9:27 AM Robert Munteanu  wrote:

> Hello Bernd,
>
> On Wed, 2020-02-12 at 20:22 +, Bernd Eckenfels wrote:
> > Can you describe why you think you need a tty? What fails if you
> > don't have one? Do use "karaf console" instead of "karaf start"? Do
> > you have ansi.so load problems?
>
> Note - I don't use karaf, but instead the bundles I indicated in my
> previous email.
>
> I think that it needs a TTY because as soon as I get the note that the
> framework has started, the application immediately starts shutting
> down. Here's the message printed out:
>
> [INFO] Framework started
> 
> Welcome to Apache Felix Gogo
>
> g! gosh: stopping framework
>
>
> I have associated that with a 'close' signal sent to the console due to
> no TTY being available. I may be wrong though, but I did not find a
> solution.
>
> I did a bit of digging and found out that I can add
>
>   -Dgosh.args="--nointeractive"
>
> to my startup script and then the container runs without the need to
> pas the it flags.
>
> However, even though the remote shell bundle is started, I am unable to
> telnet
>
> [FelixDispatchQueue] INFO  E.B.org.apache.felix.gogo.runtime - BundleEvent
> STARTED
> [FelixDispatchQueue] INFO  E.B.org.apache.felix.shell.remote - BundleEvent
> RESOLVED
> [FelixDispatchQueue] INFO  E.B.org.apache.felix.shell.remote - BundleEvent
> STARTED
>
> $ telnet localhost 
> Trying ::1...
> telnet: connect to address ::1: Connection refused
> Trying 127.0.0.1...
> telnet: connect to address 127.0.0.1: Connection refused
>
> For reference, these are the bundles I am using
>
> "org.apache.felix/org.apache.felix.gogo.command/1.1.0",
> "org.apache.felix/org.apache.felix.gogo.shell/1.1.2",
> "org.apache.felix/org.apache.felix.gogo.runtime/1.1.2",
> "org.apache.felix/org.apache.felix.shell.remote/1.2.0
>
> Thanks,
> Robert
>
> > Gruss
> > Bernd
> >
> >
> > --
> > http://bernd.eckenfels.net
> > 
> > Von: Robert Munteanu 
> > Gesendet: Wednesday, February 12, 2020 11:26:32 AM
> > An: users@felix.apache.org 
> > Betreff: Gogo shell + telnet without a local TTY
> >
> > Hi,
> >
> > I am trying to open up access to the gogo shell via telnet without
> > allocating a TTY.
> >
> > The problem with the TTY is that is there is none the shell will get
> > an
> > interrupt, therefore shutting down the OSGi framework. I am running
> > on
> > a container platform, so no much luck in getting that changed.
> >
> > I have tried by adding the following bundles:
> >
> > "org.apache.felix/org.apache.felix.gogo.command/1.1.0"
> > "org.apache.felix/org.apache.felix.gogo.runtime/1.1.2"
> > "org.apache.felix/org.apache.felix.shell.remote/1.2.0"
> >
> > Connecting via telnet results in a connection closed
> >
> > $ telnet localhost 
> > Trying ::1...
> > telnet: connect to address ::1: Connection refused
> > Trying 127.0.0.1...
> > Connected to localhost.
> > Escape character is '^]'.
> > Good Bye!
> > Connection closed by foreign host.
> >
> > and an uncaught exception on the console for the app
> >
> > org.apache.felix.gogo.runtime.CommandNotFoundException: Command not
> > found: gosh
> > at
> > org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:596)
> > at
> > org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:5
> > 26)
> > 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.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
> > at
> > java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoo
> > lExecutor.java:1128)
> > at
> > java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPo
> > olExecutor.java:628)
> > at java.base/java.lang.Thread.run(Thread.java:834)
> >
> > Adding back the "org.apache.felix/org.apache.felix.gogo.shell/1.1.2"
> > bundle fixes the issue, but requires an interactive TTY.
> >
> > I tried replacing the gogo shell bundle with org.apache.felix.shell,
> > but that is not aware of the gogo commands, and is therefore not
> > useful.
> >
> > I'm out of ideas at this point, so how can I use the gogo shell via
> > telnet without a local TTY?
> >
> > Thanks,
> > Robert
> >
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
> > For additional commands, e-mail: users-h...@felix.apache.org
> >
>
>
> 

Re: can GoGo shell load a script?

2019-05-09 Thread Raymond Auge
a) gogo has a `source` command that will read a "gogo shell script" file.

b) with the system of framework property:

gosh.home=/foo

You can specify a directory which contains the following structure `
etc/gosh_profile`
where `gosh_profile` is a text file holding a gogo shell script.

Here's the canned script [1].
Here's the code that does the work [2]

HTH
- Ray

[1]
https://github.com/apache/felix/blob/trunk/gogo/shell/src/main/resources/gosh_profile
[2]
https://github.com/apache/felix/blob/trunk/gogo/shell/src/main/java/org/apache/felix/gogo/shell/Shell.java#L116-L129



On Thu, May 9, 2019 at 12:16 PM Alexandru Repede <
alexandru.repede.stad...@gmail.com> wrote:

> As the GoGo shell support variables, functions, commands, can it also be
> configured to load on startup a set of these from a file?
>


-- 
*Raymond Augé* 
 (@rotty3000)
Senior Software Architect *Liferay, Inc.* 
 (@Liferay)
Board Member & EEG Co-Chair, OSGi Alliance  (@OSGiAlliance)


Re: List of bundles required for Declarative Services Annotation

2019-04-04 Thread Raymond Auge
You need a build plugin that understands how to turn the OSGi annotations
into the XML descriptors inside the resulting jar (bundle).

Which OSGi bundle building plugin are you using?

- Ray

On Thu, Apr 4, 2019 at 10:19 AM Davi Baldin Tavares 
wrote:

> Hello,
>
> I’m trying to move to DS Annotation.
>
> My Class:
>
> import org.osgi.service.component.annotations.Component;
>
> @Component(name = "ZPluginProvider Service", immediate = true, service =
> ZPluginProvider.class)
> public class ZPluginProvider { … }
>
> I’ve deployed these bundles:
>
> org.apache.felix.scr-2.1.16
> org.apache.felix.scr.annotations-1.12.0
> org.apache.felix.scr.ds-annotations-1.2.10
> org.osgi.util.function-1.1.0
> org.osgi.util.promise-1.1.1
>
> However the deployment is not being successfully on
> org.osgi.service.component.annotations completed because of:
>
> 1) org.osgi.service.component.annotations-1.4.0 is missing osgi.unresolved
> or
> 2) org.osgi.service.component.annotations-1.3.0 is missing
> osgi.compile.time.only
>
> Do someone happen to know witch bundles must I have to deploy along Felix
> in order to enable declarative services with annotations?
>
> Thanks,
>
> Davi
> -
> To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
> For additional commands, e-mail: users-h...@felix.apache.org
>
>

-- 
*Raymond Augé* 
 (@rotty3000)
Senior Software Architect *Liferay, Inc.* 
 (@Liferay)
Board Member & EEG Co-Chair, OSGi Alliance  (@OSGiAlliance)


Re: After adding org.apache.felix.scr Jar in bundle all my DM annotation stopped working

2019-03-08 Thread Raymond Auge
On Fri, Mar 8, 2019 at 10:43 AM Abhijeet Banerjee 
wrote:

> Hi Ray,
>
> Thanks for your reply,
> I didn't get your question completely, So trying to explain in short
> I have a project using the OSGi framework underlying.
> Due to the vulnerability issue, I am upgrading all the OSGi, HTTP, Equinox
> Jars which is currently used in my Project.
> I am referring and upgrading 3PP from this link:
> https://download.eclipse.org/equinox/drops/R-4.9-201809060745/index.php
> NOTE: Not all of the JARS which is listed is used in my project only a few
> Subset we used
>

Ok, this is what I suspected. I don't think this is the correct forum for
your question. However, I _think_ the better approach is to simply upgrade
to a later version of the Eclipse SDK entirely, _not_ piecemeal like you
are trying to do.

I would really ask this in the Eclipse forums because the folks here won't
have much insight into your issues because the jars you find in the SDK
(which come from the Eclipse Orbit project) _may not be_ original versions
provided by Felix and might be modified for use in Eclipse SDK (as is the
case for org.apache.felix.scr_2.0.14.v20180822-1822.jar).

HTH,
- Ray



>
> I was upgrading mentioned JARS in STEP Wise:
> 1. Firstly I upgraded all the org.eclipse.jetty JArs successfully.
> 2. Secondly, I Successfully upgrade org.eclipse.osgi,
> 3, Third, Equinox, very few from the list like cm, common, http.jetty,
> console, and ds.
>
> Hope it helps to understand a bit better, Do let me know if you need a few
> more details to regard the same.
>
> Thank you
>
> On Fri, Mar 8, 2019 at 7:53 PM Raymond Auge 
> wrote:
>
> > Hi Abhijeet,
> >
> > Are you working on a Eclipse RCP/SDK application?
> >
> > - Ray
> >
> >
> >
> > On Fri, Mar 8, 2019 at 1:29 AM Abhijeet Banerjee  >
> > wrote:
> >
> > > Greetings,
> > > Currently, I am in the process of upgrading
> > > *"org.eclipse.osgi.services_3.7.100.v20180827-1536.jar"*
> > >
> > > 1. After upgrade during Bundle Validation its prompt me for 2 Dependent
> > Jar
> > > Requirement.
> > >a. org.eclipse.equinox.ds: So I upgraded my current DS
> jar
> > > with supported *"org.eclipse.equinox.ds_1.5.200.v20180827-1235.jar"*
> > >b. org.eclipse.osgi.util:  So I upgraded my current util
> > jar
> > > with supported  *"org.eclipse.osgi.util_3.5.100.v20180827-1536.jar"*
> > > *2. *After upgrade of above Step1 Bundle Validation again prompt for*
> > > "org.apache.felix.scr" missing
> > > Jar from latest "**equinox.ds_1.5.200"*
> > > *NOTE*:  Currently my project doesn't contain this
> > > (*"org.apache.felix.scr") jar,
> > > So I bundled **org.apache.felix.scr_2.0.14.v20180822-1822.jar*
> > >
> > > *3. Once all the 3 above mentioned 3PP Jars Integrated, Bundle
> Validation
> > > stops complaining no more error,*
> > > * But when I am trying to run my project its stop hitting "**updated
> > > <
> > >
> >
> https://felix.apache.org/apidocs/dependencymanager.annotations/r1/org/apache/felix/dm/annotation/api/FactoryConfigurationAdapterService.html#updated()
> > > >"
> > > method of **@FactoryConfigurationAdapterService and
> @ServiceDependency *
> > > *from "**org.apache.felix.dependencymanager.annotation-3.2.0".*
> > >
> > > *Any pointer will be highly appreciated.*
> > >
> > > --
> > >
> > > *Thanks\*
> > > *Abhijeet Banerjee+919910512611*
> > >
> >
> >
> > --
> > *Raymond Augé* <http://www.liferay.com/web/raymond.auge/profile>
> >  (@rotty3000)
> > Senior Software Architect *Liferay, Inc.* <http://www.liferay.com>
> >  (@Liferay)
> > Board Member & EEG Co-Chair, OSGi Alliance <http://osgi.org>
> > (@OSGiAlliance)
> >
>
>
> --
>
> *Thanks\*
> *Abhijeet Banerjee+919910512611*
>


-- 
*Raymond Augé* <http://www.liferay.com/web/raymond.auge/profile>
 (@rotty3000)
Senior Software Architect *Liferay, Inc.* <http://www.liferay.com>
 (@Liferay)
Board Member & EEG Co-Chair, OSGi Alliance <http://osgi.org> (@OSGiAlliance)


Re: After adding org.apache.felix.scr Jar in bundle all my DM annotation stopped working

2019-03-08 Thread Raymond Auge
Hi Abhijeet,

Are you working on a Eclipse RCP/SDK application?

- Ray



On Fri, Mar 8, 2019 at 1:29 AM Abhijeet Banerjee 
wrote:

> Greetings,
> Currently, I am in the process of upgrading
> *"org.eclipse.osgi.services_3.7.100.v20180827-1536.jar"*
>
> 1. After upgrade during Bundle Validation its prompt me for 2 Dependent Jar
> Requirement.
>a. org.eclipse.equinox.ds: So I upgraded my current DS jar
> with supported *"org.eclipse.equinox.ds_1.5.200.v20180827-1235.jar"*
>b. org.eclipse.osgi.util:  So I upgraded my current util jar
> with supported  *"org.eclipse.osgi.util_3.5.100.v20180827-1536.jar"*
> *2. *After upgrade of above Step1 Bundle Validation again prompt for*
> "org.apache.felix.scr" missing
> Jar from latest "**equinox.ds_1.5.200"*
> *NOTE*:  Currently my project doesn't contain this
> (*"org.apache.felix.scr") jar,
> So I bundled **org.apache.felix.scr_2.0.14.v20180822-1822.jar*
>
> *3. Once all the 3 above mentioned 3PP Jars Integrated, Bundle Validation
> stops complaining no more error,*
> * But when I am trying to run my project its stop hitting "**updated
> <
> https://felix.apache.org/apidocs/dependencymanager.annotations/r1/org/apache/felix/dm/annotation/api/FactoryConfigurationAdapterService.html#updated()
> >"
> method of **@FactoryConfigurationAdapterService and  @ServiceDependency *
> *from "**org.apache.felix.dependencymanager.annotation-3.2.0".*
>
> *Any pointer will be highly appreciated.*
>
> --
>
> *Thanks\*
> *Abhijeet Banerjee+919910512611*
>


-- 
*Raymond Augé* 
 (@rotty3000)
Senior Software Architect *Liferay, Inc.* 
 (@Liferay)
Board Member & EEG Co-Chair, OSGi Alliance  (@OSGiAlliance)


Re: Re[3]: ServletContextListener not working?

2019-02-04 Thread Raymond Auge
Thomas did you check that your tool chain processed the annotation
`@HttpWhiteboardListener` into the appropriate service property?

- Ray

On Mon, Feb 4, 2019 at 10:05 AM Thomas Driessen <
thomas.driessen...@gmail.com> wrote:

> BTW the version of felix http is 4.0.6 and the other bundles installed and
> active are:
>
> START LEVEL 1
>ID|State  |Level|Name
> 0|Active |0|OSGi System Bundle
> (3.13.100.v20180827-1536)|3.13.100.v20180827-1536
> 1|Active |1|osgi.possiblebugs.scl.impl
> (0.0.1.201902041434)|0.0.1.201902041434
> 2|Active |1|Apache Commons FileUpload (1.3.3)|1.3.3
> 3|Active |1|Apache Commons IO (2.6.0)|2.6.0
> 4|Active |1|Apache Felix Gogo Command (1.0.2)|1.0.2
> 5|Active |1|Apache Felix Gogo Runtime (1.0.10)|1.0.10
> 6|Active |1|Apache Felix Gogo Shell (1.0.0)|1.0.0
> 7|Active |1|Apache Felix Http Jetty (4.0.6)|4.0.6
> 8|Active |1|Apache Felix Servlet API (1.1.2)|1.1.2
> 9|Active |1|Apache Felix Inventory (1.0.4)|1.0.4
>10|Active |1|Apache Felix Declarative Services (2.1.10)|2.1.10
>11|Active |1|Apache Felix Web Management Console (4.3.4)|4.3.4
>12|Active |1|Apache Felix Web Console Service Component
> Runtime/Declarative Services Plugin (2.0.8)|2.0.8
>13|Active |1|org.osgi:org.osgi.util.function
> (1.1.0.201802012106)|1.1.0.201802012106
>
> Any idea what might be missing?
>
> Kind regards,
> Thomas
>
> -- Originalnachricht --
> Von: "Thomas Driessen" 
> An: "David Bosschaert" ;
> users@felix.apache.org
> Gesendet: 04.02.2019 16:03:25
> Betreff: Re[2]: ServletContextListener not working?
>
> Hi David,
>
> yes this is done via tha @HttpWhiteboardListener annotation. The
> webconsole shows me this output for the MySCL component:
>
>
> -- Originalnachricht --
> Von: "David Bosschaert" 
> An: users@felix.apache.org; "Thomas Driessen" <
> thomas.driessen...@gmail.com>
> Gesendet: 04.02.2019 15:44:52
> Betreff: Re: ServletContextListener not working?
>
> Hi Thomas,
>
> The spec states in section 140.7 [1]
> "Events are sent to listeners registered in the Service Registry with the
> osgi.http.whiteboard.listener service property set to true"
>
> Did you set this service property?
> There is a constant for it in
> org.osgi.service.http.whiteboard.HttpWhiteboardConstants [2]
>
> Hope this helps,
>
> David
>
> [1]
> https://osgi.org/specification/osgi.enterprise/7.0.0/service.http.whiteboard.html#d0e75952
> [2]
> https://osgi.org/specification/osgi.enterprise/7.0.0/service.http.whiteboard.html#org.osgi.service.http.whiteboard.HttpWhiteboardConstants
>
> On Mon, 4 Feb 2019 at 06:38, Thomas Driessen 
> wrote:
>
>> I've investigated this further and in the Apache Felix Web Console my
>> listener is listed under the "Failed Listeners". As reason "Invalid" is
>> shown.
>>
>> I do not know what I'm doing wrong :(
>>
>> This is my ServletContextListener:
>>
>> @Component
>> @HttpWhiteboardListener
>> public class MySCL implements ServletContextListener {
>>
>>  @Override
>>  public void contextDestroyed(ServletContextEvent arg0) {
>>  System.out.println("Destroyed");
>>  }
>>
>>  @Override
>>  public void contextInitialized(ServletContextEvent arg0) {
>>  System.out.println("Initialized");
>>  }
>>
>> }
>>
>> Any idea what I'm missing?
>>
>> Kind regards,
>> thomas
>>
>> -- Originalnachricht --
>> Von: "Thomas Driessen" 
>> An: "users@felix.apache.org" 
>> Gesendet: 04.02.2019 09:48:35
>> Betreff: ServletContextListener not working?
>>
>> >Hi,
>> >
>> >I've already asked on the general OSGi Dev mailing list, but I think
>> >this might be a more appropriate place to ask:
>> >
>> >I just tried to get a ServletContextListener to work, but did not
>> >succeed, although everything is done as defined by the spec.
>> >
>> >Here you can find a minimal example of my setup
>> >https://github.com/Sandared/io.jatoms.osgi.possiblebugs.scl
>> >
>> >The Servlet I'm registering is working fine, but the
>> >ServletContextListener that I registered too is never called.
>> >Even if I call getServletContext() from within the Servlet, my Listener
>> >is never called.
>> >
>> >I would have expected the ServletContextListener to be called at least
>> >once, after a DefaultServletContext has been created by the
>> >ServletContainer, or am I wrong with this assumption?
>> >
>> >Kind regards,
>> >Thomas
>
>

-- 
*Raymond Augé* 
 (@rotty3000)
Senior Software Architect *Liferay, Inc.* 
 (@Liferay)
Board Member & EEG Co-Chair, OSGi Alliance  (@OSGiAlliance)


Re: Gogo commands: return result or print?

2019-01-18 Thread Raymond Auge
On Fri, Jan 18, 2019 at 10:39 AM Todor Boev  wrote:

> Ok, but the formatter doesn't always do what I want.
>
> Right now I return an array of objects and I want the Converter.INSPECT
> level of detail when printing each item in the array.
> The formatter uses Converter.INSPECT level for the array, but
> Converter.PART or Converter.LINE for each item.
> So what should I do:
> - Add another command to inspect one item?
> - Define my own format for that exact array?
> - ..?
>

Deploy a converter for your type along with your command ;)

- Ray


>
> On Fri, Jan 18, 2019 at 5:23 PM Raymond Auge 
> wrote:
>
> > return!
> >
> > When you print you go around the formatters engine and you cannot pipe as
> > nicely.
> >
> > The shell API is designed for returning results from command methods.
> These
> > can be complex objects which are much better for piping between commands
> > than strings on sysout. The formatter engine only kicks in when actually
> > printing out the result and so you can get nice output while having
> really
> > great piping.
> >
> > Furthermore, when you force the use of ThreadIO to manage the sys.out/err
> > you introduce complex threading issues that make things like calling the
> > command engine from other places (believe me when I say it can be useful)
> > very, very painful.
> >
> > My suggestion is to avoid using sys.out/err whenever possible.
> >
> > - Ray
> >
> > On Fri, Jan 18, 2019 at 9:53 AM Todor Boev  wrote:
> >
> > > Hi,
> > >
> > > When implementing a Gogo shell command are there any rules of thumb on
> > > whether I should return a result from the command method or print it on
> > > System.out? Possibly using the CommandSession to format it first.
> > >
> > > What bothers me is that AFAIK the automatic printing of return values
> > from
> > > command methods may be turned off.
> > >
> > > Regards
> > > Todor
> > >
> >
> >
> > --
> > *Raymond Augé* <http://www.liferay.com/web/raymond.auge/profile>
> >  (@rotty3000)
> > Senior Software Architect *Liferay, Inc.* <http://www.liferay.com>
> >  (@Liferay)
> > Board Member & EEG Co-Chair, OSGi Alliance <http://osgi.org>
> > (@OSGiAlliance)
> >
>


-- 
*Raymond Augé* <http://www.liferay.com/web/raymond.auge/profile>
 (@rotty3000)
Senior Software Architect *Liferay, Inc.* <http://www.liferay.com>
 (@Liferay)
Board Member & EEG Co-Chair, OSGi Alliance <http://osgi.org> (@OSGiAlliance)


Re: Gogo commands: return result or print?

2019-01-18 Thread Raymond Auge
return!

When you print you go around the formatters engine and you cannot pipe as
nicely.

The shell API is designed for returning results from command methods. These
can be complex objects which are much better for piping between commands
than strings on sysout. The formatter engine only kicks in when actually
printing out the result and so you can get nice output while having really
great piping.

Furthermore, when you force the use of ThreadIO to manage the sys.out/err
you introduce complex threading issues that make things like calling the
command engine from other places (believe me when I say it can be useful)
very, very painful.

My suggestion is to avoid using sys.out/err whenever possible.

- Ray

On Fri, Jan 18, 2019 at 9:53 AM Todor Boev  wrote:

> Hi,
>
> When implementing a Gogo shell command are there any rules of thumb on
> whether I should return a result from the command method or print it on
> System.out? Possibly using the CommandSession to format it first.
>
> What bothers me is that AFAIK the automatic printing of return values from
> command methods may be turned off.
>
> Regards
> Todor
>


-- 
*Raymond Augé* 
 (@rotty3000)
Senior Software Architect *Liferay, Inc.* 
 (@Liferay)
Board Member & EEG Co-Chair, OSGi Alliance  (@OSGiAlliance)


Re: maven-bundle-plugin multiple blueprint folders

2019-01-16 Thread Raymond Auge
maven-bundle-plugin will process those macros. The only doubt I have is
whether maven-bundle-plugin has all the paths configured properly for bnd.
I'd start with the assumption that it is and just try it and see if it
works.

- Ray

On Wed, Jan 16, 2019 at 9:05 AM Neil Bartlett  wrote:

> In bnd you could use macros, such as the -findpath macro (
> https://bnd.bndtools.org/macros/findpath.html).
>
> However I'm not sure if maven-bundle-plugin will process these.
>
> Neil
>
> On Wed, Jan 16, 2019 at 1:27 PM DERIES Sebastien <
> sebastien.der...@thalesgroup.com> wrote:
>
> > Hi Neil,
> > thank you for your answer!
> >
> > Do you know if there is a way to configure the maven-bundle-plugin to
> > automatically generate the bundle-blueprint header as you described (with
> > the "/"):
> > OSGI-INF/blueprint/folder1/, OSGI-INF/blueprint/folder2/,
> > OSGI-INF/blueprint/folder3/
> >
> > If such a configuration exists, it would discover automatically the
> > folders where blueprint XML files are, and list then in the header.
> >
> > Regards.
> >
> > Sebastien.
> >
> > -Message d'origine-
> > De : Neil Bartlett [mailto:njbartl...@gmail.com]
> > Envoyé : mercredi 16 janvier 2019 10:26
> > À : users
> > Objet : Re: maven-bundle-plugin multiple blueprint folders
> >
> > See OSGi Compendium specification, section 121.3.4. The Bundle-Blueprint
> > header is a list of paths and only the last component of each path can
> be a
> > wildcard. However if a path ends in a slash then it is inferred to mean
> > *.xml under that path.
> >
> > Therefore you can define your Bundle-Blueprint header as:
> > OSGI-INF/blueprint/folder1/, OSGI-INF/blueprint/folder2/,
> > OSGI-INF/blueprint/folder3/
> > (etc).
> >
> > Regards,
> > Neil
> >
> > On Tue, Jan 15, 2019 at 10:30 AM DERIES Sebastien <
> > sebastien.der...@thalesgroup.com> wrote:
> >
> > > Hi Felix users !
> > >
> > > First I wish you the best for this new year !
> > >
> > > Then, I have a question about the maven-bundle-plugin and the
> > > bundle-blueprint manifest header.
> > > Our application is built using the maven-bundle-plugin.
> > >
> > > Our bundles currently instanciate beans using many blueprint XML files.
> > > The bean definitions are stored in the following file structure :
> > > OSGI-INF
> > > ->blueprint
> > > -> file1.xml
> > > -> file2.xml
> > > -> ...
> > > -> fileN.xml
> > >
> > > The maven-bundle-plugin generates for us a perfect MANIFEST.MF file,
> with
> > > this structure.
> > >
> > > However, having such a flat file structure is not easily readable. I
> was
> > > wondering if maven-bundle-plugin could automatically generate a
> > MANIFEST.MF
> > > with the right bundle-blueprint header corresponding to a file
> structure
> > > like this:
> > >
> > > OSGI-INF
> > > ->blueprint
> > > -> folder1
> > > > file1.xml
> > > > file2.xml
> > > -> folder2
> > > > file1.xml
> > > > file2.xml
> > > -> folder3
> > > > file1.xml
> > > > file2.xml
> > >
> > > I tested this file structure with our current maven-bundle-plugin
> options
> > > and it currently does not work. Is there a way to configure the
> > > maven-bundle-plugin to have inside the manifest :
> > > bundle-blueprint: blueprint/folder1, blueprint/folder2,
> blueprint/folder3
> > >
> > > Thank you!
> > >
> > > Cheers.
> > >
> > > Sebastien
> > >
> > >
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
> > For additional commands, e-mail: users-h...@felix.apache.org
> >
>


-- 
*Raymond Augé* 
 (@rotty3000)
Senior Software Architect *Liferay, Inc.* 
 (@Liferay)
Board Member & EEG Co-Chair, OSGi Alliance  (@OSGiAlliance)


Re: [logback] Automatically setting up JUL-to-slf4j bridge?

2019-01-15 Thread Raymond Auge
Yes, precisely!

I was long struggling with it but I think in the spirit of felix.logback
trying to just make logging work super well with minimal setup, I just
embedded to JUL bridge directly into it and it will automatically be
applied. I figure this is the most effective and desirable approach to
reduce friction.

- Ray

On Tue, Jan 15, 2019 at 9:48 AM Robert Munteanu  wrote:

> Hi Ray,
>
> On Sun, 2018-11-25 at 11:55 -0500, Raymond Auge wrote:
> > On Tue, Nov 6, 2018 at 7:50 AM Robert Munteanu 
> > wrote:
> >
> > > Hi,
> > >
> > > I am looking into using the felix logback module. The main setup
> > works
> > > just fine, and anything using slf4j routes its logging through this
> > > module.
> > >
> > > In my application one bundle (aries-spi-fly) uses java.util.logging
> > > APIs. Digging through the felix.logback tests I discovered that
> > there
> > > are two ways to configure this bridge:
> > >
> > > a. Create a bundle that programatically installs the bridge
> > >
> > >
> > https://github.com/apache/felix/tree/trunk/logback/itests/standard-jul
> > >
> > > I haven't tried this, but it looks like this is a regular bundle,
> > no
> > > special setup required.
> > >
> > > b. Configure the JUL handlers using a properties file
> > >
> > >
> > https://github.com/apache/felix/tree/trunk/logback/itests/immediate-jul
> > >
> > > AFAIU, this requires that the system bundle has visibility into the
> > > slf4j classes, so that some org.slf4j classes are attached to the
> > sytem
> > > bundle (I'm not familiar with bndrun files, so please excuse any
> > > imprecisions).
> > >
> > > A couple of questions regarding this setup:
> > >
> > > 1. Is my understanding on how to setup a JUL-to-slf4j bridge
> > correct?
> > >
> > > 2. Would you consider a way of automatically setting up this
> > bridge?
> > > Ideally dropping in the jul-to-slf4j bundle should be all that is
> > > required.
> > >
> >
> > Hey Robert,
> >
> > I struggled with this a little bit. I would like to do this but I'm
> > not
> > sure the least intrusive way. The only thing I could come up with was
> > to
> > include the code somewhere in launcher code which was ugly.
> >
> > Any ideas are very welcome.
> >
> > Sincerely,
> > - Ray
>
> I did not get any bright ideas it seems :-) Did this get fixed with
>
>   https://issues.apache.org/jira/browse/FELIX-6027
>
> ?
>
> Robert
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
> For additional commands, e-mail: users-h...@felix.apache.org
>
>

-- 
*Raymond Augé* <http://www.liferay.com/web/raymond.auge/profile>
 (@rotty3000)
Senior Software Architect *Liferay, Inc.* <http://www.liferay.com>
 (@Liferay)
Board Member & EEG Co-Chair, OSGi Alliance <http://osgi.org> (@OSGiAlliance)


Re: Gogo Lline Shell and remote console

2018-11-29 Thread Raymond Auge
I forgot to mention, you're completely correct that this isn't well
documented. I've planned to do some work on that, and I started, but I
haven't had a real chance to do more _yet_. Any help would be appreciated.

Sincerely,
- Ray

On Thu, Nov 29, 2018 at 3:50 PM Raymond Auge 
wrote:

> The gogo shell dialect is described in the OSGi R4.2 draft [1] (page 103
> of the PDF).
>
> The Gosh profile is written in that same syntax. See here [2] for some
> introductory features of the shell language and command interface.
>
> [1] https://osgi.org/download/osgi-4.2-early-draft.pdf#page=103
> [2]
> http://felix.apache.org/documentation/subprojects/apache-felix-gogo/rfc-147-overview.html
>
>
> On Thu, Nov 29, 2018 at 3:35 PM Doug Meredith 
> wrote:
>
>> Thanks for the information, Guillaume. Much appreciated. Based on this
>> information, I did some further research. Some of this stuff isn't well
>> documented, so for anyone finding this later, here is what I understand:
>>
>>- Gosh is an abbreviation for Gogo Shell. Sure, that seems obvious to
>>you now that I've pointed it out, but you wouldn't believe how much
>>googling I did on this mysterious thing before it finally came to me.
>> lol
>>- gosh_profile is a startup script for the Gogo Shell. You place it in
>>an "etc" directory relative to the working directory where the
>> framework is
>>started. If you put shell-like echo commands in this file, you will see
>>them when you start Gogo.
>>- The location of gosh_profile can be changed using the system property
>>gosh.home. (I didn't test this).
>>- I found no documentation on how to code a gosh_profile, and it isn't
>>even clear to me what language it uses.
>>- The JLine 3 Git repository contains code for both telnet and SSH
>>servers.
>>- The sample gosh_profile given in the JLine repository has code to add
>>commands to Gogo for enabling telnetd.This gosh_profile causes
>> exceptions
>>to be thrown when used in an OSGi environment.
>>- It's unclear to me if proper telnet/ssh support could be enabled
>>without some coding. Quite possibly it could by someone with sufficient
>>knowledge of JLine and the intricacies of gosh_profile.
>>
>> I'm only about 80% sure of everything that I said above, and some of my
>> terminology could be a bit off, so take it with a grain of salt.
>>
>> Doug
>>
>> On Thu, Nov 29, 2018 at 2:46 AM Guillaume Nodet 
>> wrote:
>>
>> > The remote shell bundle does not support the JLine gogo integration. The
>> > code is 10 years old and has not been maintained.
>> > JLine requires a terminal to be created and setup when the
>> CommandSession
>> > is created and this step is not done by the remote shell bundle.
>> > If you want remote access, JLine provides good telnet and ssh support
>> for
>> > incoming connections.
>> > For example if you start the main JLine demo which uses gogo, but
>> outside
>> > OSGi, you can then run:
>> >   > telnetd start
>> > which starts the telnet daemon and you can then connect remotely.
>> >
>> > The commands are registered via a custom gosh_profile script which is
>> > executed when a gogo shell is created:
>> >
>> >
>> https://github.com/jline/jline3/blob/master/demo/etc/gosh_profile#L151-L163
>> >
>> >
>>
>
>
> --
> *Raymond Augé* <http://www.liferay.com/web/raymond.auge/profile>
>  (@rotty3000)
> Senior Software Architect *Liferay, Inc.* <http://www.liferay.com>
>  (@Liferay)
> Board Member & EEG Co-Chair, OSGi Alliance <http://osgi.org>
> (@OSGiAlliance)
>


-- 
*Raymond Augé* <http://www.liferay.com/web/raymond.auge/profile>
 (@rotty3000)
Senior Software Architect *Liferay, Inc.* <http://www.liferay.com>
 (@Liferay)
Board Member & EEG Co-Chair, OSGi Alliance <http://osgi.org> (@OSGiAlliance)


Re: Gogo Lline Shell and remote console

2018-11-29 Thread Raymond Auge
The gogo shell dialect is described in the OSGi R4.2 draft [1] (page 103 of
the PDF).

The Gosh profile is written in that same syntax. See here [2] for some
introductory features of the shell language and command interface.

[1] https://osgi.org/download/osgi-4.2-early-draft.pdf#page=103
[2]
http://felix.apache.org/documentation/subprojects/apache-felix-gogo/rfc-147-overview.html


On Thu, Nov 29, 2018 at 3:35 PM Doug Meredith 
wrote:

> Thanks for the information, Guillaume. Much appreciated. Based on this
> information, I did some further research. Some of this stuff isn't well
> documented, so for anyone finding this later, here is what I understand:
>
>- Gosh is an abbreviation for Gogo Shell. Sure, that seems obvious to
>you now that I've pointed it out, but you wouldn't believe how much
>googling I did on this mysterious thing before it finally came to me.
> lol
>- gosh_profile is a startup script for the Gogo Shell. You place it in
>an "etc" directory relative to the working directory where the
> framework is
>started. If you put shell-like echo commands in this file, you will see
>them when you start Gogo.
>- The location of gosh_profile can be changed using the system property
>gosh.home. (I didn't test this).
>- I found no documentation on how to code a gosh_profile, and it isn't
>even clear to me what language it uses.
>- The JLine 3 Git repository contains code for both telnet and SSH
>servers.
>- The sample gosh_profile given in the JLine repository has code to add
>commands to Gogo for enabling telnetd.This gosh_profile causes
> exceptions
>to be thrown when used in an OSGi environment.
>- It's unclear to me if proper telnet/ssh support could be enabled
>without some coding. Quite possibly it could by someone with sufficient
>knowledge of JLine and the intricacies of gosh_profile.
>
> I'm only about 80% sure of everything that I said above, and some of my
> terminology could be a bit off, so take it with a grain of salt.
>
> Doug
>
> On Thu, Nov 29, 2018 at 2:46 AM Guillaume Nodet  wrote:
>
> > The remote shell bundle does not support the JLine gogo integration. The
> > code is 10 years old and has not been maintained.
> > JLine requires a terminal to be created and setup when the CommandSession
> > is created and this step is not done by the remote shell bundle.
> > If you want remote access, JLine provides good telnet and ssh support for
> > incoming connections.
> > For example if you start the main JLine demo which uses gogo, but outside
> > OSGi, you can then run:
> >   > telnetd start
> > which starts the telnet daemon and you can then connect remotely.
> >
> > The commands are registered via a custom gosh_profile script which is
> > executed when a gogo shell is created:
> >
> >
> https://github.com/jline/jline3/blob/master/demo/etc/gosh_profile#L151-L163
> >
> >
>


-- 
*Raymond Augé* 
 (@rotty3000)
Senior Software Architect *Liferay, Inc.* 
 (@Liferay)
Board Member & EEG Co-Chair, OSGi Alliance  (@OSGiAlliance)


[ANN] Apache Felix maven-bundle-plugin 4.1.0

2018-11-25 Thread Raymond Auge
A little while ago the Apache Felix released the maven-bundle-plugin 4.1.0
to sync with release of bndlib 4.1.0.

This release is significant for being the first release that supports:

- OSGi R7 Bundle Annotation [1] processing. This feature makes external
metadata sources _practically obsolete_ by enabling developers to use
annotations at appropriate locations in their code. (These annotations are
only visible and used at build time.)
- OSGi R7 Declarative Services ComponentPropertyType Annotation [2]
processing. A component property type allows properties to be defined and
accessed in a type safe manner.
- Preliminary support for OSGi CDI Integration [3] projects. This support
allows for simple development of CDI Bundles.

Thank you,
Apache Felix Team

[1]
https://osgi.org/specification/osgi.core/7.0.0/framework.api.html#org.osgi.annotation.bundle
[2]
https://osgi.org/specification/osgi.cmpn/7.0.0/service.component.html#service.component-component.property.types
[3] https://osgi.org/specification/osgi.enterprise/7.0.0/service.cdi.html


Re: [logback] Automatically setting up JUL-to-slf4j bridge?

2018-11-25 Thread Raymond Auge
On Tue, Nov 6, 2018 at 7:50 AM Robert Munteanu  wrote:

> Hi,
>
> I am looking into using the felix logback module. The main setup works
> just fine, and anything using slf4j routes its logging through this
> module.
>
> In my application one bundle (aries-spi-fly) uses java.util.logging
> APIs. Digging through the felix.logback tests I discovered that there
> are two ways to configure this bridge:
>
> a. Create a bundle that programatically installs the bridge
>
> https://github.com/apache/felix/tree/trunk/logback/itests/standard-jul
>
> I haven't tried this, but it looks like this is a regular bundle, no
> special setup required.
>
> b. Configure the JUL handlers using a properties file
>
> https://github.com/apache/felix/tree/trunk/logback/itests/immediate-jul
>
> AFAIU, this requires that the system bundle has visibility into the
> slf4j classes, so that some org.slf4j classes are attached to the sytem
> bundle (I'm not familiar with bndrun files, so please excuse any
> imprecisions).
>
> A couple of questions regarding this setup:
>
> 1. Is my understanding on how to setup a JUL-to-slf4j bridge correct?
>
> 2. Would you consider a way of automatically setting up this bridge?
> Ideally dropping in the jul-to-slf4j bundle should be all that is
> required.
>

Hey Robert,

I struggled with this a little bit. I would like to do this but I'm not
sure the least intrusive way. The only thing I could come up with was to
include the code somewhere in launcher code which was ugly.

Any ideas are very welcome.

Sincerely,
- Ray


>
> Thanks!
>
> Robert
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
> For additional commands, e-mail: users-h...@felix.apache.org
>
>

-- 
*Raymond Augé* 
 (@rotty3000)
Senior Software Architect *Liferay, Inc.* 
 (@Liferay)
Board Member & EEG Co-Chair, OSGi Alliance  (@OSGiAlliance)


Re: Logging of all the /system/console calls

2018-11-14 Thread Raymond Auge
With Http Whiteboard version 1.1 there is now the concept of servlet
"Preprocessor" [1]

Preprocessors do not target specific urls/paths, but entire whiteboard
instances. With this you could easily log all requests to a whiteboard
instance (including requests to legacy HttpService implementations where
the implementations supports it, which Apache Felix Http does) or any
subset thereof.

HTH,
- Ray

[1]
https://osgi.org/specification/osgi.cmpn/7.0.0/service.http.whiteboard.html#service.http.whiteboard.servlet.preprocessors

On Wed, Nov 14, 2018 at 11:23 AM Cedric Latimier 
wrote:

> Hi all,
>
>
>
> I have a question. Is it possible to add a logger that will track all the
> accesses to /system/console/*?
> I have tried a debug logger on org.apache.felix.webconsole but that’s not
> working.
>
> Is there a way to do that by chance?
>
>
>
> Regards,
>
>
>
> *Cédric LATIMIER* |Technical Support Consultant, Customer Care|Customer &
> Employee Experience | Adobe |(:: (office) +41 61 226 5538 / (mobile) +41
> 79 454 5204 | *8*:: latim...@adobe.com
>
>
>
> [image: cid:image002.png@01D2FC25.421249D0]
>
>
>
> [image: EL] 
>
>
>
>
>
>
>
>
>


-- 
*Raymond Augé* 
 (@rotty3000)
Senior Software Architect *Liferay, Inc.* 
 (@Liferay)
Board Member & EEG Co-Chair, OSGi Alliance  (@OSGiAlliance)


Re: Root POM and README.md

2018-10-31 Thread Raymond Auge
On Wed, Oct 31, 2018 at 11:54 AM Thomas Driessen <
thomas.driessen...@gmail.com> wrote:

> Hi Ray,
>
> this .md file is great. Finally a well structured overview of felix and
> what is an actual compendium service and what is just added by felix for
> convenience.
>

Great first feedback! :)


> One additional information might be useful: If the respective project is
> an OSGi reference implementation or not.
>

Yeah, I can add this.


>
> Kind regards,
> Thomas
>
> -- Originalnachricht --
> Von: "Raymond Auge" 
> An: "felix users" 
> Gesendet: 31.10.2018 16:41:54
> Betreff: Root POM and README.md
>
> >Hey all,
> >
> >Over the years the Felix project has resulted in pain for newcomers
> >with
> >their first baby steps in trying to contribute.
> >
> >In order to lower the bar a little bit and make it slightly less
> >painful,
> >we've remove the top level reactor POM (since it was just broken
> >anyway)
> >and added a real README.mb [1].
> >
> >Please contribute any changes you'd like here to help highlight your
> >fav
> >sub-project(s).
> >
> >Sincerely,
> >The Apache Felix team
> >
> >[1] https://github.com/apache/felix/blob/trunk/README.md
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
> For additional commands, e-mail: users-h...@felix.apache.org
>
>

-- 
*Raymond Augé* <http://www.liferay.com/web/raymond.auge/profile>
 (@rotty3000)
Senior Software Architect *Liferay, Inc.* <http://www.liferay.com>
 (@Liferay)
Board Member & EEG Co-Chair, OSGi Alliance <http://osgi.org> (@OSGiAlliance)


Root POM and README.md

2018-10-31 Thread Raymond Auge
Hey all,

Over the years the Felix project has resulted in pain for newcomers with
their first baby steps in trying to contribute.

In order to lower the bar a little bit and make it slightly less painful,
we've remove the top level reactor POM (since it was just broken anyway)
and added a real README.mb [1].

Please contribute any changes you'd like here to help highlight your fav
sub-project(s).

Sincerely,
The Apache Felix team

[1] https://github.com/apache/felix/blob/trunk/README.md


Re: how to enable http2 in jetty

2018-10-20 Thread Raymond Auge
of
> > > packaging jetty isn't tested by jetty proper, so who can say what side
> > > effects may be lurking?
> > >
> > > The eclipse equinox impl of the http service works in the "thin" way
> > like I
> > > have proposed and looks to me like a better solution.  Is there much
> > > collaboration between equinox and felix on the parts that seem to be
> > common
> > > to both?
> > >
> > > Regarding your suggestions:  I still don't see a good solution with
> your
> > > hybrid approach either since the same problems I raised in the July
> > message
> > > thread about the activation timing remain.  For example. the bundle
> > > activator where jetty is started synchronously happens before the
> spifly
> > > bundle extender makes the ServiceLoader stuff available so any
> > > ServiceLoader configuration embedded inside of the felix.http bundle
> > would
> > > not be available yet when jetty is starting up.
> > >
> > > Plus I'm not sure I like the impression that http/2 support would have
> > the
> > > appearance of being a second-class feature when wider adoption of
> http/2
> > > would be better for everyone.
> > >
> > > Regards,
> > > -Eric
> > >
> > > On Sat, Oct 20, 2018 at 5:25 AM Carsten Ziegeler  >
> > > wrote:
> > >
> > >> Let's focus for a minute on having jetty as separate bundles. This
> will
> > >> potentially create a lot of problems as people will use the wrong
> jetty
> > >> version. I just recently updated from on 9.4.x version to the next
> > >> 9.4.(x+1) version and our code was not even compiling anymore.
> Therefore
> > >> ultimately our code is tied to a very specific version of Jetty.
> > >> From that PoV it's dangerous to not bundle jetty.
> > >> My suggestion is still:
> > >> - we bundle Jetty as today but add the missing service loader files.
> > >> This bundle has code to support http2 if the additional stuff is
> > installed.
> > >> - for people needing http2 they install a number of more bundles and
> > >> voila everything works.
> > >>
> > >> Unless this plan is not possible, I don't see a reason why we
> shouldn't
> > >> go there?
> > >>
> > >> Carsten
> > >>
> > >>
> > >> Am 19.10.2018 um 17:34 schrieb Raymond Auge:
> > >>>
> > >>>
> > >>> On Fri, Oct 19, 2018 at 11:11 AM Carsten Ziegeler <
> > cziege...@apache.org
> > >>> <mailto:cziege...@apache.org>> wrote:
> > >>>
> > >>>
> > >>>
> > >>>Am 19.10.2018 um 17:06 schrieb Raymond Auge:
> > >>>> On Fri, Oct 19, 2018 at 10:55 AM Carsten Ziegeler
> > >>>mailto:cziege...@apache.org>>
> > >>>> wrote:
> > >>>>
> > >>>>> Well, you are assuming that people are using a tool which does
> > >> the
> > >>>>> resolving. Today you can simply download the Apache Felix Jetty
> > >>>bundle,
> > >>>>> install and enjoy. No tooling required. With such a proposal
> > >> we're
> > >>>>> breaking this experience
> > >>>>>
> > >>>>
> > >>>> Can I get a vote as to how many people actually get this
> > >> experience?
> > >>>>
> > >>>> I feel this only works when you already know _exactly_ what you
> > >>>want, which
> > >>>> I do not feel is the norm.
> > >>>
> > >>>Not sure if I can follow here, people know that they want the
> Jetty
> > >>>module, download it, install it and have a party. We've constantly
> > >>>seeing people in our mailing lists saying that.
> > >>>
> > >>>
> > >>> I understand this. Perhaps we should simply offer an additional
> > >>> packaging which relies on the jetty BOM as a dependency. The benefit
> > >>> being we don't have to wait for Jetty to provide something special,
> > >>> since they already provide the BOM for exactly this purpose.
> > >>>
> > >>> I feel most people do not go to the Felix website and download jars
> > >>> except as part of experiments. It is my own experience that people
> use
> > a
> 

Re: how to enable http2 in jetty

2018-10-20 Thread Raymond Auge
Cool, it's a start!

- Ray

On Sat, Oct 20, 2018 at 8:38 AM Naftali  wrote:

> I agree, this solution would suffice for now and impact would be nihil.
>
> Op za 20 okt. 2018 om 14:25 schreef Carsten Ziegeler  >:
>
> > Let's focus for a minute on having jetty as separate bundles. This will
> > potentially create a lot of problems as people will use the wrong jetty
> > version. I just recently updated from on 9.4.x version to the next
> > 9.4.(x+1) version and our code was not even compiling anymore. Therefore
> > ultimately our code is tied to a very specific version of Jetty.
> >  From that PoV it's dangerous to not bundle jetty.
> > My suggestion is still:
> > - we bundle Jetty as today but add the missing service loader files.
> > This bundle has code to support http2 if the additional stuff is
> installed.
> > - for people needing http2 they install a number of more bundles and
> > voila everything works.
> >
> > Unless this plan is not possible, I don't see a reason why we shouldn't
> > go there?
> >
> > Carsten
> >
> >
> > Am 19.10.2018 um 17:34 schrieb Raymond Auge:
> > >
> > >
> > > On Fri, Oct 19, 2018 at 11:11 AM Carsten Ziegeler <
> cziege...@apache.org
> > > <mailto:cziege...@apache.org>> wrote:
> > >
> > >
> > >
> > > Am 19.10.2018 um 17:06 schrieb Raymond Auge:
> > >  > On Fri, Oct 19, 2018 at 10:55 AM Carsten Ziegeler
> > > mailto:cziege...@apache.org>>
> > >  > wrote:
> > >  >
> > >  >> Well, you are assuming that people are using a tool which does
> > the
> > >  >> resolving. Today you can simply download the Apache Felix Jetty
> > > bundle,
> > >  >> install and enjoy. No tooling required. With such a proposal
> > we're
> > >  >> breaking this experience
> > >  >>
> > >  >
> > >  > Can I get a vote as to how many people actually get this
> > experience?
> > >  >
> > >  > I feel this only works when you already know _exactly_ what you
> > > want, which
> > >  > I do not feel is the norm.
> > >
> > > Not sure if I can follow here, people know that they want the Jetty
> > > module, download it, install it and have a party. We've constantly
> > > seeing people in our mailing lists saying that.
> > >
> > >
> > > I understand this. Perhaps we should simply offer an additional
> > > packaging which relies on the jetty BOM as a dependency. The benefit
> > > being we don't have to wait for Jetty to provide something special,
> > > since they already provide the BOM for exactly this purpose.
> > >
> > > I feel most people do not go to the Felix website and download jars
> > > except as part of experiments. It is my own experience that people use
> a
> > > build tool which relies on dependencies stored in maven central (using
> > > maven or gradle or some other build tool).
> > >
> > > In that way, and because felix.http.jetty is a implementation, they
> > > don't care about how the transitive dependencies are handled or
> > > provided; as long as the parts they need get into their deployment.
> > >
> > > - Ray
> > >
> > >
> > > While resolver based tooling is awesome, it's not the way all
> people
> > > work. Whether that is good or bad, does not matter. Requiring over
> 20
> > > bundles to be installed to get a single functionality working seems
> > > really like overkill.
> > >
> > > Regards
> > > Carsten
> > >
> > >  >
> > >  > - Ray
> > >  >
> > >  >
> > >  >>
> > >  >> Carsten
> > >  >>
> > >  >> Am 19.10.2018 um 16:10 schrieb Raymond Auge:
> > >  >>> I know in the past I argued against exposing all the jetty
> > > bundles. But I
> > >  >>> feel I was probably wrong back then. I think that with the
> > > jetty BOM and
> > >  >>> the OSGi resolver, figuring out which bundles you need, and
> > > then adding
> > >  >>> additional ones to suite your case, is not so hard.
> > >  >>>
> > >  >>> Furthermore, Service Loader Mediator is not as painful
> anymore

Re: how to enable http2 in jetty

2018-10-19 Thread Raymond Auge
On Fri, Oct 19, 2018 at 10:55 AM Carsten Ziegeler 
wrote:

> Well, you are assuming that people are using a tool which does the
> resolving. Today you can simply download the Apache Felix Jetty bundle,
> install and enjoy. No tooling required. With such a proposal we're
> breaking this experience
>

Can I get a vote as to how many people actually get this experience?

I feel this only works when you already know _exactly_ what you want, which
I do not feel is the norm.

- Ray


>
> Carsten
>
> Am 19.10.2018 um 16:10 schrieb Raymond Auge:
> > I know in the past I argued against exposing all the jetty bundles. But I
> > feel I was probably wrong back then. I think that with the jetty BOM and
> > the OSGi resolver, figuring out which bundles you need, and then adding
> > additional ones to suite your case, is not so hard.
> >
> > Furthermore, Service Loader Mediator is not as painful anymore, just use
> an
> > R7 framework with the SpiFly framework extension.
> >
> > - Ray
> >
> > On Fri, Oct 19, 2018 at 9:30 AM Raymond Auge 
> > wrote:
> >
> >> Why not start relying on the Jetty BOM and let people depend on the
> >> bundles what they want, at least this way they can let the resolver
> >> assemble the bundles they need?
> >>
> >> - Ray
> >>
> >> On Fri, Oct 19, 2018 at 3:39 AM Carsten Ziegeler 
> >> wrote:
> >>
> >>> The other option would be if jetty could provide us one fat bundle, to
> >>> avoid having users to install N bundles, it would just be one
> additional.
> >>>
> >>> Regards
> >>> Carsten
> >>>
> >>> Am 19.10.2018 um 09:35 schrieb Carsten Ziegeler:
> >>>> Hi Eric,
> >>>>
> >>>> I would like to come back to this discussion; I somehow forgot to
> >>> follow
> >>>> up on the old thread.
> >>>> If we go with a thin Apache Felix Jetty bundle, then you need to
> >>> install
> >>>> a lot of other bundles even if you don't use http2. So updating from a
> >>>> current version to this new version is not nice.
> >>>>
> >>>> How about we still include the jetty bundles inside, fix the service
> >>>> loader configuration by including it - but do not include the other
> >>>> things needed for http2 support. So if you're not using http2, it
> works
> >>>> like today.
> >>>> If you use http2 you install additionally spifly and what else is
> >>>> required to make it work.
> >>>>
> >>>> Would that work?
> >>>>
> >>>> Regards
> >>>> Carsten
> >>>>
> >>>> Am 18.10.2018 um 19:59 schrieb Eric Norman:
> >>>>> Yes, with a few changes to the felix.http code it is possible to make
> >>> it
> >>>>> work.
> >>>>>
> >>>>> I stashed the code changes in my github fork at
> >>>>> https://github.com/enapps-enorman/felix which I think you have
> already
> >>>>> discovered?
> >>>>>
> >>>>> I would be willing to initiate a PR from the fork, but unfortunately
> >>> the
> >>>>> http/2 support doesn't work without changing how the felix.http
> bundle
> >>> is
> >>>>> packaged as discussed on the felix mailing list at:
> >>>>> https://www.mail-archive.com/users@felix.apache.org/msg18187.html
> >>>>>
> >>>>> The felix community seemed reluctant to make the packaging changes to
> >>> the
> >>>>> felix.http bundle so I didn't send the PR at the time.
> >>>>>
> >>>>>
> >>>>> Regards,
> >>>>>
> >>>>> Eric
> >>>>>
> >>>>> On Thu, Oct 18, 2018 at 10:04 AM Naftali  wrote:
> >>>>>
> >>>>>> Hi, is there any way to enable enable HTTP/2 support in the embedded
> >>>>>> felix
> >>>>>> jetty?
> >>>>>>
> >>>>>> Greetz Naftali
> >>>>>>
> >>>>>
> >>>>
> >>>
> >>> --
> >>> Carsten Ziegeler
> >>> Adobe Research Switzerland
> >>> cziege...@apache.org
> >>>
> >>> -
> >>> To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
> >>> For additional commands, e-mail: users-h...@felix.apache.org
> >>>
> >>>
> >>
> >> --
> >> *Raymond Augé* <http://www.liferay.com/web/raymond.auge/profile>
> >>   (@rotty3000)
> >> Senior Software Architect *Liferay, Inc.* <http://www.liferay.com>
> >>   (@Liferay)
> >> Board Member & EEG Co-Chair, OSGi Alliance <http://osgi.org>
> >> (@OSGiAlliance)
> >>
> >
> >
>
> --
> Carsten Ziegeler
> Adobe Research Switzerland
> cziege...@apache.org
>
> -
> To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
> For additional commands, e-mail: users-h...@felix.apache.org
>
>

-- 
*Raymond Augé* <http://www.liferay.com/web/raymond.auge/profile>
 (@rotty3000)
Senior Software Architect *Liferay, Inc.* <http://www.liferay.com>
 (@Liferay)
Board Member & EEG Co-Chair, OSGi Alliance <http://osgi.org> (@OSGiAlliance)


Re: how to enable http2 in jetty

2018-10-19 Thread Raymond Auge
I know in the past I argued against exposing all the jetty bundles. But I
feel I was probably wrong back then. I think that with the jetty BOM and
the OSGi resolver, figuring out which bundles you need, and then adding
additional ones to suite your case, is not so hard.

Furthermore, Service Loader Mediator is not as painful anymore, just use an
R7 framework with the SpiFly framework extension.

- Ray

On Fri, Oct 19, 2018 at 9:30 AM Raymond Auge 
wrote:

> Why not start relying on the Jetty BOM and let people depend on the
> bundles what they want, at least this way they can let the resolver
> assemble the bundles they need?
>
> - Ray
>
> On Fri, Oct 19, 2018 at 3:39 AM Carsten Ziegeler 
> wrote:
>
>> The other option would be if jetty could provide us one fat bundle, to
>> avoid having users to install N bundles, it would just be one additional.
>>
>> Regards
>> Carsten
>>
>> Am 19.10.2018 um 09:35 schrieb Carsten Ziegeler:
>> > Hi Eric,
>> >
>> > I would like to come back to this discussion; I somehow forgot to
>> follow
>> > up on the old thread.
>> > If we go with a thin Apache Felix Jetty bundle, then you need to
>> install
>> > a lot of other bundles even if you don't use http2. So updating from a
>> > current version to this new version is not nice.
>> >
>> > How about we still include the jetty bundles inside, fix the service
>> > loader configuration by including it - but do not include the other
>> > things needed for http2 support. So if you're not using http2, it works
>> > like today.
>> > If you use http2 you install additionally spifly and what else is
>> > required to make it work.
>> >
>> > Would that work?
>> >
>> > Regards
>> > Carsten
>> >
>> > Am 18.10.2018 um 19:59 schrieb Eric Norman:
>> >> Yes, with a few changes to the felix.http code it is possible to make
>> it
>> >> work.
>> >>
>> >> I stashed the code changes in my github fork at
>> >> https://github.com/enapps-enorman/felix which I think you have already
>> >> discovered?
>> >>
>> >> I would be willing to initiate a PR from the fork, but unfortunately
>> the
>> >> http/2 support doesn't work without changing how the felix.http bundle
>> is
>> >> packaged as discussed on the felix mailing list at:
>> >> https://www.mail-archive.com/users@felix.apache.org/msg18187.html
>> >>
>> >> The felix community seemed reluctant to make the packaging changes to
>> the
>> >> felix.http bundle so I didn't send the PR at the time.
>> >>
>> >>
>> >> Regards,
>> >>
>> >> Eric
>> >>
>> >> On Thu, Oct 18, 2018 at 10:04 AM Naftali  wrote:
>> >>
>> >>> Hi, is there any way to enable enable HTTP/2 support in the embedded
>> >>> felix
>> >>> jetty?
>> >>>
>> >>> Greetz Naftali
>> >>>
>> >>
>> >
>>
>> --
>> Carsten Ziegeler
>> Adobe Research Switzerland
>> cziege...@apache.org
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
>> For additional commands, e-mail: users-h...@felix.apache.org
>>
>>
>
> --
> *Raymond Augé* <http://www.liferay.com/web/raymond.auge/profile>
>  (@rotty3000)
> Senior Software Architect *Liferay, Inc.* <http://www.liferay.com>
>  (@Liferay)
> Board Member & EEG Co-Chair, OSGi Alliance <http://osgi.org>
> (@OSGiAlliance)
>


-- 
*Raymond Augé* <http://www.liferay.com/web/raymond.auge/profile>
 (@rotty3000)
Senior Software Architect *Liferay, Inc.* <http://www.liferay.com>
 (@Liferay)
Board Member & EEG Co-Chair, OSGi Alliance <http://osgi.org> (@OSGiAlliance)


Re: how to enable http2 in jetty

2018-10-19 Thread Raymond Auge
Why not start relying on the Jetty BOM and let people depend on the bundles
what they want, at least this way they can let the resolver assemble the
bundles they need?

- Ray

On Fri, Oct 19, 2018 at 3:39 AM Carsten Ziegeler 
wrote:

> The other option would be if jetty could provide us one fat bundle, to
> avoid having users to install N bundles, it would just be one additional.
>
> Regards
> Carsten
>
> Am 19.10.2018 um 09:35 schrieb Carsten Ziegeler:
> > Hi Eric,
> >
> > I would like to come back to this discussion; I somehow forgot to follow
> > up on the old thread.
> > If we go with a thin Apache Felix Jetty bundle, then you need to install
> > a lot of other bundles even if you don't use http2. So updating from a
> > current version to this new version is not nice.
> >
> > How about we still include the jetty bundles inside, fix the service
> > loader configuration by including it - but do not include the other
> > things needed for http2 support. So if you're not using http2, it works
> > like today.
> > If you use http2 you install additionally spifly and what else is
> > required to make it work.
> >
> > Would that work?
> >
> > Regards
> > Carsten
> >
> > Am 18.10.2018 um 19:59 schrieb Eric Norman:
> >> Yes, with a few changes to the felix.http code it is possible to make it
> >> work.
> >>
> >> I stashed the code changes in my github fork at
> >> https://github.com/enapps-enorman/felix which I think you have already
> >> discovered?
> >>
> >> I would be willing to initiate a PR from the fork, but unfortunately the
> >> http/2 support doesn't work without changing how the felix.http bundle
> is
> >> packaged as discussed on the felix mailing list at:
> >> https://www.mail-archive.com/users@felix.apache.org/msg18187.html
> >>
> >> The felix community seemed reluctant to make the packaging changes to
> the
> >> felix.http bundle so I didn't send the PR at the time.
> >>
> >>
> >> Regards,
> >>
> >> Eric
> >>
> >> On Thu, Oct 18, 2018 at 10:04 AM Naftali  wrote:
> >>
> >>> Hi, is there any way to enable enable HTTP/2 support in the embedded
> >>> felix
> >>> jetty?
> >>>
> >>> Greetz Naftali
> >>>
> >>
> >
>
> --
> Carsten Ziegeler
> Adobe Research Switzerland
> cziege...@apache.org
>
> -
> To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
> For additional commands, e-mail: users-h...@felix.apache.org
>
>

-- 
*Raymond Augé* 
 (@rotty3000)
Senior Software Architect *Liferay, Inc.* 
 (@Liferay)
Board Member & EEG Co-Chair, OSGi Alliance  (@OSGiAlliance)


Re: ***UNCHECKED*** Re: Connect remote JMX

2018-09-19 Thread Raymond Auge
The bottom line is that there are no use cases for which OSGi is a bad
decision as far as we're all concerned :)

The assembly model also part of your choice. It matters really more what
you like best, what gives you the best mileage for your usage.

- Ray

On Wed, Sep 19, 2018 at 10:39 AM Philipp Höfler <
philipp.hoef...@pernexas.com> wrote:

> Hallo Ray,
>
> thank you very much.
> I already found the Aries JMX dependency, but I was exactly missing the
> MBeanService.
> That's why it didn't worked for me.
>
> Thanks, now I can connect with VisualVM __
> I can now proceed with testing ...
>
> It's off topic, but I have to ask one last question:
> Would you recommend using "classic" OSGi with a container for an
> application like mine?
> It is connecting two systems with different APIs. It will always run on a
> server.
> Honestly, when starting the application I was not aware that enRoute was
> built to make standalone apps. Now, as I am getting a better understand
> (probably still not too good understanding) I am questioning this decision.
>
> Philipp
>
>
> Am 19.09.18, 16:21 schrieb "Raymond Auge" :
>
> I added gogo for good measure to help diagnosing issues.
>
> Aries JMX has this weird requirement that someone has to provide the
> MBeanService service, which I did for you.
>
> - Ray
>
> On Wed, Sep 19, 2018 at 10:19 AM Raymond Auge <
> raymond.a...@liferay.com>
> wrote:
>
> > I just sent a PR to your osgi-test repo adding JMX.
> >
> > Also, enRoute was most certainly not limited to desktop apps.
> >
> > In fact there are several consumers using it specifically for
> > "microservices" story.
> >
> > - Ray
> >
> > On Wed, Sep 19, 2018 at 10:12 AM Jean-Baptiste Onofré <
> j...@nanthrax.net>
> > wrote:
> >
> >> Hi,
> >>
> >> I think you can achieve this with enRoute (even if I would not do
> that
> >> way personnally).
> >>
> >> As it seems you want to do kind of integration, I would evaluate
> using
> >> Apache Camel routes running Karaf.
> >> Camel is an integration framework that allow you to easily integrate
> >> system all together.
> >>
> >> Let me know if you need some details (you can ping me directly on my
> >> e-mail to avoid to "flood" the Felix mailing list).
> >>
> >> Regards
> >> JB
> >>
> >> On 19/09/2018 16:06, Philipp Höfler wrote:
> >> > Thanks, it is getting clearer to me.
> >> > Would you recommend using enRoute for a server application
> translating
> >> rest requests to CMIS?
> >> > Now with these information, it feels like enRoute was built for
> desktop
> >> standalone apps not for server applications?
> >> >
> >> > Best,
> >> > Philipp
> >> >
> >> >
> >> > Am 19.09.18, 15:44 schrieb "Jean-Baptiste Onofré" <
> j...@nanthrax.net>:
> >> >
> >> >  Hi Philip,
> >> >
> >> >  For Karaf, you probably have to install the dependency
> bundles
> >> first.
> >> >
> >> >  Using enRoute, it creates an "uber" jar embedding all jar
> files
> >> required
> >> >  for execution. You don't need a container: it's a regular
> >> standalone jar
> >> >  application that you run with java -jar.
> >> >
> >> >  Karaf uses a modular approach where your bundles are very
> light,
> >> and you
> >> >  install dependency bundles in Karaf (that other bundles can
> use).
> >> That's
> >> >  why we have Karaf Features to install all in a row.
> >> >
> >> >  So, if you are interested by Karaf, I can help you to create
> a
> >> Karaf
> >> >  feature for your application or at least provide the
> commands you
> >> should
> >> >  do to install the dependency bundles.
> >> >
> >> >  Regards
> >> >  JB
> >> >
> >> >  On 19/09/2018 15:38, Philipp Höfler wrote:
> >> >  > Hallo Ray, hallo JB,
> >> >  >
> >> >  > thanks for yo

Re: ***UNCHECKED*** Re: Connect remote JMX

2018-09-19 Thread Raymond Auge
... as for how to enable remote JMX... then those are standard JVM system
properties that you pass to the java command that runs your executable jar.

But JMX worked for me both before (with a local connection) and after I
added OSGi specific support for JMX with Aries JMX.

- Ray



On Wed, Sep 19, 2018 at 10:21 AM Raymond Auge 
wrote:

> I added gogo for good measure to help diagnosing issues.
>
> Aries JMX has this weird requirement that someone has to provide the
> MBeanService service, which I did for you.
>
> - Ray
>
> On Wed, Sep 19, 2018 at 10:19 AM Raymond Auge 
> wrote:
>
>> I just sent a PR to your osgi-test repo adding JMX.
>>
>> Also, enRoute was most certainly not limited to desktop apps.
>>
>> In fact there are several consumers using it specifically for
>> "microservices" story.
>>
>> - Ray
>>
>> On Wed, Sep 19, 2018 at 10:12 AM Jean-Baptiste Onofré 
>> wrote:
>>
>>> Hi,
>>>
>>> I think you can achieve this with enRoute (even if I would not do that
>>> way personnally).
>>>
>>> As it seems you want to do kind of integration, I would evaluate using
>>> Apache Camel routes running Karaf.
>>> Camel is an integration framework that allow you to easily integrate
>>> system all together.
>>>
>>> Let me know if you need some details (you can ping me directly on my
>>> e-mail to avoid to "flood" the Felix mailing list).
>>>
>>> Regards
>>> JB
>>>
>>> On 19/09/2018 16:06, Philipp Höfler wrote:
>>> > Thanks, it is getting clearer to me.
>>> > Would you recommend using enRoute for a server application translating
>>> rest requests to CMIS?
>>> > Now with these information, it feels like enRoute was built for
>>> desktop standalone apps not for server applications?
>>> >
>>> > Best,
>>> > Philipp
>>> >
>>> >
>>> > Am 19.09.18, 15:44 schrieb "Jean-Baptiste Onofré" :
>>> >
>>> >  Hi Philip,
>>> >
>>> >  For Karaf, you probably have to install the dependency bundles
>>> first.
>>> >
>>> >  Using enRoute, it creates an "uber" jar embedding all jar files
>>> required
>>> >  for execution. You don't need a container: it's a regular
>>> standalone jar
>>> >  application that you run with java -jar.
>>> >
>>> >  Karaf uses a modular approach where your bundles are very light,
>>> and you
>>> >  install dependency bundles in Karaf (that other bundles can use).
>>> That's
>>> >  why we have Karaf Features to install all in a row.
>>> >
>>> >  So, if you are interested by Karaf, I can help you to create a
>>> Karaf
>>> >  feature for your application or at least provide the commands you
>>> should
>>> >  do to install the dependency bundles.
>>> >
>>> >  Regards
>>> >  JB
>>> >
>>> >  On 19/09/2018 15:38, Philipp Höfler wrote:
>>> >  > Hallo Ray, hallo JB,
>>> >  >
>>> >  > thanks for your reply :-).
>>> >  >
>>> >  > Maybe I have not clearly described the problem. I think you
>>> might have misunderstood it.
>>> >  > When compiling the application, the runable app.jar will be
>>> generated. This is working fine. All dependencies are in place and I can
>>> start it.
>>> >  >
>>> >  > Unfortunately, I am facing performance issues. Probably, these
>>> are related to the CMIS connection, but I would like to find the bottle
>>> necks by monitoring the app.
>>> >  > My first approach was, to connect VisualVM to the packaged app.
>>> But - at least for me - it was not possible.
>>> >  >
>>> >  > Then, I followed JB's suggestion to use Karaf. But I've
>>> problems to deploy the app to Karaf as I see missing dependencies.
>>> >  >
>>> >  > I think I do not get the big picture here.
>>> >  > Based on JB's latest reply, I assume that with enRoute I do not
>>> have to use any container like Karaf?
>>> >  > enRoute is for building standalone apps?
>>> >  > When using the "classic" OSGi it would be necessary to use an
>>> container, right?
>>&

Re: ***UNCHECKED*** Re: Connect remote JMX

2018-09-19 Thread Raymond Auge
I added gogo for good measure to help diagnosing issues.

Aries JMX has this weird requirement that someone has to provide the
MBeanService service, which I did for you.

- Ray

On Wed, Sep 19, 2018 at 10:19 AM Raymond Auge 
wrote:

> I just sent a PR to your osgi-test repo adding JMX.
>
> Also, enRoute was most certainly not limited to desktop apps.
>
> In fact there are several consumers using it specifically for
> "microservices" story.
>
> - Ray
>
> On Wed, Sep 19, 2018 at 10:12 AM Jean-Baptiste Onofré 
> wrote:
>
>> Hi,
>>
>> I think you can achieve this with enRoute (even if I would not do that
>> way personnally).
>>
>> As it seems you want to do kind of integration, I would evaluate using
>> Apache Camel routes running Karaf.
>> Camel is an integration framework that allow you to easily integrate
>> system all together.
>>
>> Let me know if you need some details (you can ping me directly on my
>> e-mail to avoid to "flood" the Felix mailing list).
>>
>> Regards
>> JB
>>
>> On 19/09/2018 16:06, Philipp Höfler wrote:
>> > Thanks, it is getting clearer to me.
>> > Would you recommend using enRoute for a server application translating
>> rest requests to CMIS?
>> > Now with these information, it feels like enRoute was built for desktop
>> standalone apps not for server applications?
>> >
>> > Best,
>> > Philipp
>> >
>> >
>> > Am 19.09.18, 15:44 schrieb "Jean-Baptiste Onofré" :
>> >
>> >  Hi Philip,
>> >
>> >  For Karaf, you probably have to install the dependency bundles
>> first.
>> >
>> >  Using enRoute, it creates an "uber" jar embedding all jar files
>> required
>> >  for execution. You don't need a container: it's a regular
>> standalone jar
>> >  application that you run with java -jar.
>> >
>> >  Karaf uses a modular approach where your bundles are very light,
>> and you
>> >  install dependency bundles in Karaf (that other bundles can use).
>> That's
>> >  why we have Karaf Features to install all in a row.
>> >
>> >  So, if you are interested by Karaf, I can help you to create a
>> Karaf
>> >  feature for your application or at least provide the commands you
>> should
>> >  do to install the dependency bundles.
>> >
>> >  Regards
>> >  JB
>> >
>> >  On 19/09/2018 15:38, Philipp Höfler wrote:
>> >  > Hallo Ray, hallo JB,
>> >  >
>> >  > thanks for your reply :-).
>> >  >
>> >  > Maybe I have not clearly described the problem. I think you
>> might have misunderstood it.
>> >  > When compiling the application, the runable app.jar will be
>> generated. This is working fine. All dependencies are in place and I can
>> start it.
>> >  >
>> >  > Unfortunately, I am facing performance issues. Probably, these
>> are related to the CMIS connection, but I would like to find the bottle
>> necks by monitoring the app.
>> >  > My first approach was, to connect VisualVM to the packaged app.
>> But - at least for me - it was not possible.
>> >  >
>> >  > Then, I followed JB's suggestion to use Karaf. But I've problems
>> to deploy the app to Karaf as I see missing dependencies.
>> >  >
>> >  > I think I do not get the big picture here.
>> >  > Based on JB's latest reply, I assume that with enRoute I do not
>> have to use any container like Karaf?
>> >  > enRoute is for building standalone apps?
>> >  > When using the "classic" OSGi it would be necessary to use an
>> container, right?
>> >  >
>> >  > Is the runnable jar the way of deploying enRoute apps?
>> >  > My understand was, that this is used for testing and it should
>> be deployed to an application server / container like Karaf.
>> >  >
>> >  > Best,
>> >  > Philipp
>> >  >
>> >  > Am 19.09.18, 15:31 schrieb "Jean-Baptiste Onofré" <
>> j...@nanthrax.net>:
>> >  >
>> >  >  Hi,
>> >  >
>> >  >  Using enRoute, I guess you want to have an executable jar.
>> In that case,
>> >  >  you don't need Karaf.
>> >  >
&g

Re: ***UNCHECKED*** Re: Connect remote JMX

2018-09-19 Thread Raymond Auge
I just sent a PR to your osgi-test repo adding JMX.

Also, enRoute was most certainly not limited to desktop apps.

In fact there are several consumers using it specifically for
"microservices" story.

- Ray

On Wed, Sep 19, 2018 at 10:12 AM Jean-Baptiste Onofré 
wrote:

> Hi,
>
> I think you can achieve this with enRoute (even if I would not do that
> way personnally).
>
> As it seems you want to do kind of integration, I would evaluate using
> Apache Camel routes running Karaf.
> Camel is an integration framework that allow you to easily integrate
> system all together.
>
> Let me know if you need some details (you can ping me directly on my
> e-mail to avoid to "flood" the Felix mailing list).
>
> Regards
> JB
>
> On 19/09/2018 16:06, Philipp Höfler wrote:
> > Thanks, it is getting clearer to me.
> > Would you recommend using enRoute for a server application translating
> rest requests to CMIS?
> > Now with these information, it feels like enRoute was built for desktop
> standalone apps not for server applications?
> >
> > Best,
> > Philipp
> >
> >
> > Am 19.09.18, 15:44 schrieb "Jean-Baptiste Onofré" :
> >
> >  Hi Philip,
> >
> >  For Karaf, you probably have to install the dependency bundles
> first.
> >
> >  Using enRoute, it creates an "uber" jar embedding all jar files
> required
> >  for execution. You don't need a container: it's a regular
> standalone jar
> >  application that you run with java -jar.
> >
> >  Karaf uses a modular approach where your bundles are very light,
> and you
> >  install dependency bundles in Karaf (that other bundles can use).
> That's
> >  why we have Karaf Features to install all in a row.
> >
> >  So, if you are interested by Karaf, I can help you to create a Karaf
> >  feature for your application or at least provide the commands you
> should
> >  do to install the dependency bundles.
> >
> >  Regards
> >  JB
> >
> >  On 19/09/2018 15:38, Philipp Höfler wrote:
> >  > Hallo Ray, hallo JB,
> >  >
> >  > thanks for your reply :-).
> >  >
> >  > Maybe I have not clearly described the problem. I think you might
> have misunderstood it.
> >  > When compiling the application, the runable app.jar will be
> generated. This is working fine. All dependencies are in place and I can
> start it.
> >  >
> >  > Unfortunately, I am facing performance issues. Probably, these
> are related to the CMIS connection, but I would like to find the bottle
> necks by monitoring the app.
> >  > My first approach was, to connect VisualVM to the packaged app.
> But - at least for me - it was not possible.
> >  >
> >  > Then, I followed JB's suggestion to use Karaf. But I've problems
> to deploy the app to Karaf as I see missing dependencies.
> >  >
> >  > I think I do not get the big picture here.
> >  > Based on JB's latest reply, I assume that with enRoute I do not
> have to use any container like Karaf?
> >  > enRoute is for building standalone apps?
> >  > When using the "classic" OSGi it would be necessary to use an
> container, right?
> >  >
> >  > Is the runnable jar the way of deploying enRoute apps?
> >  > My understand was, that this is used for testing and it should be
> deployed to an application server / container like Karaf.
> >  >
> >  > Best,
> >  > Philipp
> >  >
> >  > Am 19.09.18, 15:31 schrieb "Jean-Baptiste Onofré" <
> j...@nanthrax.net>:
> >  >
> >  >  Hi,
> >  >
> >  >  Using enRoute, I guess you want to have an executable jar.
> In that case,
> >  >  you don't need Karaf.
> >  >
> >  >  As an alternative, you can package your application as
> "pure" OSGi
> >  >  bundles (and eventually release), and deploy on Karaf or
> package with Karaf.
> >  >
> >  >  Packaging with Karaf will give you an execute archive.
> >  >
> >  >  Regarding log, you are right, Karaf provides a log service
> abstracting
> >  >  lot of different frameworks. The only thing you have to do
> is to import
> >  >  the package of the logging framework you are using (logback,
> slf4j,
> >  >  whatever).
> >  >
> >  >  Regards
> >  >  JB
> >  >
> >  >  On 19/09/2018 15:15, Philipp Höfler wrote:
> >  >  > Hallo JB,
> >  >  >
> >  >  > thanks for your kind reply.
> >  >  >
> >  >  > I am getting confused :-)
> >  >  > I am quite new to the OSGi world, so my questions are
> probably very basic.
> >  >  >
> >  >  > I am not sure, if I can use Karaf just like that, as I am
> using OSGi enRoute R7.
> >  >  > As far as I understood, it's not finally released yet? So
> I guess, that Karaf does it not support yet?
> >  >  >
> >  >  > Anyhow, I tried to deploy my app on Karaf. And there are a
> lot of missing dependencies.
> >  >  > How is 

***UNCHECKED*** Re: Re: Connect remote JMX

2018-09-19 Thread Raymond Auge
All I had to do in your project was:

java -jar my-app/target/my-app.jar

And it just worked.
- Ray

On Wed, Sep 19, 2018 at 9:26 AM Raymond Auge 
wrote:

> So Philipp,
>
> When I sent you a PR, your app was already resolved. Why do you not have
> the framework packages?
> All you need to do is export the runnable jar, and everything should be
> there,.. then you can run that either locally or in a Docker image that
> provides Java.
>
> You've already done all the work!
>
> :)
>
> - Ray
>
> On Wed, Sep 19, 2018 at 9:16 AM Philipp Höfler <
> philipp.hoef...@pernexas.com> wrote:
>
>> Hallo JB,
>>
>> thanks for your kind reply.
>>
>> I am getting confused :-)
>> I am quite new to the OSGi world, so my questions are probably very basic.
>>
>> I am not sure, if I can use Karaf just like that, as I am using OSGi
>> enRoute R7.
>> As far as I understood, it's not finally released yet? So I guess, that
>> Karaf does it not support yet?
>>
>> Anyhow, I tried to deploy my app on Karaf. And there are a lot of missing
>> dependencies.
>> How is the best way of deploying a OSGi app? I've three bundles and each
>> have different dependencies.
>> The packaged app jar, that is generated from the enRoute example project,
>> packs all these dependencies in a jar folder of the app.jar
>> What I do not understand is, why dependencies like "org.osgi.framework"
>> or "org.osgi.service.log" is missing. I though, that would be provided by
>> Karaf?
>>
>> I recently added logging via the new OSGi Logging standard and logback. I
>> read on the Karaf website, that Karaf can already unify the logging
>> configuration.
>> As I understood, logback is also trying to unify the configuration over
>> all popular logging frameworks. Does it just work or do I have to adapt
>> anything?
>>
>> Thanks for your help,
>> Philipp
>>
>> Am 19.09.18, 14:17 schrieb "Jean-Baptiste Onofré" :
>>
>> Hi Philip,
>>
>> You can use Karaf as a container. It supports different programming
>> model including OSGi of course.
>>
>> Karaf supports Aries JMX and MBean whiteboard pattern to simplify the
>> way of exposing your MBeans (it's just registering a MBean service).
>>
>> Once done, you can use Karaf Decanter to collect the metrics and have
>> monitoring/BAM/alerting.
>>
>> Don't hesitate to ping me if you need more details.
>>
>> Regards
>> JB
>>
>> On 19/09/2018 12:34, Philipp Höfler wrote:
>> > Hi,
>> >
>> > I've setup a small OSGi application.
>> > The application gets some REST requests and forwards these requests
>> to a content repository using CMIS.
>> > So, basically the app consists of three bundles. The first bundle
>> provides and RESTful webservice (HTTP Whiteboard), the second the CMIS
>> connection to the repository and the third is the internal API between the
>> other two bundles.
>> >
>> > Now, I am encountering performances problems. Storing documents to
>> the repository, is quite slower than it should be.
>> > I thought it would be a good idea, to monitor the application to
>> identify the bottle necks.
>> > That's why I would like to connect VisualVM (or JConsole) via JMX.
>> >
>> > Right now the application is not finished yet, so the deployment
>> does not exists.
>> > I am currently using the bundled app from the enRoute R7 example
>> project for testing.
>> >
>> > Is it a realistic to use the bundled app for tests or is an
>> application server like Karaf faster?
>> > Is it possible to connect to the JMX of the bundled app? Would you
>> recommend using Karaf (application server)?
>> >
>> > When you do recommend Karaf, how can I deploy my app to the
>> application server?
>> > Do I have to install every single bundle?
>> >
>> > As always, thanks for your help.
>> > Philipp
>> >
>> >
>> >
>> -
>> > To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
>> > For additional commands, e-mail: users-h...@felix.apache.org
>> >
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
>> For additiona

Re: ***UNCHECKED*** Re: Connect remote JMX

2018-09-19 Thread Raymond Auge
including logging...

On Wed, Sep 19, 2018 at 9:31 AM Raymond Auge 
wrote:

> All I had to do in your project was:
>
> java -jar my-app/target/my-app.jar
>
> And it just worked.
> - Ray
>
> On Wed, Sep 19, 2018 at 9:26 AM Raymond Auge 
> wrote:
>
>> So Philipp,
>>
>> When I sent you a PR, your app was already resolved. Why do you not have
>> the framework packages?
>> All you need to do is export the runnable jar, and everything should be
>> there,.. then you can run that either locally or in a Docker image that
>> provides Java.
>>
>> You've already done all the work!
>>
>> :)
>>
>> - Ray
>>
>> On Wed, Sep 19, 2018 at 9:16 AM Philipp Höfler <
>> philipp.hoef...@pernexas.com> wrote:
>>
>>> Hallo JB,
>>>
>>> thanks for your kind reply.
>>>
>>> I am getting confused :-)
>>> I am quite new to the OSGi world, so my questions are probably very
>>> basic.
>>>
>>> I am not sure, if I can use Karaf just like that, as I am using OSGi
>>> enRoute R7.
>>> As far as I understood, it's not finally released yet? So I guess, that
>>> Karaf does it not support yet?
>>>
>>> Anyhow, I tried to deploy my app on Karaf. And there are a lot of
>>> missing dependencies.
>>> How is the best way of deploying a OSGi app? I've three bundles and each
>>> have different dependencies.
>>> The packaged app jar, that is generated from the enRoute example
>>> project, packs all these dependencies in a jar folder of the app.jar
>>> What I do not understand is, why dependencies like "org.osgi.framework"
>>> or "org.osgi.service.log" is missing. I though, that would be provided by
>>> Karaf?
>>>
>>> I recently added logging via the new OSGi Logging standard and logback.
>>> I read on the Karaf website, that Karaf can already unify the logging
>>> configuration.
>>> As I understood, logback is also trying to unify the configuration over
>>> all popular logging frameworks. Does it just work or do I have to adapt
>>> anything?
>>>
>>> Thanks for your help,
>>> Philipp
>>>
>>> Am 19.09.18, 14:17 schrieb "Jean-Baptiste Onofré" :
>>>
>>> Hi Philip,
>>>
>>> You can use Karaf as a container. It supports different programming
>>> model including OSGi of course.
>>>
>>> Karaf supports Aries JMX and MBean whiteboard pattern to simplify
>>> the
>>> way of exposing your MBeans (it's just registering a MBean service).
>>>
>>> Once done, you can use Karaf Decanter to collect the metrics and
>>> have
>>> monitoring/BAM/alerting.
>>>
>>> Don't hesitate to ping me if you need more details.
>>>
>>> Regards
>>> JB
>>>
>>> On 19/09/2018 12:34, Philipp Höfler wrote:
>>> > Hi,
>>> >
>>> > I've setup a small OSGi application.
>>> > The application gets some REST requests and forwards these
>>> requests to a content repository using CMIS.
>>> > So, basically the app consists of three bundles. The first bundle
>>> provides and RESTful webservice (HTTP Whiteboard), the second the CMIS
>>> connection to the repository and the third is the internal API between the
>>> other two bundles.
>>> >
>>> > Now, I am encountering performances problems. Storing documents to
>>> the repository, is quite slower than it should be.
>>> > I thought it would be a good idea, to monitor the application to
>>> identify the bottle necks.
>>> > That's why I would like to connect VisualVM (or JConsole) via JMX.
>>> >
>>> > Right now the application is not finished yet, so the deployment
>>> does not exists.
>>> > I am currently using the bundled app from the enRoute R7 example
>>> project for testing.
>>> >
>>> > Is it a realistic to use the bundled app for tests or is an
>>> application server like Karaf faster?
>>> > Is it possible to connect to the JMX of the bundled app? Would you
>>> recommend using Karaf (application server)?
>>> >
>>> > When you do recommend Karaf, how can I deploy my app to the
>>> application server?
>>> > Do I have to install every single bundle?
>>> >
>>> &

Re: ***UNCHECKED*** Re: Connect remote JMX

2018-09-19 Thread Raymond Auge
So Philipp,

When I sent you a PR, your app was already resolved. Why do you not have
the framework packages?
All you need to do is export the runnable jar, and everything should be
there,.. then you can run that either locally or in a Docker image that
provides Java.

You've already done all the work!

:)

- Ray

On Wed, Sep 19, 2018 at 9:16 AM Philipp Höfler 
wrote:

> Hallo JB,
>
> thanks for your kind reply.
>
> I am getting confused :-)
> I am quite new to the OSGi world, so my questions are probably very basic.
>
> I am not sure, if I can use Karaf just like that, as I am using OSGi
> enRoute R7.
> As far as I understood, it's not finally released yet? So I guess, that
> Karaf does it not support yet?
>
> Anyhow, I tried to deploy my app on Karaf. And there are a lot of missing
> dependencies.
> How is the best way of deploying a OSGi app? I've three bundles and each
> have different dependencies.
> The packaged app jar, that is generated from the enRoute example project,
> packs all these dependencies in a jar folder of the app.jar
> What I do not understand is, why dependencies like "org.osgi.framework" or
> "org.osgi.service.log" is missing. I though, that would be provided by
> Karaf?
>
> I recently added logging via the new OSGi Logging standard and logback. I
> read on the Karaf website, that Karaf can already unify the logging
> configuration.
> As I understood, logback is also trying to unify the configuration over
> all popular logging frameworks. Does it just work or do I have to adapt
> anything?
>
> Thanks for your help,
> Philipp
>
> Am 19.09.18, 14:17 schrieb "Jean-Baptiste Onofré" :
>
> Hi Philip,
>
> You can use Karaf as a container. It supports different programming
> model including OSGi of course.
>
> Karaf supports Aries JMX and MBean whiteboard pattern to simplify the
> way of exposing your MBeans (it's just registering a MBean service).
>
> Once done, you can use Karaf Decanter to collect the metrics and have
> monitoring/BAM/alerting.
>
> Don't hesitate to ping me if you need more details.
>
> Regards
> JB
>
> On 19/09/2018 12:34, Philipp Höfler wrote:
> > Hi,
> >
> > I've setup a small OSGi application.
> > The application gets some REST requests and forwards these requests
> to a content repository using CMIS.
> > So, basically the app consists of three bundles. The first bundle
> provides and RESTful webservice (HTTP Whiteboard), the second the CMIS
> connection to the repository and the third is the internal API between the
> other two bundles.
> >
> > Now, I am encountering performances problems. Storing documents to
> the repository, is quite slower than it should be.
> > I thought it would be a good idea, to monitor the application to
> identify the bottle necks.
> > That's why I would like to connect VisualVM (or JConsole) via JMX.
> >
> > Right now the application is not finished yet, so the deployment
> does not exists.
> > I am currently using the bundled app from the enRoute R7 example
> project for testing.
> >
> > Is it a realistic to use the bundled app for tests or is an
> application server like Karaf faster?
> > Is it possible to connect to the JMX of the bundled app? Would you
> recommend using Karaf (application server)?
> >
> > When you do recommend Karaf, how can I deploy my app to the
> application server?
> > Do I have to install every single bundle?
> >
> > As always, thanks for your help.
> > Philipp
> >
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
> > For additional commands, e-mail: users-h...@felix.apache.org
> >
>
> -
> To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
> For additional commands, e-mail: users-h...@felix.apache.org
>
>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
> For additional commands, e-mail: users-h...@felix.apache.org
>


-- 
*Raymond Augé* 
 (@rotty3000)
Senior Software Architect *Liferay, Inc.* 
 (@Liferay)
Board Member & EEG Co-Chair, OSGi Alliance  (@OSGiAlliance)


Re: How to configure LogService

2018-09-18 Thread Raymond Auge
I sent a PR [1] which fixes things.

HTH,
- Ray
[1] https://github.com/phhoef/osgi-test/pull/3

On Tue, Sep 18, 2018 at 6:27 AM Philipp Höfler 
wrote:

> Sorry, again no attachment.
> As Neil said, it seems that the image is removed by the mailing list.
> Could you please upload the image and send the link?
>
> Thanks,
> Philipp
>
> Von: Alain Picard 
> Antworten an: "users@felix.apache.org" 
> Datum: Dienstag, 18. September 2018 um 12:24
> An: "users@felix.apache.org" 
> Betreff: Re: How to configure LogService
>
> Let me try again
>
>
> On Tue, Sep 18, 2018 at 5:27 AM Philipp Höfler <
> philipp.hoef...@pernexas.com<mailto:philipp.hoef...@pernexas.com>> wrote:
> Hallo,
>
> @Raymond Auge<mailto:raymond.a...@liferay.com raymond.a...@liferay.com>>
> I am using the new OSGi LogService 1.4.
> I’ve extended my small sample app. https://github.com/phhoef/osgi-test
> The problem is basically the same. The log can be written by some
> packages, but my packages are not.
> When the app is running, you can fire a request against my small rest
> service:
> http://localhost:9090/serverInfo?repoName=system1
> The log is written on line 55 of the ServerInfoControllerImpl.java in the
> rest-service bundle.
>
> I am also getting confused by the names. You’re saying it’s Felix logback.
> But on the logback website Felix or Apache is never mentioned. Maybe I am
> just using the wrong dependencies?
>
> @Alain Picard<mailto:pic...@castortech.com<mailto:pic...@castortech.com>>
> Thanks for the overview. Unfortunately, the picture was removed.
> I am the only one having this problem? Would you mind uploading the
> picture and sending the link?.
>
> Thanks for your help,
> Philipp
>
> Von: Alain Picard mailto:pic...@castortech.com>>
> Antworten an: "users@felix.apache.org<mailto:users@felix.apache.org>" <
> users@felix.apache.org<mailto:users@felix.apache.org>>
> Datum: Dienstag, 18. September 2018 um 10:59
> An: "users@felix.apache.org<mailto:users@felix.apache.org>" <
> users@felix.apache.org<mailto:users@felix.apache.org>>
> Betreff: Re: How to configure LogService
>
> We first struggle to get a good picture of logging and what this Felix
> Logback was doing. So here's a picture that might help. And btw, if our
> understanding is incorrect, please correct us.
>
> [image.png]
>
> On Tue, Sep 18, 2018 at 4:54 AM Raymond Auge  <mailto:raymond.a...@liferay.com><mailto:raymond.a...@liferay.com raymond.a...@liferay.com>>> wrote:
> On Tue, Sep 18, 2018 at 4:42 AM Philipp Höfler <
> philipp.hoef...@pernexas.com<mailto:philipp.hoef...@pernexas.com> philipp.hoef...@pernexas.com<mailto:philipp.hoef...@pernexas.com>>>
> wrote:
>
> > Hallo Ray,
> >
> > thanks for your explanation.
> >
> > Based on the new information, I am trying to use Logback.
> > I actually made some progress, but still have one fundamental problem.
> >
> > I added the logback maven dependencies. I found some documentation from
> > you, saying that I also have to add sl4j as dependency.
> > Why is this necessary?
> >
>
> slf4j is just a compile dependency. It's the API "used" by logback.
>
>
> >
> > I set the configurationFile as runproperties and of course I added the
> > configuration file itself:
> > 
> >
> > 
> > 
> > myApp.log
> > true
> > true
> >
> > 
> > %-4relative [%thread] %-5level %logger{35} -
> > %msg%n
> > 
> > 
> >
> > 
> > 
> >
> > 
> > http://Events.Service.org><
> http://Events.Service.org>.eclipse.osgi" level="WARN"/>
> >
> > 
> > 
> >
> > 
> > 
> > 
> > 
> >
> > Here is where the problem starts.
> > I do not get any log entry for any of the three configured packages,
>
> especially of "com.pernexas".
> >
>
> What logging API does it use?
>
>
> > BUT, when I set the root level to DEBUG I do get log entries from several
> > bundles (e.g. jetty). Unfortunately, I do not get any log from
> com.pernexas.
> >
> > I found also your Github project "osgi-to-logback". I am not sure, if
> this
> > is still necessary now, after the release of osgi r7 and new logback?
> > Especially as the project is archived.
> >
>
> That project is no longer valid. It was the basis of the contribution to
> Apache Felix. You shoul

Re: How to configure LogService

2018-09-18 Thread Raymond Auge
On Tue, Sep 18, 2018 at 4:42 AM Philipp Höfler 
wrote:

> Hallo Ray,
>
> thanks for your explanation.
>
> Based on the new information, I am trying to use Logback.
> I actually made some progress, but still have one fundamental problem.
>
> I added the logback maven dependencies. I found some documentation from
> you, saying that I also have to add sl4j as dependency.
> Why is this necessary?
>

slf4j is just a compile dependency. It's the API "used" by logback.


>
> I set the configurationFile as runproperties and of course I added the
> configuration file itself:
> 
>
> 
> 
> myApp.log
> true
> true
>
> 
> %-4relative [%thread] %-5level %logger{35} -
> %msg%n
> 
> 
>
> 
> 
>
> 
> 
>
> 
> 
>
> 
> 
> 
> 
>
> Here is where the problem starts.
> I do not get any log entry for any of the three configured packages,

especially of "com.pernexas".
>

What logging API does it use?


> BUT, when I set the root level to DEBUG I do get log entries from several
> bundles (e.g. jetty). Unfortunately, I do not get any log from com.pernexas.
>
> I found also your Github project "osgi-to-logback". I am not sure, if this
> is still necessary now, after the release of osgi r7 and new logback?
> Especially as the project is archived.
>

That project is no longer valid. It was the basis of the contribution to
Apache Felix. You should ignore it.


>
> Is it still necessary to add a configuration for a bundle in order to
> configure the log level through config admin? I was hoping, that this is
> now done by logback?
>

When using Felix Logback, I would start by having NO configurations for
logging besides the logback.xml.

I wonder if it would be possible to share something like a git(hub) project
with me?

- Ray


>
> Thanks for your patient help.
> Philipp
>
>
> Am 17.09.18, 15:22 schrieb "Raymond Auge" :
>
> Philipp,
>
> a) you don't need logback, but the Log Service spec doesn't define
> appenders per say, so you either have to provide your own LogListener
> implementation, fetch a LogStreamProvider and process the events, or
> maybe
> the LogService implementation offers it's own appenders (my experience
> has
> been that I want everything to land in the same place.)
> b) you can use configuration admin to configure log levels as per the
> spec
> [1] which is to say that you create a configuration using the
> following PID
> scheme [2].
>
> *Note:* every bundle has it's own LoggerContext (mapped to a
> configuration
> PID as described in [2]). There is also a ROOT context which is
> effectively
> the fallback for everything (so you could use that as the singular
> configuration if you like.)
>
> Logback support is really to unify all the different logging APIs into
> a
> single backend because the stark reality is that you will encounter
> other
> logging APIs if you spend enough time with your application and the
> effort
> of handling each of those on it's own always causes pain. The goal of
> Felix
> Logback is to make that scenario less painful.
>
> Sincerely,
> - Ray
>
> [1]
> https://osgi.org/specification/osgi.cmpn/7.0.0/service.log.html#d0e2548
> [2]
>
> https://osgi.org/specification/osgi.cmpn/7.0.0/service.log.html#org.osgi.service.log.admin.LoggerContext.LOGGER_CONTEXT_PID
>
> On Mon, Sep 17, 2018 at 5:25 AM Philipp Höfler <
> philipp.hoef...@pernexas.com>
> wrote:
>
> > Hi,
> >
> > with the latest update of the Felix SCR, I am able to get an
> instance of
> > the LogService by referencing the LoggerFactory using this line of
> code:
> > @Reference(service = LoggerFactory.class)
> > private Logger _logger;
> >
> > Now, I would have expected, that I can configure the LogService
> through
> > the Web Console (Configuration Admin).
> > There is a menu LogService in the WebConsole and it says “Log
> Service is
> > running”, but there is not one single log entry available nor can I
> change
> > the log level of classes (or bundles).
> >
> > I found the documentation (
> >
> http://felix.apache.org/documentation/subprojects/apache-felix-log.html)
> > and it says that it is possible to configure the logging through the
> > Configuration Admin.
> > But it’s not clear to me, what exactly I have to do.
> > Is it necessary to use LogBack (or any ot

Re: How to configure LogService

2018-09-17 Thread Raymond Auge
Philipp,

a) you don't need logback, but the Log Service spec doesn't define
appenders per say, so you either have to provide your own LogListener
implementation, fetch a LogStreamProvider and process the events, or maybe
the LogService implementation offers it's own appenders (my experience has
been that I want everything to land in the same place.)
b) you can use configuration admin to configure log levels as per the spec
[1] which is to say that you create a configuration using the following PID
scheme [2].

*Note:* every bundle has it's own LoggerContext (mapped to a configuration
PID as described in [2]). There is also a ROOT context which is effectively
the fallback for everything (so you could use that as the singular
configuration if you like.)

Logback support is really to unify all the different logging APIs into a
single backend because the stark reality is that you will encounter other
logging APIs if you spend enough time with your application and the effort
of handling each of those on it's own always causes pain. The goal of Felix
Logback is to make that scenario less painful.

Sincerely,
- Ray

[1] https://osgi.org/specification/osgi.cmpn/7.0.0/service.log.html#d0e2548
[2]
https://osgi.org/specification/osgi.cmpn/7.0.0/service.log.html#org.osgi.service.log.admin.LoggerContext.LOGGER_CONTEXT_PID

On Mon, Sep 17, 2018 at 5:25 AM Philipp Höfler 
wrote:

> Hi,
>
> with the latest update of the Felix SCR, I am able to get an instance of
> the LogService by referencing the LoggerFactory using this line of code:
> @Reference(service = LoggerFactory.class)
> private Logger _logger;
>
> Now, I would have expected, that I can configure the LogService through
> the Web Console (Configuration Admin).
> There is a menu LogService in the WebConsole and it says “Log Service is
> running”, but there is not one single log entry available nor can I change
> the log level of classes (or bundles).
>
> I found the documentation (
> http://felix.apache.org/documentation/subprojects/apache-felix-log.html)
> and it says that it is possible to configure the logging through the
> Configuration Admin.
> But it’s not clear to me, what exactly I have to do.
> Is it necessary to use LogBack (or any other logging framework)? According
> to my current understanding, I do not have to use an additional logging
> framework. Anyhow, do you recommend utilizing one?
>
> Obviously, I am missing something important.
> Could somebody please give me an introduction on how to properly use the
> LogService. I think I make correctly use of it in the code, but I do not
> understand how to use/configure it after compilation.
>
> Thanks,
> Philipp
>
>

-- 
*Raymond Augé* 
 (@rotty3000)
Senior Software Architect *Liferay, Inc.* 
 (@Liferay)
Board Member & EEG Co-Chair, OSGi Alliance  (@OSGiAlliance)


Re: Felix Log Service version 1.2.0 cannot be referenced

2018-08-01 Thread Raymond Auge
There's a bug in Felix SCR which solves this but it is not yet released.

I won't be able to do it at least 'till next week.

Sincerely,
- Ray

On Wed, Aug 1, 2018, 04:59 Philipp Höfler, 
wrote:

> Hi,
>
> I am trying to utilize the new Felix Log Service (1.2.0) with DS.
> But no matter what I am trying, the reference is always null.
>
> I added a field with the annotation in my class.
>
> @Reference(service = org.osgi.service.log.LoggerFactory.class)
> private org.osgi.service.log.Logger _logger;
>
> In addition, I've added the following two bundles to the -runbundles
> property of my bndrun file:
>
> org.apache.felix.log;version='[1.2.0,1.2.1)',\
> org.apache.felix.log.extension;version='[1.0.0,1.0.1)',\
>
> I am not sure, if this is really necessary.
> Even if no logger implementation (logback, log4j) is available, I would
> have expected that the reference could be resolved?
>
> But also, when I add logback to the -runbundles, the logger cannot be
> resolved and is always null
>
> ch.qos.logback.classic;version='[1.2.3,1.2.4)',\
> ch.qos.logback.core;version='[1.2.3,1.2.4)',\
>
> You can inspect the whole project on GitHub:
>
> https://github.com/phhoef/osgi-test/blob/master/rest-service/src/main/java/com/my/app/rest/rest/ServerInfoControllerImpl.java
>
> Thanks
>


Re: Configurator R7 example

2018-07-17 Thread Raymond Auge
On Tue, Jul 17, 2018 at 10:18 AM, Philipp Höfler <
philipp.hoef...@pernexas.com> wrote:

> Hallo Ray,
>
> I am sorry, I do not understand your pseudo code example.
> I've modified my test project to show you my current structure.
>
> From my point of view, I would need something like a "Router" to route the
> Requests to the right instance of the controller. According to my current
> understanding, I will have several controllers for each configuration due
> to the configuration factory, right?
>
> Would you mind looking over my example and guide me through?
>
> This is the RestController:
> https://github.com/phhoef/osgi-test/blob/master/rest-
> service/src/main/java/com/my/app/rest/rest/ServerInfoControllerImpl.java


Ok, I will use the terms I see in your code.

This JAXRS resource IS the router in my mind. So,

- remove all the configuration details from ServerInfoControllerImpl.java

@Component(service=ServerInfoControllerImpl.class)
@JaxrsResource
@Path("serverInfo")
public class ServerInfoControllerImpl 

- move all these configuration details to IRepository impl:

@Component(
configurationPid = "my.config",
configurationPolicy = ConfigurationPolicy.REQUIRE
)
public class IRepositoryImpl implements IRepository ...

- make IRepository implement the security checking methods itself based on
it's config
- make ServerInfoControllerImpl.java track _all_ IRepositories:

@Reference(
policy = ReferencePolicy.DYNAMIC,
policyOption = ReferencePolicyOption.GREEDY
)
private volatile Map, IRepository>
_repositories;

 - make getServiceInfo(...) find a IRepository by filtering through the
tracked _repositories using the inputs, something like:

@GET
@Produces(MediaType.TEXT_PLAIN)
public String getServerInfo(@QueryParam(REPO_NAME) String repoName,
@QueryParam(SIGNATURE) String signature) {
try {
Filter filter = FrameworkUtil.createFilter("(repoName=" +
repoName + ")");
IRepository repo = _repositories.entrySet().stream().filter(
e -> filter.matches(e.getKey())
).map(
Map.Entry::getValue
).findFirst().orElse(null);

if (repo != null) {
if (repo.isSecurityEnabled()) {
 // do sec
 return ...
}
else {
 // no sec
 return ...
}
}
}
catch (InvalidSyntaxException e1) {
// ignore
}
return "Not Found";

That's practically the whole impl.

I hope it helps.

- Ray


>
> Thanks,
> Philipp
>
> -Ursprüngliche Nachricht-
> Von: Raymond Auge 
> Gesendet: Montag, 16. Juli 2018 16:48
> An: felix users 
> Betreff: Re: Configurator R7 example
>
> On Mon, Jul 16, 2018 at 10:42 AM, David Jencks 
> wrote:
>
> > Inline...
> >
> > Sent from my iPhone
> >
> > > On Jul 16, 2018, at 6:34 AM, Raymond Auge 
> > wrote:
> > >
> > > On Mon, Jul 16, 2018 at 6:16 AM, Philipp Höfler <
> > > philipp.hoef...@pernexas.com> wrote:
> > >
> > >> Hallo Ray,
> > >>
> > >> thanks for your detailed explanation. You're right, I think one can
> > >> consider this scenario as multi-tenant.
> > >> This sounds pretty promising.
> > >>
> > >> The following points are unclear to me:
> > >> * Even if I decouple the configuration from the endpoint, the
> > >> security check has to be done in the endpoint, as it depends on the
> > >> function
> > that is
> > >> invoked.
> > >> I've several classes / endpoints for handling different functions.
> > >> Basically, it is about the CRUD functions, but there are also some
> > >> additional ones.
> > >> Is it still possible to handle the security check based on the
> > >> configuration in the endpoint itself, but "route" the call to the
> > >> right instance of the endpoint based on the ID coming from the rest
> call?
> > >>
> > >
> > > First off let me answer your second bullet, the two interfaces I
> > > used
> > were
> > > just "mock" types based on your example. The Endpoint is whatever
> > > you endpoint object was. The Tenant was just an object I made up
> > > which should encompass the instance of your configuration with which
> > > you can make security checks.
> > >
> > >
> > >> * I was trying

Re: Configurator R7 example

2018-07-16 Thread Raymond Auge
On Mon, Jul 16, 2018 at 10:42 AM, David Jencks 
wrote:

> Inline...
>
> Sent from my iPhone
>
> > On Jul 16, 2018, at 6:34 AM, Raymond Auge 
> wrote:
> >
> > On Mon, Jul 16, 2018 at 6:16 AM, Philipp Höfler <
> > philipp.hoef...@pernexas.com> wrote:
> >
> >> Hallo Ray,
> >>
> >> thanks for your detailed explanation. You're right, I think one can
> >> consider this scenario as multi-tenant.
> >> This sounds pretty promising.
> >>
> >> The following points are unclear to me:
> >> * Even if I decouple the configuration from the endpoint, the security
> >> check has to be done in the endpoint, as it depends on the function
> that is
> >> invoked.
> >> I've several classes / endpoints for handling different functions.
> >> Basically, it is about the CRUD functions, but there are also some
> >> additional ones.
> >> Is it still possible to handle the security check based on the
> >> configuration in the endpoint itself, but "route" the call to the right
> >> instance of the endpoint based on the ID coming from the rest call?
> >>
> >
> > First off let me answer your second bullet, the two interfaces I used
> were
> > just "mock" types based on your example. The Endpoint is whatever you
> > endpoint object was. The Tenant was just an object I made up which should
> > encompass the instance of your configuration with which you can make
> > security checks.
> >
> >
> >> * I was trying to implement your suggestion, but I am facing problems.
> >> What is Endpoint and Tenant for interfaces? Are they part of the JAX-RS
> >> framework or osgi or are they custom interfaces?
> >>
> >
> > See above, they are just pseudo code of your design.
> >
> >
> >> * Can I still use endpoints with the annotations (@Path, @Get, etc)?
> >>
> >
> > Yeah! this is what Endpoint was suppose to represent, again in pseudo
> code.
> >
> >
> >> * You have a map of tenants in the endpoint A. How do you create and
> fill
> >> these tenants? Is this done automagically be the factory configuration?
> >>
> >
> > DS supports tuples of services (as in my example), and it's maintained
> for
> > you. Then you have each "Tenant" created for you by configuration admin
> > from a component that requires factory configuration, automagically ;)
> >
> Don’t you mean something like...
> Specify the “Require” configuration policy for your DS tenant component.
> Then, when a management agent creates a factory configuration for each
> tenant, DS will create a corresponding instance of the tenant component.
> ?
> Config admin isn’t going to create component instances for you. This is
> close to nitpicking, but if you aren’t familiar with who does what even a
> little imprecision can be very confusing, at least to me.
>

Of course you're right David. I was trying to describe effects rather than
exact mechanics :)
- Ray


> Thanks
> David Jencks
> > Sincerely,
> > - Ray
> >
> >
> >> Again, thanks for your help.
> >> Philipp
> >>
> >>
> >> -Ursprüngliche Nachricht-
> >> Von: Raymond Auge 
> >> Gesendet: Freitag, 13. Juli 2018 16:01
> >> An: felix users 
> >> Betreff: Re: Configurator R7 example
> >>
> >> On Fri, Jul 13, 2018 at 4:37 AM, Philipp Höfler <
> >> philipp.hoef...@pernexas.com> wrote:
> >>
> >>> I've tested the factory configuration and I am afraid that my problem
> >>> is not being solved with this approach.
> >>>
> >>> I think I might have to explain the problem in more detail, that
> >>> you'll get a better understanding.
> >>> I am implementing a REST service using the HTTP Whiteboard mechanism.
> >>> This interface is described in a quite old standard.
> >>> Each call contains an identifier. I would like to configure my service
> >>> based on this identifier.
> >>> Meaning, depending on this identifier I would like to use different
> >>> configuration.
> >>>
> >>> Example:
> >>> I am receiving a call with identifier for S1 (System 1).
> >>> {
> >>>// Resource Format Version
> >>>":configurator:resource-version" : 1,
> >>>
> >>>// First Configuration
> >>>"my.config~system1":
> >>>{
> >>> &

Re: Configurator R7 example

2018-07-16 Thread Raymond Auge
On Mon, Jul 16, 2018 at 6:16 AM, Philipp Höfler <
philipp.hoef...@pernexas.com> wrote:

> Hallo Ray,
>
> thanks for your detailed explanation. You're right, I think one can
> consider this scenario as multi-tenant.
> This sounds pretty promising.
>
> The following points are unclear to me:
> * Even if I decouple the configuration from the endpoint, the security
> check has to be done in the endpoint, as it depends on the function that is
> invoked.
> I've several classes / endpoints for handling different functions.
> Basically, it is about the CRUD functions, but there are also some
> additional ones.
> Is it still possible to handle the security check based on the
> configuration in the endpoint itself, but "route" the call to the right
> instance of the endpoint based on the ID coming from the rest call?
>

First off let me answer your second bullet, the two interfaces I used were
just "mock" types based on your example. The Endpoint is whatever you
endpoint object was. The Tenant was just an object I made up which should
encompass the instance of your configuration with which you can make
security checks.


> * I was trying to implement your suggestion, but I am facing problems.
> What is Endpoint and Tenant for interfaces? Are they part of the JAX-RS
> framework or osgi or are they custom interfaces?
>

See above, they are just pseudo code of your design.


> * Can I still use endpoints with the annotations (@Path, @Get, etc)?
>

Yeah! this is what Endpoint was suppose to represent, again in pseudo code.


> * You have a map of tenants in the endpoint A. How do you create and fill
> these tenants? Is this done automagically be the factory configuration?
>

DS supports tuples of services (as in my example), and it's maintained for
you. Then you have each "Tenant" created for you by configuration admin
from a component that requires factory configuration, automagically ;)

Sincerely,
- Ray


> Again, thanks for your help.
> Philipp
>
>
> -Ursprüngliche Nachricht-
> Von: Raymond Auge 
> Gesendet: Freitag, 13. Juli 2018 16:01
> An: felix users 
> Betreff: Re: Configurator R7 example
>
> On Fri, Jul 13, 2018 at 4:37 AM, Philipp Höfler <
> philipp.hoef...@pernexas.com> wrote:
>
> > I've tested the factory configuration and I am afraid that my problem
> > is not being solved with this approach.
> >
> > I think I might have to explain the problem in more detail, that
> > you'll get a better understanding.
> > I am implementing a REST service using the HTTP Whiteboard mechanism.
> > This interface is described in a quite old standard.
> > Each call contains an identifier. I would like to configure my service
> > based on this identifier.
> > Meaning, depending on this identifier I would like to use different
> > configuration.
> >
> > Example:
> > I am receiving a call with identifier for S1 (System 1).
> > {
> > // Resource Format Version
> > ":configurator:resource-version" : 1,
> >
> > // First Configuration
> > "my.config~system1":
> > {
> >  "test.securityEnabled": false,
> >  "test.test": false
> >  },
> >  // Second Configuration
> > "my.config~system2":
> > {
> >  "test.securityEnabled": true,
> >  "test.test": false
> >  }
> >  }
> >  }
> >
> > Then, I would like to disable the security when the call comes from
> > System 1.
> > But when the call comes from System 2 the security should be enabled.
> >
> > Maybe I am still misunderstanding the factory configuration.
> >
>
> No I think you have understood it well. However I think what you need is
> to break up the concerns a little.
>
> If if were me building your system, I would:
>
> - decouple the configuration from the rest endpoint. Let's call the
> endpoint A and the configuration Tenants (because it sounds like you are
> building a multi-tenant system):
> @Component
> class A implements Endpoint {
> @Reference(
> policy = ReferencePolicy.DYNAMIC,
> policyOption = ReferencePolicyOption.GREEDY
> )
> private volatile Map, Tenant> _tenants;
>
> String handleRequest(String tenantId) {
> try {
> Filter filter = FrameworkUtil.createFilter("(tenantId=" +
> tenantId + ")");
> return _tenants.entrySet().stream().filter(
> 

Re: Re[2]: ServletContainerInitializer

2018-07-16 Thread Raymond Auge
On Mon, Jul 16, 2018 at 4:35 AM, Thomas Driessen <
thomas.driessen...@gmail.com> wrote:

> Hi Carsten, hi Ray,
>
> thanks for your answers.
> I've proposed the whiteboard solution to the Vaadin guys.
>
> @Ray
> Could you explain your idea? Unfortunatly I can not access this bug report.
>

Yeah, sorry! The idea is to use the extension dependencies model from
JAX-RS whiteboard [1].

- Ray

[1]
https://osgi.org/specification/osgi.cmpn/7.0.0/service.jaxrs.html#d0e133663


>
> Kind regards,
> Thomas
>
> ------ Originalnachricht --
> Von: "Raymond Auge" 
> An: "felix users" 
> Cc: "Thomas Driessen" 
> Gesendet: 13.07.2018 17:31:06
> Betreff: Re: ServletContainerInitializer
>
>
>>
>> On Fri, Jul 13, 2018 at 11:17 AM, Carsten Ziegeler 
>> wrote:
>>
>>> Hi,
>>>
>>> there is no support for ServletContainerInitializer in the OSGi
>>> whiteboard specification and therefore no support in the Apache Felix
>>> implementation.
>>>
>>> Major reason of this is the dynamic nature of OSGi, bundles can come and
>>> go and when a bundle arrives the servlet context might already be
>>> initialized.
>>>
>>
>> Hey Carsten, we've got a model that can handle this scenario and I've
>> already proposed it for R8 (see Bug 3061 <https://osgi.org/members/bugz
>> illa/show_bug.cgi?id=3061>).
>>
>> The idea is identical to the handling of jaxrs whiteboard's required
>> extensions.
>>
>> Maybe in the next few months, if I have time I can prototype it.
>>
>> - Ray
>>
>>
>>> Now, the equivalent of this is actually the whiteboard which allows to
>>> dynamically register web resources.
>>>
>>> Regards
>>>
>>> Carsten
>>>
>>>
>>>
>>> Thomas Driessen wrote
>>> > Hi,
>>> >
>>> > I'm following the current development of OSGi support in Vaadin 10/11
>>> > and found this issue:
>>> >
>>> > https://github.com/vaadin/flow/issues/4376 <
>>> https://github.com/vaadin/flow/issues/4376>
>>> >
>>> > Vaadin seems to make use of a ServletContainerInitializer for its
>>> Routes
>>> > and it seems not to work with jetty and felix.
>>> >
>>> > Is there support for ServletContainerInitializers in felix.http.jetty
>>> or
>>> > the whiteboard? Or is this something that is not supported?
>>> >
>>> > Kind regards,
>>> > Thomas
>>> --
>>> Carsten Ziegeler
>>> Adobe Research Switzerland
>>> cziege...@apache.org
>>>
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@felix.apache.org >> users-unsubscr...@felix.apache.org>
>>> For additional commands, e-mail: users-h...@felix.apache.org
>>>
>>>
>>
>>
>> --
>> Raymond Augé <http://www.liferay.com/web/raymond.auge/profile>
>> (@rotty3000)
>> Senior Software Architect Liferay, Inc. <http://www.liferay.com>
>> (@Liferay)
>> Board Member & EEG Co-Chair, OSGi Alliance <http://osgi.org>
>> (@OSGiAlliance)
>
>


-- 
*Raymond Augé* <http://www.liferay.com/web/raymond.auge/profile>
 (@rotty3000)
Senior Software Architect *Liferay, Inc.* <http://www.liferay.com>
 (@Liferay)
Board Member & EEG Co-Chair, OSGi Alliance <http://osgi.org> (@OSGiAlliance)


Re: Felix Http Jetty packaging as uber bundle?

2018-07-14 Thread Raymond Auge
Let's not forget the fact that jetty is not semantically versioned, which
can cause ugly problems. The Uber jetty bundle hides this concern.

I'm not saying this couldn't be solved somehow but it can't be ignored.

And also don't get me wrong, I love jetty!

The thing is that Felix modules are cornerstone OSGi technologies and it
takes things like semantic versioning seriously and I would be opposed to
having a key part of the system suddenly become a burden by binding itself
to something that isn't semantically versioned.

Sincerely,
- Ray

On Sat, Jul 14, 2018, 04:04 Carsten Ziegeler,  wrote:

> Hi Eric,
>
> that sounds interesting. As far as I remember we started to embed Jetty
> as by that time Jetty was not available as OSGi bundles out of the box.
> The other reason is ease of use, you just need to install a single
> bundle - which is sufficient for most users - instead of a set of bundles.
>
> Would it be possible to create the uber bundle with the correct set of
> files like the service loader stuff?
>
> How about we provide two artifacts, the uber and the thin one? I really
> would like to keep the uber one as this makes using it easier and is
> easier for upgrading existing systems.
>
> Regards
>
> Carsten
>
>
> Eric Norman wrote
> > I've been doing some work to enable the HTTP/2 support in jetty for usage
> > within the Felix Http Jetty 4.x bundle for an apache sling based project.
> >
> > I'm not sure about the history of the felix.http.jetty bundle, but can I
> > ask why it was decided to make copies of the jetty classes inside the
> felix
> > bundle rather than just depending on the already existing jetty bundles
> and
> > then provisioning the jetty-* bundles to the OSGi profile to provide
> those
> > classes?
> >
> > The reason I ask is that the jetty implementation is still utilizing the
> > java.util.ServiceLoader mechanism in a few places and the packaging of
> the
> > felix.http.jetty bundle is not copying the META-INF/services/* files or
> > merging the related "osgi.serviceloader" Require-Capability and
> > Provide-Capability attributes from the manifest of the embedded jetty-*
> > bundles when it is repackaged.  This makes it so the ServiceLoader code
> is
> > unable to discover the services provided by the jetty-http and the
> > jetty-alpn-* bundles and the jetty HTTP/2 related code fails.
> >
> > In other words, using the jetty-* bundles has everything packaged and
> > declared correctly to utilize the OSGi ServiceLoader mediator patterns,
> but
> > the felix.http.jetty bundle is missing some of the critical details.
> Also,
> > by using the jetty bundles directly, the jetty and felix bundles could
> > evolve at their own pace and felix would not have to re-release a new
> > version of the felix.http.jetty bundle every time a new jetty version
> gets
> > released.
> >
> > I have proven locally that the above scenario works and have gotten the
> > jetty HTTP/2 support to work locally by refactoring to make a "thin"
> > version of the felix.http.jetty bundle that doesn't have a copy of the
> > jetty classes inside of it and then provision the following bundles to
> the
> > OSGi profile:
> >
> > # "thin" felix http jetty without the jetty classes embedded
> > org.apache.felix/org.apache.felix.http.jetty/4.0.3-SNAPSHOT
> >
> > # additional bundles to enable OSGi ServiceLoader mediator support
> > org.ow2.asm/asm-all/5.2
> > org.apache.aries/org.apache.aries.util/1.1.3
> > org.apache.aries.spifly/org.apache.aries.spifly.dynamic.bundle/1.0.12
> >
> > # Jetty bundles
> > org.eclipse.jetty/jetty-servlet/9.4.11.v20180605
> > org.eclipse.jetty/jetty-server/9.4.11.v20180605
> > org.eclipse.jetty/jetty-http/9.4.11.v20180605
> > org.eclipse.jetty/jetty-io/9.4.11.v20180605
> > org.eclipse.jetty/jetty-util/9.4.11.v20180605
> > org.eclipse.jetty/jetty-jmx/9.4.11.v20180605
> > org.eclipse.jetty/jetty-security/9.4.11.v20180605
> > org.eclipse.jetty/jetty-webapp/9.4.11.v20180605
> > org.eclipse.jetty/jetty-xml/9.4.11.v20180605
> > org.eclipse.jetty.websocket/websocket-servlet/9.4.11.v20180605
> > org.eclipse.jetty.websocket/websocket-api/9.4.11.v20180605
> > org.eclipse.jetty.websocket/websocket-server/9.4.11.v20180605
> > org.eclipse.jetty.websocket/websocket-common/9.4.11.v20180605
> > org.eclipse.jetty.websocket/websocket-client/9.4.11.v20180605
> > org.eclipse.jetty/jetty-client/9.4.11.v20180605
> > org.eclipse.jetty.http2/http2-server/9.4.11.v20180605
> > org.eclipse.jetty.http2/http2-common/9.4.11.v20180605
> > org.eclipse.jetty.http2/http2-hpack/9.4.11.v20180605
> > org.eclipse.jetty/jetty-alpn-server/9.4.11.v20180605
> >
> > # Provide ALPN support for JDK8 (doesn't work for JDK 9+).  Also requires
> > an additional alpn-boot-*.jar to be declared as a "-Xbootclasspath/p"
> > argument to java.
> > org.eclipse.jetty.osgi/jetty-osgi-alpn/9.4.11.v20180605
> > org.eclipse.jetty/jetty-alpn-openjdk8-server/9.4.11.v20180605
> >
> > # Alternatively, exclude the JDK8 bundles and provide support for 

Re: ServletContainerInitializer

2018-07-13 Thread Raymond Auge
On Fri, Jul 13, 2018 at 11:17 AM, Carsten Ziegeler 
wrote:

> Hi,
>
> there is no support for ServletContainerInitializer in the OSGi
> whiteboard specification and therefore no support in the Apache Felix
> implementation.
>
> Major reason of this is the dynamic nature of OSGi, bundles can come and
> go and when a bundle arrives the servlet context might already be
> initialized.
>

Hey Carsten, we've got a model that can handle this scenario and I've
already proposed it for R8 (see *Bug 3061*
).

The idea is identical to the handling of jaxrs whiteboard's required
extensions.

Maybe in the next few months, if I have time I can prototype it.

- Ray


>
> Now, the equivalent of this is actually the whiteboard which allows to
> dynamically register web resources.
>
> Regards
>
> Carsten
>
>
>
> Thomas Driessen wrote
> > Hi,
> >
> > I'm following the current development of OSGi support in Vaadin 10/11
> > and found this issue:
> >
> > https://github.com/vaadin/flow/issues/4376
> >
> > Vaadin seems to make use of a ServletContainerInitializer for its Routes
> > and it seems not to work with jetty and felix.
> >
> > Is there support for ServletContainerInitializers in felix.http.jetty or
> > the whiteboard? Or is this something that is not supported?
> >
> > Kind regards,
> > Thomas
> --
> Carsten Ziegeler
> Adobe Research Switzerland
> cziege...@apache.org
>
> -
> To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
> For additional commands, e-mail: users-h...@felix.apache.org
>
>


-- 
*Raymond Augé* 
 (@rotty3000)
Senior Software Architect *Liferay, Inc.* 
 (@Liferay)
Board Member & EEG Co-Chair, OSGi Alliance  (@OSGiAlliance)


[ANN] Felix Log Service version 1.2.0 & Log Service Framework Extension 1.0.0 Released

2018-07-13 Thread Raymond Auge
The Felix team is pleased to announce the release of Felix Log Service
version 1.2.0 & Log Service Framework Extension 1.0.0

The Felix Log Service implements OSGi Log Service specification at
version 1.4 (R7).
The Felix Log Service Framework Extension is a framework extension
that bootstraps the Log Service (and optionally Felix Logback) when
those are placed on the framework classpath.

 http://felix.apache.org/documentation/subprojects/apache-felix-log.html

This release is available from
http://felix.apache.org/site/downloads.cgi and Maven:

  
org.apache.felix
org.apache.felix.log
1.2.0
  

  
org.apache.felix
org.apache.felix.log.extension
1.0.0
  

Release Notes: ** Bug
* [FELIX-3581] - org.apache.felix.log.Log instates the thread without
meaningful thread name
* [FELIX-3623] - LogService lock contention under heavy load


** New Feature
* [FELIX-5880] - Add a framework extension fragment which helps load Felix
Log Service and Felix Logback when they are on the framework classpath


** Improvement
* [FELIX-5876] - Update to Log Service Specification 1.4
Enjoy! -The Felix team


Re: Configurator R7 example

2018-07-13 Thread Raymond Auge
On Fri, Jul 13, 2018 at 4:37 AM, Philipp Höfler <
philipp.hoef...@pernexas.com> wrote:

> I've tested the factory configuration and I am afraid that my problem is
> not being solved with this approach.
>
> I think I might have to explain the problem in more detail, that you'll
> get a better understanding.
> I am implementing a REST service using the HTTP Whiteboard mechanism. This
> interface is described in a quite old standard.
> Each call contains an identifier. I would like to configure my service
> based on this identifier.
> Meaning, depending on this identifier I would like to use different
> configuration.
>
> Example:
> I am receiving a call with identifier for S1 (System 1).
> {
> // Resource Format Version
> ":configurator:resource-version" : 1,
>
> // First Configuration
> "my.config~system1":
> {
>  "test.securityEnabled": false,
>  "test.test": false
>  },
>  // Second Configuration
> "my.config~system2":
> {
>  "test.securityEnabled": true,
>  "test.test": false
>  }
>  }
>  }
>
> Then, I would like to disable the security when the call comes from System
> 1.
> But when the call comes from System 2 the security should be enabled.
>
> Maybe I am still misunderstanding the factory configuration.
>

No I think you have understood it well. However I think what you need is to
break up the concerns a little.

If if were me building your system, I would:

- decouple the configuration from the rest endpoint. Let's call the
endpoint A and the configuration Tenants (because it sounds like you are
building a multi-tenant system):
@Component
class A implements Endpoint {
@Reference(
policy = ReferencePolicy.DYNAMIC,
policyOption = ReferencePolicyOption.GREEDY
)
private volatile Map, Tenant> _tenants;

String handleRequest(String tenantId) {
try {
Filter filter = FrameworkUtil.createFilter("(tenantId=" +
tenantId + ")");
return _tenants.entrySet().stream().filter(
e -> filter.matches(e.getKey())
).map(
Map.Entry::getValue
).findFirst().orElse("Not Found");
}
catch (InvalidSyntaxException e1) {
// ignore
}
return "Not Found";
}
}

- create a component managed through factory configuration as above
   @Component(
configurationPid = "my.config",
configurationPolicy = ConfigurationPolicy.REQUIRE
   )
   class TenantImpl implements Tenant {
   private TenantConfig config;
   @Activate
   void activate(TenantConfig config) {
  this.config = config;
   }
   }
 this becomes a "service" for every factory configuration instance which is
then tracked by A

Create new tenants as needed.

I hope that illustrates the model a little better.

- Ray



> But according to my current understanding, osgi will create two rest
> endpoints for each configuration, right?
> When the rest call arrives, only one instance handles it, as the URL is
> the same.
> I do not know the identifier at compile time.
>
> To summarize:
> I basically want to load/use the config, based on a parameter coming with
> the request.
> If possible at all, I do not want to limit the amount of systems.
> Could you imagine any easy solution for that problem?
>
>
> -Ursprüngliche Nachricht-
> Von: Raymond Auge 
> Gesendet: Donnerstag, 12. Juli 2018 18:23
> An: felix users 
> Betreff: Re: Configurator R7 example
>
> On Thu, Jul 12, 2018 at 11:58 AM, Philipp Höfler <
> philipp.hoef...@pernexas.com> wrote:
>
> > Right, this is missing.
> > I added the @RquireConfigurator annotation to the GoGo Command class.
> > Is that a suitable place for it?
> > The json is now being loaded. The value is set to false.
> >
> > Could you please explain, how this is working?
> >
> It's not completely clear to me, why the @interface MyConfig is
> > automatically used to hold the configuration.
> >
>
> DS is merely creating a proxy of the annotation type which fronts (or is
> backed by) the configuration dictionary, using the default values as well,
> default values if that particular property is not defined or if no
> configuration is available.
>
>
> > In each class, that needs access to the config I've a activate and
> > modified method with this signature: public void modi

Re: Configurator R7 example

2018-07-12 Thread Raymond Auge
On Thu, Jul 12, 2018 at 11:58 AM, Philipp Höfler <
philipp.hoef...@pernexas.com> wrote:

> Right, this is missing.
> I added the @RquireConfigurator annotation to the GoGo Command class. Is
> that a suitable place for it?
> The json is now being loaded. The value is set to false.
>
> Could you please explain, how this is working?
>
It's not completely clear to me, why the @interface MyConfig is
> automatically used to hold the configuration.
>

DS is merely creating a proxy of the annotation type which fronts (or is
backed by) the configuration dictionary, using the default values as well,
default values if that particular property is not defined or if no
configuration is available.


> In each class, that needs access to the config I've a activate and
> modified method with this signature: public void modified(MyConfig config)
>
> Is the type resolved based on the pid and the param type of the method?
>

The Component Property Type will be backed by whatever configuration is
associated with the component. so if you use the same Component Property
Types on two different components which refer to two different pids, the
proxies will show different values (based on the backing configuration
dictionary of the component).



>
> ---
> Back to my root problem:
> Is it now possible to have the following configuration?
> {
> // Resource Format Version
> ":configurator:resource-version" : 1,
>
> // First Configuration
>"my.config":
>{
> "system1":
> {
> "test.securityEnabled": false,
> "test.test": false
> },
> "system2":
> {
> "test.securityEnabled": false,
> "test.test": false
> }
> }
> }
>

Sure in this case the configuration dictionary will hold values:

system1 = {"test.securityEnabled": false, "test.test": false}
system2 = {"test.securityEnabled": false, "test.test": false}

which is probably not what you intended.

IF what you want is to create N instances of the component, one per set of
configuration properties, you'd want to use Factory Configurations like so:

{
> // Resource Format Version
> ":configurator:resource-version" : 1,
>
> // First Configuration
>"my.config~system1":
>{
> "test.securityEnabled": false,
> "test.test": false
> },
> // Second Configuration
>"my.config~system2":
>{
> "test.securityEnabled": true,
> "test.test": false
> }
> }
> }
>

Then you will have 2 component activations; one for each system1, system2,
each with a MyConfig instance backing a different factory configuration
instance.

HTH
- Ray


>
> Is it possible to have such a config with n systems?
> Meaning, I do not know the amount of systems at compile time.
>
> Further, how would the @interface MyConfig annotation look like?
> Is it possible to expect an array of MyConfig for the modified(MyConfig[]
> configs) method?
>
> Thanks for your help,
> Philipp
>
> -Ursprüngliche Nachricht-
> Von: Raymond Auge 
> Gesendet: Donnerstag, 12. Juli 2018 16:43
> An: felix users 
> Betreff: Re: Configurator R7 example
>
> Did you add the requirement to your configuration bundle?
>
> Require-Capability: osgi.extender; \
>  filter:="(&(osgi.extender=osgi.configurator) \
>  (version>=1.0
> <https://osgi.org/specification/osgi.cmpn/7.0.0/
> service.configurator.html#org.osgi.service.configurator>)(!(
> version>=2.0)))"
>
> That or on some bit of code in the configuration bundle add the annotation:
>
> @org.osgi.service.configurator.annotations.RequireConfigurator
>
> - Ray
>
>
> On Thu, Jul 12, 2018 at 10:23 AM, Philipp Höfler <
> philipp.hoef...@pernexas.com> wrote:
>
> > Hallo David,
> >
> > thanks for the explanation.
> > So, the configurator is just a "wrapper" for the ConfigAdminService to
> > read json and transfer it into a key value format, right?
> >
> > I still have problems to use the
> > I put a test.json file in the OSGI-INF/configurator folder of a bundle
> > with the following content:
> > {
> >   // Resource Format Version
> >   ":configurator:resource-version" : 1,
> >
> >   // First Configuration
> >   "

Re: Configurator R7 example

2018-07-12 Thread Raymond Auge
Did you add the requirement to your configuration bundle?

Require-Capability: osgi.extender; \
 filter:="(&(osgi.extender=osgi.configurator) \
 (version>=1.0
)(!(version>=2.0)))"

That or on some bit of code in the configuration bundle add the annotation:

@org.osgi.service.configurator.annotations.RequireConfigurator

- Ray


On Thu, Jul 12, 2018 at 10:23 AM, Philipp Höfler <
philipp.hoef...@pernexas.com> wrote:

> Hallo David,
>
> thanks for the explanation.
> So, the configurator is just a "wrapper" for the ConfigAdminService to
> read json and transfer it into a key value format, right?
>
> I still have problems to use the
> I put a test.json file in the OSGI-INF/configurator folder of a bundle
> with the following content:
> {
>   // Resource Format Version
>   ":configurator:resource-version" : 1,
>
>   // First Configuration
>   "my.config":
>   {
> "test.securityEnabled": false,
> "test.test": false
>   }
> }
>
> In addition, I have an annotation for holding the values:
> public @interface MyConfig
> {
> boolean test_securityEnabled () default true;
> boolean test_test() default true;
> }
>
> Besides that, I've a custom GoGo command for configuration. But I am not
> sure, if this is really needed for loading the json?
>
> Unfortunately, the json is obviously not loaded.
> Both values are set to true, according to the default value.
>
> Do I have to do something in addition to load the json file?
>
> Thanks,
> Philipp
>
> -Ursprüngliche Nachricht-
> Von: David Bosschaert 
> Gesendet: Donnerstag, 12. Juli 2018 11:15
> An: users@felix.apache.org
> Betreff: Re: Configurator R7 example
>
> Hi Philipp,
>
> In the end the configuration specified with the Configurator will end up
> in OSGi Configuration Admin, so the Configurator is limited to the same
> types as ConfigAdmin. The Configurator allows complex JSON values to be
> specified, they will end up as JSON text in Configuration Admin if they go
> beyond what ConfigAdmin supports natively.
>
> So to use the Configurator you need the Configurator bundle plus the
> ConfigAdmin bundle.
>
> The Configurator handles configuration resources in OSGI-INF/configurator
> inside bundles but can also be provided with external configuration via the
> configurator.initial framework/system property. This is described in
> sections 150.4 and 150.5 in [1]. To provide Configurator configuration into
> the system you don't need to write any classes, but depending on how you
> use the configuration you may have to add classes that consume it. But
> again, the consumption can be done by anything that understands ConfigAdmin
> configs, so there are a lot of options for this.
>
> I'm not aware of a complete tutorial on this topic yet. I agree it would
> be nice to have that.
>
> Hope this helps,
>
> David
>
> [1] https://osgi.org/specification/osgi.cmpn/7.0.0/
> service.configurator.html
>
> On Thu, 12 Jul 2018 at 10:55, Philipp Höfler  >
> wrote:
>
> > Hi,
> >
> > I am searching for a possibility to load complex configurations.
> > I tried the ConfigurationAdminService, but key value pairs are not
> > sufficient as I need complex types.
> >
> > Raymond pointed out that I should have a look at the Configurator
> > Specification.
> > https://osgi.org/specification/osgi.cmpn/7.0.0/service.configurator.ht
> > ml
> >
> > I read the specification and it sounds promising.
> > But I am stuck how to use the Configuration in my project.
> > I understand that I've to add the following dependency.
> > org.apache.felix.configurator
> >
> > But I don't understand if I've to add some classes, where the json
> > file has to be placed and if it's possible to place it outside of the
> bundle?
> >
> > Is there any tutorial or sample project out there?
> >
> > Thanks,
> > Philipp
> >
>
> -
> To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
> For additional commands, e-mail: users-h...@felix.apache.org
>



-- 
*Raymond Augé* 
 (@rotty3000)
Senior Software Architect *Liferay, Inc.* 
 (@Liferay)
Board Member & EEG Co-Chair, OSGi Alliance  (@OSGiAlliance)


Re: Configurator R7 example

2018-07-12 Thread Raymond Auge
Nino, DS has that build in with Component Property types. I'm not sure
that's quite what the OP is asking.

If I'm not mistaken I think what Philipp is asking for is the ability to
have types which go beyond the types defined in Configuration Admin (or for
Service Properties).

I think the only way to achieve that is to use an encoding scheme where by
you pass around a configuration property that holds Strings encoded as
JSON, but you have to do the work of turning that into a more complex
object perhaps using JSONP or JSONB or the Converter.

At least as David said, with Configurator it will automatically encode
complex JSON properties as Strings for you.

Just keep in mind, if the vehicle is Configuration Admin you won't have
another choice, you can't force it to work outside it's specified types.
You'll have to poor some sugar over it.

Sincerely,
- Ray

On Thu, Jul 12, 2018 at 7:53 AM, nino martinez wael <
nino.martinez.w...@gmail.com> wrote:

> Just use https://github.com/TDC-Netdesign/ManagedProperties
>
> On Thu, 12 Jul 2018, 10:55 Philipp Höfler, 
> wrote:
>
> > Hi,
> >
> > I am searching for a possibility to load complex configurations.
> > I tried the ConfigurationAdminService, but key value pairs are not
> > sufficient as I need complex types.
> >
> > Raymond pointed out that I should have a look at the Configurator
> > Specification.
> > https://osgi.org/specification/osgi.cmpn/7.0.0/service.configurator.html
> >
> > I read the specification and it sounds promising.
> > But I am stuck how to use the Configuration in my project.
> > I understand that I've to add the following dependency.
> > org.apache.felix.configurator
> >
> > But I don't understand if I've to add some classes, where the json file
> > has to be placed and if it's possible to place it outside of the bundle?
> >
> > Is there any tutorial or sample project out there?
> >
> > Thanks,
> > Philipp
> >
>



-- 
*Raymond Augé* 
 (@rotty3000)
Senior Software Architect *Liferay, Inc.* 
 (@Liferay)
Board Member & EEG Co-Chair, OSGi Alliance  (@OSGiAlliance)


Re: [ANN] Felix Logback version 1.0.0 Released

2018-07-11 Thread Raymond Auge
On Wed, Jul 11, 2018 at 12:53 PM, Cristiano  wrote:

> Wow, that is really cool !!
>
> great work, Raymond !
>
> I'm wondering... would be possible to setup logging (appenders or log
> level) using configuration admin service ?
>

Your wish is my command...  to link you to the latest Log Service 1.4
specification which adds configuration of log levels via configuration
admin [1] .

However "appenders" in terms of the Log Service specification are still
handled through LogListener services. This has not changed. So no, the
logback appenders are not integrated with configuration admin.

The Felix Logback integration simply manages the root logger context [2]
through it's configuration file. It also creates a bridge via a LogListener
to pipe records to logback's appenders, whatever is configured in logback.

[1] https://osgi.org/specification/osgi.cmpn/7.0.0/service.log.html#d0e2548
[2] https://osgi.org/specification/osgi.cmpn/7.0.0/service.log.html#d0e2447

Sincerely,
- Ray


>
> regards,
>
> Cristiano
>
>
> On 06/07/2018 15:31, Raymond Auge wrote:
>
>>
>>  org.apache.felix
>>  org.apache.felix.logback
>>  1.0.0
>>
>>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
> For additional commands, e-mail: users-h...@felix.apache.org
>
>


-- 
*Raymond Augé* <http://www.liferay.com/web/raymond.auge/profile>
 (@rotty3000)
Senior Software Architect *Liferay, Inc.* <http://www.liferay.com>
 (@Liferay)
Board Member & EEG Co-Chair, OSGi Alliance <http://osgi.org> (@OSGiAlliance)


[ANN] Felix Logback version 1.0.0 Released

2018-07-06 Thread Raymond Auge
The Felix team is pleased to announce the release of Felix Logback version 1.0.0


*Apache Felix Logback* is a small integration of the Logback
 backend with OSGi.

With *OSGi R7* the *Log Service Specification 1.4* (Log 1.4) brings a
slew of new features designed to improve the developer experience with
logging, the details of which can be read about here
.

This project is intended to help bridge the last frontier of OSGi
logging by leveraging many capabilities of Logback
, the new *Log 1.4* features to provide a
*unified backend*.
  http://felix.apache.org/documentation/subprojects/apache-felix-logback.html

This release is available from
http://felix.apache.org/site/downloads.cgi and Maven:

  
org.apache.felix
org.apache.felix.logback
1.0.0
  

Enjoy!

-The Felix team


Re: is current version of Maven-Bundle-Plugin aware of @ComponentPropertyType from DS 1.4?

2018-07-03 Thread Raymond Auge
ComponentPropertyTypes only start to be recognized with bnd 4.0.0 and will
be fully with, as yet released, bnd 4.1.0.

Since the latest maven-bundle-plugin 3.5.0 only uses bnd 3.5.0 it's not
handled (note the versions are kept in sync for convenience).

Sincerely,
- Ray


On Tue, Jul 3, 2018 at 3:28 PM, Cristiano  wrote:

> hello,
>
> I'm trying to play with DS 1.4 @ComponentPropertyType.
>
> I've created an annotation:
>
> @ComponentPropertyType
>> public @interface Config {
>>
>> /**
>>  * @return
>>  */
>> String participant_id();
>> }
>>
>
> then I tried to use it in activate method:
>
> @Activate
>> @Config(participant_id = "category")
>> @Override
>> protected void activate(ComponentContext pInjectedComponentContext,
>> Map pProperties,
>> DsConfigParticipant pConfigProperties)
>>  {...}
>>
>
> but M-B-P gives me an manifest generation exception:
>
> [ERROR] Manifest br.com.c8tech.osgi:br.com.c8te
>> ch.osgi.core:jar:0.1.1-SNAPSHOT : Activate method for
>> c8tech.osgi.core.internal.configuration.ComponentCategoryServiceProvider
>> descriptor ()Ljava/lang/String; is not acceptable.
>>
>
>
> thanks,
>
> Cristiano
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
> For additional commands, e-mail: users-h...@felix.apache.org
>
>


-- 
*Raymond Augé* 
 (@rotty3000)
Senior Software Architect *Liferay, Inc.* 
 (@Liferay)
Board Member & EEG Co-Chair, OSGi Alliance  (@OSGiAlliance)


Re: Dependency problem

2018-05-29 Thread Raymond Auge
Without seeing a wider picture of what you're doing it seems you may have a
couple too many dependencies.

First of all you can likely remove any of the bnd things because those are
typically plugin dependencies rather than project dependencies.

Second, I would lower the dependency of
`org.osgi.service.component.annotations`
to 1.3 just for sanity because the RIs for all the 1.4 features aren't yet
complete and to save yourself the pain of bleeding edge.

Third, use the correct core dep (the one you have is old and wrong and for
maintainability you want the right one).

What are you using osgi.annotations for? You probably want the individual
parts rather than the aggregate.

Do you really need the SCR annotations?

In the end I would start with just these:



org.osgi
osgi.core
6.0.0
provided


org.osgi
org.osgi.annotation
6.0.1
provided


org.osgi
org.osgi.service.component.annotations
1.3.0
provided


org.osgi
org.osgi.service.metatype.annotations
1.4.0
provided



Then I'd create a separate project to hold the runtime dependencies and
build your application assembly.

Would be possible to share your project via something like github so that
we can make more concrete suggestions?

- Ray


On Tue, May 29, 2018 at 9:30 AM, Peter Nabbefeld 
wrote:

>
> Hello,
>
> I tried to use/update an example I found for Declarative Services (using
> Eclipse, i.e. equinox instead of NetBeans and Felix).
>
> When starting my bundle in Felix I get:
> Unresolved requirements: [[org.example.SampleExporter [15](R 15.0)]
> osgi.extender; (&(osgi.extender=osgi.componen
> t)(version>=1.3.0)(!(version>=2.0.0)))]
>
> The dependencies part in my POM are:
> 
> 
> org.osgi
> org.osgi.core
> 6.0.0
> provided
> 
> 
> org.osgi
> org.osgi.annotation
> 6.0.0
> jar
> 
> 
> org.osgi
> org.osgi.service.component.annotations
> 1.4.0
> jar
> 
> 
> org.osgi
> org.osgi.service.metatype.annotations
> 1.4.0
> jar
> 
> 
> org.apache.felix
> org.apache.felix.scr
> 2.1.0
> 
> 
> org.apache.felix
> org.apache.felix.scr.annotations
> 1.12.0
> 
> 
> biz.aQute
> bndlib
> 2.0.0.20130123-133441
> 
> 
>
> The last 3 dependencies are not "original" ones, they've been added after
> I alredy got the error message, but they don't help either.
>
> As I'm new to OSGi, I don't know, yet, how to find out what I have to do.
> Do I need to install some bundles first?
>
> Kind regards
> Peter
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
> For additional commands, e-mail: users-h...@felix.apache.org
>
>


-- 
*Raymond Augé* 
 (@rotty3000)
Senior Software Architect *Liferay, Inc.* 
 (@Liferay)
Board Member & EEG Co-Chair, OSGi Alliance  (@OSGiAlliance)


Re: Can you make the maven bundle plugin use maven version ranges?

2018-03-08 Thread Raymond Auge
I concede the point! :)

- Ray

On Thu, Mar 8, 2018 at 12:49 PM, Neil Bartlett <njbartl...@gmail.com> wrote:

> You don't actually have to duplicate anything. The lower bound appears in
> two places but that can be handled with a property:
>
> 
> 6.0.0
> 
>
> ...
>
> 
> ...
> ${wicket.base.version}
> 
>
> ...
>
> org.apache.wicket.*; version="[${wicket.base.version}, 9)"
>
>
>
> On Thu, Mar 8, 2018 at 4:43 PM, Raymond Auge <raymond.a...@liferay.com>
> wrote:
>
> > On Thu, Mar 8, 2018 at 11:37 AM, Neil Bartlett <njbartl...@gmail.com>
> > wrote:
> >
> > > If you're going to do this I would recommend instead building against
> the
> > > floor version 6.0.0 (i.e. 6.0.0 in the dependency
> > > section of the pom) and overriding the Import-Package with a simpler
> rule
> > > as follows:
> > >
> > > 
> > > org.apache.wicket.*; version="[6, 9)"
> > > 
> > >
> > > Building against version 6 will ensure that you do not accidentally use
> > > bits of API from Wicket 7+ in your code, which could then result in
> > errors
> > > like NoSuchMethodError, making your users sad.
> > >
> >
> > The problem with that is that you have to maintain duplicate information
> > about the upper bound, while with my solution you can forget the package
> > import configuration and just adjust the pom's dependency.
> >
> > You are of course _assuming_ about the compatibility.
> >
> > So you have the two options:
> >
> > 1) Neil - compile against a concrete floor AND have to duplicate the
> > information manually
> > 2) Ray - compile against the latest, have the information not be dup'd,
> BUT
> > assume backward compatibility
> >
> > Pick your poison.
> >
> > We already determined that there is devils in the details w.r.t. the fact
> > that Wicket is not semantically versioned.
> >
> > - Ray
> >
> >
> > > Neil
> > >
> > > On Thu, Mar 8, 2018 at 4:24 PM, Raymond Auge <raymond.a...@liferay.com
> >
> > > wrote:
> > >
> > > > Totally +1 what Neil said.
> > > >
> > > > However there is one work around you can take if you really want to
> > open
> > > > yourself up like that...
> > > >
> > > > http://bnd.bndtools.org/macros/range.html
> > > >
> > > > Specifically applied like so:
> > > >
> > > > Import-Package: org.apache.wicket.*; version="${range;[6,+)}", *
> > > >
> > > > This means use literal '6' as the floor, but increment the ceiling to
> > > > the next MAJOR version
> > > > above what's found on the classpath.
> > > >
> > > > i.e. if you compiled against 8 then the result would be "[6,8)"
> > > >
> > > >
> > > > The one caveat is I'm not sure how well bnd's macros are handle using
> > > > the maven-bundle-plugin but you could just try to see what happens
> > > >
> > > > - Ray
> > > >
> > > >
> > > >
> > > > On Thu, Mar 8, 2018 at 11:14 AM, Neil Bartlett <njbartl...@gmail.com
> >
> > > > wrote:
> > > >
> > > > > Bnd (and by extension the maven-bundle-plugin) uses semantic
> versions
> > > to
> > > > > infer import ranges, based on the actual version that was compiled
> > > > against.
> > > > > If you build against version 8.0.0 of an API then we have no way to
> > > know
> > > > > that you are also compatible with versions 7.0.0 and 6.0.0.
> > > > >
> > > > > In fact it would be a violation of semantic versioning if major
> > > versions
> > > > > 6.0.0 through 8.0.0 were actually backwards compatible.
> > > > >
> > > > > It's my understanding that most Maven users consider build-time
> > version
> > > > > ranges to be a bad practice, because your build output could vary
> > > wildly
> > > > > depending on the content of your local repository. See "Should
> Maven
> > > > > dependency version ranges be considered deprecated?"[1]
> > > > >
> > > > > Regards,
> > > > > Neil
> > > > >
> > > > >
> > > > > [1]
> > > > > https://stackoverflow.com/questions/71672

Re: Can you make the maven bundle plugin use maven version ranges?

2018-03-08 Thread Raymond Auge
On Thu, Mar 8, 2018 at 11:37 AM, Neil Bartlett <njbartl...@gmail.com> wrote:

> If you're going to do this I would recommend instead building against the
> floor version 6.0.0 (i.e. 6.0.0 in the dependency
> section of the pom) and overriding the Import-Package with a simpler rule
> as follows:
>
> 
> org.apache.wicket.*; version="[6, 9)"
> 
>
> Building against version 6 will ensure that you do not accidentally use
> bits of API from Wicket 7+ in your code, which could then result in errors
> like NoSuchMethodError, making your users sad.
>

The problem with that is that you have to maintain duplicate information
about the upper bound, while with my solution you can forget the package
import configuration and just adjust the pom's dependency.

You are of course _assuming_ about the compatibility.

So you have the two options:

1) Neil - compile against a concrete floor AND have to duplicate the
information manually
2) Ray - compile against the latest, have the information not be dup'd, BUT
assume backward compatibility

Pick your poison.

We already determined that there is devils in the details w.r.t. the fact
that Wicket is not semantically versioned.

- Ray


> Neil
>
> On Thu, Mar 8, 2018 at 4:24 PM, Raymond Auge <raymond.a...@liferay.com>
> wrote:
>
> > Totally +1 what Neil said.
> >
> > However there is one work around you can take if you really want to open
> > yourself up like that...
> >
> > http://bnd.bndtools.org/macros/range.html
> >
> > Specifically applied like so:
> >
> > Import-Package: org.apache.wicket.*; version="${range;[6,+)}", *
> >
> > This means use literal '6' as the floor, but increment the ceiling to
> > the next MAJOR version
> > above what's found on the classpath.
> >
> > i.e. if you compiled against 8 then the result would be "[6,8)"
> >
> >
> > The one caveat is I'm not sure how well bnd's macros are handle using
> > the maven-bundle-plugin but you could just try to see what happens
> >
> > - Ray
> >
> >
> >
> > On Thu, Mar 8, 2018 at 11:14 AM, Neil Bartlett <njbartl...@gmail.com>
> > wrote:
> >
> > > Bnd (and by extension the maven-bundle-plugin) uses semantic versions
> to
> > > infer import ranges, based on the actual version that was compiled
> > against.
> > > If you build against version 8.0.0 of an API then we have no way to
> know
> > > that you are also compatible with versions 7.0.0 and 6.0.0.
> > >
> > > In fact it would be a violation of semantic versioning if major
> versions
> > > 6.0.0 through 8.0.0 were actually backwards compatible.
> > >
> > > It's my understanding that most Maven users consider build-time version
> > > ranges to be a bad practice, because your build output could vary
> wildly
> > > depending on the content of your local repository. See "Should Maven
> > > dependency version ranges be considered deprecated?"[1]
> > >
> > > Regards,
> > > Neil
> > >
> > >
> > > [1]
> > > https://stackoverflow.com/questions/7167250/should-
> > > maven-dependency-version-ranges-be-considered-deprecated
> > >
> > > On Thu, Mar 8, 2018 at 4:05 PM, Martin Nielsen <mny...@gmail.com>
> wrote:
> > >
> > > > Hello everyone.
> > > >
> > > > I am trying to make the Maven Bundle Plugin use a version range i
> have
> > > > defined in the POM of my project.
> > > > Basically a project of mine has a small wicket module which i know
> > works
> > > > through wicket 6-8. So i have defined the following dependency:
> > > >
> > > > 
> > > >   org.apache.wicket
> > > >   wicket-core
> > > >   [6.0.0,9.0.0)
> > > >   provided
> > > > 
> > > >
> > > > The problem is that the Maven Bundle Plugin doesn't seem to care all
> > that
> > > > much, and i get the following dependency in the manifest:
> > > >
> > > > org.apache.wicket;version="[8.0,9)",org.apache.wicket.ajax;
> > > > version="[8.0,9)",org.apache.wicket.ajax.form;version="[8.
> > > > 0,9)",org.apache.wicket.behavior;version="[8.0,9)",
> > > > org.apache.wicket.markup.html;version="[8.0,9)",org.apache.
> > > > wicket.markup.html.basic;version="[8.0,9)",org.apache.
> > > > wicket.markup.html.form;version="[8.0,9)",org.apache.
> >

Re: Can you make the maven bundle plugin use maven version ranges?

2018-03-08 Thread Raymond Auge
On Thu, Mar 8, 2018 at 11:24 AM, Raymond Auge <raymond.a...@liferay.com>
wrote:

> Totally +1 what Neil said.
>
> However there is one work around you can take if you really want to open
> yourself up like that...
>
> http://bnd.bndtools.org/macros/range.html
>
> Specifically applied like so:
>
> Import-Package: org.apache.wicket.*; version="${range;[6,+)}", *
>
> This means use literal '6' as the floor, but increment the ceiling to the 
> next MAJOR version
> above what's found on the classpath.
>
> i.e. if you compiled against 8 then the result would be "[6,8)"
>
> oops, I meant "[6,9)"


>
>
> The one caveat is I'm not sure how well bnd's macros are handle using the 
> maven-bundle-plugin but you could just try to see what happens
>
> - Ray
>
>
>
> On Thu, Mar 8, 2018 at 11:14 AM, Neil Bartlett <njbartl...@gmail.com>
> wrote:
>
>> Bnd (and by extension the maven-bundle-plugin) uses semantic versions to
>> infer import ranges, based on the actual version that was compiled
>> against.
>> If you build against version 8.0.0 of an API then we have no way to know
>> that you are also compatible with versions 7.0.0 and 6.0.0.
>>
>> In fact it would be a violation of semantic versioning if major versions
>> 6.0.0 through 8.0.0 were actually backwards compatible.
>>
>> It's my understanding that most Maven users consider build-time version
>> ranges to be a bad practice, because your build output could vary wildly
>> depending on the content of your local repository. See "Should Maven
>> dependency version ranges be considered deprecated?"[1]
>>
>> Regards,
>> Neil
>>
>>
>> [1]
>> https://stackoverflow.com/questions/7167250/should-maven-
>> dependency-version-ranges-be-considered-deprecated
>>
>> On Thu, Mar 8, 2018 at 4:05 PM, Martin Nielsen <mny...@gmail.com> wrote:
>>
>> > Hello everyone.
>> >
>> > I am trying to make the Maven Bundle Plugin use a version range i have
>> > defined in the POM of my project.
>> > Basically a project of mine has a small wicket module which i know works
>> > through wicket 6-8. So i have defined the following dependency:
>> >
>> > 
>> >   org.apache.wicket
>> >   wicket-core
>> >   [6.0.0,9.0.0)
>> >   provided
>> > 
>> >
>> > The problem is that the Maven Bundle Plugin doesn't seem to care all
>> that
>> > much, and i get the following dependency in the manifest:
>> >
>> > org.apache.wicket;version="[8.0,9)",org.apache.wicket.ajax;
>> > version="[8.0,9)",org.apache.wicket.ajax.form;version="[8.
>> > 0,9)",org.apache.wicket.behavior;version="[8.0,9)",
>> > org.apache.wicket.markup.html;version="[8.0,9)",org.apache.
>> > wicket.markup.html.basic;version="[8.0,9)",org.apache.
>> > wicket.markup.html.form;version="[8.0,9)",org.apache.
>> > wicket.markup.html.list;version="[8.0,9)",org.apache.
>> > wicket.markup.html.panel;version="[8.0,9)",org.apache.
>> > wicket.model;version="[8.0,9)",org.apache.wicket.model.util;
>> > version="[8.0,9)",org.apache.wicket.request.mapper.
>> > parameter;version="[8.0,9)",org.apache.wicket.util.string;
>> > version="[8.0,9)"
>> >
>> > My intent was to get a version range matching the maven range, but it
>> seems
>> > that the Bundle Plugin just looks at the artifact which was actually
>> > resolved and uses that, which ends up being [8.0,9).
>> >
>> > Is there a way to make the Bundle Plugin parse the POM version range,
>> or is
>> > there a fairly none-intrusive way to specify the version for all those
>> > packages?
>> >
>> >
>> > Thank you
>> > -Martin
>> >
>>
>
>
>
> --
> *Raymond Augé* <http://www.liferay.com/web/raymond.auge/profile>
>  (@rotty3000)
> Senior Software Architect *Liferay, Inc.* <http://www.liferay.com>
>  (@Liferay)
> Board Member & EEG Co-Chair, OSGi Alliance <http://osgi.org>
> (@OSGiAlliance)
>



-- 
*Raymond Augé* <http://www.liferay.com/web/raymond.auge/profile>
 (@rotty3000)
Senior Software Architect *Liferay, Inc.* <http://www.liferay.com>
 (@Liferay)
Board Member & EEG Co-Chair, OSGi Alliance <http://osgi.org> (@OSGiAlliance)


Re: Can you make the maven bundle plugin use maven version ranges?

2018-03-08 Thread Raymond Auge
Totally +1 what Neil said.

However there is one work around you can take if you really want to open
yourself up like that...

http://bnd.bndtools.org/macros/range.html

Specifically applied like so:

Import-Package: org.apache.wicket.*; version="${range;[6,+)}", *

This means use literal '6' as the floor, but increment the ceiling to
the next MAJOR version
above what's found on the classpath.

i.e. if you compiled against 8 then the result would be "[6,8)"


The one caveat is I'm not sure how well bnd's macros are handle using
the maven-bundle-plugin but you could just try to see what happens

- Ray



On Thu, Mar 8, 2018 at 11:14 AM, Neil Bartlett  wrote:

> Bnd (and by extension the maven-bundle-plugin) uses semantic versions to
> infer import ranges, based on the actual version that was compiled against.
> If you build against version 8.0.0 of an API then we have no way to know
> that you are also compatible with versions 7.0.0 and 6.0.0.
>
> In fact it would be a violation of semantic versioning if major versions
> 6.0.0 through 8.0.0 were actually backwards compatible.
>
> It's my understanding that most Maven users consider build-time version
> ranges to be a bad practice, because your build output could vary wildly
> depending on the content of your local repository. See "Should Maven
> dependency version ranges be considered deprecated?"[1]
>
> Regards,
> Neil
>
>
> [1]
> https://stackoverflow.com/questions/7167250/should-
> maven-dependency-version-ranges-be-considered-deprecated
>
> On Thu, Mar 8, 2018 at 4:05 PM, Martin Nielsen  wrote:
>
> > Hello everyone.
> >
> > I am trying to make the Maven Bundle Plugin use a version range i have
> > defined in the POM of my project.
> > Basically a project of mine has a small wicket module which i know works
> > through wicket 6-8. So i have defined the following dependency:
> >
> > 
> >   org.apache.wicket
> >   wicket-core
> >   [6.0.0,9.0.0)
> >   provided
> > 
> >
> > The problem is that the Maven Bundle Plugin doesn't seem to care all that
> > much, and i get the following dependency in the manifest:
> >
> > org.apache.wicket;version="[8.0,9)",org.apache.wicket.ajax;
> > version="[8.0,9)",org.apache.wicket.ajax.form;version="[8.
> > 0,9)",org.apache.wicket.behavior;version="[8.0,9)",
> > org.apache.wicket.markup.html;version="[8.0,9)",org.apache.
> > wicket.markup.html.basic;version="[8.0,9)",org.apache.
> > wicket.markup.html.form;version="[8.0,9)",org.apache.
> > wicket.markup.html.list;version="[8.0,9)",org.apache.
> > wicket.markup.html.panel;version="[8.0,9)",org.apache.
> > wicket.model;version="[8.0,9)",org.apache.wicket.model.util;
> > version="[8.0,9)",org.apache.wicket.request.mapper.
> > parameter;version="[8.0,9)",org.apache.wicket.util.string;
> > version="[8.0,9)"
> >
> > My intent was to get a version range matching the maven range, but it
> seems
> > that the Bundle Plugin just looks at the artifact which was actually
> > resolved and uses that, which ends up being [8.0,9).
> >
> > Is there a way to make the Bundle Plugin parse the POM version range, or
> is
> > there a fairly none-intrusive way to specify the version for all those
> > packages?
> >
> >
> > Thank you
> > -Martin
> >
>



-- 
*Raymond Augé* 
 (@rotty3000)
Senior Software Architect *Liferay, Inc.* 
 (@Liferay)
Board Member & EEG Co-Chair, OSGi Alliance  (@OSGiAlliance)


Re: Re[2]: Replace ResourceServlet

2018-02-13 Thread Raymond Auge
And here's a permalink [1] directly into the shiny new HTML version of the
specs!

:D

- Ray

[1]
https://osgi.org/specification/osgi.cmpn/7.0.0/service.http.whiteboard.html#d0e121454


On Tue, Feb 13, 2018 at 6:57 AM, Neil Bartlett <njbartl...@gmail.com> wrote:

> On Tue, Feb 13, 2018 at 11:32 AM, Thomas Driessen <
> thomas.driessen...@gmail.com> wrote:
>
> > Hi,
> >
> > @Karl: I tried this but it didn't work. Still the resource servlet got
> all
> > requests for .css files.
> >
> > @Ray: I am already using the whiteboard for servlets. Is there a way to
> > use the whiteboard for resources as well?
> >
>
>
> See OSGi Compendium R6 Specification, section 140.6 "Registering
> Resources".
>
>
>
> >
> > My current solution now involves a service that listens if there is any
> UI
> > in debug mode, if so unregisters all resources and registers a
> > VaadinServlet under //VAADIN/*
> >
> > I still would have thought that there is an easier way to replace this
> > default resource servlet.
> >
> > Kind regards,
> > Thomas
> >
> > -- Originalnachricht --
> > Von: "Raymond Auge" <raymond.a...@liferay.com>
> > An: "felix users" <users@felix.apache.org>
> > Cc: "Thomas Driessen" <thomas.driessen...@gmail.com>
> > Gesendet: 12.02.2018 22:51:01
> > Betreff: Re: Replace ResourceServlet
> >
> >
> > I feel like you'd be having way more fun if you bumped up to using Http
> >> Whiteboard.
> >>
> >> Sincerely,
> >> - Ray
> >>
> >> On Mon, Feb 12, 2018 at 4:41 PM, Karl Pauls <karlpa...@gmail.com>
> wrote:
> >>
> >> On Mon, Feb 12, 2018 at 4:22 PM, Thomas Driessen
> >>> <thomas.driessen...@gmail.com> wrote:
> >>> > Hi,
> >>> >
> >>> > I'm currently trying to get Vaadin to work within OSGi and for this
> >>> purpose
> >>> > I'm using felix http as webserver.
> >>> >
> >>> > My current setup looks like this:
> >>> > I have a ResourceTracker that tracks all themes/widgetsets/resources
> >>> and
> >>> > registers them according to the Vaadin scheme as resources via:
> >>> >
> >>> >
> >>> > http.registerResources("/vaadin-8.2.1/VAADIN/path/to/resource",
> >>> > "/VAADIN/path/to/resource", new MySpecialContext());
> >>> >
> >>> > This works fine for production mode where all scss files are compiled
> >>> to
> >>> > css.
> >>> >
> >>> > The problem is in debug mode, where Vaadin offers an on-the-fly
> >>> compilation
> >>> > from scss to css. For this purpose Vaadin states one should register
> a
> >>> > VaadinServlet under "/VAADIN/*" (or "/vaadin-8.2.1/VAADIN/*" in an
> OSGi
> >>> > context) that takes care of compiling scss files on the fly if the
> >>> > corresponding css files can not be found.
> >>> >
> >>> > The problem is:
> >>> >
> >>> > When I register a Vaadin servlet under "/vaadin-8.2.1/VAADIN/*" then
> >>> this
> >>> > servlet is never used.
> >>>
> >>> I might not remember correctly but IIRC, you are not supposed to put a
> >>> "/*" at the end of the alias. Can you try to register the servlet with
> >>> an alias of: "/vaadin-8.2.1/VAADIN" and see if that works?
> >>>
> >>> regards,
> >>>
> >>> Karl
> >>>
> >>> > Requests to
> >>> > "localhost:8080/vaadin-8.2.1/VAADIN/path/to/resource" are still
> >>> handled
> >>> by a
> >>> > ResourceServlet (DefaultServlet?) which, of course, is not able to
> find
> >>> the
> >>> > non-existent css files.
> >>> >
> >>> > Is there a way to tell felix http to  use a custom servlet instead of
> >>> its
> >>> > default resource servlet?
> >>> >
> >>> > Kind regards,
> >>> > Thomas
> >>>
> >>>
> >>>
> >>> --
> >>> Karl Pauls
> >>> karlpa...@gmail.com
> >>>
> >>> -
> >>> To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
> >>> For additional commands, e-mail: users-h...@felix.apache.org
> >>>
> >>>
> >>>
> >>
> >> --
> >> *Raymond Augé* <http://www.liferay.com/web/raymond.auge/profile>
> >> (@rotty3000)
> >> Senior Software Architect *Liferay, Inc.* <http://www.liferay.com>
> >> (@Liferay)
> >> Board Member & EEG Co-Chair, OSGi Alliance <http://osgi.org>
> >> (@OSGiAlliance)
> >>
> >
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
> > For additional commands, e-mail: users-h...@felix.apache.org
> >
> >
>



-- 
*Raymond Augé* <http://www.liferay.com/web/raymond.auge/profile>
 (@rotty3000)
Senior Software Architect *Liferay, Inc.* <http://www.liferay.com>
 (@Liferay)
Board Member & EEG Co-Chair, OSGi Alliance <http://osgi.org> (@OSGiAlliance)


Re: Replace ResourceServlet

2018-02-12 Thread Raymond Auge
I feel like you'd be having way more fun if you bumped up to using Http
Whiteboard.

Sincerely,
- Ray

On Mon, Feb 12, 2018 at 4:41 PM, Karl Pauls  wrote:

> On Mon, Feb 12, 2018 at 4:22 PM, Thomas Driessen
>  wrote:
> > Hi,
> >
> > I'm currently trying to get Vaadin to work within OSGi and for this
> purpose
> > I'm using felix http as webserver.
> >
> > My current setup looks like this:
> > I have a ResourceTracker that tracks all themes/widgetsets/resources and
> > registers them according to the Vaadin scheme as resources via:
> >
> >
> > http.registerResources("/vaadin-8.2.1/VAADIN/path/to/resource",
> > "/VAADIN/path/to/resource", new MySpecialContext());
> >
> > This works fine for production mode where all scss files are compiled to
> > css.
> >
> > The problem is in debug mode, where Vaadin offers an on-the-fly
> compilation
> > from scss to css. For this purpose Vaadin states one should register a
> > VaadinServlet under "/VAADIN/*" (or "/vaadin-8.2.1/VAADIN/*" in an OSGi
> > context) that takes care of compiling scss files on the fly if the
> > corresponding css files can not be found.
> >
> > The problem is:
> >
> > When I register a Vaadin servlet under "/vaadin-8.2.1/VAADIN/*" then this
> > servlet is never used.
>
> I might not remember correctly but IIRC, you are not supposed to put a
> "/*" at the end of the alias. Can you try to register the servlet with
> an alias of: "/vaadin-8.2.1/VAADIN" and see if that works?
>
> regards,
>
> Karl
>
> > Requests to
> > "localhost:8080/vaadin-8.2.1/VAADIN/path/to/resource" are still handled
> by a
> > ResourceServlet (DefaultServlet?) which, of course, is not able to find
> the
> > non-existent css files.
> >
> > Is there a way to tell felix http to  use a custom servlet instead of its
> > default resource servlet?
> >
> > Kind regards,
> > Thomas
>
>
>
> --
> Karl Pauls
> karlpa...@gmail.com
>
> -
> To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
> For additional commands, e-mail: users-h...@felix.apache.org
>
>


-- 
*Raymond Augé* 
 (@rotty3000)
Senior Software Architect *Liferay, Inc.* 
 (@Liferay)
Board Member & EEG Co-Chair, OSGi Alliance  (@OSGiAlliance)


Re: Web Console DS Components view

2017-11-17 Thread Raymond Auge
I meant to add this link

http://felix.apache.org/downloads.cgi

too illustrate that there are several webconsole plugins.

- Ray

On Nov 17, 2017 7:15 AM, "Raymond Auge" <raymond.a...@liferay.com> wrote:

> Do you have either the webconsole-all bundle or the wedconsole +
> webconsole ds plugin bundles installed?
>
> - Ray
>
> On Nov 17, 2017 6:41 AM, "jesse.rao" <jesse@liferay.com> wrote:
>
>> Simple question about Web Console: Are any special steps required to use
>> it
>> to view / manage DS components?
>>
>> My application is using DS components and I can see that the
>> org.apache.felix.scr bundle is active. However, when I hit the URL
>> http://localhost:8080/system/console/components I get a 404 and am
>> redirected to http://localhost:8080/system/console/bundles.
>>
>> The felix web console docs say "If your framework uses the Apache Felix
>> Declarative Services implementation, you can use to the Web Console to
>> inspect the declared components available from the various bundles and
>> managed by the Service Component Runtime."
>>
>>
>>
>> --
>> Sent from: http://apache-felix.18485.x6.nabble.com/Apache-Felix-Users-f
>> 4833200.html
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
>> For additional commands, e-mail: users-h...@felix.apache.org
>>
>>


Re: Declarative Services problems in Apache Karaf

2017-11-17 Thread Raymond Auge
On Nov 17, 2017 7:04 AM, "Raymond Auge" <raymond.a...@liferay.com> wrote:

Hey Marco,

Now that your reference will be properly dynamic, multiple, I hope that

private B b;

as a non-volatile field is just an over simplification in your example. DS
concurrently calls


.. dynamic ..

bind methods on your component so setting of the non-volatile private field
will be dangerous. You'll want to ensure that you handle that, such as
making b volatile and making method local copies of b before using it. You
could also use an AtomicReference instead.

There are also several other non-obvious concerns if you're gonna manage
your own "collection" of services. So take care with that.

Sincerely,
- Ray



On Nov 17, 2017 5:22 AM, "MarcoF90" <marco.fierimo...@gmail.com> wrote:

Hi Neil,

thank you for your answer, this further difference is clear to me.

Kind regards,
Marco



--
Sent from: http://apache-felix.18485.x6.nabble.com/Apache-Felix-Users-f
4833200.html

-
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org


Re: [ANN] New Apache Felix PMC Chair: Karl Pauls

2017-11-16 Thread Raymond Auge
Congratulations Karl and thank you Carsten!

Sincerely,
- Ray

On Thu, Nov 16, 2017 at 10:06 AM, David Bosschaert <
david.bosscha...@gmail.com> wrote:

> Congratulations Karl!
> And many thanks to Carsten for having been at this role for the past years!
>
> David
>
> On 16 November 2017 at 06:25, Carsten Ziegeler 
> wrote:
>
> > Hi,
> >
> > it's my pleasure to announce that Karl took up the role as our new PMC
> > chair.
> >
> > Congrats Karl!
> >
> > Regards
> > Carsten
> > --
> > Carsten Ziegeler
> > Adobe Research Switzerland
> > cziege...@apache.org
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
> > For additional commands, e-mail: users-h...@felix.apache.org
> >
> >
>



-- 
*Raymond Augé* 
 (@rotty3000)
Senior Software Architect *Liferay, Inc.* 
 (@Liferay)
Board Member & EEG Co-Chair, OSGi Alliance  (@OSGiAlliance)


Re: boot/classloader delegation not working?

2017-10-12 Thread Raymond Auge
Additionally, when you use:

org.osgi.framework.system.packages.extra

though it's slightly more verbose, it means the bundles you've built will
more likely have proper metadata. Some benefits of which are:

- moving the provider of those packages around without changing the
consuming bundles
- run in a more pure OSGi environment
- support assembling applications from your bundles using the OSGi resolver
- etc.

Cheers
- Ray

On Thu, Oct 12, 2017 at 9:07 AM, Karl Pauls  wrote:

> Hi Max,
>
> I think you are using the wrong FRAMEWORK_BUNDLE_PARENT. In your
> example, you use: FRAMEWORK_BUNDLE_PARENT_APP - which happens to be
> the system classloader. I would guess you want
> FRAMEWORK_BUNDLE_PARENT_FRAMEWORK - which would be the classloader
> that loaded the framework.
>
> Does this help?
>
> regards,
>
> Karl
>
> On Thu, Oct 12, 2017 at 2:36 PM, Maximilian Schmidt
>  wrote:
> > Hi *,
> >
> > I'm currently working on getting Felix (5.6.8) embedded in an existing
> > non-OSGI application. I'd like to force bundles to use several classes
> > and packages already known to the application classloader. This is
> > mainly due to memory- and classloading-footprint, but also greatly eases
> > maintainance of bundles and their dependencies (well, for our limited
> > purpose at least).
> >
> > As far as I understood, there are two ways to archive this: either by
> > using classloader-delegation or by providing
> > org.osgi.framework.system.packages.extra.
> >
> > For now, we decided to use boot-delegation as it allows for use of
> > wildcards, instead of specifying each an every (sub-)package. However,
> > although the setup is straight-forward it simply does not work.
> >
> > For example, to provide global logging frameworks to all bundles:
> > Map configMap = new HashMap();
> > // use the current classloader to provide logging
> > configMap.put(Constants.FRAMEWORK_BOOTDELEGATION,
> > "org.slf4j.*,ch.qos.logback.*");
> > configMap.put(Constants.FRAMEWORK_BUNDLE_PARENT,
> > Constants.FRAMEWORK_BUNDLE_PARENT_APP);
> > // more initialization
> > ...
> > Felix felix = new Felix(configMap);
> > // there we go
> > felix.start()
> >
> > Now, a bundle that gets installed and started just fine will throw CNF
> > Exceptions as soon as a service class using org.slf4j... is
> > instantiated, although those are provided by the application classloader.
> >
> > The stacktrace contains:
> > Caused by: java.lang.ClassNotFoundException: *** Package 'org.slf4j' is
> > not imported by bundle support-33x [1], nor is there any bundle that
> > exports package 'org.slf4j'. However, the class
> > 'org.slf4j.LoggerFactory' is available from the system class loader.
> > There are two fixes: 1) Add package 'org.slf4j' to the
> > 'org.osgi.framework.system.packages.extra' property and modify bundle
> > support-33x [1] to import this package; this causes the system bundle to
> > export class path packages. 2) Add package 'org.slf4j' to the
> > 'org.osgi.framework.bootdelegation' property; a library or VM bug can
> > cause classes to be loaded by the wrong class loader. The first approach
> > is preferable for preserving modularity. ***
> > at
> > org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(
> BundleWiringImpl.java:2031)
> > at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
> > ... 294 more
> > Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory not
> > found by support-33x [1]
> > at
> > org.apache.felix.framework.BundleWiringImpl.
> findClassOrResourceByDelegation(BundleWiringImpl.java:1610)
> > at
> > org.apache.felix.framework.BundleWiringImpl.access$200(
> BundleWiringImpl.java:80)
> > at
> > org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(
> BundleWiringImpl.java:2018)
> >
> > Any idea, what went wrong or where to go from here?
> >
> > Thanks in advance!
> > Kind regards,
> > Max
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
> > For additional commands, e-mail: users-h...@felix.apache.org
> >
>
>
>
> --
> Karl Pauls
> karlpa...@gmail.com
>
> -
> To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
> For additional commands, e-mail: users-h...@felix.apache.org
>
>


-- 
*Raymond Augé* 
 (@rotty3000)
Senior Software Architect *Liferay, Inc.* 
 (@Liferay)
Board Member & EEG Co-Chair, OSGi Alliance  (@OSGiAlliance)


Re: Creating a "partial" OBR

2017-10-08 Thread Raymond Auge
On Oct 8, 2017 6:39 AM, "Jean-Baptiste Onofré"  wrote:

Hi David,

I guess the repository.xml is updated by the maven-bundle-plugin right (in
your .m2/repository) ?

Regards
JB


On 10/08/2017 05:19 AM, David Leangen wrote:

> Hi!
>
> I have a few felix projects that I have patched and would like to test,
> but I need to create an OBR containing just those projects.
>

Just for purists sake, you probably mean R5 index as obr refers to a
specific non-standard form of OSGi repository which should be avoided...


> I am a bit stumped as to how to go about it, though.
>

Have you looked at the bnd-indexer-maven-plugin?
https://github.com/bndtools/bnd/tree/master/maven/bnd-indexer-maven-plugin

- Ray


>
> Specifically, there are 3 projects:
>
>* converter/converter
>* converter/serializer
>* converter/schematizer
>
>
> I would like to have an OBR that contains only those 3 bundles.
>
>
> Any suggestions as to how I could go about that?
>
> maven-bundle-plugin is already configured in those projects. I am guess
> that I just need to set it up properly, but I am not understanding from the
> docs, and I have not found any examples.
>
>
> Thanks!!
> =David
>
>
>
-- 
Jean-Baptiste Onofré
jbono...@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

-
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org


Re: maven-bundle-plugin duplicate import bundle with different version

2017-07-17 Thread Raymond Auge
Bnd expects the classpath to be "clean". As such, the moment it finds a
valid package it assumes that's the best one to use.

The simplest thing to do here is to put an exclusion of metrics-core-3.1.2
on whatever dependency pulled it in.

If you do:

mvn dependency:tree

you'll see what top level dependency pulled that artifact into the
classpath.

- Ray



On Wed, Jul 12, 2017 at 10:51 PM, yswai1986  wrote:

> Plugin version: 3.3.0
> Maven version: 3.3.9
>
> I am wondering how maven-bundle-plugin resolves the version from duplicated
> Export-Packages bundle, the following is from mvn -X debug output and seems
> like the plugin is using the version from the first bundle found.
>
> ---
>
> [DEBUG] BND Classpath:
>
> ---
>
> -classpath:\
> D:\dev\m3repo\io\dropwizard\metrics\metrics-core\3.1.2\
> metrics-core-3.1.2.jar,\
> D:\dev\m3repo\com\codahale\metrics\metrics-core\3.0.2\
> metrics-core-3.0.2.jar
>
> ---
> MANIFEST.MF
> (io\dropwizard\metrics\metrics-core\3.1.2\metrics-core-3.1.2.jar)
>
> Manifest-Version: 1.0
> Bnd-LastModified: 1430020731305
> Build-Jdk: 1.8.0_05
> Built-By: ryantenney
> Bundle-Description: Metrics is a Java library which gives you unparallel
> ed
> insight into what your code does inproduction. Metrics provi  des a
> powerful toolkit of ways to measure the behavior of critical
> components in your production environment.
> Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.html
> Bundle-ManifestVersion: 2
> Bundle-Name: Metrics Core
> Bundle-SymbolicName: io.dropwizard.metrics.core
> Bundle-Version: 3.1.2
> Created-By: Apache Maven Bundle Plugin
> Export-Package:
> com.codahale.metrics;uses:="org.slf4j,javax.management,
> sun.misc";version="3.1.2"
> Implementation-Title: Metrics Core
> Implementation-Vendor-Id: io.dropwizard.metrics
> Implementation-Version: 3.1.2
> Import-Package: javax.management,org.slf4j;version="[1.6.0,2.0.0)",sun.m
> isc;resolution:=optional
> Tool: Bnd-1.50.0
> MANIFEST.MF (com\codahale\metrics\metrics-core\3.0.2\metrics-core-3.0.2.
> jar)
>
> Manifest-Version: 1.0
> Bnd-LastModified: 1392597083041
> Build-Jdk: 1.7.0_51
> Built-By: coda
> Bundle-Description: Metrics is a Java library which gives you unparallel
> ed
> insight into what your code does in production. Metrics provi  des a
> powerful toolkit of ways to measure the behavior of critical
> components in your production environment.
> Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.html
> Bundle-ManifestVersion: 2
> Bundle-Name: Metrics Core
> Bundle-SymbolicName: com.codahale.metrics.core
> Bundle-Version: 3.0.2
> Created-By: Apache Maven Bundle Plugin
> Export-Package: com.codahale.metrics;uses:="org.slf4j,javax.management,s
> un.misc";version="3.0.2"
> Implementation-Title: Metrics Core
> Implementation-Vendor-Id: com.codahale.metrics
> Implementation-Version: 3.0.2
> Import-Package: javax.management,org.slf4j;version="[1.6.0,2.0.0)",sun.m
> isc;resolution:=optional
> Tool: Bnd-1.50.0
> And the final output MANIFEST.MF for my bundle:
>
> #---
>
> [DEBUG] Final Manifest:
> #---
> Manifest-Version: 1.0
> Bnd-LastModified: 1499834358907
> Build-Jdk: 1.8.0_111
> Built-By: ys03
> Bundle-Description: MyBundle
> Bundle-DocURL: http://my.bundle
> Bundle-ManifestVersion: 2
> Bundle-Name: MyBundle
> Bundle-SymbolicName: com.foo.bar.myBundle
> Bundle-Vendor: ysw
> Bundle-Version: 1.0.0.11
> Created-By: Apache Maven Bundle Plugin
> Export-Package: com.foo.bar.myBundle;
> Implementation-Version: 1.0.0.11 Build: dfaf45de3d27234d42fcc2841e06ccc8
>  ed530f18 Timestamp: 2017-07-12 12:39:12
> Import-Package:
>  com.fasterxml.jackson.databind;version="[2.3.0,3.0.0)",
>  org.joda.time.format;version="[2.1.0,3.0.0)",
>  com.codahale.metrics;version="[3.1,4)",
>  com.google.common.collect;version="[19.0,20)",
>  org.apache.commons.codec.binary;version="[1.10,2)",
>  org.apache.commons.lang3;version="[3.4,4)",
>  org.slf4j;version="[1.7,2)",
> Tool: Bnd-3.3.0.201609221906
> #---
> The final version for com.codahale.metrics is [3.1,4), I suppose it should
> be [3.0,4), please correct my understanding if I am wrong.
>
> Thanks.
>
>
>
> --
> View this message in context: http://apache-felix.18485.x6.
> nabble.com/maven-bundle-plugin-duplicate-import-
> bundle-with-different-version-tp5021813.html
> Sent from the Apache Felix - Users mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
> For additional commands, e-mail: users-h...@felix.apache.org
>

Re: SCR : Unsatisfied ComponentFactory

2017-03-31 Thread Raymond Auge
.candata.inv.api.common.services.
> InvoiceFindResultService
> Cardinality: 1..1
> Policy: static
> Policy option: reluctant
> Reference Scope: bundle
>   Reference: InvoiceSettingsService
> Interface Name: com.candata.inv.api.client.services.
> InvoiceSettingsService
> Cardinality: 0..1
> Policy: dynamic
> Policy option: reluctant
> Reference Scope: bundle
>   Reference: Logger
> Interface Name: com.candata.core.api.interfaces.Logger
> Cardinality: 1..1
> Policy: static
> Policy option: reluctant
> Reference Scope: bundle
>   Reference: Mar03Factory
> Interface Name: org.osgi.service.component.ComponentFactory
> Target Filter: (component.factory=com.candata.customer.client.bbx.
> MAR03)
> Cardinality: 1..1
> Policy: static
> Policy option: reluctant
> Reference Scope: bundle
>   Reference: Menu13
> Interface Name: com.candata.b3.client.bbx.Menu13
> Cardinality: 1..1
> Policy: static
> Policy option: reluctant
> Reference Scope: bundle
>   Reference: MostRecentAdminService
> Interface Name: com.candata.util.client.services.
> MostRecentAdminService
> Cardinality: 1..1
> Policy: static
> Policy option: reluctant
> Reference Scope: bundle
>   Reference: PortService
> Interface Name: com.candata.util.client.services.PortService
> Cardinality: 1..1
> Policy: static
> Policy option: reluctant
> Reference Scope: bundle
>   Reference: PropertiesService
> Interface Name: com.candata.util.common.services.PropertiesService
> Cardinality: 1..1
> Policy: static
> Policy option: reluctant
> Reference Scope: bundle
>   Reference: ShipmentBus
> Interface Name: com.candata.b3.common.interfaces.ShipmentBus
> Cardinality: 1..1
> Policy: static
> Policy option: reluctant
> Reference Scope: bundle
>   Reference: ShipmentDAO
> Interface Name: com.candata.b3.common.interfaces.ShipmentDAO
> Cardinality: 1..1
> Policy: static
> Policy option: reluctant
> Reference Scope: bundle
>   Reference: ShipmentMenuItem
> Interface Name: com.candata.b3.client.services.ShipmentMenuItem
> Cardinality: 0..n
> Policy: dynamic
> Policy option: reluctant
> Reference Scope: bundle
>   Reference: ShipmentResponseDAO
> Interface Name: com.candata.b3.common.interfaces.ShipmentResponseDAO
> Cardinality: 1..1
> Policy: static
> Policy option: reluctant
> Reference Scope: bundle
>   Reference: ShipmentValidateAndSaveService
> Interface Name: com.candata.b3.common.interfaces.
> ShipmentValidateAndSaveService
> Cardinality: 1..1
> Policy: static
> Policy option: reluctant
> Reference Scope: bundle
>   Reference: ShipmentVendorDAO
> Interface Name: com.candata.b3.common.interfaces.ShipmentVendorDAO
> Cardinality: 1..1
> Policy: static
> Policy option: reluctant
> Reference Scope: bundle
>   Reference: TelnetPMFactory
> Interface Name: org.osgi.service.component.ComponentFactory
> Target Filter: (component.factory=com.candata.telnet.TelnetPM)
> Cardinality: 1..1
> Policy: static
> Policy option: reluctant
> Reference Scope: bundle
>   Reference: Track01PMFactory
> Interface Name: org.osgi.service.component.ComponentFactory
> Target Filter: (component.factory=com.candata.b3.client.bbx.Track01PM)
> Cardinality: 1..1
> Policy: static
> Policy option: reluctant
> Reference Scope: bundle
>   Reference: UserProfile
> Interface Name: com.candata.core.common.interfaces.UserProfile
> Cardinality: 1..1
> Policy: static
> Policy option: reluctant
> Reference Scope: bundle
>   Reference: XMenu
> Interface Name: com.candata.bbx.client.bbx.XMenu
> Cardinality: 1..1
> Policy: static
>     Policy option: reluctant
> Reference Scope: bundle
>   Component Description Properties:
>   B313AFactory.target = (component.factory=com.
> candata.b3.client.bbx.B313A)
>   CCI01AFactory.target = (component.factory=com.
> candata.b3.client.bbx.CCI01A)
>   CCIImporterPMFactory.target = (component.factory=com.
> candata.custom.fyke.client.model.CCIImporterPM)
>   Mar03Factory.target = (component.factory=com.
> candata.customer.client.bbx.MAR03)
>   TelnetPMFactory.target = (component.factory=com.
> candata.telnet.TelnetPM)
>   Track01PMFactory.target = (component.factory=com.
> candata.b3.client.bbx.Track01PM)
>   (No Component Configurations)
>
> On Fri, Mar 31, 2017 at 11:16 AM, Raymond Auge <raymond.a...@liferay.com>
> wrote:
>
> > On Fri, Mar 31, 2017 at 11:13 AM, Dave Smith <dave.sm...@candata.com>
> > wrote:
> >
> > > com.candata.b3.client.bbx.TRACK01
> > >
> >
> > please do
> >
> > scr:info com.candata.b3.client.bbx.TRACK01
> >
> >
> >
> > --
> > *Raymond Augé* <http://www.liferay.com/web/raymond.auge/profile>
> >  (@rotty3000)
> > Senior Software Architect *Liferay, Inc.* <http://www.liferay.com>
> >  (@Liferay)
> > Board Member & EEG Co-Chair, OSGi Alliance <http://osgi.org>
> > (@OSGiAlliance)
> >
>



-- 
*Raymond Augé* <http://www.liferay.com/web/raymond.auge/profile>
 (@rotty3000)
Senior Software Architect *Liferay, Inc.* <http://www.liferay.com>
 (@Liferay)
Board Member & EEG Co-Chair, OSGi Alliance <http://osgi.org> (@OSGiAlliance)


Re: SCR : Unsatisfied ComponentFactory

2017-03-31 Thread Raymond Auge
On Fri, Mar 31, 2017 at 11:13 AM, Dave Smith  wrote:

> com.candata.b3.client.bbx.TRACK01
>

please do

scr:info com.candata.b3.client.bbx.TRACK01



-- 
*Raymond Augé* 
 (@rotty3000)
Senior Software Architect *Liferay, Inc.* 
 (@Liferay)
Board Member & EEG Co-Chair, OSGi Alliance  (@OSGiAlliance)


Re: SCR : Unsatisfied ComponentFactory

2017-03-31 Thread Raymond Auge
It might help to show the dump of the scr:info command here so we can try
to figure out the issue.

Sincerely,
- Ray

On Fri, Mar 31, 2017 at 10:41 AM, Dave Smith  wrote:

> We have some ComponentFactory's that are not starting. However in the GOGO
> shell console and the using the ServiceComponentRuntime there are no
> unsatisfiedReferences  shown for the factory and the Factories are not
> registered in the services list
>



-- 
*Raymond Augé* 
 (@rotty3000)
Senior Software Architect *Liferay, Inc.* 
 (@Liferay)
Board Member & EEG Co-Chair, OSGi Alliance  (@OSGiAlliance)


Re: servlet API and Felix HTTP

2017-03-28 Thread Raymond Auge
On Tue, Mar 28, 2017 at 3:48 PM, Raymond Auge <raymond.a...@liferay.com>
wrote:

> It's because the regular bundle doesn't provide a Portal Java Contract
>

gah Portable Java Contract
https://www.osgi.org/portable-java-contract-definitions/

- Ray


> , the felix bundle does.
>
> - Ray
>
> On Tue, Nov 15, 2016 at 1:52 PM, Benson Margulies <bimargul...@gmail.com>
> wrote:
>
>> rg.osgi.framework.BundleException: Unable to resolve
>> org.apache.felix.http.jetty [65](R 65.0): missing requirement
>> [org.apache.felix.http.jetty [65](R 65.0)] osgi.contract;
>> (&(osgi.contract=JavaServlet)(version=3.1)) Unresolved requirements:
>> [[org.apache.felix.http.jetty [65](R 65.0)] osgi.contract;
>> (&(osgi.contract=JavaServlet)(version=3.1))]
>>
>> But I have this bundle:
>>
>> javax.servlet/javax.servlet-api/3.1.0
>>
>> Do I also need the felix http servlet API bundle?
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
>> For additional commands, e-mail: users-h...@felix.apache.org
>>
>>
>
>
> --
> *Raymond Augé* <http://www.liferay.com/web/raymond.auge/profile>
>  (@rotty3000)
> Senior Software Architect *Liferay, Inc.* <http://www.liferay.com>
>  (@Liferay)
> Board Member & EEG Co-Chair, OSGi Alliance <http://osgi.org>
> (@OSGiAlliance)
>



-- 
*Raymond Augé* <http://www.liferay.com/web/raymond.auge/profile>
 (@rotty3000)
Senior Software Architect *Liferay, Inc.* <http://www.liferay.com>
 (@Liferay)
Board Member & EEG Co-Chair, OSGi Alliance <http://osgi.org> (@OSGiAlliance)


Re: servlet API and Felix HTTP

2017-03-28 Thread Raymond Auge
It's because the regular bundle doesn't provide a Portal Java Contract, the
felix bundle does.

- Ray

On Tue, Nov 15, 2016 at 1:52 PM, Benson Margulies 
wrote:

> rg.osgi.framework.BundleException: Unable to resolve
> org.apache.felix.http.jetty [65](R 65.0): missing requirement
> [org.apache.felix.http.jetty [65](R 65.0)] osgi.contract;
> (&(osgi.contract=JavaServlet)(version=3.1)) Unresolved requirements:
> [[org.apache.felix.http.jetty [65](R 65.0)] osgi.contract;
> (&(osgi.contract=JavaServlet)(version=3.1))]
>
> But I have this bundle:
>
> javax.servlet/javax.servlet-api/3.1.0
>
> Do I also need the felix http servlet API bundle?
>
> -
> To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
> For additional commands, e-mail: users-h...@felix.apache.org
>
>


-- 
*Raymond Augé* 
 (@rotty3000)
Senior Software Architect *Liferay, Inc.* 
 (@Liferay)
Board Member & EEG Co-Chair, OSGi Alliance  (@OSGiAlliance)


Re: GoGo 1.x doesn't work with equinox

2017-03-10 Thread Raymond Auge
On Fri, Mar 10, 2017 at 4:08 PM, Cristiano Gavião <cvgav...@gmail.com>
wrote:

> Hi Ray,
>
> understood !  thanks for the explanation !
>
> btw, do you think that worth to open a request to Equinox to move to GoGo
> 1.x ?
>

Probably a good idea!

- Ray


> regards,
>
>
> Cristiano
>
>
>
> On 04/03/2017 18:34, Raymond Auge wrote:
>
>> At one point the gogo shell was subject of an OSGi RFP attempting to
>> create
>> a shell specification. During that time and according the Apache Felix's
>> policy on consuming and implementing OSGi API, the packages of the
>> in-progress project in felix used the org.apache.felix namespace and were
>> marked provisional as you have noticed.
>>
>> Fast forward several years and the shell specification never progressed
>> any
>> further. However gogo did, still having the provisional attribute on it's
>> packages.
>>
>> Moving further forward to late 2016 when some fairly significant work was
>> done to gogo and finally it was decided that after almost a decade gogo
>> should become finally version 1.0.0 and at that time since an OSGi spec
>> was
>> now far from likely the attribute provisional was dropped.
>>
>> The provisional attribute is merely a hint to developers to be aware that
>> the API they are consuming is likely to be subject to change, more so than
>> in pure semantic ways. It could suddenly become incompatible with no
>> explanation because the design is not yet finalized.
>>
>> I hope this helps explain things. :)
>>
>> - Ray
>>
>>
>> On Sat, Mar 4, 2017 at 1:58 PM, Cristiano Gavião <cvgav...@gmail.com>
>> wrote:
>>
>> Hello,
>>>
>>> Eclipse Equinox have been using GoGo since version 3.8 (I think it is
>>> Juno) and since that they do not upgrade gogo version (0.8.0).
>>>
>>> But even Eclipse team do not upgrading gogo's version, to use newer
>>> versions was just a simple matter to deploy the new bundles into the
>>> container and enjoy (until GoGo version 0.16.4).
>>>
>>> Today I decided to try the latest gogo version (1.0.2) and sadly it was
>>> not possible this time.
>>>
>>> Further investigation shows me that *org.eclipse.equinox.console* has
>>> this
>>> import: org.apache.felix.service.command;*/status=provisional/*, but new
>>> gogo version do not exports that anymore.
>>>
>>>
>>> Could someone explain me why was this status=provisional added anyway ?
>>>
>>>
>>> regards,
>>>
>>> Cristiano
>>>
>>>
>>>
>>>
>>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
> For additional commands, e-mail: users-h...@felix.apache.org
>
>


-- 
*Raymond Augé* <http://www.liferay.com/web/raymond.auge/profile>
 (@rotty3000)
Senior Software Architect *Liferay, Inc.* <http://www.liferay.com>
 (@Liferay)
Board Member & EEG Co-Chair, OSGi Alliance <http://osgi.org> (@OSGiAlliance)


Re: GoGo 1.x doesn't work with equinox

2017-03-04 Thread Raymond Auge
At one point the gogo shell was subject of an OSGi RFP attempting to create
a shell specification. During that time and according the Apache Felix's
policy on consuming and implementing OSGi API, the packages of the
in-progress project in felix used the org.apache.felix namespace and were
marked provisional as you have noticed.

Fast forward several years and the shell specification never progressed any
further. However gogo did, still having the provisional attribute on it's
packages.

Moving further forward to late 2016 when some fairly significant work was
done to gogo and finally it was decided that after almost a decade gogo
should become finally version 1.0.0 and at that time since an OSGi spec was
now far from likely the attribute provisional was dropped.

The provisional attribute is merely a hint to developers to be aware that
the API they are consuming is likely to be subject to change, more so than
in pure semantic ways. It could suddenly become incompatible with no
explanation because the design is not yet finalized.

I hope this helps explain things. :)

- Ray


On Sat, Mar 4, 2017 at 1:58 PM, Cristiano Gavião  wrote:

> Hello,
>
> Eclipse Equinox have been using GoGo since version 3.8 (I think it is
> Juno) and since that they do not upgrade gogo version (0.8.0).
>
> But even Eclipse team do not upgrading gogo's version, to use newer
> versions was just a simple matter to deploy the new bundles into the
> container and enjoy (until GoGo version 0.16.4).
>
> Today I decided to try the latest gogo version (1.0.2) and sadly it was
> not possible this time.
>
> Further investigation shows me that *org.eclipse.equinox.console* has this
> import: org.apache.felix.service.command;*/status=provisional/*, but new
> gogo version do not exports that anymore.
>
>
> Could someone explain me why was this status=provisional added anyway ?
>
>
> regards,
>
> Cristiano
>
>
>


-- 
*Raymond Augé* 
 (@rotty3000)
Senior Software Architect *Liferay, Inc.* 
 (@Liferay)
Board Member & EEG Co-Chair, OSGi Alliance  (@OSGiAlliance)


Re: Error while trying to start felix framework for the first time

2017-02-28 Thread Raymond Auge
See http://www.mail-archive.com/dev%40felix.apache.org/msg42942.html

- Ray

On Tue, Feb 28, 2017 at 11:40 AM, Raymond Auge <raymond.a...@liferay.com>
wrote:

> I believe a release with the fix for your issue is currently just under
> vote, and so you should see it within a couple of days.
>
> - Ray
>
> On Tue, Feb 28, 2017 at 11:34 AM, jaison jose <jaisonjose...@gmail.com>
> wrote:
>
>> Hello Team,
>>
>> I have downloaded the felix zip from http://felix.apache.org/downlo
>> ads.cgi.
>> A per the instructions in
>> http://felix.apache.org/documentation/subprojects/apache-
>> felix-framework/apache-felix-framework-usage-documentation.html.
>> I tried to start the felix framework and end up with the below mentioned
>> error trace.
>>
>> ERROR: Bundle org.apache.felix.gogo.jline [4] EventDispatcher: Error
>> during
>> dispatch. (java.lang.NoClassDefFoundError:
>> org/fusesource/jansi/WindowsAnsiOutputStream)
>> java.lang.NoClassDefFoundError: org/fusesource/jansi/WindowsAn
>> siOutputStream
>> at
>> org.jline.terminal.TerminalBuilder.doBuild(TerminalBuilder.java:146)
>> at
>> org.jline.terminal.TerminalBuilder.build(TerminalBuilder.java:109)
>> at
>> org.apache.felix.gogo.jline.Activator.startShell(Activator.java:118)
>> at
>> org.apache.felix.gogo.jline.Activator.serviceFound(Activator.java:75)
>> at
>> org.apache.felix.gogo.jline.SingleServiceTracker.update(Sing
>> leServiceTracker.java:168)
>> at
>> org.apache.felix.gogo.jline.SingleServiceTracker.findMatchin
>> gReference(SingleServiceTracker.java:124)
>> at
>> org.apache.felix.gogo.jline.SingleServiceTracker.serviceChan
>> ged(SingleServiceTracker.java:105)
>> at
>> org.apache.felix.framework.EventDispatcher.invokeServiceList
>> enerCallback(EventDispatcher.java:990)
>> at
>> org.apache.felix.framework.EventDispatcher.fireEventImmediat
>> ely(EventDispatcher.java:838)
>> at
>> org.apache.felix.framework.EventDispatcher.fireServiceEvent(
>> EventDispatcher.java:545)
>> at
>> org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:4578)
>> at org.apache.felix.framework.Felix.registerService(Felix.java:
>> 3570)
>> at
>> org.apache.felix.framework.BundleContextImpl.registerService
>> (BundleContextImpl.java:348)
>> at
>> org.apache.felix.framework.BundleContextImpl.registerService
>> (BundleContextImpl.java:322)
>> at
>> org.apache.felix.gogo.runtime.activator.Activator.newProcess
>> or(Activator.java:74)
>> at
>> org.apache.felix.gogo.runtime.activator.Activator.start(Acti
>> vator.java:83)
>> at
>> org.apache.felix.framework.util.SecureAction.startActivator(
>> SecureAction.java:697)
>> at org.apache.felix.framework.Felix.activateBundle(Felix.java:
>> 2238)
>> at org.apache.felix.framework.Felix.startBundle(Felix.java:2144)
>> at
>> org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1371)
>> at
>> org.apache.felix.framework.FrameworkStartLevelImpl.run(Frame
>> workStartLevelImpl.java:308)
>> at java.lang.Thread.run(Unknown Source)
>> Caused by: java.lang.ClassNotFoundException:
>> org.fusesource.jansi.WindowsAnsiOutputStream not found by org.jline [1]
>> at
>> org.apache.felix.framework.BundleWiringImpl.findClassOrResou
>> rceByDelegation(BundleWiringImpl.java:1550)
>> at
>> org.apache.felix.framework.BundleWiringImpl.access$200(Bundl
>> eWiringImpl.java:79)
>> at
>> org.apache.felix.framework.BundleWiringImpl$BundleClassLoade
>> r.loadClass(BundleWiringImpl.java:1958)
>> at java.lang.ClassLoader.loadClass(Unknown Source)
>> ... 22 more
>>
>> Kindly help me to resolve this issue.
>>
>> Regards,
>> Jaison Jose
>>
>
>
>
> --
> *Raymond Augé* <http://www.liferay.com/web/raymond.auge/profile>
>  (@rotty3000)
> Senior Software Architect *Liferay, Inc.* <http://www.liferay.com>
>  (@Liferay)
> Board Member & EEG Co-Chair, OSGi Alliance <http://osgi.org>
> (@OSGiAlliance)
>



-- 
*Raymond Augé* <http://www.liferay.com/web/raymond.auge/profile>
 (@rotty3000)
Senior Software Architect *Liferay, Inc.* <http://www.liferay.com>
 (@Liferay)
Board Member & EEG Co-Chair, OSGi Alliance <http://osgi.org> (@OSGiAlliance)


Re: Error while trying to start felix framework for the first time

2017-02-28 Thread Raymond Auge
I believe a release with the fix for your issue is currently just under
vote, and so you should see it within a couple of days.

- Ray

On Tue, Feb 28, 2017 at 11:34 AM, jaison jose 
wrote:

> Hello Team,
>
> I have downloaded the felix zip from http://felix.apache.org/downloads.cgi
> .
> A per the instructions in
> http://felix.apache.org/documentation/subprojects/
> apache-felix-framework/apache-felix-framework-usage-documentation.html.
> I tried to start the felix framework and end up with the below mentioned
> error trace.
>
> ERROR: Bundle org.apache.felix.gogo.jline [4] EventDispatcher: Error during
> dispatch. (java.lang.NoClassDefFoundError:
> org/fusesource/jansi/WindowsAnsiOutputStream)
> java.lang.NoClassDefFoundError: org/fusesource/jansi/
> WindowsAnsiOutputStream
> at
> org.jline.terminal.TerminalBuilder.doBuild(TerminalBuilder.java:146)
> at
> org.jline.terminal.TerminalBuilder.build(TerminalBuilder.java:109)
> at
> org.apache.felix.gogo.jline.Activator.startShell(Activator.java:118)
> at
> org.apache.felix.gogo.jline.Activator.serviceFound(Activator.java:75)
> at
> org.apache.felix.gogo.jline.SingleServiceTracker.update(
> SingleServiceTracker.java:168)
> at
> org.apache.felix.gogo.jline.SingleServiceTracker.findMatchingReference(
> SingleServiceTracker.java:124)
> at
> org.apache.felix.gogo.jline.SingleServiceTracker.serviceChanged(
> SingleServiceTracker.java:105)
> 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:4578)
> at org.apache.felix.framework.Felix.registerService(Felix.
> java:3570)
> at
> org.apache.felix.framework.BundleContextImpl.registerService(
> BundleContextImpl.java:348)
> at
> org.apache.felix.framework.BundleContextImpl.registerService(
> BundleContextImpl.java:322)
> at
> org.apache.felix.gogo.runtime.activator.Activator.
> newProcessor(Activator.java:74)
> at
> org.apache.felix.gogo.runtime.activator.Activator.start(Activator.java:83)
> at
> org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.
> java:697)
> at org.apache.felix.framework.Felix.activateBundle(Felix.
> java:2238)
> at org.apache.felix.framework.Felix.startBundle(Felix.java:2144)
> at
> org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1371)
> at
> org.apache.felix.framework.FrameworkStartLevelImpl.run(
> FrameworkStartLevelImpl.java:308)
> at java.lang.Thread.run(Unknown Source)
> Caused by: java.lang.ClassNotFoundException:
> org.fusesource.jansi.WindowsAnsiOutputStream not found by org.jline [1]
> at
> org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegatio
> n(BundleWiringImpl.java:1550)
> at
> org.apache.felix.framework.BundleWiringImpl.access$200(
> BundleWiringImpl.java:79)
> at
> org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(
> BundleWiringImpl.java:1958)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> ... 22 more
>
> Kindly help me to resolve this issue.
>
> Regards,
> Jaison Jose
>



-- 
*Raymond Augé* 
 (@rotty3000)
Senior Software Architect *Liferay, Inc.* 
 (@Liferay)
Board Member & EEG Co-Chair, OSGi Alliance  (@OSGiAlliance)


Re: how can a bundle stop itself programmatically?

2016-10-19 Thread Raymond Auge
I was thinking, and would suggest, exactly the same thing as Neil!

Sincerely,
- Ray

On Wed, Oct 19, 2016 at 7:04 AM, Neil Bartlett  wrote:

> Change the logic of the update… instead of always replacing the
> security.policy file, replace it only if it is not already in the required
> state. This makes your bundle idempotent (it doesn’t matter how many times
> it is called) which is a much more robust approach.
>
> Neil
>
> > On 19 Oct 2016, at 07:05, sid19039  wrote:
> >
> > Hello Ray,
> >
> > Thanks for your reply. Following is our use case:
> >
> > we are making a bundle which would be used as a security patch meant to
> > update a security.policy file.
> > Now the scenario is that we are deploying that bundle on to a felix
> > framework target via Apache Ace server. For the very first time when it
> > starts, it updates the file - which is ok. But Apache Ace server
> refreshes
> > the felix framework i.e it restarts all of the bundles installed
> previously
> > also each time some new bundle is deployed onto the target. Due to which
> our
> > security bundle also restarts and update security.policy file again
> which is
> > not required. So we want it(the bundle) to be removed from the framework
> > once it updates the file or simply runs only once until somebody tries to
> > update the file by deploying its new version.
> >
> > Any suggestions would be very helpful.
> >
> > Regards
> > Siddharth
> >
> >
> >
> > --
> > View this message in context: http://apache-felix.18485.x6.
> nabble.com/how-can-a-bundle-stop-itself-programmatically-
> tp5018885p5018894.html
> > Sent from the Apache Felix - Users mailing list archive at Nabble.com.
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
> > For additional commands, e-mail: users-h...@felix.apache.org
> >
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
> For additional commands, e-mail: users-h...@felix.apache.org
>
>


-- 
*Raymond Augé* 
 (@rotty3000)
Senior Software Architect *Liferay, Inc.* 
 (@Liferay)
Board Member & EEG Co-Chair, OSGi Alliance  (@OSGiAlliance)


Re: how can a bundle stop itself programmatically?

2016-10-18 Thread Raymond Auge
This is probably not a very good approach. Generally you should let some
bundle agent be responsible for the states of bundles.

Perhaps explaining your use case could help us suggest a better alternative.

Sincerely,
- Ray

On Tue, Oct 18, 2016 at 8:35 AM, sid19039  wrote:

> Hello All,
>
> I have trying to stop a bundle from within itself by invoking stop method
> as
> following in its Activator's start method:
> bundleContext.getBundle().stop();
>
> But post this statement is executed, when i check its state via "lb"
> command
> on  felix shell, its state is shown as Active.
> Then when i try to stop it via stop  command, an exception is
> thrown that
> *org.osgi.framework.BundleException: Stopping a starting or stopping
> bundle
> is currently not supported.*And then its state is shown as *stopping*
>
> Please someone tell how i can achieve this..
>
> Regards
> Siddharth
>
>
>
>
> --
> View this message in context: http://apache-felix.18485.x6.
> nabble.com/how-can-a-bundle-stop-itself-programmatically-tp5018885.html
> Sent from the Apache Felix - Users mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
> For additional commands, e-mail: users-h...@felix.apache.org
>
>


-- 
*Raymond Augé* 
 (@rotty3000)
Senior Software Architect *Liferay, Inc.* 
 (@Liferay)
Board Member & EEG Co-Chair, OSGi Alliance  (@OSGiAlliance)


Re: Using service interceptors to inject proxies

2016-10-06 Thread Raymond Auge
t; }
> >
> > }
> >
> > And if you want the client to define a swap callback, you can then define
> > some the callback like this:
> >
> > class Client implements Runnable {
> >volatile LogService logService; // the original LogService, or the
> > aspect chain
> >
> >// bind the required dependency (possibly the original service, or an
> > aspect)
> >void set(LogService logService) {
> >  this.logService = logService;
> >}
> >
> >// called if the original service is swapped with an aspect
> >void swap(LogService oldLog, LogService newLog) {
> >// handle the swapped service
> >this.logService = newLog;
> >}
> >
> >public void run() {
> >  logService.log(...);
> >}
> > }
> >
> > then here is the ClientActivor, defining the swap callback like this:
> >
> > component(Client.class, comp -> comp
> > .impl(Client.class.class)
> > .provides(Runnable.class)
> > .withSrv(LogService.class, srv -> srv.required().add(Client::
> > set).swap(Client::swap)));
> >
> >
> > here, the initial LogService is first injected using the "set" callback,
> > and if it's the original service, then the swap callback will be invoked
> > if (ever) an aspect has to replace the original bound service.
> >
> > finally, you might also take a look at [1]. I never looked at it, but
> > aspecio seems to be another solution allowing to manage osgi aspect
> > services.
> >
> > Hope this helps;
> >
> > cheers;
> > /Pierre
> >
> > [1] http://www.mail-archive.com/users@felix.apache.org/msg17262.html
> >
> >
> > On Thu, Oct 6, 2016 at 4:04 PM, Raymond Auge <raymond.a...@liferay.com>
> > wrote:
> >
> > > The problem with the above solution is that you will end up in a race
> > where
> > > a service might already be registered without a proxy, then what? So
> you
> > > should try to avoid ordering issues in your design otherwise you will
> > > regret it later.
> > >
> > > What really should happen is that the thing creating the service should
> > add
> > > the proxy around the service before the service is ever published. An
> > > extender is an ideal place to do this. Felix DM, and IPojo are ideal
> for
> > > this use case since they imperative APIs for managing services and can
> be
> > > "trained" to add proxies based on arbitrary heuristics.
> > >
> > > It's a wish I have also for Felix SCR.
> > >
> > > Sincerely,
> > > - Ray
> > >
> > > On Thu, Oct 6, 2016 at 6:45 AM, Martin Nielsen <mny...@gmail.com>
> wrote:
> > >
> > > > I think what i wrote might have made more sense in my own head:) I
> > > > apologize for the lousy problem description.
> > > > Maybe an actual use case would help:
> > > >
> > > > I would like to use the OSGi serviceregistry to proxy specific
> > > interfaces.
> > > > For example:
> > > > Say that i attempt to get a serviceReference for an interface with a
> > > > mybatis annotation on it. What i would like is that the service
> > registry
> > > > returns a proxy that i define (My idea was through something like a
> > > > ServiceBindingInterceptor). The proxy should then be closed down
> again
> > > when
> > > > get unget method is called on the service.
> > > >
> > > > Basically, i would like to supply a proxy implementation of
> interfaces
> > in
> > > > certain situations, but still allow for the serviceregistry lifecycle
> > > > (get/unget) to handle opening and closing the proxies.
> > > >
> > > > It doesn't have to use any specific part of the runtime, i just
> spotted
> > > the
> > > > interceptors and mistook their purpose a bit i think.
> > > >
> > > > On Thu, Oct 6, 2016 at 12:32 PM, Clement Escoffier <
> > > > clement.escoff...@gmail.com> wrote:
> > > >
> > > > > Hi,
> > > > >
> > > > > The service binding interceptor requires to have a “service”
> > available.
> > > > > You should be able to do what you want by either:
> > > > >
> > > > > - combining a “default-implementation” strategy and a binding
> > > interceptor
> > > > > (it w

Re: Using service interceptors to inject proxies

2016-10-06 Thread Raymond Auge
The problem with the above solution is that you will end up in a race where
a service might already be registered without a proxy, then what? So you
should try to avoid ordering issues in your design otherwise you will
regret it later.

What really should happen is that the thing creating the service should add
the proxy around the service before the service is ever published. An
extender is an ideal place to do this. Felix DM, and IPojo are ideal for
this use case since they imperative APIs for managing services and can be
"trained" to add proxies based on arbitrary heuristics.

It's a wish I have also for Felix SCR.

Sincerely,
- Ray

On Thu, Oct 6, 2016 at 6:45 AM, Martin Nielsen  wrote:

> I think what i wrote might have made more sense in my own head:) I
> apologize for the lousy problem description.
> Maybe an actual use case would help:
>
> I would like to use the OSGi serviceregistry to proxy specific interfaces.
> For example:
> Say that i attempt to get a serviceReference for an interface with a
> mybatis annotation on it. What i would like is that the service registry
> returns a proxy that i define (My idea was through something like a
> ServiceBindingInterceptor). The proxy should then be closed down again when
> get unget method is called on the service.
>
> Basically, i would like to supply a proxy implementation of interfaces in
> certain situations, but still allow for the serviceregistry lifecycle
> (get/unget) to handle opening and closing the proxies.
>
> It doesn't have to use any specific part of the runtime, i just spotted the
> interceptors and mistook their purpose a bit i think.
>
> On Thu, Oct 6, 2016 at 12:32 PM, Clement Escoffier <
> clement.escoff...@gmail.com> wrote:
>
> > Hi,
> >
> > The service binding interceptor requires to have a “service” available.
> > You should be able to do what you want by either:
> >
> > - combining a “default-implementation” strategy and a binding interceptor
> > (it would require to have the dependency marked as optional)
> > - or create your own handler that inject what you want to inject (
> > http://felix.apache.org/documentation/subprojects/
> > apache-felix-ipojo/apache-felix-ipojo-devguide/how-to-
> > write-your-own-handler.html  > documentation/subprojects/apache-felix-ipojo/apache-
> > felix-ipojo-devguide/how-to-write-your-own-handler.html>)
> >
> > Clement
> >
> >
> > > On 6 oct. 2016, at 04:02, Martin Nielsen  wrote:
> > >
> > > Hello everyone
> > >
> > > I am looking at the felix servicebinding interceptors with a certain
> > amount
> > > of enthusiasm, but i am having trouble figuring out if they can solve a
> > > specific task.
> > >
> > > http://felix.apache.org/documentation/subprojects/
> > apache-felix-ipojo/apache-felix-ipojo-userguide/ipojo-
> > advanced-topics/service-binding-interceptors.html
> > >
> > > What i would like to do is the following: Whenever a ServiceReference
> is
> > > requested for an interface (No matter which one), i want an interceptor
> > to
> > > examine it. If the interface meets some criteria, the an interceptor
> > should
> > > create a proxy for that interface, regardless of a matching
> > implementation
> > > being registered.
> > > So: Even if no object is actually registered as a service to that
> > > interface, i want the interceptor to return a proxy anyway. Is that
> > > possible to do in any way?
> > >
> > > Thank you in advance.
> > >
> > > -Martin
> >
> >
>



-- 
*Raymond Augé* 
 (@rotty3000)
Senior Software Architect *Liferay, Inc.* 
 (@Liferay)
Board Member & EEG Co-Chair, OSGi Alliance  (@OSGiAlliance)


Re: setting the objectclassdefinition from felix file install

2016-10-03 Thread Raymond Auge
Well, I'm not sure about that but because you've not named a pid in your
component, it's not associating that with the configuration. Honestly, I'm
not sure the pid in the OCD will get interpreted as being the pid of the
configuration. My gut tells me it's not doing that. So you still need to
name the pid in your component.

Someone else may correct me of course. However, it should be simple to
assert by adding the configurationPid property on the component and seeing
if it does eventually bind.

- Ray

On Mon, Oct 3, 2016 at 1:27 PM, David Daniel <david.daniel.1...@gmail.com>
wrote:

> Thank you,  I think I may be wrong somewhere else then.  I have this in my
> logs
>
> *DEBUG*
> listConfigurations(filter=(felix.fileinstall.filename=
> file:/media/david/abcd2f06-6ee4-4c5a-8c80-e4023ec8a52c/
> development/asae/asae-base/packaging/all/etc/com.marklogic.cfg))
> *DEBUG* Listing configurations matching
> (felix.fileinstall.filename=file:/media/david/abcd2f06-
> 6ee4-4c5a-8c80-e4023ec8a52c/development/asae/asae-base/
> packaging/all/etc/com.marklogic.cfg)
> Creating configuration from com.marklogic.cfg
> *DEBUG* getConfiguration(pid=com.marklogic, location=null)
>
> does setting the pid as I did above not do what I thought it would do.
>
>
> On Mon, Oct 3, 2016 at 1:12 PM, Raymond Auge <raymond.a...@liferay.com>
> wrote:
>
> > Make the configuration mandatory in the component!
> >
> > - Ray
> >
> > On Mon, Oct 3, 2016 at 1:08 PM, David Daniel <
> david.daniel.1...@gmail.com>
> > wrote:
> >
> > > I have an object class definition
> > >
> > > @ObjectClassDefinition(name = "Marklogic Configuration",
> > > pid = "com.marklogic")
> > > @interface MarklogicConfig {
> > > String content_host() default "localhost";
> > > String content_username() default "admin";
> > > String content_pword() default "**";
> > > String content_dbname() default "";
> > > }
> > >
> > > and a component
> > >
> > > @Component(service = {MarkLogicConnector.class})
> > > @Designate(ocd = MarklogicConfig.class)
> > > public class MarkLogicConnector {
> > >
> > > I have the felix file install bundle installed and working.  It seems
> > like
> > > it is loading com.marklogic.cfg correctly.  Is there a way to make sure
> > > that the file is loaded before the configuration is passed into the
> > > activate method.  I seem to be getting the default values rather than
> the
> > > configured ones that came from fileinstall.
> > >
> >
> >
> >
> > --
> > *Raymond Augé* <http://www.liferay.com/web/raymond.auge/profile>
> >  (@rotty3000)
> > Senior Software Architect *Liferay, Inc.* <http://www.liferay.com>
> >  (@Liferay)
> > Board Member & EEG Co-Chair, OSGi Alliance <http://osgi.org>
> > (@OSGiAlliance)
> >
>



-- 
*Raymond Augé* <http://www.liferay.com/web/raymond.auge/profile>
 (@rotty3000)
Senior Software Architect *Liferay, Inc.* <http://www.liferay.com>
 (@Liferay)
Board Member & EEG Co-Chair, OSGi Alliance <http://osgi.org> (@OSGiAlliance)


Re: setting the objectclassdefinition from felix file install

2016-10-03 Thread Raymond Auge
Make the configuration mandatory in the component!

- Ray

On Mon, Oct 3, 2016 at 1:08 PM, David Daniel 
wrote:

> I have an object class definition
>
> @ObjectClassDefinition(name = "Marklogic Configuration",
> pid = "com.marklogic")
> @interface MarklogicConfig {
> String content_host() default "localhost";
> String content_username() default "admin";
> String content_pword() default "**";
> String content_dbname() default "";
> }
>
> and a component
>
> @Component(service = {MarkLogicConnector.class})
> @Designate(ocd = MarklogicConfig.class)
> public class MarkLogicConnector {
>
> I have the felix file install bundle installed and working.  It seems like
> it is loading com.marklogic.cfg correctly.  Is there a way to make sure
> that the file is loaded before the configuration is passed into the
> activate method.  I seem to be getting the default values rather than the
> configured ones that came from fileinstall.
>



-- 
*Raymond Augé* 
 (@rotty3000)
Senior Software Architect *Liferay, Inc.* 
 (@Liferay)
Board Member & EEG Co-Chair, OSGi Alliance  (@OSGiAlliance)


Re: Help debug ServiceDependency in DM4-R8

2016-09-09 Thread Raymond Auge
Note that service visibility is subject to class space coherence...

What does that mean?

It means that the package who's interface the service is published under,
has to be the same package imported by the referencing code. The service
registry won't offer up the service to the bundle who would suffer a
ClassCastException when handed the service instance otherwise.

So, what you want to do is check that both the service bundle and the
tracking bundle are using the same package.

HTH
- Ray

On Fri, Sep 9, 2016 at 1:04 PM, mduduzik  wrote:

> I have a DM component that depends on a service that looks like is
> available
> (checking with WebConsole). However, the consuming DM component stays in
> WAITING_FOR_REQUIRED state. How do I debug why an available service is not
> being consumed.
>
> Note: required service is registered after the component is created (via
> dm.add(component)).
>
> Thanks.
>
>
>
> --
> View this message in context: http://apache-felix.18485.x6.
> nabble.com/Help-debug-ServiceDependency-in-DM4-R8-tp5018369.html
> Sent from the Apache Felix - Users mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
> For additional commands, e-mail: users-h...@felix.apache.org
>
>


-- 
*Raymond Augé* 
 (@rotty3000)
Senior Software Architect *Liferay, Inc.* 
 (@Liferay)
Board Member & EEG Co-Chair, OSGi Alliance  (@OSGiAlliance)


Re: Issues with embedded Felix framework and JAXRS

2016-09-06 Thread Raymond Auge
The issue remains with libraries designed for Java EE, they use TCCL
themselves because this has been forced upon them.

You'll have to do as David suggested and use SPI-Fly providing the
requirements and capabilities to the bundles in question to ensure that the
SPY-fly can wire the bundles together properly and do the instrumentation
necessary to make it all work.

- Ray

On Tue, Sep 6, 2016 at 2:50 PM, Alessandro Gherardi <
alessandro.ghera...@yahoo.com.invalid> wrote:

>
> Thanks.
> However, my application is NOT running within a J2EE container - it's a
> stand-alone, J2SE application started via java -cp ... path.to.main.class.
>
>
>
>   From: Raymond Auge <raymond.a...@liferay.com>
>  To: felix users <users@felix.apache.org>; Alessandro Gherardi <
> alessandro.ghera...@yahoo.com>
>  Sent: Tuesday, September 6, 2016 12:07 PM
>  Subject: Re: Issues with embedded Felix framework and JAXRS
>
> Context classloaders are an Java EE construct and not something that OSGi
> frameworks usually care about. Therefore, when running OSGi embedded in a
> JavaEE container you generally need to do all the work to ensure TCCL's are
> properly handled.
>
> Sincerely,
> - Ray
>
> On Tue, Sep 6, 2016 at 12:46 PM, Alessandro Gherardi <
> alessandro.ghera...@yahoo.com.invalid> wrote:
>
> > Hi,I have a non-OSGi Java app that loads an OSGi bundle by embedding
> > Felix. The bundle exposes its functionality as an OSGi service. The app
> > accesses the service via a service tracker. The app uses the
> > org.osgi.framework.system.packages.extra option so that the service
> > interface and the classes that the interfaces refers to are all loaded by
> > the same classloader in both the app and the bundle.
> > The bundle uses Jersey 2.X and the app uses Jersey 1.17. When the app
> > calls the bundle via the service, the Jersey 2.X code throws the
> following
> > exception:
> > Exception in thread "main" java.lang.LinkageError: ClassCastException:
> > attempting to castfile:/C:/XXX/bin/javax/ws/rs/ext/RuntimeDelegate.class
> > to bundle://59.1:1/javax/ws/rs/ext/RuntimeDelegate.classat
> > javax.ws.rs.ext.RuntimeDelegate.findDelegate(RuntimeDelegate.java:146)
> at
> > javax.ws.rs.ext.RuntimeDelegate.getInstance(RuntimeDelegate.java:120) at
> > javax.ws.rs.core.UriBuilder.newInstance(UriBuilder.java:95)...
> > Looking at the Jersey source code, it appears that RuntimeDelegate tries
> > to load a concrete subclass via javax.ws.rs.ext.FactoryFinder.
> > FactoryFinder reads the name of the subclass from file META-INF/services/
> > javax.ws.rs.ext.RuntimeDelegate, and it loads that file via the calling
> > threads's context class loader. Since the calling thread is an
> > application's thread, its class loader is the application's class loader,
> > so META-INF/services/javax.ws.rs.ext.RuntimeDelegate points to a Jersey
> > 1.17 class.
> > I can kind-of workaround the problem by setting the application thread to
> > an "empty" class loader before calling the service - i.e.:
> > ClassLoader saveCL = Thread.currentThread().getContextClassLoader();
> > ClassLoader myCL = new URLClassLoader(new URL[0], saveCL.getParent());
> > try {
> >  Thread.currentThread().setContextClassLoader(myCL);
> >  call OSGi service
> > } finally {
> >  Thrad.currentThread().setContextClassloader(saveCL);
> > }
> >
> > However, I'm surprised I have to do that. Shouldn't the framework take
> > care of this - even if the service caller is the embedded application
> > rather than another OSGi bundle?
> > Notice: This issue may or may not be related to  commons-logging and Axis
> > problems
> > Thank you in advance,Alessandro
> >
> > |
> > |
> > |
> > |  ||
> >
> >|
> >
> >  |
> > |
> > |  |
> > commons-logging and Axis problems
> >|  |
> >
> >  |
> >
> >  |
> >
> >
> >
> >
>
>
> --
> *Raymond Augé* <http://www.liferay.com/web/raymond.auge/profile>
>  (@rotty3000)
> Senior Software Architect *Liferay, Inc.* <http://www.liferay.com/>
>  (@Liferay)
> Board Member & EEG Co-Chair, OSGi Alliance <http://osgi.org/>
> (@OSGiAlliance)
>
>




-- 
*Raymond Augé* <http://www.liferay.com/web/raymond.auge/profile>
 (@rotty3000)
Senior Software Architect *Liferay, Inc.* <http://www.liferay.com>
 (@Liferay)
Board Member & EEG Co-Chair, OSGi Alliance <http://osgi.org> (@OSGiAlliance)


Re: Issues with embedded Felix framework and JAXRS

2016-09-06 Thread Raymond Auge
Context classloaders are an Java EE construct and not something that OSGi
frameworks usually care about. Therefore, when running OSGi embedded in a
JavaEE container you generally need to do all the work to ensure TCCL's are
properly handled.

Sincerely,
- Ray

On Tue, Sep 6, 2016 at 12:46 PM, Alessandro Gherardi <
alessandro.ghera...@yahoo.com.invalid> wrote:

> Hi,I have a non-OSGi Java app that loads an OSGi bundle by embedding
> Felix. The bundle exposes its functionality as an OSGi service. The app
> accesses the service via a service tracker. The app uses the
> org.osgi.framework.system.packages.extra option so that the service
> interface and the classes that the interfaces refers to are all loaded by
> the same classloader in both the app and the bundle.
> The bundle uses Jersey 2.X and the app uses Jersey 1.17. When the app
> calls the bundle via the service, the Jersey 2.X code throws the following
> exception:
> Exception in thread "main" java.lang.LinkageError: ClassCastException:
> attempting to castfile:/C:/XXX/bin/javax/ws/rs/ext/RuntimeDelegate.class
> to bundle://59.1:1/javax/ws/rs/ext/RuntimeDelegate.classat
> javax.ws.rs.ext.RuntimeDelegate.findDelegate(RuntimeDelegate.java:146) at
> javax.ws.rs.ext.RuntimeDelegate.getInstance(RuntimeDelegate.java:120) at
> javax.ws.rs.core.UriBuilder.newInstance(UriBuilder.java:95)...
> Looking at the Jersey source code, it appears that RuntimeDelegate tries
> to load a concrete subclass via javax.ws.rs.ext.FactoryFinder.
> FactoryFinder reads the name of the subclass from file META-INF/services/
> javax.ws.rs.ext.RuntimeDelegate, and it loads that file via the calling
> threads's context class loader. Since the calling thread is an
> application's thread, its class loader is the application's class loader,
> so META-INF/services/javax.ws.rs.ext.RuntimeDelegate points to a Jersey
> 1.17 class.
> I can kind-of workaround the problem by setting the application thread to
> an "empty" class loader before calling the service - i.e.:
> ClassLoader saveCL = Thread.currentThread().getContextClassLoader();
> ClassLoader myCL = new URLClassLoader(new URL[0], saveCL.getParent());
> try {
>   Thread.currentThread().setContextClassLoader(myCL);
>   call OSGi service
> } finally {
>   Thrad.currentThread().setContextClassloader(saveCL);
> }
>
> However, I'm surprised I have to do that. Shouldn't the framework take
> care of this - even if the service caller is the embedded application
> rather than another OSGi bundle?
> Notice: This issue may or may not be related to  commons-logging and Axis
> problems
> Thank you in advance,Alessandro
>
> |
> |
> |
> |   ||
>
>|
>
>   |
> |
> |   |
> commons-logging and Axis problems
>|   |
>
>   |
>
>   |
>
>
>
>


-- 
*Raymond Augé* 
 (@rotty3000)
Senior Software Architect *Liferay, Inc.* 
 (@Liferay)
Board Member & EEG Co-Chair, OSGi Alliance  (@OSGiAlliance)


Re: DM4 service factory/multiple service instance support

2016-08-24 Thread Raymond Auge
I'm fairly certain that DM supports publishing services of any type and
doesn't care about scoping, including implementations of
PrototypeServiceFactory.

Mdu, your service simply needs to implement PrototypeServiceFactory and you
should be able to use the DM's imperative API as usual.

But any other DM experts may correct me if this is wrong.

- Ray

On Wed, Aug 24, 2016 at 3:13 PM, mduduzik  wrote:

> Ray/David,
> Thanks for your prompt responses. I would like to accomplish this using
> API/Activator approach in DM4 (Felix Dependency Manager 4). Here's the
> context within which I would like to do this:
>
> public class Activator extends DependencyActivatorBase {
> @Override
> public void init(BundleContext ctx, DependencyManager dm) throws
> Exception
> {
> }
> }
>
> So in other words, a non-Annotation based approach. I hope my request is
> clearer.
>
> Regards.
> -Mdu
>
>
>
> --
> View this message in context: http://apache-felix.18485.x6.
> nabble.com/DM4-service-factory-multiple-service-instance-support-
> tp5018226p5018230.html
> Sent from the Apache Felix - Users mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
> For additional commands, e-mail: users-h...@felix.apache.org
>
>


-- 
*Raymond Augé* 
 (@rotty3000)
Senior Software Architect *Liferay, Inc.* 
 (@Liferay)
Board Member & EEG Co-Chair, OSGi Alliance  (@OSGiAlliance)


Re: DM4 service factory/multiple service instance support

2016-08-24 Thread Raymond Auge
On Wed, Aug 24, 2016 at 2:17 PM, mduduzik  wrote:

> I would like to create and new instance of component for every service
> request. I believe by default a component is a singleton - i.e. the same
> instance will be returned for every service consumer request. In DS/SCR,
> this is accomplished by using a factory property in @Component declaration.
>

Correction! That is done by using the prototype scope [1][2].

To do this outside of DS use a PrototypeServiceFactory [3]

Sincerely,
- Ray

[1]
https://osgi.org/javadoc/r6/cmpn/org/osgi/service/component/annotations/Component.html#scope()
[2]
https://osgi.org/javadoc/r6/cmpn/org/osgi/service/component/annotations/ServiceScope.html#PROTOTYPE
[3]
https://osgi.org/javadoc/r6/core/org/osgi/framework/PrototypeServiceFactory.html



> Thanks.
> -Mdu
>
>
>
>
> --
> View this message in context: http://apache-felix.18485.x6.
> nabble.com/DM4-service-factory-multiple-service-
> instance-support-tp5018226.html
> Sent from the Apache Felix - Users mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
> For additional commands, e-mail: users-h...@felix.apache.org
>
>


-- 
*Raymond Augé* 
 (@rotty3000)
Senior Software Architect *Liferay, Inc.* 
 (@Liferay)
Board Member & EEG Co-Chair, OSGi Alliance  (@OSGiAlliance)


Re: Cannot use configuration pid ... for bundle XX because it belongs to bundle YY

2016-08-10 Thread Raymond Auge
Carsten, are you sure about null and not the literal string "?"

- Ray

On Wed, Aug 10, 2016 at 9:57 AM, Carsten Ziegeler 
wrote:

> > Did not find any annotation in those components, they actually get
> configured using the ConfigurationAdmin.
> >
> > Error:
> >  > pid=com.kuka.authorizationService.component
> for bundle 7 because it belongs to bundle 77>
> >
> > OSGI-LIB\*.xml:
> > http://www.osgi.org/xmlns/scr/v1.1.0;
> activate="activate" configuration-policy="require" deactivate="deactivate"
> immediate="true" name="com.kuka.authorizationService.component">
> >
> >
> >   
> >
> > >   bind="setServiceRegistry"
> >   cardinality="1..1"
> >   interface="comIServiceRegistry"
> >   name="IServiceRegistry"
> >   configuration-policy="require"
> >   policy="static"/>
> > 
> >
> > The component itself that has no annotations at all:
> > [...]
> > import com.IServiceRegistry;
> >
> > /**
> >  * The OSGI component for the {@link AuthorizationService}.
> >  */
> > public class AuthorizationServiceComponent implements
> IAuthorizationOsgiService
> > [...]
> >
> > The main bundle activator does the following regarding this component:
> > Dictionary properties = new Hashtable();
> > properties.put("userRolesFile", "someFileSystemPath");
> > properties.put("userCredentialsFile", "someFileSystemPath");
> > configAdmin.getConfiguration("com.kuka.authorizationService.
> component").update(properties);
>
> This is exactly your problem :) With this you bind the configuration to
> the bundle executing this code and then DS can't use it anymore. Change
> it to use the two argument getConfiguration method and pass null as the
> second argument (location).
>
> Regards
> Carsten
> >
> > Interesting that all bundles that are configured like this end in such
> an error.
> > The application I try to wrap was built in equinox and starts there
> without issues.
> >
> >
> >
> > -Original Message-
> > From: Benson Margulies [mailto:ben...@basistech.com]
> > Sent: Mittwoch, 10. August 2016 12:46
> > To: users@felix.apache.org
> > Subject: Re: Cannot use configuration pid ... for bundle XX because it
> belongs to bundle YY
> >
> > In my experience, it means that you have annotated two different classes
> with @Component and specified the same configurationPid. You can't do that;
> if you need to share a configuration between DS components, you have to
> inject the ConfigurationAdmin service instead of using the @Component
> annotation.
> >
> > On Wed, Aug 10, 2016 at 3:32 AM, Remo Liechti  >
> > wrote:
> >
> >> Hi guys
> >>
> >> During starting of bundles I get the following message:
> >>
> >>  >> pid=com.kuka.configuration.manager for bundle 17 because it belongs to
> >> bundle 7>
> >>
> >> What does this actually mean? I have not found good information with
> >> uncle sams google.
> >> What I do, is the following:
> >> - Wrap an osgi application into a j2ee web application (war file)
> >> - Using Felix on Weblogic: https://docs.oracle.com/
> >> middleware/1212/wls/WLPRG/osgi.htm
> >> - My main bundle activator is called, using a servlet I start all
> >> other bundles manually
> >>
> >>
> >> @Resource(lookup = "java:app/osgi/Bundle") Bundle bundle;
> >>
> >> BundleContext bc = bundle.getBundleContext(); for (Bundle b :
> >> bc.getBundles()) { [] b.start(); [...] }
> >>
> >> Thanks,
> >> Remo
> >>
> >>
> >> This message may contain legally privileged or confidential
> >> information and is therefore addressed to the named persons only. The
> >> recipient should inform the sender and delete this message, if he/she
> >> is not named as addressee. The sender disclaims any and all liability
> >> for the integrity and punctuality of this message. The sender has
> >> activated an automatic virus scanning, but does not guarantee the
> >> virus free transmission of this message.
> >>
> >> -
> >> To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
> >> For additional commands, e-mail: users-h...@felix.apache.org
> >>
> >>
> > This message may contain legally privileged or confidential information
> and is therefore addressed to the named persons only. The recipient should
> inform the sender and delete this message, if he/she is not named as
> addressee. The sender disclaims any and all liability for the integrity and
> punctuality of this message. The sender has activated an automatic virus
> scanning, but does not guarantee the virus free transmission of this
> message.
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
> > For additional commands, e-mail: users-h...@felix.apache.org
> >
>
>
>
>
> --
> Carsten Ziegeler
> Adobe Research Switzerland
> cziege...@apache.org
>
>
> 

[resolver] fragments use case

2016-07-21 Thread Raymond Auge
Hey everyone,

I've observed in bndtools that if a fragment contributes a capability to
it's host, the resolve result will contain the host but not the fragment
causing runtime resolution to fail.

This is perfectly acceptable during runtime, but not during deploy time
where I need to identify all the required artifacts.

I've filled an issue on bnd here:
https://github.com/bndtools/bnd/issues/1559

But I'm suspecting that the resolver has at least something to do with it.
I'm not claiming this is a bug but a limitation of the resolver API.

Would there be a way to ask the resolver to include the fragments that were
used to produce the result?

Thoughts?
-- 
*Raymond Augé* 
 (@rotty3000)
Senior Software Architect *Liferay, Inc.* 
 (@Liferay)
Board Member & EEG Co-Chair, OSGi Alliance  (@OSGiAlliance)


Re: Same private service in different bundles

2016-06-17 Thread Raymond Auge
Vincent, what is the mechanism you are using to get the service?

If you can use a service filter, then you can easily filter on the bundle
id of the service. Bundle id is a required property of services.

It's simple to do this using a service tracker, but not simple with DS (DS
doesn't have a mechanism to let your write a target filter using local
bundle information as criteria, if so the solution would have been trivial).

So, each of the bundles could start a service tracker which merely filters
on their own bundle id.

- Ray

On Fri, Jun 17, 2016 at 8:58 AM, Clement Escoffier <
clement.escoff...@gmail.com> wrote:

> Hi,
>
> You may be able to achieve what you want with a composites:
>
> http://felix.apache.org/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-gettingstarted/ipojo-composition-tutorial.html
> <
> http://felix.apache.org/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-gettingstarted/ipojo-composition-tutorial.html
> >
>
> http://felix.apache.org/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-userguide/ipojo-advanced-topics/ipojo-hierarchical-composition-overview.html
> <
> http://felix.apache.org/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-userguide/ipojo-advanced-topics/ipojo-hierarchical-composition-overview.html
> >
>
>
> Regards,
>
> Clement
>
> > On 17 juin 2016, at 12:27, Vincent Vandemeulebrouck <
> vincent.vandemeulebro...@ullink.com> wrote:
> >
> > I need two different bundles to have the same private iPojo service, to
> be
> > used internally. It is defined in a shared library, included in both
> bundle.
> >
> > How can I enforce that the requiring service get the service from their
> own
> > bundle?
> >
> > Currently, as each bundle has the same service and same specifications, I
> > end-up having the private service from the other bundle injected, causing
> > some illegal accesses.
> >
> > Bundles are implemented in java. The issue is that each bundle has its
> own
> > ClassLoader, and injecting the class from the othe ClassLoader causes a
> > ClassCastException.
> >
> >
> > *--Vincent Vandemeulebrouck | *Architect - UL MIDDLE and Extensions *|
> > ULLINK | *D: +33 1 44 50 52 02* | *T: +33 1 49 95 30 00* | *23-25 rue de
> > Provence, 75009 Paris, FRANCE *|* vincent.vandemeulebro...@ullink.com
> *| *
> >
> > --
> > *The information contained in or attached to this email is strictly
> > confidential. If you are not the intended recipient, please notify us
> > immediately by telephone and return the message to us.*
>
>


-- 
*Raymond Augé* 
 (@rotty3000)
Senior Software Architect *Liferay, Inc.* 
 (@Liferay)
Board Member & EEG Co-Chair, OSGi Alliance  (@OSGiAlliance)


Re: Get a list of paths of registered servlets

2016-06-01 Thread Raymond Auge
Also, the runtime API DOES include information about the legacy HttpService
registrations, the service id numbering increments downward from -1
indicating they aren't real services.

that's the only difference.

- Ray

On Wed, Jun 1, 2016 at 5:40 PM, Neil Bartlett <njbartl...@gmail.com> wrote:

> Well, you CAN atomically find out whether the name you want to register is
> already registered: just try to do it, and catch the NamespaceException.
>
> Neil
>
>
> > On 1 Jun 2016, at 22:37, Marcel Offermans <marcel.offerm...@luminis.nl>
> wrote:
> >
> > That only helps him if he uses the whiteboard API. If he directly talks
> to HttpService it probably won’t work.
> >
> > Another problem is that you probably can’t do this as an atomic
> operation so after you’ve checked, someone else can still beat you to it.
> >
> > That said I don’t have a great solution to your problem beyond keeping
> track of this yourself and delegating the registration of the servlets to a
> service you design (which can then atomically do such a check). Again, that
> only works if everything then goes through your service.
> >
> > Greetings, Marcel
> >
> > On 1 June 2016 at 22:56:01, Raymond Auge (raymond.a...@liferay.com)
> wrote:
> >
> > The Http Whiteboard API contains a runtime introspection API which
> returns
> > DTOs of what's registered.
> >
> > look for a service registered under interface:
> >
> > org.osgi.service.http.runtime.HttpServiceRuntime
> >
> >
> > - Ray
> >
> > On Wed, Jun 1, 2016 at 4:24 PM, David Daniel <
> david.daniel.1...@gmail.com>
> > wrote:
> >
> >> Is it possible to find out what servlets have been registered with the
> >> httpservice. I am dynamically registering servlets and want to verify
> that
> >> a servlet has not already been registered with the same path. Is there a
> >> way to query the httpservice for all servlet paths that are registered,
> >> should I be keeping that information elsewhere or is there a tracker of
> >> some sort.
> >>
> >> Thanks for any help,
> >> David
> >>
> >
> >
> >
> > --
> > *Raymond Augé* <http://www.liferay.com/web/raymond.auge/profile>
> > (@rotty3000)
> > Senior Software Architect *Liferay, Inc.* <http://www.liferay.com>
> > (@Liferay)
> > Board Member & EEG Co-Chair, OSGi Alliance <http://osgi.org>
> (@OSGiAlliance)
>
>


-- 
*Raymond Augé* <http://www.liferay.com/web/raymond.auge/profile>
 (@rotty3000)
Senior Software Architect *Liferay, Inc.* <http://www.liferay.com>
 (@Liferay)
Board Member & EEG Co-Chair, OSGi Alliance <http://osgi.org> (@OSGiAlliance)


Re: Get a list of paths of registered servlets

2016-06-01 Thread Raymond Auge
On Wed, Jun 1, 2016 at 5:43 PM, Raymond Auge <raymond.a...@liferay.com>
wrote:

> increments downward from -1
>

decrementing from -1


Re: Get a list of paths of registered servlets

2016-06-01 Thread Raymond Auge
The Http Whiteboard API contains a runtime introspection API which returns
DTOs of what's registered.

look for a service registered under interface:

org.osgi.service.http.runtime.HttpServiceRuntime


- Ray

On Wed, Jun 1, 2016 at 4:24 PM, David Daniel 
wrote:

> Is it possible to find out what servlets have been registered with the
> httpservice.  I am dynamically registering servlets and want to verify that
> a servlet has not already been registered with the same path.  Is there a
> way to query the httpservice for all servlet paths that are registered,
> should I be keeping that information elsewhere or is there a tracker of
> some sort.
>
> Thanks for any help,
>   David
>



-- 
*Raymond Augé* 
 (@rotty3000)
Senior Software Architect *Liferay, Inc.* 
 (@Liferay)
Board Member & EEG Co-Chair, OSGi Alliance  (@OSGiAlliance)


Re: Where can I find the default implementation of httpcontext

2016-05-31 Thread Raymond Auge
I believe in the latest felix http impl Carsten added a feature to be able
to target legacy contexts using DS via http whiteboard.

However, you need to know the name of this legacy context
and I'm not sure how you do that in the felix impl.

@Carsten?

- Ray

On Tue, May 31, 2016 at 4:11 PM, David Daniel <david.daniel.1...@gmail.com>
wrote:

> I am using whiteboard to register my servlets but i also use the jaxrs
> connector https://github.com/hstaudacher/osgi-jax-rs-connector.  My custom
> filter is called on rest calls but I do not seem to be getting the correct
> context.  I am not sure if it is similar to
> https://github.com/hstaudacher/osgi-jax-rs-connector/issues/99  or not.  I
> can see how to set the context for the connector by implementing this class
>
> https://github.com/hstaudacher/osgi-jax-rs-connector/blob/master/bundles/com.eclipsesource.jaxrs.publisher/src/com/eclipsesource/jaxrs/publisher/ServletConfiguration.java
> but I do not know how to get an already created context from the
> httpservice.  I do know how to set the context for a given path using
> declarative services though.  My thinking was that I could just create a
> class based off the default context and set it in declarative services and
> return it in the ServletConfiguration.  It seems kinda hacky to me but I
> couldn't think of a better way.  Am I on the wrong track.
>
> On Tue, May 31, 2016 at 3:50 PM, Raymond Auge <raymond.a...@liferay.com>
> wrote:
>
> > You may want to consider moving to Http Whiteboard. It's much more
> flexible
> > particularly around context.
> >
> > - Ray
> >
> > On Tue, May 31, 2016 at 3:04 PM, David Daniel <
> david.daniel.1...@gmail.com
> > >
> > wrote:
> >
> > > I'm ok.  I think I found it.
> > >
> > >
> > >
> >
> https://github.com/apache/felix/blob/trunk/http/whiteboard/src/main/java/org/apache/felix/http/whiteboard/internal/manager/DefaultHttpContext.java
> > >
> > > On Tue, May 31, 2016 at 2:44 PM, David Daniel <
> > david.daniel.1...@gmail.com
> > > >
> > > wrote:
> > >
> > > > When no implementation of httpcontext is passed in to felix what is
> the
> > > > default implementation used.  Where can I find this code in source
> > > > control.
> > > >
> > > > Thanks for any help,
> > > >   David
> > > >
> > >
> >
> >
> >
> > --
> > *Raymond Augé* <http://www.liferay.com/web/raymond.auge/profile>
> >  (@rotty3000)
> > Senior Software Architect *Liferay, Inc.* <http://www.liferay.com>
> >  (@Liferay)
> > Board Member & EEG Co-Chair, OSGi Alliance <http://osgi.org>
> > (@OSGiAlliance)
> >
>



-- 
*Raymond Augé* <http://www.liferay.com/web/raymond.auge/profile>
 (@rotty3000)
Senior Software Architect *Liferay, Inc.* <http://www.liferay.com>
 (@Liferay)
Board Member & EEG Co-Chair, OSGi Alliance <http://osgi.org> (@OSGiAlliance)


Re: Where can I find the default implementation of httpcontext

2016-05-31 Thread Raymond Auge
You may want to consider moving to Http Whiteboard. It's much more flexible
particularly around context.

- Ray

On Tue, May 31, 2016 at 3:04 PM, David Daniel 
wrote:

> I'm ok.  I think I found it.
>
>
> https://github.com/apache/felix/blob/trunk/http/whiteboard/src/main/java/org/apache/felix/http/whiteboard/internal/manager/DefaultHttpContext.java
>
> On Tue, May 31, 2016 at 2:44 PM, David Daniel  >
> wrote:
>
> > When no implementation of httpcontext is passed in to felix what is the
> > default implementation used.  Where can I find this code in source
> > control.
> >
> > Thanks for any help,
> >   David
> >
>



-- 
*Raymond Augé* 
 (@rotty3000)
Senior Software Architect *Liferay, Inc.* 
 (@Liferay)
Board Member & EEG Co-Chair, OSGi Alliance  (@OSGiAlliance)


Re: may have found a resolver bug

2016-05-26 Thread Raymond Auge
https://issues.apache.org/jira/browse/FELIX-5263

On Thu, May 26, 2016 at 8:48 AM, Raymond Auge <raymond.a...@liferay.com>
wrote:

> I didn't because I wasn't sure it was even a real issue.
>
> but I can if you like.
>
> On Thu, May 26, 2016 at 8:06 AM, Richard S. Hall <he...@ungoverned.org>
> wrote:
>
>> Did you open an issue in JIRA?
>>
>>
>> On 5/25/16 23:21 , Raymond Auge wrote:
>>
>>> Hello everyone,
>>>
>>> I'm not completely sure, but I think I have found a bug in the felix
>>> resolver.
>>>
>>> It's a little hard to reproduce, but I have done so in a test I've
>>> submitted in this PR [1] to bnd (because I was trying to use the resolver
>>> through bndlib and so it was far simpler to reproduce there).
>>>
>>> You'll note that the travis failure is actually the test reproducing the
>>> exact failure scenario.
>>>
>>> The problem "seems" to stem from a scenario where a set of duplicated
>>> resources results in miss handling of a capability index (I speculate
>>> during the second iteration of the duplicated resource).
>>>
>>> The issue is in resolver code that is far more complex than I have a
>>> stomach for, but I would appreciate if someone could take a look at it.
>>>
>>> Sincerely,
>>> - Ray
>>>
>>> [1] https://github.com/bndtools/bnd/pull/1472
>>>
>>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
>> For additional commands, e-mail: users-h...@felix.apache.org
>>
>>
>
>
> --
> *Raymond Augé* <http://www.liferay.com/web/raymond.auge/profile>
>  (@rotty3000)
> Senior Software Architect *Liferay, Inc.* <http://www.liferay.com>
>  (@Liferay)
> Board Member & EEG Co-Chair, OSGi Alliance <http://osgi.org>
> (@OSGiAlliance)
>



-- 
*Raymond Augé* <http://www.liferay.com/web/raymond.auge/profile>
 (@rotty3000)
Senior Software Architect *Liferay, Inc.* <http://www.liferay.com>
 (@Liferay)
Board Member & EEG Co-Chair, OSGi Alliance <http://osgi.org> (@OSGiAlliance)


Re: may have found a resolver bug

2016-05-26 Thread Raymond Auge
I didn't because I wasn't sure it was even a real issue.

but I can if you like.

On Thu, May 26, 2016 at 8:06 AM, Richard S. Hall <he...@ungoverned.org>
wrote:

> Did you open an issue in JIRA?
>
>
> On 5/25/16 23:21 , Raymond Auge wrote:
>
>> Hello everyone,
>>
>> I'm not completely sure, but I think I have found a bug in the felix
>> resolver.
>>
>> It's a little hard to reproduce, but I have done so in a test I've
>> submitted in this PR [1] to bnd (because I was trying to use the resolver
>> through bndlib and so it was far simpler to reproduce there).
>>
>> You'll note that the travis failure is actually the test reproducing the
>> exact failure scenario.
>>
>> The problem "seems" to stem from a scenario where a set of duplicated
>> resources results in miss handling of a capability index (I speculate
>> during the second iteration of the duplicated resource).
>>
>> The issue is in resolver code that is far more complex than I have a
>> stomach for, but I would appreciate if someone could take a look at it.
>>
>> Sincerely,
>> - Ray
>>
>> [1] https://github.com/bndtools/bnd/pull/1472
>>
>>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
> For additional commands, e-mail: users-h...@felix.apache.org
>
>


-- 
*Raymond Augé* <http://www.liferay.com/web/raymond.auge/profile>
 (@rotty3000)
Senior Software Architect *Liferay, Inc.* <http://www.liferay.com>
 (@Liferay)
Board Member & EEG Co-Chair, OSGi Alliance <http://osgi.org> (@OSGiAlliance)


may have found a resolver bug

2016-05-25 Thread Raymond Auge
Hello everyone,

I'm not completely sure, but I think I have found a bug in the felix
resolver.

It's a little hard to reproduce, but I have done so in a test I've
submitted in this PR [1] to bnd (because I was trying to use the resolver
through bndlib and so it was far simpler to reproduce there).

You'll note that the travis failure is actually the test reproducing the
exact failure scenario.

The problem "seems" to stem from a scenario where a set of duplicated
resources results in miss handling of a capability index (I speculate
during the second iteration of the duplicated resource).

The issue is in resolver code that is far more complex than I have a
stomach for, but I would appreciate if someone could take a look at it.

Sincerely,
- Ray

[1] https://github.com/bndtools/bnd/pull/1472


  1   2   >