You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Nagesh <ni...@gmail.com> on 2015/06/16 11:44:33 UTC

install external osgi jars using karaf's feature.xml

Hello,

I have created features.xml as below to deploy external jar in servicemix.
But I am getting error to do so. please help. 

Below are the things which I have tried.

STEP 1. Created features.xml file as below

<features name="NumberGenFeature">
    <feature name="NumberGenFeature" version="1.0.0">
        <bundle>file:/pathto/externaljar/TcSoaClient_10000.1.0.jar</bundle>
    </feature>
</features>

STEP 2. Added this feature to servicemix karaf using command

features:addurl file:pathto/features.xml

STEP 3. Then install this feature using command
feature:install NumberGenFeature

but I get below error after STEP 3
<http://servicemix.396122.n5.nabble.com/file/n5722692/SERVICEMIX.jpg> 
MANIFEST.MF file from TcSoaClient_10000.1.0.jar

Ant-Version: Apache Ant 1.7.0
Created-By: 21.1-b02 (Oracle Corporation)
Implementation-Title: Teamcenter Services Client
Implementation-Version: 10000.1.0, April 21, 2015
Implementation-Vendor: Siemens PLM Software, Inc.
Bundle-ManifestVersion: 2
Bundle-Name: Teamcenter Services Client
Bundle-SymbolicName: TcSoaClient
Bundle-Version: 10000.1.0
TC-Version: V10000.1.0.40_20150421.00
Bundle-ClassPath: .
Bundle-Vendor: Siemens PLM Software, Inc.
Bundle-Localization: plugin
Bundle-ActivationPolicy: lazy
Require-Bundle: *com.teamcenter.rac.external*,com.teamcenter.SecuritySer
vices,tcgatewaystubs,TcSoaCommon


>From manifest file its clear that TcSoaClient_10000.1.0.jar is dependent on
com.teamcenter.rac.external, but this com.teamcenter.rac.external dependency
*is not a jar its folder *. 
Have a look of com.teamcenter.rac.external dependency folder
<http://servicemix.396122.n5.nabble.com/file/n5722692/external.png> 

MANIFEST.MF of this com.teamcenter.rac.external
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: External Plug-in
Bundle-SymbolicName: com.teamcenter.rac.external
Bundle-Version: 10000.1.0
TC-Version: V10000.1.0.40_20150421.00
Bundle-Vendor: Siemens PLM Software, Inc.
Eclipse-BuddyPolicy: registered
Bundle-RequiredExecutionEnvironment: JavaSE-1.6

My question is how can I add this com.teamcenter.rac.external dependency
which is in form of folder in features.xml file? 

By the way  All the dependent jars/folders are eclipse plugins.

Below is my servicemix details
1. Apache servicemix 5.4.0
2. Apache karaf 2.4.1

Thank you



--
View this message in context: http://servicemix.396122.n5.nabble.com/install-external-osgi-jars-using-karaf-s-feature-xml-tp5722692.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: install external osgi jars using karaf's feature.xml

Posted by Sobkowiak Krzysztof <kr...@gmail.com>.
Hi

I don't know if I have correctly understood your question.  Do you ask how you can install all the cxf dependencies? Almost everything is installed in ServiceMix. The CXF
project provides feature file for the CXF libraries and it's dependencies. You can see it by pitying:

karaf@root> features:list | grep cxf
[installed  ] [2.14.1          ] camel-cxf                               camel-2.14.1
[uninstalled] [5.4.0           ] examples-cxf-osgi                       servicemix-examples-5.4.0
....
[installed  ] [3.0.2           ] cxf-specs                               cxf-3.0.2
[installed  ] [3.0.2           ] cxf-jaxb                                cxf-3.0.2
[uninstalled] [3.0.2           ] cxf-abdera                              cxf-3.0.2
[installed  ] [2.0.2           ] wss4j                                   cxf-3.0.2
[installed  ] [3.0.2           ] cxf-core                                cxf-3.0.2
[installed  ] [3.0.2           ] cxf-wsdl                                cxf-3.0.2
....

If you need something what is not installed by default, you can install the feature manually (using features:install command) or reference it in your feature. You must only
ensure your bundle imports all necessary packages from the CXF stuff.

Regards
Krzysztof


On 16.06.2015 14:18, Nagesh wrote:
> Thank you so much. You saved my life.
>
> As you suggested I have converted unzipped bundles to jar again using below
> command
>
> jar cf com.rac.teamcenter.external.jar *
>
> and then modified manifest.mf file of this new jar. Now I am able to install
> features.
>
> But one thing I would like to ask you is, how karaf/servicemix read/activate
> this bundles?. because in my case I have added external dependencies to
> cxf-osgi example project e.g.  TcSoaClient_10000.1.0.jar. (I am doing all
> this to create cxf web service and deploy it in servicemix) . I have added
> this jar as cxf-osgi web service dependency , this external jar depend on
> five more external jar, that five more external jar again depend on its own
> dependencies and so on. 
>
> This dependencies chain is going on and on. do karaf/servicemix always
> deploy anythings on its way to so called bundle? e.g is .war, .wab get
> installed as bundle internally? How can I handle this external dependencies
> jars in case of cxf web service? 
>
> Thank you
>
>
>
> --
> View this message in context: http://servicemix.396122.n5.nabble.com/install-external-osgi-jars-using-karaf-s-feature-xml-tp5722692p5722697.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.

