You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Leandro Andrade <le...@gmail.com> on 2016/06/30 16:12:44 UTC

Doubt in implementation of get all CXF services in a karaf bundle

Hi,

I'm implementing in Karaf 3.0.6 a bundle. In this bundle I'm trying get info
about all CXF services registered in my Karaf.

Using the karaf console it's simple:
$cxf:list-endpoints

But I want do it using Java code. I implementation of cxf-commands I saw the
method .getServers(), but it need a instance of Bus. I tired:

Bus bus = CXFBusFactory.getThreadDefaultBus();
ServerRegistry serverRegistry = bus.getExtension(ServerRegistry.class);
List<Server> servers = serverRegistry.getServers();

However I received the error:

java.lang.IllegalAccessError: tried to access class
org.apache.cxf.BusFactory$BusHolder from class org.apache.cxf.BusFactory
	at org.apache.cxf.BusFactory.getThreadBusHolder(BusFactory.java:124)
	at org.apache.cxf.BusFactory.getThreadDefaultBus(BusFactory.java:225)
	at org.apache.cxf.BusFactory.getThreadDefaultBus(BusFactory.java:214)
	at
br.ufba.dcc.wiser.smartufba.mqttfuseki.MqttCxfController.<init>(MqttCxfController.java:40)
	at
br.ufba.dcc.wiser.smartufba.mqttfuseki.Activator$1.run(Activator.java:31)
	at java.lang.Thread.run(Thread.java:745)

Somebody can help me with this?

Thanks a lot

Regards, 


Leandro Andrade






--
View this message in context: http://cxf.547215.n5.nabble.com/Doubt-in-implementation-of-get-all-CXF-services-in-a-karaf-bundle-tp5769879.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Doubt in implementation of get all CXF services in a karaf bundle

Posted by Leandro Andrade <le...@gmail.com>.
Thanks Christian. I'll try do it and I send message with result.

Best regards,

2016-07-01 3:46 GMT-03:00 cschneider [via CXF] <
ml-node+s547215n5769890h29@n5.nabble.com>:

> It should work like this:
>
> List<Bus> busList;
> and its setter...
>
> In blueprint you need this:
>
> <reference-list  id="busList"member-type="service-object"
>      interface="org.apache.cxf.Bus"/>
>
> Christian
>
> On 01.07.2016 08:35, Leandro Andrade wrote:
>
> > Thanks Christian. I'll try do it using blueprint. Do you have some
> > reference where I learn how I can do it?
> >
> > Thanks again. I lost many time with this.
> >
> > Regards,
> >
> > Leandro Andrade
> > Em 1 de jul de 2016 03:20, "cschneider [via CXF]" <
> > [hidden email] <http:///user/SendEmail.jtp?type=node&node=5769890&i=0>>
> escreveu:
> >
> >> In OSGi CXF uses one bus per bundle. So it will not work to just use
> the
> >> thread default bus which is quite unsafe to use anyway.
> >>
> >> So the correct way is to bind to all services with the Bus interface
> and
> >> go
> >> through all of them. The preferred way to do this is with DS or
> blueprint
> >> as it is quite easy to do it wrong with the plain OSGi APIs. I just
> looked
> >> into the CXF command source and found that retrieving the services is
> done
> >> incorrectly there.
> >>
> >> Christian
> >>
> >>
> >> 2016-06-30 18:12 GMT+02:00 Leandro Andrade <[hidden email]
> >> <http:///user/SendEmail.jtp?type=node&node=5769888&i=0>>:
> >>
> >>> Hi,
> >>>
> >>> I'm implementing in Karaf 3.0.6 a bundle. In this bundle I'm trying
> get
> >>> info
> >>> about all CXF services registered in my Karaf.
> >>>
> >>> Using the karaf console it's simple:
> >>> $cxf:list-endpoints
> >>>
> >>> But I want do it using Java code. I implementation of cxf-commands I
> saw
> >>> the
> >>> method .getServers(), but it need a instance of Bus. I tired:
> >>>
> >>> Bus bus = CXFBusFactory.getThreadDefaultBus();
> >>> ServerRegistry serverRegistry =
> bus.getExtension(ServerRegistry.class);
> >>> List<Server> servers = serverRegistry.getServers();
> >>>
> >>> However I received the error:
> >>>
> >>> java.lang.IllegalAccessError: tried to access class
> >>> org.apache.cxf.BusFactory$BusHolder from class
> org.apache.cxf.BusFactory
> >>>          at
> >>> org.apache.cxf.BusFactory.getThreadBusHolder(BusFactory.java:124)
> >>>          at
> >>> org.apache.cxf.BusFactory.getThreadDefaultBus(BusFactory.java:225)
> >>>          at
> >>> org.apache.cxf.BusFactory.getThreadDefaultBus(BusFactory.java:214)
> >>>          at
> >>>
> >>>
> >>
> br.ufba.dcc.wiser.smartufba.mqttfuseki.MqttCxfController.<init>(MqttCxfController.java:40)
>
> >>
> >>>          at
> >>>
> >>
> br.ufba.dcc.wiser.smartufba.mqttfuseki.Activator$1.run(Activator.java:31)
> >>>          at java.lang.Thread.run(Thread.java:745)
> >>>
> >>> Somebody can help me with this?
> >>>
> >>> Thanks a lot
> >>>
> >>> Regards,
> >>>
> >>>
> >>> Leandro Andrade
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>> --
> >>> View this message in context:
> >>>
> >>
> http://cxf.547215.n5.nabble.com/Doubt-in-implementation-of-get-all-CXF-services-in-a-karaf-bundle-tp5769879.html
> >>> Sent from the cxf-user mailing list archive at Nabble.com.
> >>>
> >>
> >>
> >> --
> >> --
> >> Christian Schneider
> >> http://www.liquid-reality.de
> >> <
> >>
> https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46&URL=http%3a%2f%2fwww.liquid-reality.de>
>
> >>
> >>
> >> Open Source Architect
> >> http://www.talend.com
> >> <
> >>
> https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46&URL=http%3a%2f%2fwww.talend.com>
>
> >>
> >>
> >>
> >> ------------------------------
> >> If you reply to this email, your message will be added to the
> discussion
> >> below:
> >>
> >>
> http://cxf.547215.n5.nabble.com/Doubt-in-implementation-of-get-all-CXF-services-in-a-karaf-bundle-tp5769879p5769888.html
> >> To start a new topic under cxf-user, email
> >> [hidden email] <http:///user/SendEmail.jtp?type=node&node=5769890&i=1>
> >> To unsubscribe from cxf-user, click here
> >> <
> >> .
> >> NAML
> >> <
> http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
> >>
> >
> >
> >
> > --
> > View this message in context:
> http://cxf.547215.n5.nabble.com/Doubt-in-implementation-of-get-all-CXF-services-in-a-karaf-bundle-tp5769879p5769889.html
> > Sent from the cxf-user mailing list archive at Nabble.com.
>
>
> --
> Christian Schneider
> http://www.liquid-reality.de
>
> Open Source Architect
> http://www.talend.com
>
>
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://cxf.547215.n5.nabble.com/Doubt-in-implementation-of-get-all-CXF-services-in-a-karaf-bundle-tp5769879p5769890.html
> To start a new topic under cxf-user, email
> ml-node+s547215n547216h35@n5.nabble.com
> To unsubscribe from cxf-user, click here
> <http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=547216&code=bGVvanNhbmRyYWRlQGdtYWlsLmNvbXw1NDcyMTZ8LTk0Nzk5OTkwMQ==>
> .
> NAML
> <http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>



