Hi Achim,

This isn't particularly new, the original recommendation is at least three 
years old and was blogged about in 2014 
(http://blog.osgi.org/2014/09/portable-java-contracts-for-javax.html?m=1). 

The complexity comes from the fact that Java EE uses marketing versions for 
API, not semantic ones. My bundle using servlet 2.5 still needs to work with 
modern 3.x containers. The same is true of JPA, JAX-RS and a host of others.

The OSGi alliance cannot fix this problem at source, so had to come up with an 
alternative.

The bnd "contract" instruction makes it easy to require a contract, from there 
it's just a question of making sure you use a suitably packaged implementation.

Regards,

Tim

Sent from my iPhone

> On 12 Jun 2017, at 13:47, Achim Nierbeck <bcanh...@googlemail.com> wrote:
> 
> Ok ... that's new, and when did that happen? 
> Which package 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 
> 
> 
> 2017-06-12 14:43 GMT+02:00 Tim Ward <tim.w...@paremus.com>:
>> 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 iPhone
>> 
>>> On 12 Jun 2017, at 13:39, Achim Nierbeck <bcanh...@googlemail.com> wrote:
>>> 
>>> taken from your first mail, 
>>> your bundle mybundle seems  to declare an osgi contract on JavaServlet. 
>>> Never seen that kind of dependency before. 
>>> Make sure you have a clean import-package export-package structure in your 
>>> bundle. 
>>> I think that is your root issue. 
>>> 
>>> regarding using pax-web instead of felix-http. Both provide the http 
>>> service according to the spec. 
>>> So you should be safe on that :)
>>> 
>>> regards, Achim
>>> 
>>> 
>>> 2017-06-12 14:10 GMT+02:00 <t...@quarendon.net>:
>>>> With regard to the "wrap/0.0.0" error, running Maven with -X gives me:
>>>> 
>>>> Caused by: 
>>>> org.apache.karaf.features.internal.service.Deployer$CircularPrerequisiteException:
>>>>  [wrap/0.0.0]
>>>>         at 
>>>> org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:266)
>>>>         at 
>>>> org.apache.karaf.profile.assembly.Builder.resolve(Builder.java:1429)
>>>>         at 
>>>> org.apache.karaf.profile.assembly.Builder.startupStage(Builder.java:1183)
>>>>         at 
>>>> org.apache.karaf.profile.assembly.Builder.doGenerateAssembly(Builder.java:659)
>>>>         at 
>>>> org.apache.karaf.profile.assembly.Builder.generateAssembly(Builder.java:441)
>>>>         at 
>>>> org.apache.karaf.tooling.AssemblyMojo.doExecute(AssemblyMojo.java:506)
>>>>         at 
>>>> org.apache.karaf.tooling.AssemblyMojo.execute(AssemblyMojo.java:262)
>>>>         ... 22 more
>>>> 
>>>> 
>>>> Suggesting a circular dependency issue somewhere, though quite where, who 
>>>> knows. There are one or two references to "pax-url-wrap" in the -X output, 
>>>> but that's all there is that mentions "wrap" at any point.
>>>> 
>>>> Don't know whether that helps?
>>> 
>>> 
>>> 
>>> -- 
>>> 
>>> Apache Member
>>> Apache Karaf <http://karaf.apache.org/> Committer & PMC
>>> OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer & 
>>> Project Lead
>>> blog <http://notizblog.nierbeck.de/>
>>> Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>
>>> 
>>> Software Architect / Project Manager / Scrum Master 
>>> 
> 
> 
> 
> -- 
> 
> Apache Member
> Apache Karaf <http://karaf.apache.org/> Committer & PMC
> OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer & 
> Project Lead
> blog <http://notizblog.nierbeck.de/>
> Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>
> 
> Software Architect / Project Manager / Scrum Master 
> 

Reply via email to