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: osgi.contract;osgi.contract=JavaServlet;version:Vers
> ion="3.1";uses:="javax.servlet,javax.servlet.http,javax.servlet.descrip
> tor,javax.servlet.annotation"
> 
> line in the MANIFEST.
> 
> I say "solved", the karaf assmembly now at least builds. I have yet to 
> determine how successfully it actually runs.
> 
> However, this seems like a gross hack to me. Shouldn't the pax-web http-api 
> bundle provide this capability?
> 
> Thanks.


Re: missing requirement osgi.contract=JavaServlet

2017-06-12 Thread Tim Ward
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  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 :
>> 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  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 :
 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  Committer & PMC
>>> OPS4J Pax Web  Committer & 
>>> Project Lead
>>> blog 
>>> Co-Author of Apache Karaf Cookbook 
>>> 
>>> Software Architect / Project Manager / Scrum Master 
>>> 
> 
> 
> 
> -- 
> 
> Apache Member
> Apache Karaf  Committer & PMC
> OPS4J Pax Web  Committer & 
> Project Lead
> blog 
> Co-Author of Apache Karaf Cookbook 
> 
> Software Architect / Project Manager / Scrum Master 
> 


Re: missing requirement osgi.contract=JavaServlet

2017-06-12 Thread Achim Nierbeck
You are right, pax-web should provide you with that,
please open an issue for it at https://ops4j1.jira.com/projects/PAXWEB
if you don't have an account, give me a ping I'll create that one for you.

till this point in time, I wasn't even aware of that possible contract,
that's why it's missing.


regards, Achim



2017-06-12 14:48 GMT+02:00 :

> OK, I've "solved" this by creating an additional bundle that simply has
> the required:
>
> Provide-Capability: osgi.contract;osgi.contract=JavaServlet;version:Vers
>  ion="3.1";uses:="javax.servlet,javax.servlet.http,javax.servlet.descrip
>  tor,javax.servlet.annotation"
>
> line in the MANIFEST.
>
> I say "solved", the karaf assmembly now at least builds. I have yet to
> determine how successfully it actually runs.
>
> However, this seems like a gross hack to me. Shouldn't the pax-web
> http-api bundle provide this capability?
>
> Thanks.
>



-- 

Apache Member
Apache Karaf  Committer & PMC
OPS4J Pax Web  Committer &
Project Lead
blog 
Co-Author of Apache Karaf Cookbook 

Software Architect / Project Manager / Scrum Master


Re: missing requirement osgi.contract=JavaServlet

2017-06-12 Thread tom
OK, I've "solved" this by creating an additional bundle that simply has the 
required:

Provide-Capability: osgi.contract;osgi.contract=JavaServlet;version:Vers
 ion="3.1";uses:="javax.servlet,javax.servlet.http,javax.servlet.descrip
 tor,javax.servlet.annotation"

line in the MANIFEST.

I say "solved", the karaf assmembly now at least builds. I have yet to 
determine how successfully it actually runs.

However, this seems like a gross hack to me. Shouldn't the pax-web http-api 
bundle provide this capability?

Thanks.


Re: missing requirement osgi.contract=JavaServlet

2017-06-12 Thread Achim Nierbeck
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 :

> 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  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 :
>
>> 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(Build
>> er.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  Committer & PMC
> OPS4J Pax Web  Committer &
> Project Lead
> blog 
> Co-Author of Apache Karaf Cookbook 
>
> Software Architect / Project Manager / Scrum Master
>
>


-- 

Apache Member
Apache Karaf  Committer & PMC
OPS4J Pax Web  Committer &
Project Lead
blog 
Co-Author of Apache Karaf Cookbook 

Software Architect / Project Manager / Scrum Master


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 iPhone

> On 12 Jun 2017, at 13:39, Achim Nierbeck  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 :
>> 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  Committer & PMC
> OPS4J Pax Web  Committer & 
> Project Lead
> blog 
> Co-Author of Apache Karaf Cookbook 
> 
> Software Architect / Project Manager / Scrum Master 
> 


Re: missing requirement osgi.contract=JavaServlet

2017-06-12 Thread Achim Nierbeck
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 :

> 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  Committer & PMC
OPS4J Pax Web  Committer &
Project Lead
blog 
Co-Author of Apache Karaf Cookbook 

Software Architect / Project Manager / Scrum Master


RE: missing requirement osgi.contract=JavaServlet

2017-06-12 Thread tom
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?