-- 
Krzysztof Sobkowiak

JEE & OSS Architect
Apache Software Foundation Member
Apache ServiceMix <http://servicemix.apache.org/> Committer & PMC
Senior Solution Architect @ Capgemini SSC <http://www.pl.capgemini-sdm.com/en/>

Re: install external osgi jars using karaf's feature.xml

Posted by Nagesh <ni...@gmail.com>.
Thank you so much. You saved my life.

As you suggested I have converted unzipped bundles to jar again using below
command

jar cf com.rac.teamcenter.external.jar *

and then modified manifest.mf file of this new jar. Now I am able to install
features.

But one thing I would like to ask you is, how karaf/servicemix read/activate
this bundles?. because in my case I have added external dependencies to
cxf-osgi example project e.g.  TcSoaClient_10000.1.0.jar. (I am doing all
this to create cxf web service and deploy it in servicemix) . I have added
this jar as cxf-osgi web service dependency , this external jar depend on
five more external jar, that five more external jar again depend on its own
dependencies and so on. 

This dependencies chain is going on and on. do karaf/servicemix always
deploy anythings on its way to so called bundle? e.g is .war, .wab get
installed as bundle internally? How can I handle this external dependencies
jars in case of cxf web service? 

Thank you



--
View this message in context: http://servicemix.396122.n5.nabble.com/install-external-osgi-jars-using-karaf-s-feature-xml-tp5722692p5722697.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: install external osgi jars using karaf's feature.xml

Posted by Sobkowiak Krzysztof <kr...@gmail.com>.
Hi

It looks like it is an unzipped bundle. Try to pack it into a jar file containing the whole content and add it into your feature. I'm not sure whether Karaf/ServiceMix
supports the unzipped bundles in features. You must probably also adjust the classpath in the Manifest file like here http://wiki.osgi.org/wiki/Bundle-ClassPath, but try
without it first


Regards
Krzysztof

On 16.06.2015 11:44, Nagesh wrote:
> Hello,
>
> I have created features.xml as below to deploy external jar in servicemix.
> But I am getting error to do so. please help. 
>
> Below are the things which I have tried.
>
> STEP 1. Created features.xml file as below
>
> <features name="NumberGenFeature">
>     <feature name="NumberGenFeature" version="1.0.0">
>         <bundle>file:/pathto/externaljar/TcSoaClient_10000.1.0.jar</bundle>
>     </feature>
> </features>
>
> STEP 2. Added this feature to servicemix karaf using command
>
> features:addurl file:pathto/features.xml
>
> STEP 3. Then install this feature using command
> feature:install NumberGenFeature
>
> but I get below error after STEP 3
> <http://servicemix.396122.n5.nabble.com/file/n5722692/SERVICEMIX.jpg> 
> MANIFEST.MF file from TcSoaClient_10000.1.0.jar
>
> Ant-Version: Apache Ant 1.7.0
> Created-By: 21.1-b02 (Oracle Corporation)
> Implementation-Title: Teamcenter Services Client
> Implementation-Version: 10000.1.0, April 21, 2015
> Implementation-Vendor: Siemens PLM Software, Inc.
> Bundle-ManifestVersion: 2
> Bundle-Name: Teamcenter Services Client
> Bundle-SymbolicName: TcSoaClient
> Bundle-Version: 10000.1.0
> TC-Version: V10000.1.0.40_20150421.00
> Bundle-ClassPath: .
> Bundle-Vendor: Siemens PLM Software, Inc.
> Bundle-Localization: plugin
> Bundle-ActivationPolicy: lazy
> Require-Bundle: *com.teamcenter.rac.external*,com.teamcenter.SecuritySer
> vices,tcgatewaystubs,TcSoaCommon
>
>
> From manifest file its clear that TcSoaClient_10000.1.0.jar is dependent on
> com.teamcenter.rac.external, but this com.teamcenter.rac.external dependency
> *is not a jar its folder *. 
> Have a look of com.teamcenter.rac.external dependency folder
> <http://servicemix.396122.n5.nabble.com/file/n5722692/external.png> 
>
> MANIFEST.MF of this com.teamcenter.rac.external
> Manifest-Version: 1.0
> Bundle-ManifestVersion: 2
> Bundle-Name: External Plug-in
> Bundle-SymbolicName: com.teamcenter.rac.external
> Bundle-Version: 10000.1.0
> TC-Version: V10000.1.0.40_20150421.00
> Bundle-Vendor: Siemens PLM Software, Inc.
> Eclipse-BuddyPolicy: registered
> Bundle-RequiredExecutionEnvironment: JavaSE-1.6
>
> My question is how can I add this com.teamcenter.rac.external dependency
> which is in form of folder in features.xml file? 
>
> By the way  All the dependent jars/folders are eclipse plugins.
>
> Below is my servicemix details
> 1. Apache servicemix 5.4.0
> 2. Apache karaf 2.4.1
>
> Thank you
>
>
>
> --
> View this message in context: http://servicemix.396122.n5.nabble.com/install-external-osgi-jars-using-karaf-s-feature-xml-tp5722692.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.

-- 
Krzysztof Sobkowiak

JEE & OSS Architect
Apache Software Foundation Member
Apache ServiceMix <http://servicemix.apache.org/> Committer & PMC
Senior Solution Architect @ Capgemini SSC <http://www.pl.capgemini-sdm.com/en/>