You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by Hervé BARRAULT <he...@gmail.com> on 2012/05/31 20:29:37 UTC

Exported Packages and bundles

Hi,
I have sometimes some class loading issues (ClassCastException for the same
class).
I suppose that this class can be exposed (in different version) by
different bundles.
Is there a command in karaf to know which bundle expose this package (and
in which version) ?

In my case it is for the package javax.xml.bind
I know that I can use the version to select a version, but at this time I
don't know which version is exposed.

Regards
Hervé

Re: Exported Packages and bundles

Posted by Hervé BARRAULT <he...@gmail.com>.
Hi, thanks for the packages:exports command and the tip for embedded jars.
Regards
Hervé



On Fri, Jun 1, 2012 at 5:29 AM, Freeman Fang <fr...@gmail.com> wrote:

> And the ClassCastException can also comes from that your bundle embed some
> lib but not use it from OSGi container.
> For your case, you need ensure your bundle didn't embed jax-api jar.
>
> Freeman
>
> On 2012-6-1, at 上午4:27, Scott England-Sullivan wrote:
>
> Herve,
>
> Another alternative is to install the webconsole using features:install
> webconsole.  Then navigate to http://localhost:8181/system/console/bundles.
> You can then drill into the gory details of each bundle in an easy to read
> format.
>
> It provides the same information that you can get from the console but I
> find it is a little easier to navigate than just the CLI.
>
>
> On Thu, May 31, 2012 at 1:42 PM, Gert Vanthienen <
> gert.vanthienen@gmail.com> wrote:
>
>> L.S.,
>>
>> You can use packages:exports to get a list of all exports packages and
>> then use grep to filter for javax.xml.bind.  Something like...
>> packages:exports | grep javax.xml.bind
>>
>> Regards,
>>
>> Gert Vanthienen
>> ------------------------
>> FuseSource
>> Web: http://fusesource.com
>> Blog: http://gertvanthienen.blogspot.com/
>>
>>
>> On Thu, May 31, 2012 at 8:29 PM, Hervé BARRAULT
>> <he...@gmail.com> wrote:
>> > Hi,
>> > I have sometimes some class loading issues (ClassCastException for the
>> same
>> > class).
>> > I suppose that this class can be exposed (in different version) by
>> different
>> > bundles.
>> > Is there a command in karaf to know which bundle expose this package
>> (and in
>> > which version) ?
>> >
>> > In my case it is for the package javax.xml.bind
>> > I know that I can use the version to select a version, but at this time
>> I
>> > don't know which version is exposed.
>> >
>> > Regards
>> > Hervé
>> >
>>
>
>
>
> --
> --
> Scott England-Sullivan
> ----------------------------------
> FuseSource
> Web:     http://www.fusesource.com
> Blog:     http://sully6768.blogspot.com
> Twitter: sully6768
>
>
> ---------------------------------------------
> Freeman Fang
>
> FuseSource
> Email:f <de...@fusesource.com>fang@fusesource.com
> Web: fusesource.com
> Twitter: freemanfang
> Blog: http://freemanfang.blogspot.com
> http://blog.sina.com.cn/u/1473905042
> weibo: http://weibo.com/u/1473905042
>
>
>
>
>
>
>
>
>
>
>

Re: Exported Packages and bundles

Posted by Freeman Fang <fr...@gmail.com>.
And the ClassCastException can also comes from that your bundle embed  
some lib but not use it from OSGi container.
For your case, you need ensure your bundle didn't embed jax-api jar.

Freeman
On 2012-6-1, at 上午4:27, Scott England-Sullivan wrote:

