Re: Recommanded way to use an XML parser in OSGi ?

2018-03-27 Thread Tim Ward
Given that we’re now resorting to class loader trickery as a workaround, wouldn’t it actually make more sense to use the specification which solves this properly? The object in question is already a DS component, so requiring a service is about as low effort as possible, and there must be a

Re: Recommanded way to use an XML parser in OSGi ?

2018-03-27 Thread Tim Ward
The recommendation would almost certainly be to use the XML Parser Service. You can see it in the spec at https://osgi.org/specification/osgi.cmpn/7.0.0/util.xml.html - note that this spec is pretty old, so all the examples use the

Re: Regarding Configuration Types

2018-02-26 Thread Tim Ward
Scott, Those two issues are actually different things. The first one is to do with the defaulting of configuration, the second is to do with how File Install interprets property values with trailing spaces. As for why you don’t get the default - your configuration explicitly contains a

Re: Bundle start is an asynchronous call

2018-01-31 Thread Tim Ward
You must never write code like this in OSGi. It is a serious error to assume that a service will be available immediately after a bundle has started, you must always listen for the service becoming available (which may happen a long time in the future). I’m not sure what it is that you’re

Re: Why does Karaf say this is a uses constraint?

2018-01-29 Thread Tim Ward
The JClouds API sucks for this reason. They always return/receive a guava collection type rather than just using guava to generate the collections. It’s a leaky abstraction nightmare! Tim Sent from my iPhone > On 29 Jan 2018, at 15:58, Ryan Moquin wrote: > >

Re: Transaction Control

2018-01-18 Thread Tim Ward
Hi Scott, Those are the two bundles that you need. At a guess Karaf is unhappy because the Aries bundles substitutably export the API packages that they need (including config admin) for ease of deployment. When installing bundles Karaf sometimes attempts some interesting package rewiring

Re: [osgi-dev] Create instance of factory configuration at runtime

2017-12-18 Thread Tim Ward
ional questions for anybody who cares to answer. > > 1) If “?” isn’t used, what would the location argument look like? Is it > like a bundle symbolic id, with wildcards perhaps? It’s unclear to me how > this would be used even if you wanted to. > 2) Now for a Karaf

Re: Recommended CDI tool, Blueprint / DS / Dependency Management / Low level API?

2017-12-18 Thread Tim Ward
ainers in different bundles and know that those bundles will still work together - the way that they are wired together internally is hidden. Regards, Tim Ward OSGi IoT EG chair tim.w...@paremus.com <mailto:tim.w...@paremus.com> > On 18 Dec 2017, at 06:56, Jean-Baptiste Onofré <j...@nanthra

Re: Adding an @Activate to a DS bundle causes the bundle not to load

2017-12-04 Thread Tim Ward
My educated guess... By adding the activate method you have increased the required version of DS detected by bnd. This, in turn, has probably added a Require-Capability for the service that you import. This has no effect at runtime (due to the value of its effective directive) but if the

Re: Writing commands for karaf shell.

2017-07-22 Thread Tim Ward
Sorry to wind this back a little, but there were a couple of questions from Tom which got skipped over. I'm afraid that when it comes to shells there isn't a standard. There was an RFC created a long time ago, which roughly represented the work that is now Gogo. There was a decision at the

Re: Pax-JDBC 1.1 hikari pool and XA Support

2017-07-10 Thread Tim Ward
Another option would be to look at Apache Aries Transaction control. That provides a simple, effective model for connection pooling, resource lifecycle management, and transaction enlistment. It will also be the reference implementation of the OSGi Transaction Control specification when OSGi R7

Re: java.lang.ClassNotFoundException: org.h2.Driver from bundle ..

2017-07-01 Thread Tim Ward
That would be Karaf complaining that there is no H2 bundle installed into the runtime. You will need to include it in a feature somewhere. For reference you can configure a DBCP pool like this, passing in a DataSource:

