Re: Felix Log Service version 1.2.0 cannot be referenced
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 >
AW: GoGo Shell not accessible
Is there anything I could test? I am quite lost, as I do not have a clue what's causing this or where to start to find the cause.. Thanks. -Ursprüngliche Nachricht- Von: Derek Baum Im Auftrag von Derek Baum Gesendet: Freitag, 13. Juli 2018 18:11 An: users@felix.apache.org Betreff: Re: GoGo Shell not accessible Hi Philipp, Can you tell me which versions of the gogo bundles you are using? and whether you are using org.apache.felix.gogo.jline or org.apache.felix.gogo.shell? Also, how do you invoke the framework? e.g. from command line? from IDE? (which one?) The output looks very like gogo has a closed standard input stream, although I can't replicate the output you get by doing this on purpose. -- Derek > On 13 Jul 2018, at 09:40, Philipp Höfler wrote: > > Sorry for double posting, but it seems, that my first email was not working? > At least in mail-archive the thread is not accessible for some reason > (https://www.mail-archive.com/users@felix.apache.org/msg18161.html) > > Starting some days ago, the GoGo shell is gone crazy and prints something > like this: > INFORMATION: Setting the server's publish address to be / > 13:04:30.451 [main] DEBUG > org.apache.aries.jax.rs.whiteboard.internal.Whiteboard - Registered endpoint > > g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! > g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! > g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! > g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! > g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! > g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! > g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! > g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! > g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! > g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! > g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! g! > g! g! g! g! g! g! g! g! g! g! g! > > g! is printed until I quit the application. > I am pressing enter one time, after the application has started to bring up > the GoGo shell. > Any ideas, how I can make it work again? I haven't changed the project > structure or configuration knowingly. So, I don't know what's causing this. > > Best, > 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
Felix Log Service version 1.2.0 cannot be referenced
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
AW: Configurator R7 example
May I ask you again for help. I am still stuck at the multi-tenant implementation. As described in my last mail, I have slightly modified your suggestion. I was busy the last couple of days. For some reason, when I try to build the project including a reference to the Map> I am getting the following error: [ERROR] Failed to execute goal biz.aQute.bnd:bnd-export-maven-plugin:4.1.0-SNAPSHOT:export (default) on project my-app: Unable to resolve <>: missing requirement osgi.identity;filter:='(osgi.identity=com.my.app.rest-service)' [caused by: Unable to resolve com.my.app.rest-service version=1.0.0.201808010851: missing requirement osgi.service;filter:='(objectClass=java.util.Map)';effective:='active'] -> [Help 1] Again, you can find the project on GitHub https://github.com/phhoef/osgi-test/blob/master/rest-service/src/main/java/com/my/app/rest/rest/ServerInfoControllerImpl.java Thanks -Ursprüngliche Nachricht- Von: Raymond Auge Gesendet: Dienstag, 17. Juli 2018 16:43 An: felix users Betreff: Re: Configurator R7 example 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.ja > va 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 "rou