You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@servicemix.apache.org by fernado <fe...@alcatel-lucent.com> on 2010/07/11 11:06:50 UTC

Can not import org.apache.servicemix.client in bundle

ALL:

I am developing one bundle which can subscribe/publish message wit hwsn2005.
While there is no bundle which exports the org.apache.servicemix.client. the
package is included in servicemix-core.jar(3.3.1 I used). When I test the
bundle which can not found the class in the packages even if  I install
servicemix-core.jar because of its no exporting this packages.

So I used 
<Embed-Dependency>servicemix-core;scope=compile|runtime</Embed-Dependency>
 <Embed-Transitive>true</Embed-Transitive>
while I can not pass compiling. It shows:
[ERROR] Error building bundle
org.fernado.test:cxf-fernado:bundle:4.2.0-fuse-01-
00 : Unresolved references to [com.thoughtworks.xstream,
com.thoughtworks.xstrea
m.io, com.thoughtworks.xstream.io.xml, javax.activation, javax.jbi,
javax.jbi.co .....
org.w3c.dom.traversal, org.xml.sax] by class(es) on the
Bundle-Classpath[Jar:dot
, Jar:servicemix-core-3.3.1.jar]:
[org/apache/servicemix/jbi/jmx/ConnectorServer
FactoryBean.class, org/apache/servicemix/jbi/messaging/InOnlyImpl.class,
org/apa
che/servicemix/jbi/FaultException.class,
org/apache/servicemix/jbi/framework/End
pointRegistry$1.class,
org/apache/servicemix/jbi/messaging/NormalizedMessageImpl
.class, org/apache/servicemix/jbi/framework/DeploymentService.class,
org/apache/..

It seems that when I embed the dependency(servicemix-core3.3.1.jar), some
classes in the jar will also use some other classes which is needed in other
jar.
whether I need to embed all jars which is used by servicemix-core.jar? and I
am afraid there are nested dependency.

Why not export these package in the servicemix-core.jar?

This issue has blocked me for some days, who can help me?
Summary  the issue:
In my bundle I need to use classes of org.apache.servicemix.client which is
packed in servicemix-core.jar which does not expose its package as bundle.

If i  only embed dependency of servicemix-core, it wil cause other
dependency issue?
How to solve this?

thanks
fernado



-- 
View this message in context: http://servicemix.396122.n5.nabble.com/Can-not-import-org-apache-servicemix-client-in-bundle-tp1046035p1046035.html
Sent from the ServiceMix - Dev mailing list archive at Nabble.com.

Re: Can not import org.apache.servicemix.client in bundle

Posted by fernado <fe...@alcatel-lucent.com>.
Here
http://www.nabble.com/wsn2005-outside-JBI-bus...
it is said:
"If you are inside the JBI bus, I would advise you to use the client API
for the WS-Notication component ..."
and here
http://servicemix.apache.org/servicemix-wsn20...
is sample code
String topic = ...;
NotificationBroker wsnBroker = new NotificationBroker(getContext());
wsnBroker.notify(topic, message);

but AFAIK this comes from internal implementation of wsn2005 component so
getContext() method returns wsn2005 component context. 
how can I get wsn2005 component context  in cxf bundle.

thanks
fernado

-- 
View this message in context: http://servicemix.396122.n5.nabble.com/Can-not-import-org-apache-servicemix-client-in-bundle-tp1046035p1046194.html
Sent from the ServiceMix - Dev mailing list archive at Nabble.com.

Re: Can not import org.apache.servicemix.client in bundle

Posted by Freeman Fang <fr...@gmail.com>.
Hi,

org.apache.servicemix.client  is deprecated in smx4.

If you want to use client api in smx4, take a look at nmr/client  
example shipped with kit.

Freeman
On 2010-7-11, at 下午5:06, fernado wrote:

>
> ALL:
>
> I am developing one bundle which can subscribe/publish message wit  
> hwsn2005.
> While there is no bundle which exports the  
> org.apache.servicemix.client. the
> package is included in servicemix-core.jar(3.3.1 I used). When I  
> test the
> bundle which can not found the class in the packages even if  I  
> install
> servicemix-core.jar because of its no exporting this packages.
>
> So I used
> <Embed-Dependency>servicemix-core;scope=compile|runtime</Embed- 
> Dependency>
> <Embed-Transitive>true</Embed-Transitive>
> while I can not pass compiling. It shows:
> [ERROR] Error building bundle
> org.fernado.test:cxf-fernado:bundle:4.2.0-fuse-01-
> 00 : Unresolved references to [com.thoughtworks.xstream,
> com.thoughtworks.xstrea
> m.io, com.thoughtworks.xstream.io.xml, javax.activation, javax.jbi,
> javax.jbi.co .....
> org.w3c.dom.traversal, org.xml.sax] by class(es) on the
> Bundle-Classpath[Jar:dot
> , Jar:servicemix-core-3.3.1.jar]:
> [org/apache/servicemix/jbi/jmx/ConnectorServer
> FactoryBean.class, org/apache/servicemix/jbi/messaging/ 
> InOnlyImpl.class,
> org/apa
> che/servicemix/jbi/FaultException.class,
> org/apache/servicemix/jbi/framework/End
> pointRegistry$1.class,
> org/apache/servicemix/jbi/messaging/NormalizedMessageImpl
> .class, org/apache/servicemix/jbi/framework/DeploymentService.class,
> org/apache/..
>
> It seems that when I embed the dependency(servicemix-core3.3.1.jar),  
> some
> classes in the jar will also use some other classes which is needed  
> in other
> jar.
> whether I need to embed all jars which is used by servicemix- 
> core.jar? and I
> am afraid there are nested dependency.
>
> Why not export these package in the servicemix-core.jar?
>
> This issue has blocked me for some days, who can help me?
> Summary  the issue:
> In my bundle I need to use classes of org.apache.servicemix.client  
> which is
> packed in servicemix-core.jar which does not expose its package as  
> bundle.
>
> If i  only embed dependency of servicemix-core, it wil cause other
> dependency issue?
> How to solve this?
>
> thanks
> fernado
>
>
>
> -- 
> View this message in context: http://servicemix.396122.n5.nabble.com/Can-not-import-org-apache-servicemix-client-in-bundle-tp1046035p1046035.html
> Sent from the ServiceMix - Dev mailing list archive at Nabble.com.


-- 
Freeman Fang

------------------------
Open Source SOA: http://fusesource.com
Apache Servicemix:http://servicemix.apache.org
Apache Cxf: http://cxf.apache.org
Apache Karaf: http://karaf.apache.org
Apache Felix: http://felix.apache.org