You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by Jérôme Pochat <jp...@sopragroup.com> on 2010/08/26 10:10:45 UTC

Karaf 2.0.0 & Jersey 1.3.0

Hi

I tried to install Jersey REST implementation into fresh Karaf 2.0.0
instance without any success. This was working fine in previous version of
Karaf. What is strange is that there is no problem to install it inside
Felix 3.0.*.

install jsr311-api-1.1.1.jar ==> Success
install jersey-core-1.3.jar ==> Failed

Error executing command: Unresolved constraint in bundle
com.sun.jersey.jersey-core [34]: Unable to resolve 34.0: missing requirement
[34.0] package; (package=com.sun.jersey.api.representation) - [34.0]
package; (package=com.sun.jersey.api.representation)

This package is imported and exported by the same bundle. Could it be a
reason of the issue?

Thanks in advance for help.
-- 
View this message in context: http://karaf.922171.n3.nabble.com/Karaf-2-0-0-Jersey-1-3-0-tp1347655p1347655.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Karaf 2.0.0 & Jersey 1.3.0

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Oh yes Guillaume, you're right.

I was thinking about two jersey-core bundles are deployed but it doesn't 
seem the case. My apologies.

I'm going to make a try of my side too to see how it's behaving.

Thanks,
Regards
JB

On 08/26/2010 10:27 AM, Guillaume Nodet wrote:
> JB, you're right, but it still should not cause a resolution failure,
> especially if a single version of this bundle is installed in the
> framework.  Jérôme, I would try to switch to equinox (in the
> etc/config file) and restart to see what happen.  Also, the Felix
> Framework 3.0.2 has been released recently which may fix the problem,
> so it's worth a try too.  I'll upgrade to this latest version in trunk
> asap anyway.
>
> On Thu, Aug 26, 2010 at 10:20, Jean-Baptiste Onofré<jb...@nanthrax.net>  wrote:
>> Hi Jérôme,
>>
>> The com.sun.jersey.api package is provided by jersey-core jar.
>> It's exported by the jersey-core bundle (according to the MANIFEST).
>>
>> You are right, the package shouldn't be imported and exported.
>>
>> The bundle package statement should looks like :
>>
>> <Export-Package>
>>    com.sun.jersey*...
>> </Export-Package>
>> <Import-Package>
>>    !com.sun.jersey*,
>>    *
>> </Import-Package>
>>
>> Like this, it can support several version of jersey-core bundle in the same
>> OSGi framework and avoid this kind of issue.
>>
>> A possible workaround is to create your own jersey-core bundle using
>> maven-bundle-plugin for example.
>>
>> Regards
>> JB
>>
>> On 08/26/2010 10:10 AM, Jérôme Pochat wrote:
>>>
>>> Hi
>>>
>>> I tried to install Jersey REST implementation into fresh Karaf 2.0.0
>>> instance without any success. This was working fine in previous version of
>>> Karaf. What is strange is that there is no problem to install it inside
>>> Felix 3.0.*.
>>>
>>> install jsr311-api-1.1.1.jar ==>    Success
>>> install jersey-core-1.3.jar ==>    Failed
>>>
>>> Error executing command: Unresolved constraint in bundle
>>> com.sun.jersey.jersey-core [34]: Unable to resolve 34.0: missing
>>> requirement
>>> [34.0] package; (package=com.sun.jersey.api.representation) - [34.0]
>>> package; (package=com.sun.jersey.api.representation)
>>>
>>> This package is imported and exported by the same bundle. Could it be a
>>> reason of the issue?
>>>
>>> Thanks in advance for help.
>>
>
>
>

Re: Karaf 2.0.0 & Jersey 1.3.0

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Thanks for the update Jérôme.

I think I will have some time to take a look tomorrow.

Regards
JB

On 08/26/2010 02:44 PM, Jérôme Pochat wrote:
>
> You right understood :)
>
> I tried to install bundle directly with "osgi:install" or part of feature
> using "feature:install", but both failed.

Re: Karaf 2.0.0 & Jersey 1.3.0

Posted by Jérôme Pochat <jp...@sopragroup.com>.
You right understood :)