Re: java.lang.ClassNotFoundException: org.h2.Driver from bundle ..

2017-07-01 Thread Tim Ward
Hi, The org.osgi.service.jdbc.DataSourceFactory service is an OSGi standard, not part of Karaf (hence the org.osgi package name). You can find the specification chapter in the OSGi compendium. If you look at the H2 bundle you'll also see that H2 actually implements this standard directly.

Re: java.lang.ClassNotFoundException: org.h2.Driver from bundle ..

2017-07-01 Thread Tim Ward
The correct way to obtain instances of JDBC reources is using a org.osgi.service.jdbc.DataSourceFactory service. This decouples you from a specific JDBC driver and allows you to pick an appropriate implementation at runtime. You can inject instances of this service using DS, Blueprint, or get

Re: missing requirement osgi.contract=JavaServlet

2017-06-12 Thread Tim Ward
In answer to your question, yes PAX Web should be providing the contract. Tim Sent from my iPhone > On 12 Jun 2017, at 13:48, t...@quarendon.net wrote: > > OK, I've "solved" this by creating an additional bundle that simply has the > required: > > Provide-Capability:

Re: missing requirement osgi.contract=JavaServlet

2017-06-12 Thread Tim Ward
ckage is supposed to provide that? > And why do we now need another re-package package of the already available > servlet api package? > > That's one of those moments I really can see why people say OSGi makes > everything far to complex ... > > regards, Achim &

Re: missing requirement osgi.contract=JavaServlet

