You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by 程操红 <cc...@ufida.com.cn> on 2008/01/25 08:18:56 UTC

About shared library

Freeman Fang,您好!

	I have read the docoments and articles about shared library in servicemix.apache.org and forums.

But i still have some problems about "shared library", can anyone explain to me, thanks you very much!

    For example:

    If i create a SU named SU-A which depends on servicemix-core and servicemix-http, 
then I create another SU name SU-B which is also depends on servicemix-core and servicemix-http,
I use "mvn clean intall" to create the install zip for both SU-A and SU-B, each one will include
lots of jars which come from servicemix-core and servicemix-http. That's say, there are too many
dulplicated jars.

   So I create a shared library which includes all the jars need by  servicemix-core and servicemix-http
and other jars which will be used frequently. Then i add dependency for SU-A and SU-B, like this:

    <dependency>
      <groupId>org.apache.servicemix.examples</groupId>
      <artifactId>ufida-esb-lib</artifactId>
      <version>1.0-SNAPSHOT</version>
    </dependency>

  and also add classpath in xbean.xml for SU, like this:
    <classpath>
	  <library>ufida-esb-lib</library>
	  <!--component>servicemix-core</component-->
    </classpath>

  But when i create intall zip for SU-A and SU-B, the finished zip still includes lots of jars which are
contained in shared library.

  Is there any way to create a thin intall zip which doesn't contain jars in shared library?
   

    

======= 2008-01-25 14:59:05 您在来信中写道:=======

>Hi,
>
>If you are using servicemix cxf component, you can refer to how to set 
>soap headers in cxf, [1] is the disscussion about it
>[1]http://www.nabble.com/Add-SOAP-HEADER-value-td11710546.html#a11710546
>
>Best Regards
>
>Freeman
>
>johper wrote:
>> Hi,
>>
>> Using HTTP and SOAP and would like to add to SOAP Header like:
>>
>> <soapenv:Header><ns6:AuthenticationHeader
>> xmlns:ns6="http://net/Security"><ns6:Dsn>DB</ns6:Dsn><ns6:Proof>pwd</ns6:Proof><ns6:UserName>usr</ns6:UserName></ns6:AuthenticationHeader></soapenv:Header>
>>
>> This header need to be set before providing service call from SMX.
>>
>> Anyone know how to do this?
>>
>> Tia
>>   
>

= = = = = = = = = = = = = = = = = = = =
			

        致
礼!
 
				 
---------------------------------------------------------
程操红 
用友软件股份有限公司 集团平台技术开发部
Tel:62435466
Email:cch@ufida.com.cn
地址:北京市海淀区北清路68号 用友软件园
邮编:100085
---------------------------------------------------------


Re: About shared library

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

Did you read the discussion on the mailing list about "Add JBI Shared
Library to a SU classpath" these days? I believe it can resolve your problem
[1] for more details

[1]http://www.nabble.com/Add-JBI-Shared-Library-to-a-SU-classpath-td15063749s12049.html#a15068938


Best Regards

Freeman

程操红 wrote:
> Freeman Fang,您好!
>
> 	I have read the docoments and articles about shared library in servicemix.apache.org and forums.
>
> But i still have some problems about "shared library", can anyone explain to me, thanks you very much!
>
>     For example:
>
>     If i create a SU named SU-A which depends on servicemix-core and servicemix-http, 
> then I create another SU name SU-B which is also depends on servicemix-core and servicemix-http,
> I use "mvn clean intall" to create the install zip for both SU-A and SU-B, each one will include
> lots of jars which come from servicemix-core and servicemix-http. That's say, there are too many
> dulplicated jars.
>
>    So I create a shared library which includes all the jars need by  servicemix-core and servicemix-http
> and other jars which will be used frequently. Then i add dependency for SU-A and SU-B, like this:
>
>     <dependency>
>       <groupId>org.apache.servicemix.examples</groupId>
>       <artifactId>ufida-esb-lib</artifactId>
>       <version>1.0-SNAPSHOT</version>
>     </dependency>
>
>   and also add classpath in xbean.xml for SU, like this:
>     <classpath>
> 	  <library>ufida-esb-lib</library>
> 	  <!--component>servicemix-core</component-->
>     </classpath>
>
>   But when i create intall zip for SU-A and SU-B, the finished zip still includes lots of jars which are
> contained in shared library.
>
>   Is there any way to create a thin intall zip which doesn't contain jars in shared library?
>    
>
>     
>
> ======= 2008-01-25 14:59:05 您在来信中写道:=======
>
>   
>> Hi,
>>
>> If you are using servicemix cxf component, you can refer to how to set 
>> soap headers in cxf, [1] is the disscussion about it
>> [1]http://www.nabble.com/Add-SOAP-HEADER-value-td11710546.html#a11710546
>>
>> Best Regards
>>
>> Freeman
>>
>> johper wrote:
>>     
>>> Hi,
>>>
>>> Using HTTP and SOAP and would like to add to SOAP Header like:
>>>
>>> <soapenv:Header><ns6:AuthenticationHeader
>>> xmlns:ns6="http://net/Security"><ns6:Dsn>DB</ns6:Dsn><ns6:Proof>pwd</ns6:Proof><ns6:UserName>usr</ns6:UserName></ns6:AuthenticationHeader></soapenv:Header>
>>>
>>> This header need to be set before providing service call from SMX.
>>>
>>> Anyone know how to do this?
>>>
>>> Tia
>>>   
>>>       
>
> = = = = = = = = = = = = = = = = = = = =
> 			
>
>         致
> 礼!
>  
> 				 
> ---------------------------------------------------------
> 程操红 
> 用友软件股份有限公司 集团平台技术开发部
> Tel:62435466
> Email:cch@ufida.com.cn
> 地址:北京市海淀区北清路68号 用友软件园
> 邮编:100085
> ---------------------------------------------------------
>
>   