> Herve,
>
> Another alternative is to install the webconsole using  
> features:install webconsole.  Then navigate to http://localhost:8181/system/console/bundles 
> .  You can then drill into the gory details of each bundle in an  
> easy to read format.
>
> It provides the same information that you can get from the console  
> but I find it is a little easier to navigate than just the CLI.
>
>
> On Thu, May 31, 2012 at 1:42 PM, Gert Vanthienen <gert.vanthienen@gmail.com 
> > wrote:
> L.S.,
>
> You can use packages:exports to get a list of all exports packages and
> then use grep to filter for javax.xml.bind.  Something like...
> packages:exports | grep javax.xml.bind
>
> Regards,
>
> Gert Vanthienen
> ------------------------
> FuseSource
> Web: http://fusesource.com
> Blog: http://gertvanthienen.blogspot.com/
>
>
> On Thu, May 31, 2012 at 8:29 PM, Hervé BARRAULT
> <he...@gmail.com> wrote:
> > Hi,
> > I have sometimes some class loading issues (ClassCastException for  
> the same
> > class).
> > I suppose that this class can be exposed (in different version) by  
> different
> > bundles.
> > Is there a command in karaf to know which bundle expose this  
> package (and in
> > which version) ?
> >
> > In my case it is for the package javax.xml.bind
> > I know that I can use the version to select a version, but at this  
> time I
> > don't know which version is exposed.
> >
> > Regards
> > Hervé
> >
>
>
>
> -- 
> -- 
> Scott England-Sullivan
> ----------------------------------
> FuseSource
> Web:     http://www.fusesource.com
> Blog:     http://sully6768.blogspot.com
> Twitter: sully6768
>

---------------------------------------------
Freeman Fang

FuseSource
Email:ffang@fusesource.com
Web: fusesource.com
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
http://blog.sina.com.cn/u/1473905042
weibo: http://weibo.com/u/1473905042











Re: Exported Packages and bundles

Posted by Scott England-Sullivan <su...@gmail.com>.
Herve,

Another alternative is to install the webconsole using features:install
webconsole.  Then navigate to http://localhost:8181/system/console/bundles.
You can then drill into the gory details of each bundle in an easy to read
format.

It provides the same information that you can get from the console but I
find it is a little easier to navigate than just the CLI.


On Thu, May 31, 2012 at 1:42 PM, Gert Vanthienen
<ge...@gmail.com>wrote:

> L.S.,
>
> You can use packages:exports to get a list of all exports packages and
> then use grep to filter for javax.xml.bind.  Something like...
> packages:exports | grep javax.xml.bind
>
> Regards,
>
> Gert Vanthienen
> ------------------------
> FuseSource
> Web: http://fusesource.com
> Blog: http://gertvanthienen.blogspot.com/
>
>
> On Thu, May 31, 2012 at 8:29 PM, Hervé BARRAULT
> <he...@gmail.com> wrote:
> > Hi,
> > I have sometimes some class loading issues (ClassCastException for the
> same
> > class).
> > I suppose that this class can be exposed (in different version) by
> different
> > bundles.
> > Is there a command in karaf to know which bundle expose this package
> (and in
> > which version) ?
> >
> > In my case it is for the package javax.xml.bind
> > I know that I can use the version to select a version, but at this time I
> > don't know which version is exposed.
> >
> > Regards
> > Hervé
> >
>



-- 
-- 
Scott England-Sullivan
----------------------------------
FuseSource
Web:     http://www.fusesource.com
Blog:     http://sully6768.blogspot.com
Twitter: sully6768

Re: Exported Packages and bundles

Posted by Gert Vanthienen <ge...@gmail.com>.
L.S.,

You can use packages:exports to get a list of all exports packages and
then use grep to filter for javax.xml.bind.  Something like...
packages:exports | grep javax.xml.bind

Regards,

Gert Vanthienen
------------------------
FuseSource
Web: http://fusesource.com
Blog: http://gertvanthienen.blogspot.com/


On Thu, May 31, 2012 at 8:29 PM, Hervé BARRAULT
<he...@gmail.com> wrote:
> Hi,
> I have sometimes some class loading issues (ClassCastException for the same
> class).
> I suppose that this class can be exposed (in different version) by different
> bundles.
> Is there a command in karaf to know which bundle expose this package (and in
> which version) ?
>
> In my case it is for the package javax.xml.bind
> I know that I can use the version to select a version, but at this time I
> don't know which version is exposed.
>
> Regards
> Hervé
>