-- 
Leandro Andrade
http://www.leandroandrade.net




--
View this message in context: http://cxf.547215.n5.nabble.com/Doubt-in-implementation-of-get-all-CXF-services-in-a-karaf-bundle-tp5769879p5769901.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Doubt in implementation of get all CXF services in a karaf bundle

Posted by Leandro Andrade <le...@gmail.com>.
Adding info...

After timeout:
Unable to start blueprint container for bundle
br.ufba.dcc.wiser.streamingmqttfuseki-osgi/0.2.0 due to unresolved
dependencies [(objectClass=org.apache.cxf.Bus)]

java.util.concurrent.TimeoutException at
org.apache.aries.blueprint.container.BlueprintContainerImpl$1.run(BlueprintContainerImpl.java:336)
at
org.apache.aries.blueprint.utils.threading.impl.DiscardableRunnable.run(DiscardableRunnable.java:48)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266) at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

In my pom file I'm importing dependence cxf-core 3.1.4

2016-07-06 15:26 GMT-03:00 Leandro Andrade <le...@gmail.com>:

> Hi Christian,
>
> I write the blueprint file as you suggest, but I had the same mistake.
> Analizing the log service I saw:
>
> Destroying BlueprintContainer for bundle
> br.ufba.dcc.wiser.streamingmqttfuseki-osgi/0.2.0
> Bundle br.ufba.dcc.wiser.streamingmqttfuseki-osgi/0.2.0 is waiting for
> dependencies [(objectClass=org.apache.cxf.Bus)]
>
> 2016-07-06 3:04 GMT-03:00 cschneider [via CXF] <
> ml-node+s547215n5770102h1@n5.nabble.com>:
>
>> You can not mix Activator and blueprint. Either go with an Activator or
>> with blueprint.
>> If you do both then you end up with two instances of your class one
>> created by blueprint and one by the activator.
>>
>> For blueprint:
>>
>> <reference-list id="busList" member-type="service-object"
>> interface="org.apache.cxf.Bus" />
>>
>>
>> <bean
>> class="br.ufba.dcc.wiser.smartufba.mqttfuseki.MqttCxfControllerImpl">
>>    <property name="busList ref="busList">
>> </bean>
>>
>>
>> Christian
>>
>> On 05.07.2016 21:59, Leandro Andrade wrote:
>>
>> > Hi Christian,
>> >
>> > I tried implemented what you suggested.
>> > I did a file with blueprint
>> > (main/resources/OSGI-INF/blueprint/blueprint.xml)
>> >
>> > Firstly, inside blueprint tag I put:
>> >
>> > <reference-list id="busList" member-type="service-object"
>> > interface="org.apache.cxf.Bus" />
>> >
>> > After I tried:
>> >
>> > <reference-list id="busList" interface="org.apache.cxf.Bus">
>> > <reference-listener bind-method="setBusList">
>> > <bean
>> class="br.ufba.dcc.wiser.smartufba.mqttfuseki.MqttCxfControllerImpl"
>> > />
>> > </reference-listener>
>> > </reference-list>
>> >
>> > The both my attribute busList are null. I tried initialize it but had
>> the
>> > same execption that I said in first e-mail.
>> >
>> > Other information:
>> >
>> > In my bundle the Activator class I create new Thread and I instance my
>> > class MqttCxfControllerImpl. like it:
>> >
>> > public void start(BundleContext bc) throws Exception {
>> >          System.out.println("Starting the bundle MQTT Fuseki");
>> >          new Thread (new Runnable()
>> >          {
>> >          public void run(){
>> >          MqttCxfControllerImpl mf = null;
>> > try {
>> > mf = new MqttCxfControllerImpl(...);
>> > } catch (InterruptedException e) {
>> > // TODO Auto-generated catch block
>> > e.printStackTrace();
>> > }
>> >         }}).start();
>> >
>> >
>> > Thus, I did something wrong?
>> >
>> > Thanks again.
>> >
>> >
>> > Regards,
>> >
>> >
>> > Leandro Andrade
>> >
>>
>> --
>> Christian Schneider
>> http://www.liquid-reality.de
>>
>> Open Source Architect
>> http://www.talend.com
>>
>>
>>
>> ------------------------------
>> If you reply to this email, your message will be added to the discussion
>> below:
>>
>> http://cxf.547215.n5.nabble.com/Doubt-in-implementation-of-get-all-CXF-services-in-a-karaf-bundle-tp5769879p5770102.html
>> To start a new topic under cxf-user, email
>> ml-node+s547215n547216h35@n5.nabble.com
>> To unsubscribe from cxf-user, click here
>> <http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=547216&code=bGVvanNhbmRyYWRlQGdtYWlsLmNvbXw1NDcyMTZ8LTk0Nzk5OTkwMQ==>
>> .
>> NAML
>> <http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>>
>
>
>
> --
> Leandro Andrade
> http://www.leandroandrade.net
>



-- 
Leandro Andrade
http://www.leandroandrade.net




--
View this message in context: http://cxf.547215.n5.nabble.com/Doubt-in-implementation-of-get-all-CXF-services-in-a-karaf-bundle-tp5769879p5770173.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Doubt in implementation of get all CXF services in a karaf bundle

Posted by Leandro Andrade <le...@gmail.com>.
Hi Christian,

I write the blueprint file as you suggest, but I had the same mistake.
Analizing the log service I saw:

Destroying BlueprintContainer for bundle
br.ufba.dcc.wiser.streamingmqttfuseki-osgi/0.2.0
Bundle br.ufba.dcc.wiser.streamingmqttfuseki-osgi/0.2.0 is waiting for
dependencies [(objectClass=org.apache.cxf.Bus)]

2016-07-06 3:04 GMT-03:00 cschneider [via CXF] <
ml-node+s547215n5770102h1@n5.nabble.com>:

> You can not mix Activator and blueprint. Either go with an Activator or
> with blueprint.
> If you do both then you end up with two instances of your class one
> created by blueprint and one by the activator.
>
> For blueprint:
>
> <reference-list id="busList" member-type="service-object"
> interface="org.apache.cxf.Bus" />
>
>
> <bean
> class="br.ufba.dcc.wiser.smartufba.mqttfuseki.MqttCxfControllerImpl">
>    <property name="busList ref="busList">
> </bean>
>
>
> Christian
>
> On 05.07.2016 21:59, Leandro Andrade wrote:
>
> > Hi Christian,
> >
> > I tried implemented what you suggested.
> > I did a file with blueprint
> > (main/resources/OSGI-INF/blueprint/blueprint.xml)
> >
> > Firstly, inside blueprint tag I put:
> >
> > <reference-list id="busList" member-type="service-object"
> > interface="org.apache.cxf.Bus" />
> >
> > After I tried:
> >
> > <reference-list id="busList" interface="org.apache.cxf.Bus">
> > <reference-listener bind-method="setBusList">
> > <bean
> class="br.ufba.dcc.wiser.smartufba.mqttfuseki.MqttCxfControllerImpl"
> > />
> > </reference-listener>
> > </reference-list>
> >
> > The both my attribute busList are null. I tried initialize it but had
> the
> > same execption that I said in first e-mail.
> >
> > Other information:
> >
> > In my bundle the Activator class I create new Thread and I instance my
> > class MqttCxfControllerImpl. like it:
> >
> > public void start(BundleContext bc) throws Exception {
> >          System.out.println("Starting the bundle MQTT Fuseki");
> >          new Thread (new Runnable()
> >          {
> >          public void run(){
> >          MqttCxfControllerImpl mf = null;
> > try {
> > mf = new MqttCxfControllerImpl(...);
> > } catch (InterruptedException e) {
> > // TODO Auto-generated catch block
> > e.printStackTrace();
> > }
> >         }}).start();
> >
> >
> > Thus, I did something wrong?
> >
> > Thanks again.
> >
> >
> > Regards,
> >
> >
> > Leandro Andrade
> >
>
> --
> Christian Schneider
> http://www.liquid-reality.de
>
> Open Source Architect
> http://www.talend.com
>
>
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://cxf.547215.n5.nabble.com/Doubt-in-implementation-of-get-all-CXF-services-in-a-karaf-bundle-tp5769879p5770102.html
> To start a new topic under cxf-user, email
> ml-node+s547215n547216h35@n5.nabble.com
> To unsubscribe from cxf-user, click here
> <http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=547216&code=bGVvanNhbmRyYWRlQGdtYWlsLmNvbXw1NDcyMTZ8LTk0Nzk5OTkwMQ==>
> .
> NAML
> <http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>



-- 
Leandro Andrade
http://www.leandroandrade.net




--
View this message in context: http://cxf.547215.n5.nabble.com/Doubt-in-implementation-of-get-all-CXF-services-in-a-karaf-bundle-tp5769879p5770171.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Doubt in implementation of get all CXF services in a karaf bundle

Posted by Christian Schneider <ch...@die-schneider.net>.
Great you found the issue. I forgot the optional attr which allows your 
bundle to start before the first CXF bus is published.

Christian

On 07.07.2016 02:11, Leandro Andrade wrote:
> Hi Christian,
>
> I resolve this problem doing a little diference of you suggest. I found a
> similar project with it (https://github.com/jbonofre/capgemini).
>
> So, I did:
>
> <reference-list id="busList"
> interface="org.apache.cxf.Bus" filter="(cxf.bus.id=*)"
> availability="optional"/>
>
> <bean id="busObj" class="br.ufba.dcc.wiser.fot.storage.MqttCxfController" >
> <property name="busList" ref="busList" />
> </bean>
>
> To access this object I used camel for execute choiced method.
>
> Thanks a lot.
>
> Regards,
>
> 2016-07-06 15:35 GMT-03:00 Leandro Andrade <le...@gmail.com>:
>

-- 
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
http://www.talend.com


Re: Doubt in implementation of get all CXF services in a karaf bundle

Posted by Leandro Andrade <le...@gmail.com>.
Hi Christian,

I resolve this problem doing a little diference of you suggest. I found a
similar project with it (https://github.com/jbonofre/capgemini).

So, I did:

<reference-list id="busList"
interface="org.apache.cxf.Bus" filter="(cxf.bus.id=*)"
availability="optional"/>

<bean id="busObj" class="br.ufba.dcc.wiser.fot.storage.MqttCxfController" >
<property name="busList" ref="busList" />
</bean>

To access this object I used camel for execute choiced method.

Thanks a lot.

Regards,

2016-07-06 15:35 GMT-03:00 Leandro Andrade <le...@gmail.com>:

> Adding info...
>
> After timeout:
> Unable to start blueprint container for bundle
> br.ufba.dcc.wiser.streamingmqttfuseki-osgi/0.2.0 due to unresolved
> dependencies [(objectClass=org.apache.cxf.Bus)]
>
> java.util.concurrent.TimeoutException at
> org.apache.aries.blueprint.container.BlueprintContainerImpl$1.run(BlueprintContainerImpl.java:336)
> at
> org.apache.aries.blueprint.utils.threading.impl.DiscardableRunnable.run(DiscardableRunnable.java:48)
> at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
> at java.util.concurrent.FutureTask.run(FutureTask.java:266) at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
> at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
> at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> at java.lang.Thread.run(Thread.java:745)
>
> In my pom file I'm importing dependence cxf-core 3.1.4
>
> 2016-07-06 15:26 GMT-03:00 Leandro Andrade <le...@gmail.com>:
>
>> Hi Christian,
>>
>> I write the blueprint file as you suggest, but I had the same mistake.
>> Analizing the log service I saw:
>>
>> Destroying BlueprintContainer for bundle
>> br.ufba.dcc.wiser.streamingmqttfuseki-osgi/0.2.0
>> Bundle br.ufba.dcc.wiser.streamingmqttfuseki-osgi/0.2.0 is waiting for
>> dependencies [(objectClass=org.apache.cxf.Bus)]
>>
>> 2016-07-06 3:04 GMT-03:00 cschneider [via CXF] <
>> ml-node+s547215n5770102h1@n5.nabble.com>:
>>
>>> You can not mix Activator and blueprint. Either go with an Activator or
>>> with blueprint.
>>> If you do both then you end up with two instances of your class one
>>> created by blueprint and one by the activator.
>>>
>>> For blueprint:
>>>
>>> <reference-list id="busList" member-type="service-object"
>>> interface="org.apache.cxf.Bus" />
>>>
>>>
>>> <bean
>>> class="br.ufba.dcc.wiser.smartufba.mqttfuseki.MqttCxfControllerImpl">
>>>    <property name="busList ref="busList">
>>> </bean>
>>>
>>>
>>> Christian
>>>
>>> On 05.07.2016 21:59, Leandro Andrade wrote:
>>>
>>> > Hi Christian,
>>> >
>>> > I tried implemented what you suggested.
>>> > I did a file with blueprint
>>> > (main/resources/OSGI-INF/blueprint/blueprint.xml)
>>> >
>>> > Firstly, inside blueprint tag I put:
>>> >
>>> > <reference-list id="busList" member-type="service-object"
>>> > interface="org.apache.cxf.Bus" />
>>> >
>>> > After I tried:
>>> >
>>> > <reference-list id="busList" interface="org.apache.cxf.Bus">
>>> > <reference-listener bind-method="setBusList">
>>> > <bean
>>> class="br.ufba.dcc.wiser.smartufba.mqttfuseki.MqttCxfControllerImpl"
>>> > />
>>> > </reference-listener>
>>> > </reference-list>
>>> >
>>> > The both my attribute busList are null. I tried initialize it but had
>>> the
>>> > same execption that I said in first e-mail.
>>> >
>>> > Other information:
>>> >
>>> > In my bundle the Activator class I create new Thread and I instance my
>>> > class MqttCxfControllerImpl. like it:
>>> >
>>> > public void start(BundleContext bc) throws Exception {
>>> >          System.out.println("Starting the bundle MQTT Fuseki");
>>> >          new Thread (new Runnable()
>>> >          {
>>> >          public void run(){
>>> >          MqttCxfControllerImpl mf = null;
>>> > try {
>>> > mf = new MqttCxfControllerImpl(...);
>>> > } catch (InterruptedException e) {
>>> > // TODO Auto-generated catch block
>>> > e.printStackTrace();
>>> > }
>>> >         }}).start();
>>> >
>>> >
>>> > Thus, I did something wrong?
>>> >
>>> > Thanks again.
>>> >
>>> >
>>> > Regards,
>>> >
>>> >
>>> > Leandro Andrade
>>> >
>>>
>>> --
>>> Christian Schneider
>>> http://www.liquid-reality.de
>>>
>>> Open Source Architect
>>> http://www.talend.com
>>>
>>>
>>>
>>> ------------------------------
>>> If you reply to this email, your message will be added to the discussion
>>> below:
>>>
>>> http://cxf.547215.n5.nabble.com/Doubt-in-implementation-of-get-all-CXF-services-in-a-karaf-bundle-tp5769879p5770102.html
>>> To start a new topic under cxf-user, email
>>> ml-node+s547215n547216h35@n5.nabble.com
>>> To unsubscribe from cxf-user, click here
>>> <http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=547216&code=bGVvanNhbmRyYWRlQGdtYWlsLmNvbXw1NDcyMTZ8LTk0Nzk5OTkwMQ==>
>>> .
>>> NAML
>>> <http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>>>
>>
>>
>>
>> --
>> Leandro Andrade
>> http://www.leandroandrade.net
>>
>
>
>
> --
> Leandro Andrade
> http://www.leandroandrade.net
>



-- 
Leandro Andrade
http://www.leandroandrade.net




--
View this message in context: http://cxf.547215.n5.nabble.com/Doubt-in-implementation-of-get-all-CXF-services-in-a-karaf-bundle-tp5769879p5770183.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Doubt in implementation of get all CXF services in a karaf bundle

Posted by Christian Schneider <ch...@die-schneider.net>.
You can not mix Activator and blueprint. Either go with an Activator or 
with blueprint.
If you do both then you end up with two instances of your class one 
created by blueprint and one by the activator.

For blueprint:

<reference-list id="busList" member-type="service-object"
interface="org.apache.cxf.Bus" />


<bean class="br.ufba.dcc.wiser.smartufba.mqttfuseki.MqttCxfControllerImpl">
   <property name="busList ref="busList">
</bean>


Christian

On 05.07.2016 21:59, Leandro Andrade wrote:
> Hi Christian,
>
> I tried implemented what you suggested.
> I did a file with blueprint
> (main/resources/OSGI-INF/blueprint/blueprint.xml)
>
> Firstly, inside blueprint tag I put:
>
> <reference-list id="busList" member-type="service-object"
> interface="org.apache.cxf.Bus" />
>
> After I tried:
>
> <reference-list id="busList" interface="org.apache.cxf.Bus">
> <reference-listener bind-method="setBusList">
> <bean class="br.ufba.dcc.wiser.smartufba.mqttfuseki.MqttCxfControllerImpl"
> />
> </reference-listener>
> </reference-list>
>
> The both my attribute busList are null. I tried initialize it but had the
> same execption that I said in first e-mail.
>
> Other information:
>
> In my bundle the Activator class I create new Thread and I instance my
> class MqttCxfControllerImpl. like it:
>
> public void start(BundleContext bc) throws Exception {
>          System.out.println("Starting the bundle MQTT Fuseki");
>          new Thread (new Runnable()
>          {
>          public void run(){
>          MqttCxfControllerImpl mf = null;
> try {
> mf = new MqttCxfControllerImpl(...);
> } catch (InterruptedException e) {
> // TODO Auto-generated catch block
> e.printStackTrace();
> }
>         }}).start();
>
>
> Thus, I did something wrong?
>
> Thanks again.
>
>
> Regards,
>
>
> Leandro Andrade
>

-- 
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
http://www.talend.com


Re: Doubt in implementation of get all CXF services in a karaf bundle

Posted by Leandro Andrade <le...@gmail.com>.
Hi Christian,

I tried implemented what you suggested.
I did a file with blueprint
(main/resources/OSGI-INF/blueprint/blueprint.xml)

Firstly, inside blueprint tag I put:

<reference-list id="busList" member-type="service-object"
interface="org.apache.cxf.Bus" />

After I tried:

<reference-list id="busList" interface="org.apache.cxf.Bus">
<reference-listener bind-method="setBusList">
<bean class="br.ufba.dcc.wiser.smartufba.mqttfuseki.MqttCxfControllerImpl"
/>
</reference-listener>
</reference-list>

The both my attribute busList are null. I tried initialize it but had the
same execption that I said in first e-mail.

Other information:

In my bundle the Activator class I create new Thread and I instance my
class MqttCxfControllerImpl. like it:

public void start(BundleContext bc) throws Exception {
        System.out.println("Starting the bundle MQTT Fuseki");
        new Thread (new Runnable()
        {
        public void run(){
        MqttCxfControllerImpl mf = null;
try {
mf = new MqttCxfControllerImpl(...);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
       }}).start();


Thus, I did something wrong?

Thanks again.


Regards,


Leandro Andrade


2016-07-01 3:46 GMT-03:00 cschneider [via CXF] <
ml-node+s547215n5769890h29@n5.nabble.com>:

> It should work like this:
>
> List<Bus> busList;
> and its setter...
>
> In blueprint you need this:
>
> <reference-list  id="busList"member-type="service-object"
>      interface="org.apache.cxf.Bus"/>
>
> Christian
>
> On 01.07.2016 08:35, Leandro Andrade wrote:
>
> > Thanks Christian. I'll try do it using blueprint. Do you have some
> > reference where I learn how I can do it?
> >
> > Thanks again. I lost many time with this.
> >
> > Regards,
> >
> > Leandro Andrade
> > Em 1 de jul de 2016 03:20, "cschneider [via CXF]" <
> > [hidden email] <http:///user/SendEmail.jtp?type=node&node=5769890&i=0>>
> escreveu:
> >
> >> In OSGi CXF uses one bus per bundle. So it will not work to just use
> the
> >> thread default bus which is quite unsafe to use anyway.
> >>
> >> So the correct way is to bind to all services with the Bus interface
> and
> >> go
> >> through all of them. The preferred way to do this is with DS or
> blueprint
> >> as it is quite easy to do it wrong with the plain OSGi APIs. I just
> looked
> >> into the CXF command source and found that retrieving the services is
> done
> >> incorrectly there.
> >>
> >> Christian
> >>
> >>
> >> 2016-06-30 18:12 GMT+02:00 Leandro Andrade <[hidden email]
> >> <http:///user/SendEmail.jtp?type=node&node=5769888&i=0>>:
> >>
> >>> Hi,
> >>>
> >>> I'm implementing in Karaf 3.0.6 a bundle. In this bundle I'm trying
> get
> >>> info
> >>> about all CXF services registered in my Karaf.
> >>>
> >>> Using the karaf console it's simple:
> >>> $cxf:list-endpoints
> >>>
> >>> But I want do it using Java code. I implementation of cxf-commands I
> saw
> >>> the
> >>> method .getServers(), but it need a instance of Bus. I tired:
> >>>
> >>> Bus bus = CXFBusFactory.getThreadDefaultBus();
> >>> ServerRegistry serverRegistry =
> bus.getExtension(ServerRegistry.class);
> >>> List<Server> servers = serverRegistry.getServers();
> >>>
> >>> However I received the error:
> >>>
> >>> java.lang.IllegalAccessError: tried to access class
> >>> org.apache.cxf.BusFactory$BusHolder from class
> org.apache.cxf.BusFactory
> >>>          at
> >>> org.apache.cxf.BusFactory.getThreadBusHolder(BusFactory.java:124)
> >>>          at
> >>> org.apache.cxf.BusFactory.getThreadDefaultBus(BusFactory.java:225)
> >>>          at
> >>> org.apache.cxf.BusFactory.getThreadDefaultBus(BusFactory.java:214)
> >>>          at
> >>>
> >>>
> >>
> br.ufba.dcc.wiser.smartufba.mqttfuseki.MqttCxfController.<init>(MqttCxfController.java:40)
>
> >>
> >>>          at
> >>>
> >>
> br.ufba.dcc.wiser.smartufba.mqttfuseki.Activator$1.run(Activator.java:31)
> >>>          at java.lang.Thread.run(Thread.java:745)
> >>>
> >>> Somebody can help me with this?
> >>>
> >>> Thanks a lot
> >>>
> >>> Regards,
> >>>
> >>>
> >>> Leandro Andrade
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>> --
> >>> View this message in context:
> >>>
> >>
> http://cxf.547215.n5.nabble.com/Doubt-in-implementation-of-get-all-CXF-services-in-a-karaf-bundle-tp5769879.html
> >>> Sent from the cxf-user mailing list archive at Nabble.com.
> >>>
> >>
> >>
> >> --
> >> --
> >> Christian Schneider
> >> http://www.liquid-reality.de
> >> <
> >>
> https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46&URL=http%3a%2f%2fwww.liquid-reality.de>
>
> >>
> >>
> >> Open Source Architect
> >> http://www.talend.com
> >> <
> >>
> https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46&URL=http%3a%2f%2fwww.talend.com>
>
> >>
> >>
> >>
> >> ------------------------------
> >> If you reply to this email, your message will be added to the
> discussion
> >> below:
> >>
> >>
> http://cxf.547215.n5.nabble.com/Doubt-in-implementation-of-get-all-CXF-services-in-a-karaf-bundle-tp5769879p5769888.html
> >> To start a new topic under cxf-user, email
> >> [hidden email] <http:///user/SendEmail.jtp?type=node&node=5769890&i=1>
> >> To unsubscribe from cxf-user, click here
> >> <
> >> .
> >> NAML
> >> <
> http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
> >>
> >
> >
> >
> > --
> > View this message in context:
> http://cxf.547215.n5.nabble.com/Doubt-in-implementation-of-get-all-CXF-services-in-a-karaf-bundle-tp5769879p5769889.html
> > Sent from the cxf-user mailing list archive at Nabble.com.
>
>
> --
> Christian Schneider
> http://www.liquid-reality.de
>
> Open Source Architect
> http://www.talend.com
>
>
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://cxf.547215.n5.nabble.com/Doubt-in-implementation-of-get-all-CXF-services-in-a-karaf-bundle-tp5769879p5769890.html
> To start a new topic under cxf-user, email
> ml-node+s547215n547216h35@n5.nabble.com
> To unsubscribe from cxf-user, click here
> <http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=547216&code=bGVvanNhbmRyYWRlQGdtYWlsLmNvbXw1NDcyMTZ8LTk0Nzk5OTkwMQ==>
> .
> NAML
> <http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>



-- 
Leandro Andrade
http://www.leandroandrade.net




--
View this message in context: http://cxf.547215.n5.nabble.com/Doubt-in-implementation-of-get-all-CXF-services-in-a-karaf-bundle-tp5769879p5770096.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Doubt in implementation of get all CXF services in a karaf bundle

Posted by Christian Schneider <ch...@die-schneider.net>.
It should work like this:

List<Bus> busList;
and its setter...

In blueprint you need this:

<reference-list  id="busList"member-type="service-object"
     interface="org.apache.cxf.Bus"/>

Christian

On 01.07.2016 08:35, Leandro Andrade wrote:
> Thanks Christian. I'll try do it using blueprint. Do you have some
> reference where I learn how I can do it?
>
> Thanks again. I lost many time with this.
>
> Regards,
>
> Leandro Andrade
> Em 1 de jul de 2016 03:20, "cschneider [via CXF]" <
> ml-node+s547215n5769888h67@n5.nabble.com> escreveu:
>
>> In OSGi CXF uses one bus per bundle. So it will not work to just use the
>> thread default bus which is quite unsafe to use anyway.
>>
>> So the correct way is to bind to all services with the Bus interface and
>> go
>> through all of them. The preferred way to do this is with DS or blueprint
>> as it is quite easy to do it wrong with the plain OSGi APIs. I just looked
>> into the CXF command source and found that retrieving the services is done
>> incorrectly there.
>>
>> Christian
>>
>>
>> 2016-06-30 18:12 GMT+02:00 Leandro Andrade <[hidden email]
>> <http:///user/SendEmail.jtp?type=node&node=5769888&i=0>>:
>>
>>> Hi,
>>>
>>> I'm implementing in Karaf 3.0.6 a bundle. In this bundle I'm trying get
>>> info
>>> about all CXF services registered in my Karaf.
>>>
>>> Using the karaf console it's simple:
>>> $cxf:list-endpoints
>>>
>>> But I want do it using Java code. I implementation of cxf-commands I saw
>>> the
>>> method .getServers(), but it need a instance of Bus. I tired:
>>>
>>> Bus bus = CXFBusFactory.getThreadDefaultBus();
>>> ServerRegistry serverRegistry = bus.getExtension(ServerRegistry.class);
>>> List<Server> servers = serverRegistry.getServers();
>>>
>>> However I received the error:
>>>
>>> java.lang.IllegalAccessError: tried to access class
>>> org.apache.cxf.BusFactory$BusHolder from class org.apache.cxf.BusFactory
>>>          at
>>> org.apache.cxf.BusFactory.getThreadBusHolder(BusFactory.java:124)
>>>          at
>>> org.apache.cxf.BusFactory.getThreadDefaultBus(BusFactory.java:225)
>>>          at
>>> org.apache.cxf.BusFactory.getThreadDefaultBus(BusFactory.java:214)
>>>          at
>>>
>>>
>> br.ufba.dcc.wiser.smartufba.mqttfuseki.MqttCxfController.<init>(MqttCxfController.java:40)
>>
>>>          at
>>>
>> br.ufba.dcc.wiser.smartufba.mqttfuseki.Activator$1.run(Activator.java:31)
>>>          at java.lang.Thread.run(Thread.java:745)
>>>
>>> Somebody can help me with this?
>>>
>>> Thanks a lot
>>>
>>> Regards,
>>>
>>>
>>> Leandro Andrade
>>>
>>>
>>>
>>>
>>>
>>>
>>> --
>>> View this message in context:
>>>
>> http://cxf.547215.n5.nabble.com/Doubt-in-implementation-of-get-all-CXF-services-in-a-karaf-bundle-tp5769879.html
>>> Sent from the cxf-user mailing list archive at Nabble.com.
>>>
>>
>>
>> --
>> --
>> Christian Schneider
>> http://www.liquid-reality.de
>> <
>> https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46&URL=http%3a%2f%2fwww.liquid-reality.de>
>>
>>
>> Open Source Architect
>> http://www.talend.com
>> <
>> https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46&URL=http%3a%2f%2fwww.talend.com>
>>
>>
>>
>> ------------------------------
>> If you reply to this email, your message will be added to the discussion
>> below:
>>
>> http://cxf.547215.n5.nabble.com/Doubt-in-implementation-of-get-all-CXF-services-in-a-karaf-bundle-tp5769879p5769888.html
>> To start a new topic under cxf-user, email
>> ml-node+s547215n547216h35@n5.nabble.com
>> To unsubscribe from cxf-user, click here
>> <http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=547216&code=bGVvanNhbmRyYWRlQGdtYWlsLmNvbXw1NDcyMTZ8LTk0Nzk5OTkwMQ==>
>> .
>> NAML
>> <http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>>
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/Doubt-in-implementation-of-get-all-CXF-services-in-a-karaf-bundle-tp5769879p5769889.html
> Sent from the cxf-user mailing list archive at Nabble.com.


-- 
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
http://www.talend.com


Re: Doubt in implementation of get all CXF services in a karaf bundle

Posted by Leandro Andrade <le...@gmail.com>.
Thanks Christian. I'll try do it using blueprint. Do you have some
reference where I learn how I can do it?

Thanks again. I lost many time with this.

Regards,

Leandro Andrade
Em 1 de jul de 2016 03:20, "cschneider [via CXF]" <
ml-node+s547215n5769888h67@n5.nabble.com> escreveu:

> In OSGi CXF uses one bus per bundle. So it will not work to just use the
> thread default bus which is quite unsafe to use anyway.
>
> So the correct way is to bind to all services with the Bus interface and
> go
> through all of them. The preferred way to do this is with DS or blueprint
> as it is quite easy to do it wrong with the plain OSGi APIs. I just looked
> into the CXF command source and found that retrieving the services is done
> incorrectly there.
>
> Christian
>
>
> 2016-06-30 18:12 GMT+02:00 Leandro Andrade <[hidden email]
> <http:///user/SendEmail.jtp?type=node&node=5769888&i=0>>:
>
> > Hi,
> >
> > I'm implementing in Karaf 3.0.6 a bundle. In this bundle I'm trying get
> > info
> > about all CXF services registered in my Karaf.
> >
> > Using the karaf console it's simple:
> > $cxf:list-endpoints
> >
> > But I want do it using Java code. I implementation of cxf-commands I saw
> > the
> > method .getServers(), but it need a instance of Bus. I tired:
> >
> > Bus bus = CXFBusFactory.getThreadDefaultBus();
> > ServerRegistry serverRegistry = bus.getExtension(ServerRegistry.class);
> > List<Server> servers = serverRegistry.getServers();
> >
> > However I received the error:
> >
> > java.lang.IllegalAccessError: tried to access class
> > org.apache.cxf.BusFactory$BusHolder from class org.apache.cxf.BusFactory
> >         at
> > org.apache.cxf.BusFactory.getThreadBusHolder(BusFactory.java:124)
> >         at
> > org.apache.cxf.BusFactory.getThreadDefaultBus(BusFactory.java:225)
> >         at
> > org.apache.cxf.BusFactory.getThreadDefaultBus(BusFactory.java:214)
> >         at
> >
> >
> br.ufba.dcc.wiser.smartufba.mqttfuseki.MqttCxfController.<init>(MqttCxfController.java:40)
>
> >         at
> >
> br.ufba.dcc.wiser.smartufba.mqttfuseki.Activator$1.run(Activator.java:31)
> >         at java.lang.Thread.run(Thread.java:745)
> >
> > Somebody can help me with this?
> >
> > Thanks a lot
> >
> > Regards,
> >
> >
> > Leandro Andrade
> >
> >
> >
> >
> >
> >
> > --
> > View this message in context:
> >
> http://cxf.547215.n5.nabble.com/Doubt-in-implementation-of-get-all-CXF-services-in-a-karaf-bundle-tp5769879.html
> > Sent from the cxf-user mailing list archive at Nabble.com.
> >
>
>
>
> --
> --
> Christian Schneider
> http://www.liquid-reality.de
> <
> https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46&URL=http%3a%2f%2fwww.liquid-reality.de>
>
>
> Open Source Architect
> http://www.talend.com
> <
> https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46&URL=http%3a%2f%2fwww.talend.com>
>
>
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://cxf.547215.n5.nabble.com/Doubt-in-implementation-of-get-all-CXF-services-in-a-karaf-bundle-tp5769879p5769888.html
> To start a new topic under cxf-user, email
> ml-node+s547215n547216h35@n5.nabble.com
> To unsubscribe from cxf-user, click here
> <http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=547216&code=bGVvanNhbmRyYWRlQGdtYWlsLmNvbXw1NDcyMTZ8LTk0Nzk5OTkwMQ==>
> .
> NAML
> <http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://cxf.547215.n5.nabble.com/Doubt-in-implementation-of-get-all-CXF-services-in-a-karaf-bundle-tp5769879p5769889.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Doubt in implementation of get all CXF services in a karaf bundle

Posted by Christian Schneider <ch...@die-schneider.net>.
In OSGi CXF uses one bus per bundle. So it will not work to just use the
thread default bus which is quite unsafe to use anyway.

So the correct way is to bind to all services with the Bus interface and go
through all of them. The preferred way to do this is with DS or blueprint
as it is quite easy to do it wrong with the plain OSGi APIs. I just looked
into the CXF command source and found that retrieving the services is done
incorrectly there.

Christian


2016-06-30 18:12 GMT+02:00 Leandro Andrade <le...@gmail.com>:

> Hi,
>
> I'm implementing in Karaf 3.0.6 a bundle. In this bundle I'm trying get
> info
> about all CXF services registered in my Karaf.
>
> Using the karaf console it's simple:
> $cxf:list-endpoints
>
> But I want do it using Java code. I implementation of cxf-commands I saw
> the
> method .getServers(), but it need a instance of Bus. I tired:
>
> Bus bus = CXFBusFactory.getThreadDefaultBus();
> ServerRegistry serverRegistry = bus.getExtension(ServerRegistry.class);
> List<Server> servers = serverRegistry.getServers();
>
> However I received the error:
>
> java.lang.IllegalAccessError: tried to access class
> org.apache.cxf.BusFactory$BusHolder from class org.apache.cxf.BusFactory
>         at
> org.apache.cxf.BusFactory.getThreadBusHolder(BusFactory.java:124)
>         at
> org.apache.cxf.BusFactory.getThreadDefaultBus(BusFactory.java:225)
>         at
> org.apache.cxf.BusFactory.getThreadDefaultBus(BusFactory.java:214)
>         at
>
> br.ufba.dcc.wiser.smartufba.mqttfuseki.MqttCxfController.<init>(MqttCxfController.java:40)
>         at
> br.ufba.dcc.wiser.smartufba.mqttfuseki.Activator$1.run(Activator.java:31)
>         at java.lang.Thread.run(Thread.java:745)
>
> Somebody can help me with this?
>
> Thanks a lot
>
> Regards,
>
>
> Leandro Andrade
>
>
>
>
>
>
> --
> View this message in context:
> http://cxf.547215.n5.nabble.com/Doubt-in-implementation-of-get-all-CXF-services-in-a-karaf-bundle-tp5769879.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>



-- 
-- 
Christian Schneider
http://www.liquid-reality.de
<https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46&URL=http%3a%2f%2fwww.liquid-reality.de>

Open Source Architect
http://www.talend.com
<https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46&URL=http%3a%2f%2fwww.talend.com>