I tried to install bundle directly with "osgi:install" or part of feature
using "feature:install", but both failed.
-- 
View this message in context: http://karaf.922171.n3.nabble.com/Karaf-2-0-0-Jersey-1-3-0-tp1347655p1350662.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Karaf 2.0.0 & Jersey 1.3.0

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Ioannis has encountered the same issue yesterday and this morning (I 
don't remember on which bundles).

@Jérôme: If I have right understood, you said that the bundle worked 
without problem directly in Felix OSGi framework but not while deploying 
in Karaf.
When you tried to deploy in Karaf, the bundle was part of a feature or 
you tried to deploy directly the bundle like this:

osgi:install mvn:groupId/artifactId/version

Regards
JB

On 08/26/2010 02:01 PM, Jérôme Pochat wrote:
>
> Just for your information, that works fine with Equinox framework instead of
> Felix.
> Thanks for this workaround.

Re: Karaf 2.0.0 & Jersey 1.3.0

Posted by Jérôme Pochat <jp...@sopragroup.com>.
Just for your information, that works fine with Equinox framework instead of
Felix.
Thanks for this workaround.
-- 
View this message in context: http://karaf.922171.n3.nabble.com/Karaf-2-0-0-Jersey-1-3-0-tp1347655p1350064.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Karaf 2.0.0 & Jersey 1.3.0

Posted by Guillaume Nodet <gn...@gmail.com>.
Yes, edit the etc/config.properties and change the property to

karaf.framework=equinox

Then delete the data directory and restart.

On Thu, Aug 26, 2010 at 10:58, Jérôme Pochat <jp...@sopragroup.com> wrote:
>
> Thanks for quick answers!
>
> What I don't understand is that it works with Felix 3.0.1 and Felix 3.0.2,
> but not in Karaf 2.0.0 which embed Felix 3.0.1.
>
> Does Equinox also included into Karaf distribution to make it possible
> switch from Felix to Equinox?
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Karaf-2-0-0-Jersey-1-3-0-tp1347655p1348304.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>



-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com

Re: Karaf 2.0.0 & Jersey 1.3.0

Posted by Jérôme Pochat <jp...@sopragroup.com>.
Thanks for quick answers!

What I don't understand is that it works with Felix 3.0.1 and Felix 3.0.2,
but not in Karaf 2.0.0 which embed Felix 3.0.1.

Does Equinox also included into Karaf distribution to make it possible
switch from Felix to Equinox?
-- 
View this message in context: http://karaf.922171.n3.nabble.com/Karaf-2-0-0-Jersey-1-3-0-tp1347655p1348304.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Karaf 2.0.0 & Jersey 1.3.0

Posted by Guillaume Nodet <gn...@gmail.com>.
JB, you're right, but it still should not cause a resolution failure,
especially if a single version of this bundle is installed in the
framework.  Jérôme, I would try to switch to equinox (in the
etc/config file) and restart to see what happen.  Also, the Felix
Framework 3.0.2 has been released recently which may fix the problem,
so it's worth a try too.  I'll upgrade to this latest version in trunk
asap anyway.

On Thu, Aug 26, 2010 at 10:20, Jean-Baptiste Onofré <jb...@nanthrax.net> wrote:
> Hi Jérôme,
>
> The com.sun.jersey.api package is provided by jersey-core jar.
> It's exported by the jersey-core bundle (according to the MANIFEST).
>
> You are right, the package shouldn't be imported and exported.
>
> The bundle package statement should looks like :
>
> <Export-Package>
>   com.sun.jersey*...
> </Export-Package>
> <Import-Package>
>   !com.sun.jersey*,
>   *
> </Import-Package>
>
> Like this, it can support several version of jersey-core bundle in the same
> OSGi framework and avoid this kind of issue.
>
> A possible workaround is to create your own jersey-core bundle using
> maven-bundle-plugin for example.
>
> Regards
> JB
>
> On 08/26/2010 10:10 AM, Jérôme Pochat wrote:
>>
>> Hi
>>
>> I tried to install Jersey REST implementation into fresh Karaf 2.0.0
>> instance without any success. This was working fine in previous version of
>> Karaf. What is strange is that there is no problem to install it inside
>> Felix 3.0.*.
>>
>> install jsr311-api-1.1.1.jar ==>  Success
>> install jersey-core-1.3.jar ==>  Failed
>>
>> Error executing command: Unresolved constraint in bundle
>> com.sun.jersey.jersey-core [34]: Unable to resolve 34.0: missing
>> requirement
>> [34.0] package; (package=com.sun.jersey.api.representation) - [34.0]
>> package; (package=com.sun.jersey.api.representation)
>>
>> This package is imported and exported by the same bundle. Could it be a
>> reason of the issue?
>>
>> Thanks in advance for help.
>



-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com

Re: Karaf 2.0.0 & Jersey 1.3.0

Posted by Jérôme Pochat <jp...@sopragroup.com>.
Thanks again for quick answer.

My post was premature. I confirm that Felix and Equinox export same
packages.

The issue seems caused by inconsistency of XML API:
- "javax.xml.stream" is provided by "Apache ServiceMix Specs :: STAX API
1.0"
- "javax.xml.transform.stax" is provided by JRE.

This seems to make StAXSource unusable :-(
-- 
View this message in context: http://karaf.922171.n3.nabble.com/Karaf-2-0-0-Jersey-1-3-0-tp1347655p1413036.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Karaf 2.0.0 & Jersey 1.3.0

Posted by Guillaume Nodet <gn...@gmail.com>.
Yeah, Karaf is consistent so the same packages are exported whtether
you use felix or equinox (or it should be).
However, we have dicussed not restricting the packages provided by the
jre, so i think we need to get back to this discussion.

On Fri, Sep 3, 2010 at 17:19, Jérôme Pochat <jp...@sopragroup.com> wrote:
>
> Hi again
>
> I'm back :)
>
> Since I switch to Equinox as workaround, I now face new issue about Java 6
> API that is also provided by ServiceMix bundles (i.e. StAX).
>
> Using Felix, some system packages are hidden in "jre.properties". Using
> Equinox, all system packages seems to be exported. In some cases (such as
> mine :-p), this could create conflicts at runtime (java.lang.LinkageError).
>
> Does "jre.properties" file is read with using Equinox as well as Felix?
>
> Thanks in advance.
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Karaf-2-0-0-Jersey-1-3-0-tp1347655p1412755.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>



-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com

Re: Karaf 2.0.0 & Jersey 1.3.0

Posted by Jérôme Pochat <jp...@sopragroup.com>.
Hi again

I'm back :)

Since I switch to Equinox as workaround, I now face new issue about Java 6
API that is also provided by ServiceMix bundles (i.e. StAX).

Using Felix, some system packages are hidden in "jre.properties". Using
Equinox, all system packages seems to be exported. In some cases (such as
mine :-p), this could create conflicts at runtime (java.lang.LinkageError).

Does "jre.properties" file is read with using Equinox as well as Felix?

Thanks in advance.
-- 
View this message in context: http://karaf.922171.n3.nabble.com/Karaf-2-0-0-Jersey-1-3-0-tp1347655p1412755.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Karaf 2.0.0 & Jersey 1.3.0

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Jérôme,

The com.sun.jersey.api package is provided by jersey-core jar.
It's exported by the jersey-core bundle (according to the MANIFEST).

You are right, the package shouldn't be imported and exported.

The bundle package statement should looks like :

<Export-Package>
    com.sun.jersey*...
</Export-Package>
<Import-Package>
    !com.sun.jersey*,
    *
</Import-Package>

Like this, it can support several version of jersey-core bundle in the 
same OSGi framework and avoid this kind of issue.

A possible workaround is to create your own jersey-core bundle using 
maven-bundle-plugin for example.

Regards
JB

On 08/26/2010 10:10 AM, Jérôme Pochat wrote:
>
> Hi
>
> I tried to install Jersey REST implementation into fresh Karaf 2.0.0
> instance without any success. This was working fine in previous version of
> Karaf. What is strange is that there is no problem to install it inside
> Felix 3.0.*.
>
> install jsr311-api-1.1.1.jar ==>  Success
> install jersey-core-1.3.jar ==>  Failed
>
> Error executing command: Unresolved constraint in bundle
> com.sun.jersey.jersey-core [34]: Unable to resolve 34.0: missing requirement
> [34.0] package; (package=com.sun.jersey.api.representation) - [34.0]
> package; (package=com.sun.jersey.api.representation)
>
> This package is imported and exported by the same bundle. Could it be a
> reason of the issue?
>
> Thanks in advance for help.