Hi Julien,

just for testing I'd suggest throwing them into the deploy folder,
they are picked up from there.
As Charles already mentioned, after you feel comfortable enough you
can play around with feature files.

regards, Achim

2012/8/13 Julien Martin <[email protected]>:
> Charles,
>
> I see your point and appreciate your help.
>
> I successfully installed Spring batch infrastructure running the command you
> provided. Do you have a tip for installing multiple jars at the same time? I
> have 39 jars to install and I am just wondering if there is an alternate way
> to install them than running the command 39 times.
>
> Another problem I have is that my app uses SpringFramework 3.0.5.RELEASE and
> unfortunately, Spring batch already comes with transitive dependencies for
> SpringFramework 2.x.x... hence the error I was getting. I guess Karaf will
> pick up the correct version?
>
> Julien.
>
>
>
> 2012/8/13 Charles Moulliard <[email protected]>
>>
>> Hi Julien,
>>
>> Until now, I suggest that you use basic features of Karaf/OSGI until you
>> have a better knowledge about what Karaf can offer
>> (http://karaf.apache.org/manual/latest-2.2.x/users-guide/provisioning.html).
>>
>> However, I am not sure how to exclude dependencies (as one would do in
>> maven).
>> >> You cannot exclude dependencies when you use OSGI mechanism or features
>> >> of karaf to install bundles/jars. This is why I provided you the command 
>> >> to
>> >> deploy Spring Batch. As Spring Batch needs some Spring bundles, they will 
>> >> be
>> >> installed (if this is not already the case) by using the command
>> >> "features:install spring".
>>
>> Regards,
>>
>> Charles
>>
>>
>> On Mon, Aug 13, 2012 at 1:33 PM, Julien Martin <[email protected]> wrote:
>>>
>>> Thanks,
>>> One more question: I think I found a way to install jar into Karaf using
>>> a feature.xml file.
>>> However, I am not sure how to exclude dependencies (as one would do in
>>> maven).
>>> Can you please advise?
>>> Regards,
>>> J.
>>>
>>> P.S. I get this:
>>> Error executing command: Could not start bundle
>>> mvn:org.springframework.batch/spring-batch-core/2.1.8.RELEASE in feature(s)
>>> batchFeature-1.0: Unable t
>>> o resolve module org.springframework.batch.core [175.0] because it is
>>> exposed to package 'org.springframework.context.support' from
>>> org.springframewor
>>> k.context [180.0] and org.springframework.context [57.0] via two
>>> dependency chains.
>>>
>>> Chain 1:
>>>   org.springframework.batch.core [175.0]
>>>     import:
>>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>>>      |
>>>     export: package=org.springframework.context.support
>>>   org.springframework.context [180.0]
>>>
>>> Chain 2:
>>>   org.springframework.batch.core [175.0]
>>>     import:
>>> (&(package=org.springframework.osgi.context.support)(version>=1.1.0)(!(version>=2.0.0)))
>>>      |
>>>     export: package=org.springframework.osgi.context.support;
>>> uses:=org.springframework.context.support
>>>   org.springframework.osgi.core [61.0]
>>>     import:
>>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>>>      |
>>>     export: package=org.springframework.context.support
>>>   org.springframework.context [57.0]
>>>
>>> 2012/8/13 Charles Moulliard <[email protected]>
>>>>
>>>> I have no idea if the Spring jar is already a bundle
>>>> (http://en.wikipedia.org/wiki/OSGi#Bundles). So I suggest that you use the
>>>> following command to install it :
>>>>
>>>> install -s
>>>> wrap:mvn:org.springframework.batch/spring-batch-infrastructure/2.10
>>>>
>>>> Verify also that the Maven Spring repo defined here
>>>> (http://static.springsource.org/spring-batch/downloads.html) is well added
>>>> in this file etc/org.aps4j.pax.url.mvn.cfg
>>>>
>>>>
>>>> On Mon, Aug 13, 2012 at 1:08 PM, Julien Martin <[email protected]> wrote:
>>>>>
>>>>> How do I install the Spring batch jars/bundle into Karaf?
>>>>> Regards,
>>>>> J.
>>>>>
>>>>> 2012/8/13 Charles Moulliard <[email protected]>
>>>>>>
>>>>>> You get this error because the bundle containing the package
>>>>>> (org.springframework.batch.core) is not installed or the version 
>>>>>> installed
>>>>>> is not >= 2.1.0
>>>>>>
>>>>>>
>>>>>> On Mon, Aug 13, 2012 at 12:53 PM, Julien Martin <[email protected]>
>>>>>> wrote:
>>>>>>>
>>>>>>> Charles,
>>>>>>>
>>>>>>> Once I have dropped the jar into the deploy directory, here is what
>>>>>>> happens:
>>>>>>>
>>>>>>> karaf@root> osgi:start 123
>>>>>>> org.osgi.framework.BundleException: Unresolved constraint in bundle
>>>>>>> spring-batch-demo-trc-dm [123]: Unable to resolve 123.0: missing 
>>>>>>> requirement
>>>>>>> [123.
>>>>>>> 0] package;
>>>>>>> (&(package=org.springframework.batch.core)(version>=2.1.0)(!(version>=3.0.0)))
>>>>>>>
>>>>>>>
>>>>>>> FYI, here is my POM:
>>>>>>>
>>>>>>> <project xmlns="http://maven.apache.org/POM/4.0.0";
>>>>>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>>>>>>> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
>>>>>>> http://maven.apache.org/xsd/maven-4.0.0.xsd";>
>>>>>>> <modelVersion>4.0.0</modelVersion>
>>>>>>> <groupId>spring-batch-demo-trc-dm</groupId>
>>>>>>> <artifactId>spring-batch-demo-trc-dm</artifactId>
>>>>>>> <version>1.0.0-SNAPSHOT</version>
>>>>>>> <dependencies>
>>>>>>> <dependency>
>>>>>>> <groupId>junit</groupId>
>>>>>>> <artifactId>junit</artifactId>
>>>>>>> <version>4.10</version>
>>>>>>> <scope>test</scope>
>>>>>>> </dependency>
>>>>>>> <dependency>
>>>>>>> <groupId>org.apache.felix</groupId>
>>>>>>> <artifactId>org.osgi.core</artifactId>
>>>>>>> <version>1.4.0</version>
>>>>>>> </dependency>
>>>>>>> <dependency>
>>>>>>> <groupId>org.springframework.batch</groupId>
>>>>>>> <artifactId>spring-batch-core</artifactId>
>>>>>>> <version>${spring.batch.version}</version>
>>>>>>> <exclusions>
>>>>>>> <exclusion>
>>>>>>> <artifactId>spring-core</artifactId>
>>>>>>> <groupId>org.springframework</groupId>
>>>>>>> </exclusion>
>>>>>>> <exclusion>
>>>>>>> <artifactId>spring-aop</artifactId>
>>>>>>> <groupId>org.springframework</groupId>
>>>>>>> </exclusion>
>>>>>>> <exclusion>
>>>>>>> <artifactId>spring-beans</artifactId>
>>>>>>> <groupId>org.springframework</groupId>
>>>>>>> </exclusion>
>>>>>>> <exclusion>
>>>>>>> <artifactId>spring-context</artifactId>
>>>>>>> <groupId>org.springframework</groupId>
>>>>>>> </exclusion>
>>>>>>> <exclusion>
>>>>>>> <artifactId>spring-tx</artifactId>
>>>>>>> <groupId>org.springframework</groupId>
>>>>>>> </exclusion>
>>>>>>> <exclusion>
>>>>>>> <artifactId>commons-logging</artifactId>
>>>>>>> <groupId>commons-logging</groupId>
>>>>>>> </exclusion>
>>>>>>> </exclusions>
>>>>>>> </dependency>
>>>>>>> <dependency>
>>>>>>> <groupId>org.springframework.batch</groupId>
>>>>>>> <artifactId>spring-batch-infrastructure</artifactId>
>>>>>>> <version>${spring.batch.version}</version>
>>>>>>> <exclusions>
>>>>>>> <exclusion>
>>>>>>> <artifactId>spring-core</artifactId>
>>>>>>> <groupId>org.springframework</groupId>
>>>>>>> </exclusion>
>>>>>>> </exclusions>
>>>>>>> </dependency>
>>>>>>> <dependency>
>>>>>>> <groupId>org.springframework</groupId>
>>>>>>> <artifactId>spring-core</artifactId>
>>>>>>> <version>${spring.version}</version>
>>>>>>> <exclusions>
>>>>>>> <exclusion>
>>>>>>> <artifactId>commons-logging</artifactId>
>>>>>>> <groupId>commons-logging</groupId>
>>>>>>> </exclusion>
>>>>>>> </exclusions>
>>>>>>> </dependency>
>>>>>>> <dependency>
>>>>>>> <groupId>org.springframework</groupId>
>>>>>>> <artifactId>spring-beans</artifactId>
>>>>>>> <version>${spring.version}</version>
>>>>>>> </dependency>
>>>>>>> <dependency>
>>>>>>> <groupId>org.springframework</groupId>
>>>>>>> <artifactId>spring-context</artifactId>
>>>>>>> <version>${spring.version}</version>
>>>>>>> </dependency>
>>>>>>> <dependency>
>>>>>>> <groupId>org.springframework</groupId>
>>>>>>> <artifactId>spring-context-support</artifactId>
>>>>>>> <version>${spring.version}</version>
>>>>>>> </dependency>
>>>>>>> <dependency>
>>>>>>> <groupId>org.springframework</groupId>
>>>>>>> <artifactId>spring-jdbc</artifactId>
>>>>>>> <version>${spring.version}</version>
>>>>>>> </dependency>
>>>>>>> <dependency>
>>>>>>> <groupId>org.springframework</groupId>
>>>>>>> <artifactId>spring-tx</artifactId>
>>>>>>> <version>${spring.version}</version>
>>>>>>> </dependency>
>>>>>>> <dependency>
>>>>>>> <groupId>org.slf4j</groupId>
>>>>>>> <artifactId>slf4j-api</artifactId>
>>>>>>> <version>${slf4j.version}</version>
>>>>>>> </dependency>
>>>>>>> <dependency>
>>>>>>> <groupId>org.slf4j</groupId>
>>>>>>> <artifactId>jcl-over-slf4j</artifactId>
>>>>>>> <version>${slf4j.version}</version>
>>>>>>> </dependency>
>>>>>>> <dependency>
>>>>>>> <groupId>c3p0</groupId>
>>>>>>> <artifactId>c3p0</artifactId>
>>>>>>> <version>0.9.1.2</version>
>>>>>>> </dependency>
>>>>>>> <dependency>
>>>>>>> <groupId>commons-io</groupId>
>>>>>>> <artifactId>commons-io</artifactId>
>>>>>>> <version>2.0.1</version>
>>>>>>> </dependency>
>>>>>>> <dependency>
>>>>>>> <groupId>org.springframework</groupId>
>>>>>>> <artifactId>spring-test</artifactId>
>>>>>>> <version>${spring.version}</version>
>>>>>>> <scope>test</scope>
>>>>>>> </dependency>
>>>>>>> <dependency>
>>>>>>> <groupId>mysql</groupId>
>>>>>>> <artifactId>mysql-connector-java</artifactId>
>>>>>>> <version>5.1.18</version>
>>>>>>> </dependency>
>>>>>>> <dependency>
>>>>>>> <groupId>log4j</groupId>
>>>>>>> <artifactId>log4j</artifactId>
>>>>>>> <version>1.2.16</version>
>>>>>>> </dependency>
>>>>>>> <dependency>
>>>>>>> <groupId>org.codehaus.btm</groupId>
>>>>>>> <artifactId>btm</artifactId>
>>>>>>> <version>2.1.2</version>
>>>>>>> </dependency>
>>>>>>> <dependency>
>>>>>>> <groupId>org.slf4j</groupId>
>>>>>>> <artifactId>slf4j-log4j12</artifactId>
>>>>>>> <version>1.6.1</version>
>>>>>>> <scope>runtime</scope>
>>>>>>> </dependency>
>>>>>>> <dependency>
>>>>>>> <groupId>org.springframework.batch</groupId>
>>>>>>> <artifactId>spring-batch-test</artifactId>
>>>>>>> <version>${spring.batch.version}</version>
>>>>>>> <scope>test</scope>
>>>>>>> </dependency>
>>>>>>> <dependency>
>>>>>>> <groupId>org.springframework</groupId>
>>>>>>> <artifactId>spring-oxm</artifactId>
>>>>>>> <version>${spring.version}</version>
>>>>>>> </dependency>
>>>>>>> <dependency>
>>>>>>> <groupId>org.springframework.integration</groupId>
>>>>>>> <artifactId>spring-integration-core</artifactId>
>>>>>>> <version>2.1.3.RELEASE</version>
>>>>>>> </dependency>
>>>>>>> <dependency>
>>>>>>> <groupId>org.springframework.integration</groupId>
>>>>>>> <artifactId>spring-integration-file</artifactId>
>>>>>>> <version>2.1.3.RELEASE</version>
>>>>>>> </dependency>
>>>>>>> <dependency>
>>>>>>> <groupId>org.springframework.batch</groupId>
>>>>>>> <artifactId>spring-batch-integration</artifactId>
>>>>>>> <version>1.2.1.RELEASE</version>
>>>>>>> </dependency>
>>>>>>> <dependency>
>>>>>>> <groupId>org.springframework.osgi</groupId>
>>>>>>> <artifactId>spring-osgi-extender</artifactId>
>>>>>>> <version>1.2.1</version>
>>>>>>> </dependency>
>>>>>>> <dependency>
>>>>>>> <groupId>org.springframework.osgi</groupId>
>>>>>>> <artifactId>spring-osgi-io</artifactId>
>>>>>>> <version>1.2.1</version>
>>>>>>> </dependency>
>>>>>>> <dependency>
>>>>>>> <groupId>org.springframework.osgi</groupId>
>>>>>>> <artifactId>spring-osgi-core</artifactId>
>>>>>>> <version>1.2.1</version>
>>>>>>> <exclusions>
>>>>>>> <exclusion>
>>>>>>> <artifactId>org.springframework.aop</artifactId>
>>>>>>> <groupId>org.springframework</groupId>
>>>>>>> </exclusion>
>>>>>>> <exclusion>
>>>>>>> <artifactId>org.springframework.context</artifactId>
>>>>>>> <groupId>org.springframework</groupId>
>>>>>>> </exclusion>
>>>>>>> <exclusion>
>>>>>>> <artifactId>org.springframework.beans</artifactId>
>>>>>>> <groupId>org.springframework</groupId>
>>>>>>> </exclusion>
>>>>>>> <exclusion>
>>>>>>> <artifactId>org.springframework.core</artifactId>
>>>>>>> <groupId>org.springframework</groupId>
>>>>>>> </exclusion>
>>>>>>> </exclusions>
>>>>>>> </dependency>
>>>>>>> </dependencies>
>>>>>>> <build>
>>>>>>> <plugins>
>>>>>>> <plugin>
>>>>>>> <groupId>org.apache.maven.plugins</groupId>
>>>>>>> <artifactId>maven-compiler-plugin</artifactId>
>>>>>>> <configuration>
>>>>>>> <source>${maven.compiler.source}</source>
>>>>>>> <target>${maven.compiler.target}</target>
>>>>>>> </configuration>
>>>>>>> </plugin>
>>>>>>> <plugin>
>>>>>>> <groupId>org.apache.felix</groupId>
>>>>>>> <artifactId>maven-bundle-plugin</artifactId>
>>>>>>> <extensions>true</extensions>
>>>>>>> <configuration>
>>>>>>> <instructions>
>>>>>>> <Export-Package>com.docapost.batch</Export-Package>
>>>>>>> </instructions>
>>>>>>> </configuration>
>>>>>>> </plugin>
>>>>>>> </plugins>
>>>>>>> </build>
>>>>>>> <properties>
>>>>>>> <spring.batch.version>2.1.8.RELEASE</spring.batch.version>
>>>>>>> <spring.version>3.0.5.RELEASE</spring.version>
>>>>>>> <slf4j.version>1.6.1</slf4j.version>
>>>>>>> <mockito.version>1.8.5</mockito.version>
>>>>>>> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
>>>>>>> <maven.compiler.source>1.6</maven.compiler.source>
>>>>>>> <maven.compiler.target>1.6</maven.compiler.target>
>>>>>>> </properties>
>>>>>>> <name>spring-batch-demo-trc</name>
>>>>>>> <packaging>bundle</packaging>
>>>>>>> </project>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> 2012/8/13 Charles Moulliard <[email protected]>
>>>>>>>>
>>>>>>>> Have you packaged your project (= created a bundle) as I explain in
>>>>>>>> my previous email ?
>>>>>>>> You can make a test by simply drag and drop your xxx.xml file into
>>>>>>>> the deploy directory of Karaf and check what happen (installed and 
>>>>>>>> started)
>>>>>>>> ?
>>>>>>>>
>>>>>>>>
>>>>>>>> On Mon, Aug 13, 2012 at 12:27 PM, Julien Martin <[email protected]>
>>>>>>>> wrote:
>>>>>>>>>
>>>>>>>>> Thanks Charles.
>>>>>>>>> I actually removed my activator and it still does not work (cf
>>>>>>>>> previous emails)...
>>>>>>>>> Any other idea?
>>>>>>>>> J.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> 2012/8/13 Charles Moulliard <[email protected]>
>>>>>>>>>>
>>>>>>>>>> Hi Julien,
>>>>>>>>>>
>>>>>>>>>> I just discovered that you use an activator class in charge to
>>>>>>>>>> load the Spring XML file. This is not at all required with Apache 
>>>>>>>>>> Karaf
>>>>>>>>>> using Spring DM technology or Apache Aries Blueprint (based on work 
>>>>>>>>>> done by
>>>>>>>>>> Spring DM project).
>>>>>>>>>> You simply needs to package the xml files under
>>>>>>>>>> META-INF/spring/myConfig.xml (Spring DM) or 
>>>>>>>>>> OSGI-INF/blueprint/myConfig.xml
>>>>>>>>>> and Spring DM or Blueprint will instantiate for you the context.
>>>>>>>>>>
>>>>>>>>>> Regards,
>>>>>>>>>>
>>>>>>>>>> Charles
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On Mon, Aug 13, 2012 at 11:24 AM, Julien Martin <[email protected]>
>>>>>>>>>> wrote:
>>>>>>>>>>>
>>>>>>>>>>> This is the output from osgi:list:
>>>>>>>>>>>
>>>>>>>>>>> karaf@root> osgi:list
>>>>>>>>>>> START LEVEL 100 , List Threshold: 50
>>>>>>>>>>>    ID   State         Blueprint      Spring    Level  Name
>>>>>>>>>>> [  80] [Active     ] [            ] [       ] [   80] Batch-dep
>>>>>>>>>>> (1.0.0)
>>>>>>>>>>> [  91] [Active     ] [            ] [       ] [   80] Batch
>>>>>>>>>>> (1.0.0)
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> 2012/8/13 Julien Martin <[email protected]>
>>>>>>>>>>>>
>>>>>>>>>>>> I forgot to include some details on how I deploy my app:
>>>>>>>>>>>>
>>>>>>>>>>>> karaf@root> osgi:install
>>>>>>>>>>>> file:///C:/Users/jumartin/Documents/plugins/batch_1.0.0.jar
>>>>>>>>>>>> Bundle ID: 91
>>>>>>>>>>>> karaf@root> osgi:start 91
>>>>>>>>>>>>
>>>>>>>>>>>> and then nothing happens. No output...
>>>>>>>>>>>> Regards,
>>>>>>>>>>>> J.
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> 2012/8/13 Julien Martin <[email protected]>
>>>>>>>>>>>>>
>>>>>>>>>>>>> Thanks,
>>>>>>>>>>>>> I've just removed my BundleActivator and redeployed my app to
>>>>>>>>>>>>> Karaf. It just doesn't pick up the Spring config file...
>>>>>>>>>>>>> Any other idea?
>>>>>>>>>>>>> Regards,
>>>>>>>>>>>>> J.
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> 2012/8/10 Jean-Baptiste Onofré <[email protected]>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Hi Julien,
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> You don't need any Activator with Spring-DM (and Blueprint).
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Put directly your beans.xml in META-INF/spring and Karaf will
>>>>>>>>>>>>>> load it for you.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Regards
>>>>>>>>>>>>>> JB
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> On 08/10/2012 06:37 PM, Julien Martin wrote:
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Hello,
>>>>>>>>>>>>>>> I managed to successfully install and start my bundle.
>>>>>>>>>>>>>>> However, nothing
>>>>>>>>>>>>>>> really happens once I have "osgi:start 88" started my bundle
>>>>>>>>>>>>>>> with id 88.
>>>>>>>>>>>>>>> The business logic is not run...
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Here is my activator:
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> *import org.osgi.framework.BundleActivator;*
>>>>>>>>>>>>>>> *import org.osgi.framework.BundleContext;*
>>>>>>>>>>>>>>> *import
>>>>>>>>>>>>>>> org.springframework.context.support.ClassPathXmlApplicationContext;*
>>>>>>>>>>>>>>> *
>>>>>>>>>>>>>>> *
>>>>>>>>>>>>>>> *public class Activator implements BundleActivator {*
>>>>>>>>>>>>>>> *
>>>>>>>>>>>>>>> *
>>>>>>>>>>>>>>> *private BundleContext context;*
>>>>>>>>>>>>>>> *
>>>>>>>>>>>>>>> *
>>>>>>>>>>>>>>> *@Override*
>>>>>>>>>>>>>>> *public void start(BundleContext context) throws Exception {*
>>>>>>>>>>>>>>> *this.context = context;*
>>>>>>>>>>>>>>> *new
>>>>>>>>>>>>>>> ClassPathXmlApplicationContext("META-INF/spring/batch-demo-trc.xml");*
>>>>>>>>>>>>>>> *}*
>>>>>>>>>>>>>>> *
>>>>>>>>>>>>>>> *
>>>>>>>>>>>>>>> *@Override*
>>>>>>>>>>>>>>> *public void stop(BundleContext context) throws Exception {*
>>>>>>>>>>>>>>> *this.context = context;*
>>>>>>>>>>>>>>> *// TODO Auto-generated method stub*
>>>>>>>>>>>>>>> *}*
>>>>>>>>>>>>>>> *
>>>>>>>>>>>>>>> *
>>>>>>>>>>>>>>> *}*
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> 2012/8/10 Julien Martin <[email protected]
>>>>>>>>>>>>>>> <mailto:[email protected]>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>     Thanks to both of you. I'll try as you advised and let
>>>>>>>>>>>>>>> you know.
>>>>>>>>>>>>>>>     Best regards,
>>>>>>>>>>>>>>>     J.
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>     2012/8/10 Freeman Fang <[email protected]
>>>>>>>>>>>>>>>     <mailto:[email protected]>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>         Hi,
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>         The spring deployer is only applicable for a plain
>>>>>>>>>>>>>>> spring file,
>>>>>>>>>>>>>>>           for example, you have a  plain spring camel router
>>>>>>>>>>>>>>> file, when
>>>>>>>>>>>>>>>         you drop it into $KARAF_HOME/deploy folder, a karaf
>>>>>>>>>>>>>>> spring
>>>>>>>>>>>>>>>         deployer will kick in and transform the blueprint
>>>>>>>>>>>>>>> file into a
>>>>>>>>>>>>>>>         bundle underlying.
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>         In your case, you have a jar which contain
>>>>>>>>>>>>>>> mySpringConfig.xml
>>>>>>>>>>>>>>>         and java class, you should OSGi-fy this jar first,
>>>>>>>>>>>>>>> that said,
>>>>>>>>>>>>>>>         change it to a bundle yourself.
>>>>>>>>>>>>>>>         You should use bnd tool or more popularly, use
>>>>>>>>>>>>>>>         maven-bundle-plugin to do this task.
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>         Freeman
>>>>>>>>>>>>>>>         -------------
>>>>>>>>>>>>>>>         Freeman Fang
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>         FuseSource
>>>>>>>>>>>>>>>         Email:[email protected]
>>>>>>>>>>>>>>> <mailto:email%[email protected]>
>>>>>>>>>>>>>>>         Web: fusesource.com <http://fusesource.com>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>         Twitter: freemanfang
>>>>>>>>>>>>>>>         Blog: http://freemanfang.blogspot.com
>>>>>>>>>>>>>>>         http://blog.sina.com.cn/u/1473905042
>>>>>>>>>>>>>>>         weibo: http://weibo.com/u/1473905042
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>         On 2012-8-10, at 下午3:49, Julien Martin wrote:
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>         I would be very grateful for some clarification
>>>>>>>>>>>>>>>> about the
>>>>>>>>>>>>>>>>         following:
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>         /"Karaf includes a deployer that is able to deploy
>>>>>>>>>>>>>>>> plain
>>>>>>>>>>>>>>>>         blueprint or spring-dm configuration files./
>>>>>>>>>>>>>>>>         /The deployer will transform on the fly any spring
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>         configuration file dropped into the deploy folder
>>>>>>>>>>>>>>>> into a valid
>>>>>>>>>>>>>>>>         OSGi bundle."/
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>         I am not sure what is meant by "spring-dm
>>>>>>>>>>>>>>>> configuration file"...
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>         What I have now is a jar (non-osgi) that contains a
>>>>>>>>>>>>>>>>         META-INF/spring/mySpringConfig.xml plus the relevant
>>>>>>>>>>>>>>>> java
>>>>>>>>>>>>>>>>         classe; all dependencies/jars including the
>>>>>>>>>>>>>>>> spring-dm 1.2.1.
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>         How am I supposed to package all that so that the
>>>>>>>>>>>>>>>> karaf
>>>>>>>>>>>>>>>>         feature described above applies?
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>         Regards,
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>         Julien.
>>>>>>>>>>>>>>>>         2012/8/9 Julien Martin <[email protected]
>>>>>>>>>>>>>>>>         <mailto:[email protected]>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>             thanks Achim
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>             2012/8/9 Achim Nierbeck <[email protected]
>>>>>>>>>>>>>>>>             <mailto:[email protected]>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>                 Hi
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>                 well if you have placed your
>>>>>>>>>>>>>>>> spring-application.xml in
>>>>>>>>>>>>>>>>                 the right
>>>>>>>>>>>>>>>>                 directory of your bundle it'll start right
>>>>>>>>>>>>>>>> away.
>>>>>>>>>>>>>>>>                 This should be something like
>>>>>>>>>>>>>>>> /META-INF/spring/.
>>>>>>>>>>>>>>>>                 If you want to consume other services take a
>>>>>>>>>>>>>>>> look at
>>>>>>>>>>>>>>>>                 the spring-dm
>>>>>>>>>>>>>>>>                 documentation on how to reference those.
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>                 something similar to <reference
>>>>>>>>>>>>>>>> interface="x.y.z">
>>>>>>>>>>>>>>>>                 will give you a
>>>>>>>>>>>>>>>>                 bean to this service.
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>                 Regards, Achim
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>                 2012/8/9 Julien Martin <[email protected]
>>>>>>>>>>>>>>>>                 <mailto:[email protected]>>:
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>                 > Thanks Achim,
>>>>>>>>>>>>>>>>                 > 1. I have successfully installed the
>>>>>>>>>>>>>>>> spring-dm feature.
>>>>>>>>>>>>>>>>                 > 2. I will next package my app as a Spring
>>>>>>>>>>>>>>>> DM app.
>>>>>>>>>>>>>>>>                 > 3. What do I do after 2. in order to
>>>>>>>>>>>>>>>> deploy and
>>>>>>>>>>>>>>>>                 manage my app with Karaf?
>>>>>>>>>>>>>>>>                 > Regards,
>>>>>>>>>>>>>>>>                 > J.
>>>>>>>>>>>>>>>>                 >
>>>>>>>>>>>>>>>>                 >
>>>>>>>>>>>>>>>>                 > 2012/8/9 Achim Nierbeck
>>>>>>>>>>>>>>>> <[email protected]
>>>>>>>>>>>>>>>>                 <mailto:[email protected]>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>                 >>
>>>>>>>>>>>>>>>>                 >> Hi,
>>>>>>>>>>>>>>>>                 >>
>>>>>>>>>>>>>>>>                 >> for starting spring inside a OSGi
>>>>>>>>>>>>>>>> container you can
>>>>>>>>>>>>>>>>                 use spring-dm [1].
>>>>>>>>>>>>>>>>                 >> For Karaf you just need to install the
>>>>>>>>>>>>>>>> spring-dm
>>>>>>>>>>>>>>>>                 feature and then you're
>>>>>>>>>>>>>>>>                 >> set.
>>>>>>>>>>>>>>>>                 >> As Spring-DM 2.0 is equivalent to
>>>>>>>>>>>>>>>> blueprint only
>>>>>>>>>>>>>>>>                 spring-dm 1.2.1 is
>>>>>>>>>>>>>>>>                 >> supported by Karaf right now but this
>>>>>>>>>>>>>>>> should be
>>>>>>>>>>>>>>>>                 sufficient for you.
>>>>>>>>>>>>>>>>                 >>
>>>>>>>>>>>>>>>>                 >> regards, Achim
>>>>>>>>>>>>>>>>                 >>
>>>>>>>>>>>>>>>>                 >> [1] -
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> http://static.springsource.org/osgi/docs/1.2.1/reference/html/
>>>>>>>>>>>>>>>>                 >>
>>>>>>>>>>>>>>>>                 >> 2012/8/9 Julien Martin <[email protected]
>>>>>>>>>>>>>>>>                 <mailto:[email protected]>>:
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>                 >> > Hello,
>>>>>>>>>>>>>>>>                 >> >
>>>>>>>>>>>>>>>>                 >> > I am in the process of developing a
>>>>>>>>>>>>>>>> Spring app.
>>>>>>>>>>>>>>>>                 As it stands the app is
>>>>>>>>>>>>>>>>                 >> > currently run as follows by a main
>>>>>>>>>>>>>>>> class:
>>>>>>>>>>>>>>>>                 >> >
>>>>>>>>>>>>>>>>                 >> > import
>>>>>>>>>>>>>>>>                 >> >
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> org.springframework.context.support.ClassPathXmlApplicationContext;
>>>>>>>>>>>>>>>>                 >> >
>>>>>>>>>>>>>>>>                 >> >
>>>>>>>>>>>>>>>>                 >> > public class Bootstrap {
>>>>>>>>>>>>>>>>                 >> >
>>>>>>>>>>>>>>>>                 >> >
>>>>>>>>>>>>>>>>                 >> >     public static void main(String[]
>>>>>>>>>>>>>>>> args) {
>>>>>>>>>>>>>>>>                 >> >
>>>>>>>>>>>>>>>>                 >> >         new
>>>>>>>>>>>>>>>>                 >> >
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> ClassPathXmlApplicationContext("spring-integration-demo.xml");
>>>>>>>>>>>>>>>>                 >> >
>>>>>>>>>>>>>>>>                 >> >     }
>>>>>>>>>>>>>>>>                 >> >
>>>>>>>>>>>>>>>>                 >> >
>>>>>>>>>>>>>>>>                 >> > }
>>>>>>>>>>>>>>>>                 >> >
>>>>>>>>>>>>>>>>                 >> > I would like to integrate my app into
>>>>>>>>>>>>>>>> Apache
>>>>>>>>>>>>>>>>                 Karaf (or integrate Apache
>>>>>>>>>>>>>>>>                 >> > Karaf into my app?).
>>>>>>>>>>>>>>>>                 >> >
>>>>>>>>>>>>>>>>                 >> > I am not sure where and how to start.
>>>>>>>>>>>>>>>> Can someone
>>>>>>>>>>>>>>>>                 please provide basic
>>>>>>>>>>>>>>>>                 >> > advice and/or pointer to relevant
>>>>>>>>>>>>>>>> documentation?
>>>>>>>>>>>>>>>>                 >> >
>>>>>>>>>>>>>>>>                 >> > Thanks in advance,
>>>>>>>>>>>>>>>>                 >> >
>>>>>>>>>>>>>>>>                 >> > J.
>>>>>>>>>>>>>>>>                 >>
>>>>>>>>>>>>>>>>                 >>
>>>>>>>>>>>>>>>>                 >>
>>>>>>>>>>>>>>>>                 >> --
>>>>>>>>>>>>>>>>                 >>
>>>>>>>>>>>>>>>>                 >> Apache Karaf <http://karaf.apache.org/>
>>>>>>>>>>>>>>>> Committer & PMC
>>>>>>>>>>>>>>>>                 >> OPS4J Pax Web
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> <http://wiki.ops4j.org/display/paxweb/Pax+Web/>
>>>>>>>>>>>>>>>>                 >> Committer & Project Lead
>>>>>>>>>>>>>>>>                 >> OPS4J Pax for Vaadin
>>>>>>>>>>>>>>>>                 >>
>>>>>>>>>>>>>>>> <http://team.ops4j.org/wiki/display/PAXVAADIN/Home>
>>>>>>>>>>>>>>>>                 Commiter & Project
>>>>>>>>>>>>>>>>                 >> Lead
>>>>>>>>>>>>>>>>                 >> blog <http://notizblog.nierbeck.de/>
>>>>>>>>>>>>>>>>                 >
>>>>>>>>>>>>>>>>                 >
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>                 --
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>                 Apache Karaf <http://karaf.apache.org/>
>>>>>>>>>>>>>>>> Committer & PMC
>>>>>>>>>>>>>>>>                 OPS4J Pax Web
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> <http://wiki.ops4j.org/display/paxweb/Pax+Web/>
>>>>>>>>>>>>>>>>                 Committer & Project Lead
>>>>>>>>>>>>>>>>                 OPS4J Pax for Vaadin
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> <http://team.ops4j.org/wiki/display/PAXVAADIN/Home>
>>>>>>>>>>>>>>>>                 Commiter & Project
>>>>>>>>>>>>>>>>                 Lead
>>>>>>>>>>>>>>>>                 blog <http://notizblog.nierbeck.de/>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> --
>>>>>>>>>>>>>> Jean-Baptiste Onofré
>>>>>>>>>>>>>> [email protected]
>>>>>>>>>>>>>> http://blog.nanthrax.net
>>>>>>>>>>>>>> Talend - http://www.talend.com
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> --
>>>>>>>>>> Charles Moulliard
>>>>>>>>>> Apache Committer / Sr. Pr. Consultant at FuseSource.com
>>>>>>>>>> Twitter : @cmoulliard
>>>>>>>>>> Blog : http://cmoulliard.blogspot.com
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>> Charles Moulliard
>>>>>>>> Apache Committer / Sr. Pr. Consultant at FuseSource.com
>>>>>>>> Twitter : @cmoulliard
>>>>>>>> Blog : http://cmoulliard.blogspot.com
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Charles Moulliard
>>>>>> Apache Committer / Sr. Pr. Consultant at FuseSource.com
>>>>>> Twitter : @cmoulliard
>>>>>> Blog : http://cmoulliard.blogspot.com
>>>>>>
>>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Charles Moulliard
>>>> Apache Committer / Sr. Pr. Consultant at FuseSource.com
>>>> Twitter : @cmoulliard
>>>> Blog : http://cmoulliard.blogspot.com
>>>>
>>>>
>>>
>>
>>
>>
>> --
>> Charles Moulliard
>> Apache Committer / Sr. Pr. Consultant at FuseSource.com
>> Twitter : @cmoulliard
>> Blog : http://cmoulliard.blogspot.com
>>
>>
>



-- 

Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/>
Committer & Project Lead
OPS4J Pax for Vaadin
<http://team.ops4j.org/wiki/display/PAXVAADIN/Home> Commiter & Project
Lead
blog <http://notizblog.nierbeck.de/>

Reply via email to