2017-06-12 Thread Tim Ward
Requiring the JavaServlet contract is a good idea, and recommended by the OSGi Alliance (https://www.osgi.org/portable-java-contract-definitions/). You need a bundle which provides the contract in your runtime. I'd suggest using the repackaged servlet api from Apache Felix. Tim Sent from my

Re: PAX JDBC 1.0.1 pools

2017-02-24 Thread Tim Ward
Hi Scott, The OSGi Transaction Control service has built in support for connection pooling. There's an en route example here: https://github.com/osgi/osgi.enroute.examples.jdbc Regards, Tim Sent from my iPhone > On 24 Feb 2017, at 16:12, Leschke, Scott wrote: > > I’m

Re: DS components not Active

2017-02-03 Thread Tim Ward
I disagree with the earlier statement that Blueprint and DS cannot coexist in the same bundle. I have thought quite hard about this and can think of no reason whatsoever why it should not work. Tim Sent from my iPhone > On 3 Feb 2017, at 15:28, Christian Schneider

Re: DS components not Active

2017-02-03 Thread Tim Ward
That sounds like a bug in blueprint then, unless there's a filter on the blueprint reference which prevents it from picking the reconfigured service it should definitely re-wire. Tim Sent from my iPhone > On 3 Feb 2017, at 13:42, Alex Soto wrote: > > Yes, I hear you,

Re: Karaf-4.0.7/8 - ResolutionException for existing Aries TransactionControl Service.

2016-12-30 Thread Tim Ward
David is right, there is a bug in the packaging of the Aries local transaction control service implementation. You should just be able to use the XA implementation (which also supports local transactions) instead, or you can wait for a fix in the snapshots, which will likely appear in the new

Re: Configuration file handling?

2016-11-28 Thread Tim Ward
On 28/11/2016 15:14, Christian Schneider wrote: On 28.11.2016 15:14, Tim Ward wrote: Thanks - replies inline: On 28/11/2016 13:50, Christian Schneider wrote: You already found the confiFile option for features. This is the most widely used option. So what is the "URL" in th

Re: Configuration file handling?

2016-11-28 Thread Tim Ward
ere, and tells the user in big red letters that they've got some manual merging to do? Do such scripts, or frameworks for writing them, exist, to save wheel-reinventing, as this must be a common question? Christian On 28.11.2016 14:05, Tim Ward wrote: I'm trying to work out how to handle confi

Re: Beginner's question - Jetty configuration

2016-11-18 Thread Tim Ward
744 | osgi.enroute.configurer.simple.provider 887 | Active | 80 | 1.5.100.v20140428-1446 | Supplemental Equinox Functionality 888 | Active | 80 | 1.4.8 | Apache Felix EventAdmin The two with com.telensa.* are my code. On 18/11/2016 15:58, Tim Ward wrote: On 18/11/2016 15:49, Achim Nierbeck wr

Re: Beginner's question - Jetty configuration

2016-11-18 Thread Tim Ward
alled. As per http://enroute.osgi.org/appnotes/bndtools-and-karaf.html plus the stuff I've written myself. regards, Achim 2016-11-18 16:43 GMT+01:00 Tim Ward <t...@telensa.com <mailto:t...@telensa.com>>: On 18/11/2016 15:41, Achim Nierbeck wrote: I'm not sure whic

Re: Beginner's question - Jetty configuration

2016-11-18 Thread Tim Ward
got a servlet to run. How could it be much more "vanilla" than that? I fear with all those tryings of you to somehow configure the server, it's not possible to help via mailinglist ... regards, Achim -- Tim Ward

Re: Beginner's question - Jetty configuration

2016-11-18 Thread Tim Ward
ds, Achim 2016-11-18 16:25 GMT+01:00 Tim Ward <t...@telensa.com <mailto:t...@telensa.com>>: Ah, thank you. (1) That wasn't clear from any documentation I found. (2) I would have hoped to get an error message in the log if I'd coded it wrongl

Re: Beginner's question - Jetty configuration

2016-11-18 Thread Tim Ward
if nothing else is configured. Usually you also find a log message in the logs, telling where it tries to log to: NCSARequestlogging is using the following directory: regards, Achim 2016-11-18 16:25 GMT+01:00 Tim Ward <t...@telensa.com <mailto:t...@telensa.com>>: A

Re: Beginner's question - Jetty configuration

2016-11-18 Thread Tim Ward
need to set the following org.ops4j.pax.web.log.ncsa.directory=c:/karaf/access/ regards, Achim 2016-11-18 16:00 GMT+01:00 Tim Ward <t...@telensa.com <mailto:t...@telensa.com>>: Yes, I've tried various versions of those things, and they don't work for me. I'v

Re: Beginner's question - Jetty configuration

2016-11-18 Thread Tim Ward
#L405-L437 [3] - https://github.com/ops4j/org.ops4j.pax.web/blob/master/pax-web-runtime/src/main/resources/OSGI-INF/metatype/metatype.xml 2016-11-18 15:43 GMT+01:00 Tim Ward <t...@telensa.com <mailto:t...@telensa.com>>: On 18/11/2016 14:28, Achim Nierbeck wrote: Oh and

Re: Beginner's question - Jetty configuration

2016-11-18 Thread Tim Ward
On 18/11/2016 14:28, Achim Nierbeck wrote: Oh and one more thing, which might be different. Per default, jetty doesn't listen on port 8181 unless there is at least one application capable of listening to it. It's been a feature request in the past. I'm sorry, I don't understand that. I have

Re: Beginner's question - Jetty configuration

2016-11-18 Thread Tim Ward
On 18/11/2016 14:27, Achim Nierbeck wrote: Hi Tim, as JB already said, that's part of the configuration. For more details on how to use Pax-Web can be found here [1]. I tried that, setting some of the |org.ops4j.pax.web.log.ncsa.*| properties, it didn't work. *Exactly* what properties do I

Beginner's question - Jetty configuration

2016-11-18 Thread Tim Ward
, but that didn't work. It didn't work doing the same via configuration.json either. I haven't really found any actual *documentation* of any of the above, just snippets of example code, so all my attempts were probably wrong anyway.) -- Tim Ward

Re: SCR Reference annotation on field

2016-08-24 Thread Tim Ward
of org.osgi.compendium in any of the public Maven >> repositories. >> Do you know of a public Maven repository where I can get the artifact? >> >> Best regards, >> Alex soto >> >> >> >>> On Aug 23, 2016, at 6:32 PM, Tim Ward <tim.w..

Re: SCR Reference annotation on field

2016-08-23 Thread Tim Ward
This is absolutely correct. The "Release 6" version of declarative services supports field injection. The "Release 5" version that you are depending on does not! Regards, Tim Sent from my iPhone > On 23 Aug 2016, at 22:43, Alex Soto wrote: > > Hello, > > I am new

Re: Aries JPA 2.3.0: mapping file not used

2016-08-17 Thread Tim Ward
The issue appears to be that Aries JPA has no code to handle the mapping files element of the persistence unit. As a result no mapping file names are passed to the JPA provider. I think this is an Aries issue. Tim Sent from my iPhone > On 17 Aug 2016, at 21:09, Christian Schneider

Re: RESTful web service in Karaf using CXF and blueprint

2016-08-15 Thread Tim Ward
If the services that you're looking to provide use JAX-RS the there is a specification proposal for OSGi R7 that you should look at. Prototyping work is starting in Apache Aries now. Tim Sent from my iPhone > On 15 Aug 2016, at 18:56, Scott Lewis wrote: > >> On

Re: Access control of OSGi Web app?

2016-08-01 Thread Tim Ward
This sounds a lot like what you can do with the security services from en Route. You can query for the user's full permission set so that parts of the UI can be disabled - obviously this is not a replacement for actually checking when the APIs are called! Tim Sent from my iPhone > On 1 Aug

Re: Removal of start levels from Karaf 4.0.2 onwards - transaction manager not available in time

2016-07-27 Thread Tim Ward
Hi Jochen, Sent from my iPhone > On 27 Jul 2016, at 07:47, jochenw wrote: > > Hi Tim, > > the transaction control service sounds interesting. I haven't found some > example or tutorial which shows how to used it with JPA. Do you know whether > something like

Re: Access control of OSGi Web app?

2016-07-26 Thread Tim Ward
://enroute.osgi.org) provided the original work which inspired the RFPs, and also provides some usable implementations. I hope this helps, Tim Ward IoT EG Chair, OSGi Alliance Sent from my iPhone > On 26 Jul 2016, at 07:29, Sigmund Lee <wua...@gmail.com> wrote: > > We are a website, using OSGi a

Re: Reasons that triggers IllegalStateException: Invalid BundleContext

2016-06-30 Thread Tim Ward
a BundleContext at all. Best Regards, Tim Ward OSGi Alliance IoT EG Chair > On 30 Jun 2016, at 15:57, Cristiano Costantini > <cristiano.costant...@gmail.com> wrote: > > Hello All, > > I'n our application it happen sometime to find in situations where we get the > "

Re: exported package in bundle A is not able to be imported in bundle B

2016-03-29 Thread Tim Ward
> >> You should investigate why this service is not present, or if it is, why >> bundle B has not wired to the same class space for package com.foo.bar as >> the service provider. >> >> Regards >> >> Tim Ward >> >> OSGi IoT EG Chair

Re: exported package in bundle A is not able to be imported in bundle B

2016-03-29 Thread Tim Ward
provider. Regards Tim Ward OSGi IoT EG Chair > On 28 Mar 2016, at 23:36, asookazian2 <asookaz...@gmail.com> wrote: > > Karaf 3.0.3 > > bundle B is in GracePeriod (and ultimately Failure) with dependency on > bundle A (which is active and has lower start-level than bu

Re: importing and exporting same package in same bundle

2016-03-29 Thread Tim Ward
red to one of the exported packages)! As with many things context is king - more information about what is in the package and how it is used is needed before a specific recommendation can be made for this bundle. Regards, Tim Ward OSGi IoT EG Chair > On 29 Mar 2016, at 09:25, CLEMENT Jean-Phil

<    1   2