Re: About shared library

Posted by Guillaume Nodet <gn...@gmail.com>.
If you need to include a dependency on servicemix-core, you must specify
that the scope is provided so that all these jars are not included.

   <dependency>
     <groupId>org.apache.servicemix</groupId>
     <artifactId>servicemix-core</artifactId>

>      <version>3.2.1</version>

     <scope>provided</scope>
    </dependency>

As of Shared Libraries, it's a collection of jars, but their use is limited
by the JBI spec to components.  ServiceMix goes a bit beyond and allow their
use for Service Units, but the jbi maven plugin won't really help there.
The only solution is to tag all the dependencies that are included as
provided or to exclude them.

Btw, the servicemix-core and all these jars are already included in a shared
library called servicemix-shared and servicemix-shared-compat, so you don't
have to include them in your SU at all, because servicemix components
already reference this shared library.

2008/1/25 程操红 <cc...@ufida.com.cn>:

> Freeman Fang,您好!
>
>        I have read the docoments and articles about shared library in
> servicemix.apache.org and forums.
>
> But i still have some problems about "shared library", can anyone explain
> to me, thanks you very much!
>
>    For example:
>
>    If i create a SU named SU-A which depends on servicemix-core and
> servicemix-http,
> then I create another SU name SU-B which is also depends on
> servicemix-core and servicemix-http,
> I use "mvn clean intall" to create the install zip for both SU-A and SU-B,
> each one will include
> lots of jars which come from servicemix-core and servicemix-http. That's
> say, there are too many
> dulplicated jars.
>
>   So I create a shared library which includes all the jars need by
>  servicemix-core and servicemix-http
> and other jars which will be used frequently. Then i add dependency for
> SU-A and SU-B, like this:
>
>    <dependency>
>      <groupId>org.apache.servicemix.examples</groupId>
>      <artifactId>ufida-esb-lib</artifactId>
>      <version>1.0-SNAPSHOT</version>
>    </dependency>
>
>  and also add classpath in xbean.xml for SU, like this:
>    <classpath>
>          <library>ufida-esb-lib</library>
>          <!--component>servicemix-core</component-->
>    </classpath>
>
>  But when i create intall zip for SU-A and SU-B, the finished zip still
> includes lots of jars which are
> contained in shared library.
>
>  Is there any way to create a thin intall zip which doesn't contain jars
> in shared library?
>
>
>
>
> ======= 2008-01-25 14:59:05 您在来信中写道:=======
>
> >Hi,
> >
> >If you are using servicemix cxf component, you can refer to how to set
> >soap headers in cxf, [1] is the disscussion about it
> >[1]http://www.nabble.com/Add-SOAP-HEADER-value-td11710546.html#a11710546
> >
> >Best Regards
> >
> >Freeman
> >
> >johper wrote:
> >> Hi,
> >>
> >> Using HTTP and SOAP and would like to add to SOAP Header like:
> >>
> >> <soapenv:Header><ns6:AuthenticationHeader
> >> xmlns:ns6="http://net/Security
> "><ns6:Dsn>DB</ns6:Dsn><ns6:Proof>pwd</ns6:Proof><ns6:UserName>usr</ns6:UserName></ns6:AuthenticationHeader></soapenv:Header>
> >>
> >> This header need to be set before providing service call from SMX.
> >>
> >> Anyone know how to do this?
> >>
> >> Tia
> >>
> >
>
> = = = = = = = = = = = = = = = = = = = =
>
>
> 致
> 礼!
>
>
> ---------------------------------------------------------
> 程操红
> 用友软件股份有限公司 集团平台技术开发部
> Tel:62435466
> Email:cch@ufida.com.cn
> 地址:北京市海淀区北清路68号 用友软件园
> 邮编:100085
> ---------------------------------------------------------
>
>


-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/