You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by Julien Martin <ba...@gmail.com> on 2012/08/09 13:10:13 UTC

Embedding a Spring Integration app into Apache Karaf

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<http://karaf.apache.org/>
* (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.

Re: Embedding a Spring Integration app into Apache Karaf

Posted by Charles Moulliard <ch...@gmail.com>.
If you feel comfortable now with Karaf and OSGI install command, I suggest
that you define a features.xml file to install the 39 bundles (
http://karaf.apache.org/manual/latest-2.2.x/users-guide/provisioning.html).

Can also deploy Spring 2.x on Karaf (features:install spring/2.x.x) and
check that it works please ?

There is no mechanism allowing to escape transitive dependencies on Karaf
except if you use fab technology (
http://fuse.fusesource.org/bundle/overview.html)

On Mon, Aug 13, 2012 at 2:13 PM, Julien Martin <ba...@gmail.com> wrote:

> 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 <ch...@gmail.com>
>
>> 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 <ba...@gmail.com> 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 <ch...@gmail.com>
>>>
>>>> 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 <ba...@gmail.com>wrote:
>>>>
>>>>> How do I install the Spring batch jars/bundle into Karaf?
>>>>> Regards,
>>>>> J.
>>>>>
>>>>> 2012/8/13 Charles Moulliard <ch...@gmail.com>
>>>>>
>>>>>> 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 <ba...@gmail.com>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 <ch...@gmail.com>
>>>>>>>
>>>>>>>> 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 <ba...@gmail.com>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 <ch...@gmail.com>
>>>>>>>>>
>>>>>>>>>> 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 <balteo@gmail.com
>>>>>>>>>> > 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 <ba...@gmail.com>
>>>>>>>>>>>
>>>>>>>>>>>> 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 <ba...@gmail.com>
>>>>>>>>>>>>
>>>>>>>>>>>>> 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é <jb...@nanthrax.net>
>>>>>>>>>>>>>
>>>>>>>>>>>>>> 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 <balteo@gmail.com <mailto:
>>>>>>>>>>>>>>> balteo@gmail.com>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>     Thanks to both of you. I'll try as you advised and let
>>>>>>>>>>>>>>> you know.
>>>>>>>>>>>>>>>     Best regards,
>>>>>>>>>>>>>>>     J.
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>     2012/8/10 Freeman Fang <freeman.fang@gmail.com
>>>>>>>>>>>>>>>     <mailto:freeman.fang@gmail.com**>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>         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:ffang@fusesource.com <mailto:Email%3Affang@**
>>>>>>>>>>>>>>> fusesource.com <Em...@fusesource.com>>
>>>>>>>>>>>>>>>         Web: fusesource.com <http://fusesource.com>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>         Twitter: freemanfang
>>>>>>>>>>>>>>>         Blog: http://freemanfang.blogspot.**com<http://freemanfang.blogspot.com>
>>>>>>>>>>>>>>>         http://blog.sina.com.cn/u/**1473905042<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 <balteo@gmail.com
>>>>>>>>>>>>>>>>         <ma...@gmail.com>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>             thanks Achim
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>             2012/8/9 Achim Nierbeck <
>>>>>>>>>>>>>>>> bcanhome@googlemail.com
>>>>>>>>>>>>>>>>             <ma...@googlemail.com>
>>>>>>>>>>>>>>>> >>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>                 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 <balteo@gmail.com
>>>>>>>>>>>>>>>>                 <ma...@gmail.com>>:
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>                 > 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 <
>>>>>>>>>>>>>>>> bcanhome@googlemail.com
>>>>>>>>>>>>>>>>                 <ma...@googlemail.com>
>>>>>>>>>>>>>>>> >>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>                 >>
>>>>>>>>>>>>>>>>                 >> 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/<http://static.springsource.org/osgi/docs/1.2.1/reference/html/>
>>>>>>>>>>>>>>>>                 >>
>>>>>>>>>>>>>>>>                 >> 2012/8/9 Julien Martin <balteo@gmail.com
>>>>>>>>>>>>>>>>                 <ma...@gmail.com>>:
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>                 >> > 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/<http://wiki.ops4j.org/display/paxweb/Pax+Web/>
>>>>>>>>>>>>>>>> >
>>>>>>>>>>>>>>>>                 >> Committer & Project Lead
>>>>>>>>>>>>>>>>                 >> OPS4J Pax for Vaadin
>>>>>>>>>>>>>>>>                 >> <http://team.ops4j.org/wiki/**
>>>>>>>>>>>>>>>> display/PAXVAADIN/Home<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/<http://wiki.ops4j.org/display/paxweb/Pax+Web/>
>>>>>>>>>>>>>>>> >
>>>>>>>>>>>>>>>>                 Committer & Project Lead
>>>>>>>>>>>>>>>>                 OPS4J Pax for Vaadin
>>>>>>>>>>>>>>>>                 <http://team.ops4j.org/wiki/**
>>>>>>>>>>>>>>>> display/PAXVAADIN/Home<http://team.ops4j.org/wiki/display/PAXVAADIN/Home>
>>>>>>>>>>>>>>>> >
>>>>>>>>>>>>>>>>                 Commiter & Project
>>>>>>>>>>>>>>>>                 Lead
>>>>>>>>>>>>>>>>                 blog <http://notizblog.nierbeck.de/**>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>> --
>>>>>>>>>>>>>> Jean-Baptiste Onofré
>>>>>>>>>>>>>> jbonofre@apache.org
>>>>>>>>>>>>>> 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
>>
>>
>>
>


-- 
Charles Moulliard
Apache Committer / Sr. Pr. Consultant at FuseSource.com
Twitter : @cmoulliard
Blog : http://cmoulliard.blogspot.com

Re: Embedding a Spring Integration app into Apache Karaf

Posted by Charles Moulliard <ch...@gmail.com>.
Good job :-)

On Mon, Aug 13, 2012 at 3:53 PM, Julien Martin <ba...@gmail.com> wrote:

> Thanks a lot Charles. It now properly picks up my spring config!!
> Regards,
> J.
>
> 2012/8/13 Charles Moulliard <ch...@gmail.com>
>
>> You can restart karaf and clean it using this command ./karaf clean
>>
>> After that, deploy spring and Spring batch
>>
>> features:install spring
>> install -s mvn:org.springframework.batch/spring-batch-core/2.1.8.RELEASE
>> install -s
>> mvn:org.springframework.batch/spring-batch-infrastructure/2.1.8.RELEASE
>>
>>
>> On Mon, Aug 13, 2012 at 3:43 PM, Julien Martin <ba...@gmail.com> wrote:
>>
>>> Charles,
>>> How did you managed to do that? I followed your advice and I get a
>>> different result...
>>> Do you think I should start from a clean karaf install?
>>> J.
>>>
>>> 2012/8/13 Charles Moulliard <ch...@gmail.com>
>>>
>>>> This is not a bug as I have been able to deploy Spring Batch (core,
>>>> infra)
>>>>
>>>> karaf@root> list -t 0 | grep -i spring
>>>> [  57] [Active     ] [            ] [       ] [   30] Spring Core
>>>> (3.0.7.RELEASE)
>>>> [  58] [Active     ] [            ] [       ] [   30] Spring ASM
>>>> (3.0.7.RELEASE)
>>>> [  59] [Active     ] [            ] [       ] [   30] Spring Expression
>>>> Language (3.0.7.RELEASE)
>>>> [  60] [Active     ] [            ] [       ] [   30] Spring Beans
>>>> (3.0.7.RELEASE)
>>>> [  61] [Active     ] [            ] [       ] [   30] Spring AOP
>>>> (3.0.7.RELEASE)
>>>> [  62] [Active     ] [            ] [       ] [   30] Spring Context
>>>> (3.0.7.RELEASE)
>>>> [  63] [Active     ] [            ] [       ] [   30] Spring Context
>>>> Support (3.0.7.RELEASE)
>>>> [  77] [Active     ] [            ] [       ] [   30] Spring
>>>> Transaction (3.0.7.RELEASE)
>>>>
>>>> [  92] [Active     ] [            ] [       ] [   80] Spring Batch
>>>> Infrastructure (2.1.8.RELEASE)
>>>> [  93] [Active     ] [            ] [       ] [   80] Spring Batch Core
>>>> (2.1.8.RELEASE)
>>>>
>>>> On Mon, Aug 13, 2012 at 3:34 PM, Julien Martin <ba...@gmail.com>wrote:
>>>>
>>>>> Charles,
>>>>> Do you reckon it is a bug on the springsource side?
>>>>> J.
>>>>>
>>>>> 2012/8/13 Julien Martin <ba...@gmail.com>
>>>>>
>>>>>> Charles,
>>>>>>
>>>>>> I did as you advised and I get the same dependency chain error as
>>>>>> before i.e.:
>>>>>>
>>>>>> *karaf@root> start 380*
>>>>>> *org.osgi.framework.BundleException: Unable to resolve module
>>>>>> org.springframework.batch.core [380.0] because it is exposed to
>>>>>> package 'org.springframew*
>>>>>>  *ork.context.support' from org.springframework.context [347.0] and
>>>>>> org.springframework.context [366.0] via two dependency chains.*
>>>>>> *
>>>>>> *
>>>>>> *Chain 1:*
>>>>>> *  org.springframework.batch.core [380.0]*
>>>>>> *    import:
>>>>>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>>>>>> *
>>>>>> *     |*
>>>>>> *    export: package=org.springframework.context.support*
>>>>>>  *  org.springframework.context [347.0]*
>>>>>> *
>>>>>> *
>>>>>> *Chain 2:*
>>>>>> *  org.springframework.batch.core [380.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 [373.0]*
>>>>>> *    import:
>>>>>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>>>>>> *
>>>>>> *     |*
>>>>>> *    export: package=org.springframework.context.support*
>>>>>> *  org.springframework.context [366.0]*
>>>>>>
>>>>>> 2012/8/13 Charles Moulliard <ch...@gmail.com>
>>>>>>
>>>>>>> I suggest that you install the spring batch jar file as I tell you
>>>>>>> and drop after all the other 38 jars files.
>>>>>>>
>>>>>>>
>>>>>>> On Mon, Aug 13, 2012 at 3:13 PM, Julien Martin <ba...@gmail.com>wrote:
>>>>>>>
>>>>>>>> Hi Charles,
>>>>>>>> Thanks. I actually dropped all my jars into the /deploy folder (for
>>>>>>>> testing purposes) as advised by Achim.
>>>>>>>> The real issue I have now is that of the dependency chains...
>>>>>>>> Regards,
>>>>>>>> J.
>>>>>>>>
>>>>>>>> 2012/8/13 Charles Moulliard <ch...@gmail.com>
>>>>>>>>
>>>>>>>>> Hi Julien,
>>>>>>>>>
>>>>>>>>> You do not need to wrap the Spring Batch jar file as it is already
>>>>>>>>> a bundle -->
>>>>>>>>>
>>>>>>>>> install -s
>>>>>>>>> mvn:org.springframework.batch/spring-batch-infrastructure/2.1.8.RELEASE
>>>>>>>>>
>>>>>>>>> [  92] [Active     ] [            ] [       ] [   80]
>>>>>>>>> mvn:org.springframework.batch/spring-batch-infrastructure/2.1.8.RELEASE
>>>>>>>>>
>>>>>>>>> Regards,
>>>>>>>>>
>>>>>>>>> Charles
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Mon, Aug 13, 2012 at 2:57 PM, Julien Martin <ba...@gmail.com>wrote:
>>>>>>>>>
>>>>>>>>>> Hi,
>>>>>>>>>> I am almost there. I dropped the dependencies as well as my app
>>>>>>>>>> into the /deploy folder. I get a multiple dependency chain problem as
>>>>>>>>>> follows. Can anyone please help?
>>>>>>>>>>
>>>>>>>>>> *C:\system\apache-karaf-2.2.8\bin>karaf*
>>>>>>>>>> *        __ __                  ____*
>>>>>>>>>> *       / //_/____ __________ _/ __/*
>>>>>>>>>> *      / ,<  / __ `/ ___/ __ `/ /_*
>>>>>>>>>> *     / /| |/ /_/ / /  / /_/ / __/*
>>>>>>>>>> *    /_/ |_|\__,_/_/   \__,_/_/*
>>>>>>>>>> *
>>>>>>>>>> *
>>>>>>>>>> *  Apache Karaf (2.2.8)*
>>>>>>>>>> *
>>>>>>>>>> *
>>>>>>>>>> *Hit '<tab>' for a list of available commands*
>>>>>>>>>> *and '[cmd] --help' for help on a specific command.*
>>>>>>>>>> *Hit '<ctrl-d>' or 'osgi:shutdown' to shutdown Karaf.*
>>>>>>>>>> *
>>>>>>>>>> *
>>>>>>>>>> *karaf@root> ERROR: Bundle org.springframework.batch.test [339]
>>>>>>>>>> Error starting
>>>>>>>>>> file:/C:/system/apache-karaf-2.2.8/deploy/spring-batch-test-2.1.8.RELEAS
>>>>>>>>>> *
>>>>>>>>>> *E.jar (org.osgi.framework.BundleException: Unable to resolve
>>>>>>>>>> module org.springframework.batch.core [341.0] because it is
>>>>>>>>>> exposed to package 'org.sprin*
>>>>>>>>>> *gframework.context.support' from org.springframework.context
>>>>>>>>>> [347.0] and org.springframework.context [366.0] via two
>>>>>>>>>> dependency chains.*
>>>>>>>>>> *
>>>>>>>>>> *
>>>>>>>>>> *Chain 1:*
>>>>>>>>>> *  org.springframework.batch.core [341.0]*
>>>>>>>>>> *    import:
>>>>>>>>>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>>>>>>>>>> *
>>>>>>>>>> *     |*
>>>>>>>>>> *    export: package=org.springframework.context.support*
>>>>>>>>>> *  org.springframework.context [347.0]*
>>>>>>>>>> *
>>>>>>>>>> *
>>>>>>>>>> *Chain 2:*
>>>>>>>>>> *  org.springframework.batch.core [341.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 [373.0]*
>>>>>>>>>> *    import:
>>>>>>>>>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>>>>>>>>>> *
>>>>>>>>>> *     |*
>>>>>>>>>> *    export: package=org.springframework.context.support*
>>>>>>>>>> *  org.springframework.context [366.0])*
>>>>>>>>>> *org.osgi.framework.BundleException: Unable to resolve module
>>>>>>>>>> org.springframework.batch.core [341.0] because it is exposed to
>>>>>>>>>> package 'org.springframew*
>>>>>>>>>> *ork.context.support' from org.springframework.context [347.0]
>>>>>>>>>> and org.springframework.context [366.0] via two dependency
>>>>>>>>>> chains.*
>>>>>>>>>> *
>>>>>>>>>> *
>>>>>>>>>> *Chain 1:*
>>>>>>>>>> *  org.springframework.batch.core [341.0]*
>>>>>>>>>>  *    import:
>>>>>>>>>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>>>>>>>>>> *
>>>>>>>>>> *     |*
>>>>>>>>>> *    export: package=org.springframework.context.support*
>>>>>>>>>>  *  org.springframework.context [347.0]*
>>>>>>>>>> *
>>>>>>>>>> *
>>>>>>>>>> *Chain 2:*
>>>>>>>>>> *  org.springframework.batch.core [341.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 [373.0]*
>>>>>>>>>>  *    import:
>>>>>>>>>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>>>>>>>>>> *
>>>>>>>>>> *     |*
>>>>>>>>>> *    export: package=org.springframework.context.support*
>>>>>>>>>> *  org.springframework.context [366.0]*
>>>>>>>>>> *        at
>>>>>>>>>> org.apache.felix.framework.Felix.resolveBundle(Felix.java:3452)*
>>>>>>>>>> *        at
>>>>>>>>>> org.apache.felix.framework.Felix.startBundle(Felix.java:1734)*
>>>>>>>>>> *        at
>>>>>>>>>> org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1163)
>>>>>>>>>> *
>>>>>>>>>> *        at
>>>>>>>>>> org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264)
>>>>>>>>>> *
>>>>>>>>>> *        at java.lang.Thread.run(Thread.java:662)*
>>>>>>>>>> *ERROR: Bundle org.springframework.batch.core [341] Error
>>>>>>>>>> starting
>>>>>>>>>> file:/C:/system/apache-karaf-2.2.8/deploy/spring-batch-core-2.1.8.RELEASE.jar
>>>>>>>>>> (org.o*
>>>>>>>>>> *sgi.framework.BundleException: Unable to resolve module
>>>>>>>>>> org.springframework.batch.core [341.0] because it is exposed to
>>>>>>>>>> package 'org.springframework.c*
>>>>>>>>>> *ontext.support' from org.springframework.context [347.0] and
>>>>>>>>>> org.springframework.context [366.0] via two dependency chains.*
>>>>>>>>>> *
>>>>>>>>>> *
>>>>>>>>>> *Chain 1:*
>>>>>>>>>> *  org.springframework.batch.core [341.0]*
>>>>>>>>>> *    import:
>>>>>>>>>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>>>>>>>>>> *
>>>>>>>>>> *     |*
>>>>>>>>>> *    export: package=org.springframework.context.support*
>>>>>>>>>> *  org.springframework.context [347.0]*
>>>>>>>>>> *
>>>>>>>>>> *
>>>>>>>>>> *Chain 2:*
>>>>>>>>>> *  org.springframework.batch.core [341.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 [373.0]*
>>>>>>>>>> *    import:
>>>>>>>>>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>>>>>>>>>> *
>>>>>>>>>> *     |*
>>>>>>>>>> *    export: package=org.springframework.context.support*
>>>>>>>>>> *  org.springframework.context [366.0])*
>>>>>>>>>> *org.osgi.framework.BundleException: Unable to resolve module
>>>>>>>>>> org.springframework.batch.core [341.0] because it is exposed to
>>>>>>>>>> package 'org.springframew*
>>>>>>>>>> *ork.context.support' from org.springframework.context [347.0]
>>>>>>>>>> and org.springframework.context [366.0] via two dependency
>>>>>>>>>> chains.*
>>>>>>>>>> *
>>>>>>>>>> *
>>>>>>>>>> *Chain 1:*
>>>>>>>>>> *  org.springframework.batch.core [341.0]*
>>>>>>>>>>  *    import:
>>>>>>>>>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>>>>>>>>>> *
>>>>>>>>>> *     |*
>>>>>>>>>> *    export: package=org.springframework.context.support*
>>>>>>>>>>  *  org.springframework.context [347.0]*
>>>>>>>>>> *
>>>>>>>>>> *
>>>>>>>>>> *Chain 2:*
>>>>>>>>>> *  org.springframework.batch.core [341.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 [373.0]*
>>>>>>>>>>  *    import:
>>>>>>>>>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>>>>>>>>>> *
>>>>>>>>>> *     |*
>>>>>>>>>> *    export: package=org.springframework.context.support*
>>>>>>>>>> *  org.springframework.context [366.0]*
>>>>>>>>>> *        at
>>>>>>>>>> org.apache.felix.framework.Felix.resolveBundle(Felix.java:3452)*
>>>>>>>>>> *        at
>>>>>>>>>> org.apache.felix.framework.Felix.startBundle(Felix.java:1734)*
>>>>>>>>>> *        at
>>>>>>>>>> org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1163)
>>>>>>>>>> *
>>>>>>>>>> *        at
>>>>>>>>>> org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264)
>>>>>>>>>> *
>>>>>>>>>> *        at java.lang.Thread.run(Thread.java:662)*
>>>>>>>>>> *ERROR: Bundle org.springframework.batch.integration [342] Error
>>>>>>>>>> starting
>>>>>>>>>> file:/C:/system/apache-karaf-2.2.8/deploy/spring-batch-integration-1.2.1.RELE
>>>>>>>>>> *
>>>>>>>>>> *ASE.jar (org.osgi.framework.BundleException: Unable to resolve
>>>>>>>>>> module org.springframework.batch.core [341.0] because it is
>>>>>>>>>> exposed to package 'org.spr*
>>>>>>>>>> *ingframework.context.support' from org.springframework.context
>>>>>>>>>> [347.0] and org.springframework.context [366.0] via two
>>>>>>>>>> dependency chains.*
>>>>>>>>>> *
>>>>>>>>>> *
>>>>>>>>>> *Chain 1:*
>>>>>>>>>> *  org.springframework.batch.core [341.0]*
>>>>>>>>>> *    import:
>>>>>>>>>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>>>>>>>>>> *
>>>>>>>>>> *     |*
>>>>>>>>>> *    export: package=org.springframework.context.support*
>>>>>>>>>> *  org.springframework.context [347.0]*
>>>>>>>>>> *
>>>>>>>>>> *
>>>>>>>>>> *Chain 2:*
>>>>>>>>>> *  org.springframework.batch.core [341.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 [373.0]*
>>>>>>>>>> *    import:
>>>>>>>>>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>>>>>>>>>> *
>>>>>>>>>> *     |*
>>>>>>>>>> *    export: package=org.springframework.context.support*
>>>>>>>>>> *  org.springframework.context [366.0])*
>>>>>>>>>> *org.osgi.framework.BundleException: Unable to resolve module
>>>>>>>>>> org.springframework.batch.core [341.0] because it is exposed to
>>>>>>>>>> package 'org.springframew*
>>>>>>>>>> *ork.context.support' from org.springframework.context [347.0]
>>>>>>>>>> and org.springframework.context [366.0] via two dependency
>>>>>>>>>> chains.*
>>>>>>>>>> *
>>>>>>>>>> *
>>>>>>>>>> *Chain 1:*
>>>>>>>>>> *  org.springframework.batch.core [341.0]*
>>>>>>>>>>  *    import:
>>>>>>>>>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>>>>>>>>>> *
>>>>>>>>>> *     |*
>>>>>>>>>> *    export: package=org.springframework.context.support*
>>>>>>>>>>  *  org.springframework.context [347.0]*
>>>>>>>>>> *
>>>>>>>>>> *
>>>>>>>>>> *Chain 2:*
>>>>>>>>>> *  org.springframework.batch.core [341.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 [373.0]*
>>>>>>>>>>  *    import:
>>>>>>>>>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>>>>>>>>>> *
>>>>>>>>>> *     |*
>>>>>>>>>> *    export: package=org.springframework.context.support*
>>>>>>>>>> *  org.springframework.context [366.0]*
>>>>>>>>>> *        at
>>>>>>>>>> org.apache.felix.framework.Felix.resolveBundle(Felix.java:3452)*
>>>>>>>>>> *        at
>>>>>>>>>> org.apache.felix.framework.Felix.startBundle(Felix.java:1734)*
>>>>>>>>>> *        at
>>>>>>>>>> org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1163)
>>>>>>>>>> *
>>>>>>>>>> *        at
>>>>>>>>>> org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264)
>>>>>>>>>> *
>>>>>>>>>> *        at java.lang.Thread.run(Thread.java:662)*
>>>>>>>>>> *ERROR: Bundle spring-batch-demo-trc-dm [368] Error starting
>>>>>>>>>> file:/C:/system/apache-karaf-2.2.8/deploy/spring-batch-demo-trc-dm-1.0.0-SNAPSHOT.jar
>>>>>>>>>> (org*
>>>>>>>>>> *.osgi.framework.BundleException: Unable to resolve module
>>>>>>>>>> org.springframework.batch.core [341.0] because it is exposed to
>>>>>>>>>> package 'org.springframework*
>>>>>>>>>> *.context.support' from org.springframework.context [347.0] and
>>>>>>>>>> org.springframework.context [366.0] via two dependency chains.*
>>>>>>>>>> *
>>>>>>>>>> *
>>>>>>>>>> *Chain 1:*
>>>>>>>>>> *  org.springframework.batch.core [341.0]*
>>>>>>>>>> *    import:
>>>>>>>>>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>>>>>>>>>> *
>>>>>>>>>> *     |*
>>>>>>>>>> *    export: package=org.springframework.context.support*
>>>>>>>>>> *  org.springframework.context [347.0]*
>>>>>>>>>> *
>>>>>>>>>> *
>>>>>>>>>> *Chain 2:*
>>>>>>>>>> *  org.springframework.batch.core [341.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 [373.0]*
>>>>>>>>>> *    import:
>>>>>>>>>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>>>>>>>>>> *
>>>>>>>>>> *     |*
>>>>>>>>>> *    export: package=org.springframework.context.support*
>>>>>>>>>> *  org.springframework.context [366.0])*
>>>>>>>>>> *org.osgi.framework.BundleException: Unable to resolve module
>>>>>>>>>> org.springframework.batch.core [341.0] because it is exposed to package
>>>>>>>>>> 'org.springframew*
>>>>>>>>>> *ork.context.support' from org.springframework.context [347.0]
>>>>>>>>>> and org.springframework.context [366.0] via two dependency chains.
>>>>>>>>>> *
>>>>>>>>>> *
>>>>>>>>>> *
>>>>>>>>>> *Chain 1:*
>>>>>>>>>> *  org.springframework.batch.core [341.0]*
>>>>>>>>>>  *    import:
>>>>>>>>>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>>>>>>>>>> *
>>>>>>>>>> *     |*
>>>>>>>>>> *    export: package=org.springframework.context.support*
>>>>>>>>>>  *  org.springframework.context [347.0]*
>>>>>>>>>> *
>>>>>>>>>> *
>>>>>>>>>> *Chain 2:*
>>>>>>>>>> *  org.springframework.batch.core [341.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 [373.0]*
>>>>>>>>>> *    import:
>>>>>>>>>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>>>>>>>>>> *
>>>>>>>>>> *     |*
>>>>>>>>>> *    export: package=org.springframework.context.support*
>>>>>>>>>> *  org.springframework.context [366.0]*
>>>>>>>>>> *        at
>>>>>>>>>> org.apache.felix.framework.Felix.resolveBundle(Felix.java:3452)*
>>>>>>>>>> *        at
>>>>>>>>>> org.apache.felix.framework.Felix.startBundle(Felix.java:1734)*
>>>>>>>>>> *        at
>>>>>>>>>> org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1163)
>>>>>>>>>> *
>>>>>>>>>> *        at
>>>>>>>>>> org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264)
>>>>>>>>>> *
>>>>>>>>>> *        at java.lang.Thread.run(Thread.java:662)*
>>>>>>>>>> *Exception in thread "Thread-16"
>>>>>>>>>> java.lang.IllegalArgumentException: Cannot write resource:
>>>>>>>>>> org/xmlpull/mxp1/MXParser.class :43114: exception: java.io.*
>>>>>>>>>> *IOException: Pipe closed*
>>>>>>>>>> *        at aQute.lib.osgi.Jar.writeResource(Jar.java:302)*
>>>>>>>>>> *        at aQute.lib.osgi.Jar.write(Jar.java:211)*
>>>>>>>>>> *        at
>>>>>>>>>> org.ops4j.pax.swissbox.bnd.BndUtils$1.run(BndUtils.java:174)*
>>>>>>>>>> *^C*
>>>>>>>>>> *karaf@root>*
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> 2012/8/13 Achim Nierbeck <bc...@googlemail.com>
>>>>>>>>>>
>>>>>>>>>>> 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 <ba...@gmail.com>:
>>>>>>>>>>> > 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 <ch...@gmail.com>
>>>>>>>>>>> >>
>>>>>>>>>>> >> 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 <
>>>>>>>>>>> balteo@gmail.com> 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 <ch...@gmail.com>
>>>>>>>>>>> >>>>
>>>>>>>>>>> >>>> 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 <
>>>>>>>>>>> balteo@gmail.com> wrote:
>>>>>>>>>>> >>>>>
>>>>>>>>>>> >>>>> How do I install the Spring batch jars/bundle into Karaf?
>>>>>>>>>>> >>>>> Regards,
>>>>>>>>>>> >>>>> J.
>>>>>>>>>>> >>>>>
>>>>>>>>>>> >>>>> 2012/8/13 Charles Moulliard <ch...@gmail.com>
>>>>>>>>>>> >>>>>>
>>>>>>>>>>> >>>>>> 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 <
>>>>>>>>>>> balteo@gmail.com>
>>>>>>>>>>> >>>>>> 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 <ch...@gmail.com>
>>>>>>>>>>> >>>>>>>>
>>>>>>>>>>> >>>>>>>> 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 <
>>>>>>>>>>> balteo@gmail.com>
>>>>>>>>>>> >>>>>>>> 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 <ch...@gmail.com>
>>>>>>>>>>> >>>>>>>>>>
>>>>>>>>>>> >>>>>>>>>> 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 <
>>>>>>>>>>> balteo@gmail.com>
>>>>>>>>>>> >>>>>>>>>> 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 <ba...@gmail.com>
>>>>>>>>>>> >>>>>>>>>>>>
>>>>>>>>>>> >>>>>>>>>>>> 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 <ba...@gmail.com>
>>>>>>>>>>> >>>>>>>>>>>>>
>>>>>>>>>>> >>>>>>>>>>>>> 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é <jb...@nanthrax.net>
>>>>>>>>>>> >>>>>>>>>>>>>>
>>>>>>>>>>> >>>>>>>>>>>>>> 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 <balteo@gmail.com
>>>>>>>>>>> >>>>>>>>>>>>>>> <ma...@gmail.com>>
>>>>>>>>>>> >>>>>>>>>>>>>>>
>>>>>>>>>>> >>>>>>>>>>>>>>>
>>>>>>>>>>> >>>>>>>>>>>>>>>     Thanks to both of you. I'll try as you
>>>>>>>>>>> advised and let
>>>>>>>>>>> >>>>>>>>>>>>>>> you know.
>>>>>>>>>>> >>>>>>>>>>>>>>>     Best regards,
>>>>>>>>>>> >>>>>>>>>>>>>>>     J.
>>>>>>>>>>> >>>>>>>>>>>>>>>
>>>>>>>>>>> >>>>>>>>>>>>>>>
>>>>>>>>>>> >>>>>>>>>>>>>>>     2012/8/10 Freeman Fang <
>>>>>>>>>>> freeman.fang@gmail.com
>>>>>>>>>>> >>>>>>>>>>>>>>>     <ma...@gmail.com>>
>>>>>>>>>>> >>>>>>>>>>>>>>>
>>>>>>>>>>> >>>>>>>>>>>>>>>
>>>>>>>>>>> >>>>>>>>>>>>>>>         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:ffang@fusesource.com
>>>>>>>>>>> >>>>>>>>>>>>>>> <ma...@fusesource.com>
>>>>>>>>>>> >>>>>>>>>>>>>>>         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 <
>>>>>>>>>>> balteo@gmail.com
>>>>>>>>>>> >>>>>>>>>>>>>>>>         <ma...@gmail.com>>
>>>>>>>>>>> >>>>>>>>>>>>>>>>
>>>>>>>>>>> >>>>>>>>>>>>>>>>
>>>>>>>>>>> >>>>>>>>>>>>>>>>             thanks Achim
>>>>>>>>>>> >>>>>>>>>>>>>>>>
>>>>>>>>>>> >>>>>>>>>>>>>>>>
>>>>>>>>>>> >>>>>>>>>>>>>>>>             2012/8/9 Achim Nierbeck <
>>>>>>>>>>> bcanhome@googlemail.com
>>>>>>>>>>> >>>>>>>>>>>>>>>>             <ma...@googlemail.com>>
>>>>>>>>>>> >>>>>>>>>>>>>>>>
>>>>>>>>>>> >>>>>>>>>>>>>>>>
>>>>>>>>>>> >>>>>>>>>>>>>>>>                 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 <
>>>>>>>>>>> balteo@gmail.com
>>>>>>>>>>> >>>>>>>>>>>>>>>>                 <ma...@gmail.com>>:
>>>>>>>>>>> >>>>>>>>>>>>>>>>
>>>>>>>>>>> >>>>>>>>>>>>>>>>                 > 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
>>>>>>>>>>> >>>>>>>>>>>>>>>> <bcanhome@googlemail.com
>>>>>>>>>>> >>>>>>>>>>>>>>>>                 <mailto:bcanhome@googlemail.com
>>>>>>>>>>> >>
>>>>>>>>>>> >>>>>>>>>>>>>>>>
>>>>>>>>>>> >>>>>>>>>>>>>>>>                 >>
>>>>>>>>>>> >>>>>>>>>>>>>>>>                 >> 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 <
>>>>>>>>>>> balteo@gmail.com
>>>>>>>>>>> >>>>>>>>>>>>>>>>                 <ma...@gmail.com>>:
>>>>>>>>>>> >>>>>>>>>>>>>>>>
>>>>>>>>>>> >>>>>>>>>>>>>>>>                 >> > 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é
>>>>>>>>>>> >>>>>>>>>>>>>> jbonofre@apache.org
>>>>>>>>>>> >>>>>>>>>>>>>> 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/>
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> 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

Re: Embedding a Spring Integration app into Apache Karaf

Posted by Julien Martin <ba...@gmail.com>.
Thanks a lot Charles. It now properly picks up my spring config!!
Regards,
J.

2012/8/13 Charles Moulliard <ch...@gmail.com>

> You can restart karaf and clean it using this command ./karaf clean
>
> After that, deploy spring and Spring batch
>
> features:install spring
> install -s mvn:org.springframework.batch/spring-batch-core/2.1.8.RELEASE
> install -s
> mvn:org.springframework.batch/spring-batch-infrastructure/2.1.8.RELEASE
>
>
> On Mon, Aug 13, 2012 at 3:43 PM, Julien Martin <ba...@gmail.com> wrote:
>
>> Charles,
>> How did you managed to do that? I followed your advice and I get a
>> different result...
>> Do you think I should start from a clean karaf install?
>> J.
>>
>> 2012/8/13 Charles Moulliard <ch...@gmail.com>
>>
>>> This is not a bug as I have been able to deploy Spring Batch (core,
>>> infra)
>>>
>>> karaf@root> list -t 0 | grep -i spring
>>> [  57] [Active     ] [            ] [       ] [   30] Spring Core
>>> (3.0.7.RELEASE)
>>> [  58] [Active     ] [            ] [       ] [   30] Spring ASM
>>> (3.0.7.RELEASE)
>>> [  59] [Active     ] [            ] [       ] [   30] Spring Expression
>>> Language (3.0.7.RELEASE)
>>> [  60] [Active     ] [            ] [       ] [   30] Spring Beans
>>> (3.0.7.RELEASE)
>>> [  61] [Active     ] [            ] [       ] [   30] Spring AOP
>>> (3.0.7.RELEASE)
>>> [  62] [Active     ] [            ] [       ] [   30] Spring Context
>>> (3.0.7.RELEASE)
>>> [  63] [Active     ] [            ] [       ] [   30] Spring Context
>>> Support (3.0.7.RELEASE)
>>> [  77] [Active     ] [            ] [       ] [   30] Spring Transaction
>>> (3.0.7.RELEASE)
>>>
>>> [  92] [Active     ] [            ] [       ] [   80] Spring Batch
>>> Infrastructure (2.1.8.RELEASE)
>>> [  93] [Active     ] [            ] [       ] [   80] Spring Batch Core
>>> (2.1.8.RELEASE)
>>>
>>> On Mon, Aug 13, 2012 at 3:34 PM, Julien Martin <ba...@gmail.com> wrote:
>>>
>>>> Charles,
>>>> Do you reckon it is a bug on the springsource side?
>>>> J.
>>>>
>>>> 2012/8/13 Julien Martin <ba...@gmail.com>
>>>>
>>>>> Charles,
>>>>>
>>>>> I did as you advised and I get the same dependency chain error as
>>>>> before i.e.:
>>>>>
>>>>> *karaf@root> start 380*
>>>>> *org.osgi.framework.BundleException: Unable to resolve module
>>>>> org.springframework.batch.core [380.0] because it is exposed to
>>>>> package 'org.springframew*
>>>>>  *ork.context.support' from org.springframework.context [347.0] and
>>>>> org.springframework.context [366.0] via two dependency chains.*
>>>>> *
>>>>> *
>>>>> *Chain 1:*
>>>>> *  org.springframework.batch.core [380.0]*
>>>>> *    import:
>>>>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>>>>> *
>>>>> *     |*
>>>>> *    export: package=org.springframework.context.support*
>>>>>  *  org.springframework.context [347.0]*
>>>>> *
>>>>> *
>>>>> *Chain 2:*
>>>>> *  org.springframework.batch.core [380.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 [373.0]*
>>>>> *    import:
>>>>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>>>>> *
>>>>> *     |*
>>>>> *    export: package=org.springframework.context.support*
>>>>> *  org.springframework.context [366.0]*
>>>>>
>>>>> 2012/8/13 Charles Moulliard <ch...@gmail.com>
>>>>>
>>>>>> I suggest that you install the spring batch jar file as I tell you
>>>>>> and drop after all the other 38 jars files.
>>>>>>
>>>>>>
>>>>>> On Mon, Aug 13, 2012 at 3:13 PM, Julien Martin <ba...@gmail.com>wrote:
>>>>>>
>>>>>>> Hi Charles,
>>>>>>> Thanks. I actually dropped all my jars into the /deploy folder (for
>>>>>>> testing purposes) as advised by Achim.
>>>>>>> The real issue I have now is that of the dependency chains...
>>>>>>> Regards,
>>>>>>> J.
>>>>>>>
>>>>>>> 2012/8/13 Charles Moulliard <ch...@gmail.com>
>>>>>>>
>>>>>>>> Hi Julien,
>>>>>>>>
>>>>>>>> You do not need to wrap the Spring Batch jar file as it is already
>>>>>>>> a bundle -->
>>>>>>>>
>>>>>>>> install -s
>>>>>>>> mvn:org.springframework.batch/spring-batch-infrastructure/2.1.8.RELEASE
>>>>>>>>
>>>>>>>> [  92] [Active     ] [            ] [       ] [   80]
>>>>>>>> mvn:org.springframework.batch/spring-batch-infrastructure/2.1.8.RELEASE
>>>>>>>>
>>>>>>>> Regards,
>>>>>>>>
>>>>>>>> Charles
>>>>>>>>
>>>>>>>>
>>>>>>>> On Mon, Aug 13, 2012 at 2:57 PM, Julien Martin <ba...@gmail.com>wrote:
>>>>>>>>
>>>>>>>>> Hi,
>>>>>>>>> I am almost there. I dropped the dependencies as well as my app
>>>>>>>>> into the /deploy folder. I get a multiple dependency chain problem as
>>>>>>>>> follows. Can anyone please help?
>>>>>>>>>
>>>>>>>>> *C:\system\apache-karaf-2.2.8\bin>karaf*
>>>>>>>>> *        __ __                  ____*
>>>>>>>>> *       / //_/____ __________ _/ __/*
>>>>>>>>> *      / ,<  / __ `/ ___/ __ `/ /_*
>>>>>>>>> *     / /| |/ /_/ / /  / /_/ / __/*
>>>>>>>>> *    /_/ |_|\__,_/_/   \__,_/_/*
>>>>>>>>> *
>>>>>>>>> *
>>>>>>>>> *  Apache Karaf (2.2.8)*
>>>>>>>>> *
>>>>>>>>> *
>>>>>>>>> *Hit '<tab>' for a list of available commands*
>>>>>>>>> *and '[cmd] --help' for help on a specific command.*
>>>>>>>>> *Hit '<ctrl-d>' or 'osgi:shutdown' to shutdown Karaf.*
>>>>>>>>> *
>>>>>>>>> *
>>>>>>>>> *karaf@root> ERROR: Bundle org.springframework.batch.test [339]
>>>>>>>>> Error starting
>>>>>>>>> file:/C:/system/apache-karaf-2.2.8/deploy/spring-batch-test-2.1.8.RELEAS
>>>>>>>>> *
>>>>>>>>> *E.jar (org.osgi.framework.BundleException: Unable to resolve
>>>>>>>>> module org.springframework.batch.core [341.0] because it is
>>>>>>>>> exposed to package 'org.sprin*
>>>>>>>>> *gframework.context.support' from org.springframework.context
>>>>>>>>> [347.0] and org.springframework.context [366.0] via two
>>>>>>>>> dependency chains.*
>>>>>>>>> *
>>>>>>>>> *
>>>>>>>>> *Chain 1:*
>>>>>>>>> *  org.springframework.batch.core [341.0]*
>>>>>>>>> *    import:
>>>>>>>>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>>>>>>>>> *
>>>>>>>>> *     |*
>>>>>>>>> *    export: package=org.springframework.context.support*
>>>>>>>>> *  org.springframework.context [347.0]*
>>>>>>>>> *
>>>>>>>>> *
>>>>>>>>> *Chain 2:*
>>>>>>>>> *  org.springframework.batch.core [341.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 [373.0]*
>>>>>>>>> *    import:
>>>>>>>>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>>>>>>>>> *
>>>>>>>>> *     |*
>>>>>>>>> *    export: package=org.springframework.context.support*
>>>>>>>>> *  org.springframework.context [366.0])*
>>>>>>>>> *org.osgi.framework.BundleException: Unable to resolve module
>>>>>>>>> org.springframework.batch.core [341.0] because it is exposed to
>>>>>>>>> package 'org.springframew*
>>>>>>>>> *ork.context.support' from org.springframework.context [347.0]
>>>>>>>>> and org.springframework.context [366.0] via two dependency chains.
>>>>>>>>> *
>>>>>>>>> *
>>>>>>>>> *
>>>>>>>>> *Chain 1:*
>>>>>>>>> *  org.springframework.batch.core [341.0]*
>>>>>>>>>  *    import:
>>>>>>>>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>>>>>>>>> *
>>>>>>>>> *     |*
>>>>>>>>> *    export: package=org.springframework.context.support*
>>>>>>>>>  *  org.springframework.context [347.0]*
>>>>>>>>> *
>>>>>>>>> *
>>>>>>>>> *Chain 2:*
>>>>>>>>> *  org.springframework.batch.core [341.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 [373.0]*
>>>>>>>>>  *    import:
>>>>>>>>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>>>>>>>>> *
>>>>>>>>> *     |*
>>>>>>>>> *    export: package=org.springframework.context.support*
>>>>>>>>> *  org.springframework.context [366.0]*
>>>>>>>>> *        at
>>>>>>>>> org.apache.felix.framework.Felix.resolveBundle(Felix.java:3452)*
>>>>>>>>> *        at
>>>>>>>>> org.apache.felix.framework.Felix.startBundle(Felix.java:1734)*
>>>>>>>>> *        at
>>>>>>>>> org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1163)
>>>>>>>>> *
>>>>>>>>> *        at
>>>>>>>>> org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264)
>>>>>>>>> *
>>>>>>>>> *        at java.lang.Thread.run(Thread.java:662)*
>>>>>>>>> *ERROR: Bundle org.springframework.batch.core [341] Error
>>>>>>>>> starting
>>>>>>>>> file:/C:/system/apache-karaf-2.2.8/deploy/spring-batch-core-2.1.8.RELEASE.jar
>>>>>>>>> (org.o*
>>>>>>>>> *sgi.framework.BundleException: Unable to resolve module
>>>>>>>>> org.springframework.batch.core [341.0] because it is exposed to
>>>>>>>>> package 'org.springframework.c*
>>>>>>>>> *ontext.support' from org.springframework.context [347.0] and
>>>>>>>>> org.springframework.context [366.0] via two dependency chains.*
>>>>>>>>> *
>>>>>>>>> *
>>>>>>>>> *Chain 1:*
>>>>>>>>> *  org.springframework.batch.core [341.0]*
>>>>>>>>> *    import:
>>>>>>>>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>>>>>>>>> *
>>>>>>>>> *     |*
>>>>>>>>> *    export: package=org.springframework.context.support*
>>>>>>>>> *  org.springframework.context [347.0]*
>>>>>>>>> *
>>>>>>>>> *
>>>>>>>>> *Chain 2:*
>>>>>>>>> *  org.springframework.batch.core [341.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 [373.0]*
>>>>>>>>> *    import:
>>>>>>>>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>>>>>>>>> *
>>>>>>>>> *     |*
>>>>>>>>> *    export: package=org.springframework.context.support*
>>>>>>>>> *  org.springframework.context [366.0])*
>>>>>>>>> *org.osgi.framework.BundleException: Unable to resolve module
>>>>>>>>> org.springframework.batch.core [341.0] because it is exposed to
>>>>>>>>> package 'org.springframew*
>>>>>>>>> *ork.context.support' from org.springframework.context [347.0]
>>>>>>>>> and org.springframework.context [366.0] via two dependency chains.
>>>>>>>>> *
>>>>>>>>> *
>>>>>>>>> *
>>>>>>>>> *Chain 1:*
>>>>>>>>> *  org.springframework.batch.core [341.0]*
>>>>>>>>>  *    import:
>>>>>>>>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>>>>>>>>> *
>>>>>>>>> *     |*
>>>>>>>>> *    export: package=org.springframework.context.support*
>>>>>>>>>  *  org.springframework.context [347.0]*
>>>>>>>>> *
>>>>>>>>> *
>>>>>>>>> *Chain 2:*
>>>>>>>>> *  org.springframework.batch.core [341.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 [373.0]*
>>>>>>>>>  *    import:
>>>>>>>>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>>>>>>>>> *
>>>>>>>>> *     |*
>>>>>>>>> *    export: package=org.springframework.context.support*
>>>>>>>>> *  org.springframework.context [366.0]*
>>>>>>>>> *        at
>>>>>>>>> org.apache.felix.framework.Felix.resolveBundle(Felix.java:3452)*
>>>>>>>>> *        at
>>>>>>>>> org.apache.felix.framework.Felix.startBundle(Felix.java:1734)*
>>>>>>>>> *        at
>>>>>>>>> org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1163)
>>>>>>>>> *
>>>>>>>>> *        at
>>>>>>>>> org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264)
>>>>>>>>> *
>>>>>>>>> *        at java.lang.Thread.run(Thread.java:662)*
>>>>>>>>> *ERROR: Bundle org.springframework.batch.integration [342] Error
>>>>>>>>> starting
>>>>>>>>> file:/C:/system/apache-karaf-2.2.8/deploy/spring-batch-integration-1.2.1.RELE
>>>>>>>>> *
>>>>>>>>> *ASE.jar (org.osgi.framework.BundleException: Unable to resolve
>>>>>>>>> module org.springframework.batch.core [341.0] because it is
>>>>>>>>> exposed to package 'org.spr*
>>>>>>>>> *ingframework.context.support' from org.springframework.context
>>>>>>>>> [347.0] and org.springframework.context [366.0] via two
>>>>>>>>> dependency chains.*
>>>>>>>>> *
>>>>>>>>> *
>>>>>>>>> *Chain 1:*
>>>>>>>>> *  org.springframework.batch.core [341.0]*
>>>>>>>>> *    import:
>>>>>>>>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>>>>>>>>> *
>>>>>>>>> *     |*
>>>>>>>>> *    export: package=org.springframework.context.support*
>>>>>>>>> *  org.springframework.context [347.0]*
>>>>>>>>> *
>>>>>>>>> *
>>>>>>>>> *Chain 2:*
>>>>>>>>> *  org.springframework.batch.core [341.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 [373.0]*
>>>>>>>>> *    import:
>>>>>>>>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>>>>>>>>> *
>>>>>>>>> *     |*
>>>>>>>>> *    export: package=org.springframework.context.support*
>>>>>>>>> *  org.springframework.context [366.0])*
>>>>>>>>> *org.osgi.framework.BundleException: Unable to resolve module
>>>>>>>>> org.springframework.batch.core [341.0] because it is exposed to
>>>>>>>>> package 'org.springframew*
>>>>>>>>> *ork.context.support' from org.springframework.context [347.0]
>>>>>>>>> and org.springframework.context [366.0] via two dependency chains.
>>>>>>>>> *
>>>>>>>>> *
>>>>>>>>> *
>>>>>>>>> *Chain 1:*
>>>>>>>>> *  org.springframework.batch.core [341.0]*
>>>>>>>>>  *    import:
>>>>>>>>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>>>>>>>>> *
>>>>>>>>> *     |*
>>>>>>>>> *    export: package=org.springframework.context.support*
>>>>>>>>>  *  org.springframework.context [347.0]*
>>>>>>>>> *
>>>>>>>>> *
>>>>>>>>> *Chain 2:*
>>>>>>>>> *  org.springframework.batch.core [341.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 [373.0]*
>>>>>>>>> *    import:
>>>>>>>>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>>>>>>>>> *
>>>>>>>>> *     |*
>>>>>>>>> *    export: package=org.springframework.context.support*
>>>>>>>>> *  org.springframework.context [366.0]*
>>>>>>>>> *        at
>>>>>>>>> org.apache.felix.framework.Felix.resolveBundle(Felix.java:3452)*
>>>>>>>>> *        at
>>>>>>>>> org.apache.felix.framework.Felix.startBundle(Felix.java:1734)*
>>>>>>>>> *        at
>>>>>>>>> org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1163)
>>>>>>>>> *
>>>>>>>>> *        at
>>>>>>>>> org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264)
>>>>>>>>> *
>>>>>>>>> *        at java.lang.Thread.run(Thread.java:662)*
>>>>>>>>> *ERROR: Bundle spring-batch-demo-trc-dm [368] Error starting
>>>>>>>>> file:/C:/system/apache-karaf-2.2.8/deploy/spring-batch-demo-trc-dm-1.0.0-SNAPSHOT.jar
>>>>>>>>> (org*
>>>>>>>>> *.osgi.framework.BundleException: Unable to resolve module
>>>>>>>>> org.springframework.batch.core [341.0] because it is exposed to
>>>>>>>>> package 'org.springframework*
>>>>>>>>> *.context.support' from org.springframework.context [347.0] and
>>>>>>>>> org.springframework.context [366.0] via two dependency chains.*
>>>>>>>>> *
>>>>>>>>> *
>>>>>>>>> *Chain 1:*
>>>>>>>>> *  org.springframework.batch.core [341.0]*
>>>>>>>>> *    import:
>>>>>>>>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>>>>>>>>> *
>>>>>>>>> *     |*
>>>>>>>>> *    export: package=org.springframework.context.support*
>>>>>>>>> *  org.springframework.context [347.0]*
>>>>>>>>> *
>>>>>>>>> *
>>>>>>>>> *Chain 2:*
>>>>>>>>> *  org.springframework.batch.core [341.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 [373.0]*
>>>>>>>>> *    import:
>>>>>>>>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>>>>>>>>> *
>>>>>>>>> *     |*
>>>>>>>>> *    export: package=org.springframework.context.support*
>>>>>>>>> *  org.springframework.context [366.0])*
>>>>>>>>> *org.osgi.framework.BundleException: Unable to resolve module
>>>>>>>>> org.springframework.batch.core [341.0] because it is exposed to package
>>>>>>>>> 'org.springframew*
>>>>>>>>> *ork.context.support' from org.springframework.context [347.0]
>>>>>>>>> and org.springframework.context [366.0] via two dependency chains.
>>>>>>>>> *
>>>>>>>>> *
>>>>>>>>> *
>>>>>>>>> *Chain 1:*
>>>>>>>>> *  org.springframework.batch.core [341.0]*
>>>>>>>>>  *    import:
>>>>>>>>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>>>>>>>>> *
>>>>>>>>> *     |*
>>>>>>>>> *    export: package=org.springframework.context.support*
>>>>>>>>>  *  org.springframework.context [347.0]*
>>>>>>>>> *
>>>>>>>>> *
>>>>>>>>> *Chain 2:*
>>>>>>>>> *  org.springframework.batch.core [341.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 [373.0]*
>>>>>>>>> *    import:
>>>>>>>>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>>>>>>>>> *
>>>>>>>>> *     |*
>>>>>>>>> *    export: package=org.springframework.context.support*
>>>>>>>>> *  org.springframework.context [366.0]*
>>>>>>>>> *        at
>>>>>>>>> org.apache.felix.framework.Felix.resolveBundle(Felix.java:3452)*
>>>>>>>>> *        at
>>>>>>>>> org.apache.felix.framework.Felix.startBundle(Felix.java:1734)*
>>>>>>>>> *        at
>>>>>>>>> org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1163)
>>>>>>>>> *
>>>>>>>>> *        at
>>>>>>>>> org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264)
>>>>>>>>> *
>>>>>>>>> *        at java.lang.Thread.run(Thread.java:662)*
>>>>>>>>> *Exception in thread "Thread-16"
>>>>>>>>> java.lang.IllegalArgumentException: Cannot write resource:
>>>>>>>>> org/xmlpull/mxp1/MXParser.class :43114: exception: java.io.*
>>>>>>>>> *IOException: Pipe closed*
>>>>>>>>> *        at aQute.lib.osgi.Jar.writeResource(Jar.java:302)*
>>>>>>>>> *        at aQute.lib.osgi.Jar.write(Jar.java:211)*
>>>>>>>>> *        at
>>>>>>>>> org.ops4j.pax.swissbox.bnd.BndUtils$1.run(BndUtils.java:174)*
>>>>>>>>> *^C*
>>>>>>>>> *karaf@root>*
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> 2012/8/13 Achim Nierbeck <bc...@googlemail.com>
>>>>>>>>>
>>>>>>>>>> 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 <ba...@gmail.com>:
>>>>>>>>>> > 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 <ch...@gmail.com>
>>>>>>>>>> >>
>>>>>>>>>> >> 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 <
>>>>>>>>>> balteo@gmail.com> 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 <ch...@gmail.com>
>>>>>>>>>> >>>>
>>>>>>>>>> >>>> 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 <
>>>>>>>>>> balteo@gmail.com> wrote:
>>>>>>>>>> >>>>>
>>>>>>>>>> >>>>> How do I install the Spring batch jars/bundle into Karaf?
>>>>>>>>>> >>>>> Regards,
>>>>>>>>>> >>>>> J.
>>>>>>>>>> >>>>>
>>>>>>>>>> >>>>> 2012/8/13 Charles Moulliard <ch...@gmail.com>
>>>>>>>>>> >>>>>>
>>>>>>>>>> >>>>>> 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 <
>>>>>>>>>> balteo@gmail.com>
>>>>>>>>>> >>>>>> 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 <ch...@gmail.com>
>>>>>>>>>> >>>>>>>>
>>>>>>>>>> >>>>>>>> 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 <
>>>>>>>>>> balteo@gmail.com>
>>>>>>>>>> >>>>>>>> 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 <ch...@gmail.com>
>>>>>>>>>> >>>>>>>>>>
>>>>>>>>>> >>>>>>>>>> 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 <
>>>>>>>>>> balteo@gmail.com>
>>>>>>>>>> >>>>>>>>>> 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 <ba...@gmail.com>
>>>>>>>>>> >>>>>>>>>>>>
>>>>>>>>>> >>>>>>>>>>>> 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 <ba...@gmail.com>
>>>>>>>>>> >>>>>>>>>>>>>
>>>>>>>>>> >>>>>>>>>>>>> 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é <jb...@nanthrax.net>
>>>>>>>>>> >>>>>>>>>>>>>>
>>>>>>>>>> >>>>>>>>>>>>>> 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 <balteo@gmail.com
>>>>>>>>>> >>>>>>>>>>>>>>> <ma...@gmail.com>>
>>>>>>>>>> >>>>>>>>>>>>>>>
>>>>>>>>>> >>>>>>>>>>>>>>>
>>>>>>>>>> >>>>>>>>>>>>>>>     Thanks to both of you. I'll try as you
>>>>>>>>>> advised and let
>>>>>>>>>> >>>>>>>>>>>>>>> you know.
>>>>>>>>>> >>>>>>>>>>>>>>>     Best regards,
>>>>>>>>>> >>>>>>>>>>>>>>>     J.
>>>>>>>>>> >>>>>>>>>>>>>>>
>>>>>>>>>> >>>>>>>>>>>>>>>
>>>>>>>>>> >>>>>>>>>>>>>>>     2012/8/10 Freeman Fang <
>>>>>>>>>> freeman.fang@gmail.com
>>>>>>>>>> >>>>>>>>>>>>>>>     <ma...@gmail.com>>
>>>>>>>>>> >>>>>>>>>>>>>>>
>>>>>>>>>> >>>>>>>>>>>>>>>
>>>>>>>>>> >>>>>>>>>>>>>>>         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:ffang@fusesource.com
>>>>>>>>>> >>>>>>>>>>>>>>> <ma...@fusesource.com>
>>>>>>>>>> >>>>>>>>>>>>>>>         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 <balteo@gmail.com
>>>>>>>>>> >>>>>>>>>>>>>>>>         <ma...@gmail.com>>
>>>>>>>>>> >>>>>>>>>>>>>>>>
>>>>>>>>>> >>>>>>>>>>>>>>>>
>>>>>>>>>> >>>>>>>>>>>>>>>>             thanks Achim
>>>>>>>>>> >>>>>>>>>>>>>>>>
>>>>>>>>>> >>>>>>>>>>>>>>>>
>>>>>>>>>> >>>>>>>>>>>>>>>>             2012/8/9 Achim Nierbeck <
>>>>>>>>>> bcanhome@googlemail.com
>>>>>>>>>> >>>>>>>>>>>>>>>>             <ma...@googlemail.com>>
>>>>>>>>>> >>>>>>>>>>>>>>>>
>>>>>>>>>> >>>>>>>>>>>>>>>>
>>>>>>>>>> >>>>>>>>>>>>>>>>                 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 <
>>>>>>>>>> balteo@gmail.com
>>>>>>>>>> >>>>>>>>>>>>>>>>                 <ma...@gmail.com>>:
>>>>>>>>>> >>>>>>>>>>>>>>>>
>>>>>>>>>> >>>>>>>>>>>>>>>>                 > 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
>>>>>>>>>> >>>>>>>>>>>>>>>> <bcanhome@googlemail.com
>>>>>>>>>> >>>>>>>>>>>>>>>>                 <mailto:bcanhome@googlemail.com
>>>>>>>>>> >>
>>>>>>>>>> >>>>>>>>>>>>>>>>
>>>>>>>>>> >>>>>>>>>>>>>>>>                 >>
>>>>>>>>>> >>>>>>>>>>>>>>>>                 >> 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 <
>>>>>>>>>> balteo@gmail.com
>>>>>>>>>> >>>>>>>>>>>>>>>>                 <ma...@gmail.com>>:
>>>>>>>>>> >>>>>>>>>>>>>>>>
>>>>>>>>>> >>>>>>>>>>>>>>>>                 >> > 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é
>>>>>>>>>> >>>>>>>>>>>>>> jbonofre@apache.org
>>>>>>>>>> >>>>>>>>>>>>>> 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/>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>> 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
>
>
>

Re: Embedding a Spring Integration app into Apache Karaf

Posted by Charles Moulliard <ch...@gmail.com>.
You can restart karaf and clean it using this command ./karaf clean

After that, deploy spring and Spring batch

features:install spring
install -s mvn:org.springframework.batch/spring-batch-core/2.1.8.RELEASE
install -s
mvn:org.springframework.batch/spring-batch-infrastructure/2.1.8.RELEASE

On Mon, Aug 13, 2012 at 3:43 PM, Julien Martin <ba...@gmail.com> wrote:

> Charles,
> How did you managed to do that? I followed your advice and I get a
> different result...
> Do you think I should start from a clean karaf install?
> J.
>
> 2012/8/13 Charles Moulliard <ch...@gmail.com>
>
>> This is not a bug as I have been able to deploy Spring Batch (core, infra)
>>
>> karaf@root> list -t 0 | grep -i spring
>> [  57] [Active     ] [            ] [       ] [   30] Spring Core
>> (3.0.7.RELEASE)
>> [  58] [Active     ] [            ] [       ] [   30] Spring ASM
>> (3.0.7.RELEASE)
>> [  59] [Active     ] [            ] [       ] [   30] Spring Expression
>> Language (3.0.7.RELEASE)
>> [  60] [Active     ] [            ] [       ] [   30] Spring Beans
>> (3.0.7.RELEASE)
>> [  61] [Active     ] [            ] [       ] [   30] Spring AOP
>> (3.0.7.RELEASE)
>> [  62] [Active     ] [            ] [       ] [   30] Spring Context
>> (3.0.7.RELEASE)
>> [  63] [Active     ] [            ] [       ] [   30] Spring Context
>> Support (3.0.7.RELEASE)
>> [  77] [Active     ] [            ] [       ] [   30] Spring Transaction
>> (3.0.7.RELEASE)
>>
>> [  92] [Active     ] [            ] [       ] [   80] Spring Batch
>> Infrastructure (2.1.8.RELEASE)
>> [  93] [Active     ] [            ] [       ] [   80] Spring Batch Core
>> (2.1.8.RELEASE)
>>
>> On Mon, Aug 13, 2012 at 3:34 PM, Julien Martin <ba...@gmail.com> wrote:
>>
>>> Charles,
>>> Do you reckon it is a bug on the springsource side?
>>> J.
>>>
>>> 2012/8/13 Julien Martin <ba...@gmail.com>
>>>
>>>> Charles,
>>>>
>>>> I did as you advised and I get the same dependency chain error as
>>>> before i.e.:
>>>>
>>>> *karaf@root> start 380*
>>>> *org.osgi.framework.BundleException: Unable to resolve module
>>>> org.springframework.batch.core [380.0] because it is exposed to
>>>> package 'org.springframew*
>>>>  *ork.context.support' from org.springframework.context [347.0] and
>>>> org.springframework.context [366.0] via two dependency chains.*
>>>> *
>>>> *
>>>> *Chain 1:*
>>>> *  org.springframework.batch.core [380.0]*
>>>> *    import:
>>>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>>>> *
>>>> *     |*
>>>> *    export: package=org.springframework.context.support*
>>>>  *  org.springframework.context [347.0]*
>>>> *
>>>> *
>>>> *Chain 2:*
>>>> *  org.springframework.batch.core [380.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 [373.0]*
>>>> *    import:
>>>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>>>> *
>>>> *     |*
>>>> *    export: package=org.springframework.context.support*
>>>> *  org.springframework.context [366.0]*
>>>>
>>>> 2012/8/13 Charles Moulliard <ch...@gmail.com>
>>>>
>>>>> I suggest that you install the spring batch jar file as I tell you and
>>>>> drop after all the other 38 jars files.
>>>>>
>>>>>
>>>>> On Mon, Aug 13, 2012 at 3:13 PM, Julien Martin <ba...@gmail.com>wrote:
>>>>>
>>>>>> Hi Charles,
>>>>>> Thanks. I actually dropped all my jars into the /deploy folder (for
>>>>>> testing purposes) as advised by Achim.
>>>>>> The real issue I have now is that of the dependency chains...
>>>>>> Regards,
>>>>>> J.
>>>>>>
>>>>>> 2012/8/13 Charles Moulliard <ch...@gmail.com>
>>>>>>
>>>>>>> Hi Julien,
>>>>>>>
>>>>>>> You do not need to wrap the Spring Batch jar file as it is already a
>>>>>>> bundle -->
>>>>>>>
>>>>>>> install -s
>>>>>>> mvn:org.springframework.batch/spring-batch-infrastructure/2.1.8.RELEASE
>>>>>>>
>>>>>>> [  92] [Active     ] [            ] [       ] [   80]
>>>>>>> mvn:org.springframework.batch/spring-batch-infrastructure/2.1.8.RELEASE
>>>>>>>
>>>>>>> Regards,
>>>>>>>
>>>>>>> Charles
>>>>>>>
>>>>>>>
>>>>>>> On Mon, Aug 13, 2012 at 2:57 PM, Julien Martin <ba...@gmail.com>wrote:
>>>>>>>
>>>>>>>> Hi,
>>>>>>>> I am almost there. I dropped the dependencies as well as my app
>>>>>>>> into the /deploy folder. I get a multiple dependency chain problem as
>>>>>>>> follows. Can anyone please help?
>>>>>>>>
>>>>>>>> *C:\system\apache-karaf-2.2.8\bin>karaf*
>>>>>>>> *        __ __                  ____*
>>>>>>>> *       / //_/____ __________ _/ __/*
>>>>>>>> *      / ,<  / __ `/ ___/ __ `/ /_*
>>>>>>>> *     / /| |/ /_/ / /  / /_/ / __/*
>>>>>>>> *    /_/ |_|\__,_/_/   \__,_/_/*
>>>>>>>> *
>>>>>>>> *
>>>>>>>> *  Apache Karaf (2.2.8)*
>>>>>>>> *
>>>>>>>> *
>>>>>>>> *Hit '<tab>' for a list of available commands*
>>>>>>>> *and '[cmd] --help' for help on a specific command.*
>>>>>>>> *Hit '<ctrl-d>' or 'osgi:shutdown' to shutdown Karaf.*
>>>>>>>> *
>>>>>>>> *
>>>>>>>> *karaf@root> ERROR: Bundle org.springframework.batch.test [339]
>>>>>>>> Error starting
>>>>>>>> file:/C:/system/apache-karaf-2.2.8/deploy/spring-batch-test-2.1.8.RELEAS
>>>>>>>> *
>>>>>>>> *E.jar (org.osgi.framework.BundleException: Unable to resolve
>>>>>>>> module org.springframework.batch.core [341.0] because it is
>>>>>>>> exposed to package 'org.sprin*
>>>>>>>> *gframework.context.support' from org.springframework.context
>>>>>>>> [347.0] and org.springframework.context [366.0] via two dependency
>>>>>>>> chains.*
>>>>>>>> *
>>>>>>>> *
>>>>>>>> *Chain 1:*
>>>>>>>> *  org.springframework.batch.core [341.0]*
>>>>>>>> *    import:
>>>>>>>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>>>>>>>> *
>>>>>>>> *     |*
>>>>>>>> *    export: package=org.springframework.context.support*
>>>>>>>> *  org.springframework.context [347.0]*
>>>>>>>> *
>>>>>>>> *
>>>>>>>> *Chain 2:*
>>>>>>>> *  org.springframework.batch.core [341.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 [373.0]*
>>>>>>>> *    import:
>>>>>>>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>>>>>>>> *
>>>>>>>> *     |*
>>>>>>>> *    export: package=org.springframework.context.support*
>>>>>>>> *  org.springframework.context [366.0])*
>>>>>>>> *org.osgi.framework.BundleException: Unable to resolve module
>>>>>>>> org.springframework.batch.core [341.0] because it is exposed to
>>>>>>>> package 'org.springframew*
>>>>>>>> *ork.context.support' from org.springframework.context [347.0] and
>>>>>>>> org.springframework.context [366.0] via two dependency chains.*
>>>>>>>> *
>>>>>>>> *
>>>>>>>> *Chain 1:*
>>>>>>>> *  org.springframework.batch.core [341.0]*
>>>>>>>>  *    import:
>>>>>>>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>>>>>>>> *
>>>>>>>> *     |*
>>>>>>>> *    export: package=org.springframework.context.support*
>>>>>>>>  *  org.springframework.context [347.0]*
>>>>>>>> *
>>>>>>>> *
>>>>>>>> *Chain 2:*
>>>>>>>> *  org.springframework.batch.core [341.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 [373.0]*
>>>>>>>>  *    import:
>>>>>>>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>>>>>>>> *
>>>>>>>> *     |*
>>>>>>>> *    export: package=org.springframework.context.support*
>>>>>>>> *  org.springframework.context [366.0]*
>>>>>>>> *        at
>>>>>>>> org.apache.felix.framework.Felix.resolveBundle(Felix.java:3452)*
>>>>>>>> *        at
>>>>>>>> org.apache.felix.framework.Felix.startBundle(Felix.java:1734)*
>>>>>>>> *        at
>>>>>>>> org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1163)
>>>>>>>> *
>>>>>>>> *        at
>>>>>>>> org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264)
>>>>>>>> *
>>>>>>>> *        at java.lang.Thread.run(Thread.java:662)*
>>>>>>>> *ERROR: Bundle org.springframework.batch.core [341] Error starting
>>>>>>>> file:/C:/system/apache-karaf-2.2.8/deploy/spring-batch-core-2.1.8.RELEASE.jar
>>>>>>>> (org.o*
>>>>>>>> *sgi.framework.BundleException: Unable to resolve module
>>>>>>>> org.springframework.batch.core [341.0] because it is exposed to
>>>>>>>> package 'org.springframework.c*
>>>>>>>> *ontext.support' from org.springframework.context [347.0] and
>>>>>>>> org.springframework.context [366.0] via two dependency chains.*
>>>>>>>> *
>>>>>>>> *
>>>>>>>> *Chain 1:*
>>>>>>>> *  org.springframework.batch.core [341.0]*
>>>>>>>> *    import:
>>>>>>>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>>>>>>>> *
>>>>>>>> *     |*
>>>>>>>> *    export: package=org.springframework.context.support*
>>>>>>>> *  org.springframework.context [347.0]*
>>>>>>>> *
>>>>>>>> *
>>>>>>>> *Chain 2:*
>>>>>>>> *  org.springframework.batch.core [341.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 [373.0]*
>>>>>>>> *    import:
>>>>>>>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>>>>>>>> *
>>>>>>>> *     |*
>>>>>>>> *    export: package=org.springframework.context.support*
>>>>>>>> *  org.springframework.context [366.0])*
>>>>>>>> *org.osgi.framework.BundleException: Unable to resolve module
>>>>>>>> org.springframework.batch.core [341.0] because it is exposed to
>>>>>>>> package 'org.springframew*
>>>>>>>> *ork.context.support' from org.springframework.context [347.0] and
>>>>>>>> org.springframework.context [366.0] via two dependency chains.*
>>>>>>>> *
>>>>>>>> *
>>>>>>>> *Chain 1:*
>>>>>>>> *  org.springframework.batch.core [341.0]*
>>>>>>>>  *    import:
>>>>>>>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>>>>>>>> *
>>>>>>>> *     |*
>>>>>>>> *    export: package=org.springframework.context.support*
>>>>>>>>  *  org.springframework.context [347.0]*
>>>>>>>> *
>>>>>>>> *
>>>>>>>> *Chain 2:*
>>>>>>>> *  org.springframework.batch.core [341.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 [373.0]*
>>>>>>>>  *    import:
>>>>>>>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>>>>>>>> *
>>>>>>>> *     |*
>>>>>>>> *    export: package=org.springframework.context.support*
>>>>>>>> *  org.springframework.context [366.0]*
>>>>>>>> *        at
>>>>>>>> org.apache.felix.framework.Felix.resolveBundle(Felix.java:3452)*
>>>>>>>> *        at
>>>>>>>> org.apache.felix.framework.Felix.startBundle(Felix.java:1734)*
>>>>>>>> *        at
>>>>>>>> org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1163)
>>>>>>>> *
>>>>>>>> *        at
>>>>>>>> org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264)
>>>>>>>> *
>>>>>>>> *        at java.lang.Thread.run(Thread.java:662)*
>>>>>>>> *ERROR: Bundle org.springframework.batch.integration [342] Error
>>>>>>>> starting
>>>>>>>> file:/C:/system/apache-karaf-2.2.8/deploy/spring-batch-integration-1.2.1.RELE
>>>>>>>> *
>>>>>>>> *ASE.jar (org.osgi.framework.BundleException: Unable to resolve
>>>>>>>> module org.springframework.batch.core [341.0] because it is
>>>>>>>> exposed to package 'org.spr*
>>>>>>>> *ingframework.context.support' from org.springframework.context
>>>>>>>> [347.0] and org.springframework.context [366.0] via two dependency
>>>>>>>> chains.*
>>>>>>>> *
>>>>>>>> *
>>>>>>>> *Chain 1:*
>>>>>>>> *  org.springframework.batch.core [341.0]*
>>>>>>>> *    import:
>>>>>>>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>>>>>>>> *
>>>>>>>> *     |*
>>>>>>>> *    export: package=org.springframework.context.support*
>>>>>>>> *  org.springframework.context [347.0]*
>>>>>>>> *
>>>>>>>> *
>>>>>>>> *Chain 2:*
>>>>>>>> *  org.springframework.batch.core [341.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 [373.0]*
>>>>>>>> *    import:
>>>>>>>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>>>>>>>> *
>>>>>>>> *     |*
>>>>>>>> *    export: package=org.springframework.context.support*
>>>>>>>> *  org.springframework.context [366.0])*
>>>>>>>> *org.osgi.framework.BundleException: Unable to resolve module
>>>>>>>> org.springframework.batch.core [341.0] because it is exposed to package
>>>>>>>> 'org.springframew*
>>>>>>>> *ork.context.support' from org.springframework.context [347.0] and
>>>>>>>> org.springframework.context [366.0] via two dependency chains.*
>>>>>>>> *
>>>>>>>> *
>>>>>>>> *Chain 1:*
>>>>>>>> *  org.springframework.batch.core [341.0]*
>>>>>>>>  *    import:
>>>>>>>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>>>>>>>> *
>>>>>>>> *     |*
>>>>>>>> *    export: package=org.springframework.context.support*
>>>>>>>>  *  org.springframework.context [347.0]*
>>>>>>>> *
>>>>>>>> *
>>>>>>>> *Chain 2:*
>>>>>>>> *  org.springframework.batch.core [341.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 [373.0]*
>>>>>>>> *    import:
>>>>>>>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>>>>>>>> *
>>>>>>>> *     |*
>>>>>>>> *    export: package=org.springframework.context.support*
>>>>>>>> *  org.springframework.context [366.0]*
>>>>>>>> *        at
>>>>>>>> org.apache.felix.framework.Felix.resolveBundle(Felix.java:3452)*
>>>>>>>> *        at
>>>>>>>> org.apache.felix.framework.Felix.startBundle(Felix.java:1734)*
>>>>>>>> *        at
>>>>>>>> org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1163)
>>>>>>>> *
>>>>>>>> *        at
>>>>>>>> org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264)
>>>>>>>> *
>>>>>>>> *        at java.lang.Thread.run(Thread.java:662)*
>>>>>>>> *ERROR: Bundle spring-batch-demo-trc-dm [368] Error starting
>>>>>>>> file:/C:/system/apache-karaf-2.2.8/deploy/spring-batch-demo-trc-dm-1.0.0-SNAPSHOT.jar
>>>>>>>> (org*
>>>>>>>> *.osgi.framework.BundleException: Unable to resolve module
>>>>>>>> org.springframework.batch.core [341.0] because it is exposed to package
>>>>>>>> 'org.springframework*
>>>>>>>> *.context.support' from org.springframework.context [347.0] and
>>>>>>>> org.springframework.context [366.0] via two dependency chains.*
>>>>>>>> *
>>>>>>>> *
>>>>>>>> *Chain 1:*
>>>>>>>> *  org.springframework.batch.core [341.0]*
>>>>>>>> *    import:
>>>>>>>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>>>>>>>> *
>>>>>>>> *     |*
>>>>>>>> *    export: package=org.springframework.context.support*
>>>>>>>> *  org.springframework.context [347.0]*
>>>>>>>> *
>>>>>>>> *
>>>>>>>> *Chain 2:*
>>>>>>>> *  org.springframework.batch.core [341.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 [373.0]*
>>>>>>>> *    import:
>>>>>>>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>>>>>>>> *
>>>>>>>> *     |*
>>>>>>>> *    export: package=org.springframework.context.support*
>>>>>>>> *  org.springframework.context [366.0])*
>>>>>>>> *org.osgi.framework.BundleException: Unable to resolve module
>>>>>>>> org.springframework.batch.core [341.0] because it is exposed to package
>>>>>>>> 'org.springframew*
>>>>>>>> *ork.context.support' from org.springframework.context [347.0] and
>>>>>>>> org.springframework.context [366.0] via two dependency chains.*
>>>>>>>> *
>>>>>>>> *
>>>>>>>> *Chain 1:*
>>>>>>>> *  org.springframework.batch.core [341.0]*
>>>>>>>>  *    import:
>>>>>>>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>>>>>>>> *
>>>>>>>> *     |*
>>>>>>>> *    export: package=org.springframework.context.support*
>>>>>>>>  *  org.springframework.context [347.0]*
>>>>>>>> *
>>>>>>>> *
>>>>>>>> *Chain 2:*
>>>>>>>> *  org.springframework.batch.core [341.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 [373.0]*
>>>>>>>> *    import:
>>>>>>>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>>>>>>>> *
>>>>>>>> *     |*
>>>>>>>> *    export: package=org.springframework.context.support*
>>>>>>>> *  org.springframework.context [366.0]*
>>>>>>>> *        at
>>>>>>>> org.apache.felix.framework.Felix.resolveBundle(Felix.java:3452)*
>>>>>>>> *        at
>>>>>>>> org.apache.felix.framework.Felix.startBundle(Felix.java:1734)*
>>>>>>>> *        at
>>>>>>>> org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1163)
>>>>>>>> *
>>>>>>>> *        at
>>>>>>>> org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264)
>>>>>>>> *
>>>>>>>> *        at java.lang.Thread.run(Thread.java:662)*
>>>>>>>> *Exception in thread "Thread-16"
>>>>>>>> java.lang.IllegalArgumentException: Cannot write resource:
>>>>>>>> org/xmlpull/mxp1/MXParser.class :43114: exception: java.io.*
>>>>>>>> *IOException: Pipe closed*
>>>>>>>> *        at aQute.lib.osgi.Jar.writeResource(Jar.java:302)*
>>>>>>>> *        at aQute.lib.osgi.Jar.write(Jar.java:211)*
>>>>>>>> *        at
>>>>>>>> org.ops4j.pax.swissbox.bnd.BndUtils$1.run(BndUtils.java:174)*
>>>>>>>> *^C*
>>>>>>>> *karaf@root>*
>>>>>>>>
>>>>>>>>
>>>>>>>> 2012/8/13 Achim Nierbeck <bc...@googlemail.com>
>>>>>>>>
>>>>>>>>> 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 <ba...@gmail.com>:
>>>>>>>>> > 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 <ch...@gmail.com>
>>>>>>>>> >>
>>>>>>>>> >> 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 <
>>>>>>>>> balteo@gmail.com> 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 <ch...@gmail.com>
>>>>>>>>> >>>>
>>>>>>>>> >>>> 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 <
>>>>>>>>> balteo@gmail.com> wrote:
>>>>>>>>> >>>>>
>>>>>>>>> >>>>> How do I install the Spring batch jars/bundle into Karaf?
>>>>>>>>> >>>>> Regards,
>>>>>>>>> >>>>> J.
>>>>>>>>> >>>>>
>>>>>>>>> >>>>> 2012/8/13 Charles Moulliard <ch...@gmail.com>
>>>>>>>>> >>>>>>
>>>>>>>>> >>>>>> 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 <
>>>>>>>>> balteo@gmail.com>
>>>>>>>>> >>>>>> 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 <ch...@gmail.com>
>>>>>>>>> >>>>>>>>
>>>>>>>>> >>>>>>>> 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 <
>>>>>>>>> balteo@gmail.com>
>>>>>>>>> >>>>>>>> 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 <ch...@gmail.com>
>>>>>>>>> >>>>>>>>>>
>>>>>>>>> >>>>>>>>>> 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 <
>>>>>>>>> balteo@gmail.com>
>>>>>>>>> >>>>>>>>>> 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 <ba...@gmail.com>
>>>>>>>>> >>>>>>>>>>>>
>>>>>>>>> >>>>>>>>>>>> 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 <ba...@gmail.com>
>>>>>>>>> >>>>>>>>>>>>>
>>>>>>>>> >>>>>>>>>>>>> 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é <jb...@nanthrax.net>
>>>>>>>>> >>>>>>>>>>>>>>
>>>>>>>>> >>>>>>>>>>>>>> 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 <balteo@gmail.com
>>>>>>>>> >>>>>>>>>>>>>>> <ma...@gmail.com>>
>>>>>>>>> >>>>>>>>>>>>>>>
>>>>>>>>> >>>>>>>>>>>>>>>
>>>>>>>>> >>>>>>>>>>>>>>>     Thanks to both of you. I'll try as you advised
>>>>>>>>> and let
>>>>>>>>> >>>>>>>>>>>>>>> you know.
>>>>>>>>> >>>>>>>>>>>>>>>     Best regards,
>>>>>>>>> >>>>>>>>>>>>>>>     J.
>>>>>>>>> >>>>>>>>>>>>>>>
>>>>>>>>> >>>>>>>>>>>>>>>
>>>>>>>>> >>>>>>>>>>>>>>>     2012/8/10 Freeman Fang <freeman.fang@gmail.com
>>>>>>>>> >>>>>>>>>>>>>>>     <ma...@gmail.com>>
>>>>>>>>> >>>>>>>>>>>>>>>
>>>>>>>>> >>>>>>>>>>>>>>>
>>>>>>>>> >>>>>>>>>>>>>>>         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:ffang@fusesource.com
>>>>>>>>> >>>>>>>>>>>>>>> <ma...@fusesource.com>
>>>>>>>>> >>>>>>>>>>>>>>>         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 <balteo@gmail.com
>>>>>>>>> >>>>>>>>>>>>>>>>         <ma...@gmail.com>>
>>>>>>>>> >>>>>>>>>>>>>>>>
>>>>>>>>> >>>>>>>>>>>>>>>>
>>>>>>>>> >>>>>>>>>>>>>>>>             thanks Achim
>>>>>>>>> >>>>>>>>>>>>>>>>
>>>>>>>>> >>>>>>>>>>>>>>>>
>>>>>>>>> >>>>>>>>>>>>>>>>             2012/8/9 Achim Nierbeck <
>>>>>>>>> bcanhome@googlemail.com
>>>>>>>>> >>>>>>>>>>>>>>>>             <ma...@googlemail.com>>
>>>>>>>>> >>>>>>>>>>>>>>>>
>>>>>>>>> >>>>>>>>>>>>>>>>
>>>>>>>>> >>>>>>>>>>>>>>>>                 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 <
>>>>>>>>> balteo@gmail.com
>>>>>>>>> >>>>>>>>>>>>>>>>                 <ma...@gmail.com>>:
>>>>>>>>> >>>>>>>>>>>>>>>>
>>>>>>>>> >>>>>>>>>>>>>>>>                 > 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
>>>>>>>>> >>>>>>>>>>>>>>>> <bcanhome@googlemail.com
>>>>>>>>> >>>>>>>>>>>>>>>>                 <ma...@googlemail.com>>
>>>>>>>>> >>>>>>>>>>>>>>>>
>>>>>>>>> >>>>>>>>>>>>>>>>                 >>
>>>>>>>>> >>>>>>>>>>>>>>>>                 >> 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 <
>>>>>>>>> balteo@gmail.com
>>>>>>>>> >>>>>>>>>>>>>>>>                 <ma...@gmail.com>>:
>>>>>>>>> >>>>>>>>>>>>>>>>
>>>>>>>>> >>>>>>>>>>>>>>>>                 >> > 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é
>>>>>>>>> >>>>>>>>>>>>>> jbonofre@apache.org
>>>>>>>>> >>>>>>>>>>>>>> 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/>
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> 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

Re: Embedding a Spring Integration app into Apache Karaf

Posted by Julien Martin <ba...@gmail.com>.
I might have messed with the install I mean...

2012/8/13 Julien Martin <ba...@gmail.com>

> Charles,
> How did you managed to do that? I followed your advice and I get a
> different result...
> Do you think I should start from a clean karaf install?
> J.
>
> 2012/8/13 Charles Moulliard <ch...@gmail.com>
>
>> This is not a bug as I have been able to deploy Spring Batch (core, infra)
>>
>> karaf@root> list -t 0 | grep -i spring
>> [  57] [Active     ] [            ] [       ] [   30] Spring Core
>> (3.0.7.RELEASE)
>> [  58] [Active     ] [            ] [       ] [   30] Spring ASM
>> (3.0.7.RELEASE)
>> [  59] [Active     ] [            ] [       ] [   30] Spring Expression
>> Language (3.0.7.RELEASE)
>> [  60] [Active     ] [            ] [       ] [   30] Spring Beans
>> (3.0.7.RELEASE)
>> [  61] [Active     ] [            ] [       ] [   30] Spring AOP
>> (3.0.7.RELEASE)
>> [  62] [Active     ] [            ] [       ] [   30] Spring Context
>> (3.0.7.RELEASE)
>> [  63] [Active     ] [            ] [       ] [   30] Spring Context
>> Support (3.0.7.RELEASE)
>> [  77] [Active     ] [            ] [       ] [   30] Spring Transaction
>> (3.0.7.RELEASE)
>>
>> [  92] [Active     ] [            ] [       ] [   80] Spring Batch
>> Infrastructure (2.1.8.RELEASE)
>> [  93] [Active     ] [            ] [       ] [   80] Spring Batch Core
>> (2.1.8.RELEASE)
>>
>> On Mon, Aug 13, 2012 at 3:34 PM, Julien Martin <ba...@gmail.com> wrote:
>>
>>> Charles,
>>> Do you reckon it is a bug on the springsource side?
>>> J.
>>>
>>> 2012/8/13 Julien Martin <ba...@gmail.com>
>>>
>>>> Charles,
>>>>
>>>> I did as you advised and I get the same dependency chain error as
>>>> before i.e.:
>>>>
>>>> *karaf@root> start 380*
>>>> *org.osgi.framework.BundleException: Unable to resolve module
>>>> org.springframework.batch.core [380.0] because it is exposed to
>>>> package 'org.springframew*
>>>>  *ork.context.support' from org.springframework.context [347.0] and
>>>> org.springframework.context [366.0] via two dependency chains.*
>>>> *
>>>> *
>>>> *Chain 1:*
>>>> *  org.springframework.batch.core [380.0]*
>>>> *    import:
>>>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>>>> *
>>>> *     |*
>>>> *    export: package=org.springframework.context.support*
>>>>  *  org.springframework.context [347.0]*
>>>> *
>>>> *
>>>> *Chain 2:*
>>>> *  org.springframework.batch.core [380.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 [373.0]*
>>>> *    import:
>>>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>>>> *
>>>> *     |*
>>>> *    export: package=org.springframework.context.support*
>>>> *  org.springframework.context [366.0]*
>>>>
>>>> 2012/8/13 Charles Moulliard <ch...@gmail.com>
>>>>
>>>>> I suggest that you install the spring batch jar file as I tell you and
>>>>> drop after all the other 38 jars files.
>>>>>
>>>>>
>>>>> On Mon, Aug 13, 2012 at 3:13 PM, Julien Martin <ba...@gmail.com>wrote:
>>>>>
>>>>>> Hi Charles,
>>>>>> Thanks. I actually dropped all my jars into the /deploy folder (for
>>>>>> testing purposes) as advised by Achim.
>>>>>> The real issue I have now is that of the dependency chains...
>>>>>> Regards,
>>>>>> J.
>>>>>>
>>>>>> 2012/8/13 Charles Moulliard <ch...@gmail.com>
>>>>>>
>>>>>>> Hi Julien,
>>>>>>>
>>>>>>> You do not need to wrap the Spring Batch jar file as it is already a
>>>>>>> bundle -->
>>>>>>>
>>>>>>> install -s
>>>>>>> mvn:org.springframework.batch/spring-batch-infrastructure/2.1.8.RELEASE
>>>>>>>
>>>>>>> [  92] [Active     ] [            ] [       ] [   80]
>>>>>>> mvn:org.springframework.batch/spring-batch-infrastructure/2.1.8.RELEASE
>>>>>>>
>>>>>>> Regards,
>>>>>>>
>>>>>>> Charles
>>>>>>>
>>>>>>>
>>>>>>> On Mon, Aug 13, 2012 at 2:57 PM, Julien Martin <ba...@gmail.com>wrote:
>>>>>>>
>>>>>>>> Hi,
>>>>>>>> I am almost there. I dropped the dependencies as well as my app
>>>>>>>> into the /deploy folder. I get a multiple dependency chain problem as
>>>>>>>> follows. Can anyone please help?
>>>>>>>>
>>>>>>>> *C:\system\apache-karaf-2.2.8\bin>karaf*
>>>>>>>> *        __ __                  ____*
>>>>>>>> *       / //_/____ __________ _/ __/*
>>>>>>>> *      / ,<  / __ `/ ___/ __ `/ /_*
>>>>>>>> *     / /| |/ /_/ / /  / /_/ / __/*
>>>>>>>> *    /_/ |_|\__,_/_/   \__,_/_/*
>>>>>>>> *
>>>>>>>> *
>>>>>>>> *  Apache Karaf (2.2.8)*
>>>>>>>> *
>>>>>>>> *
>>>>>>>> *Hit '<tab>' for a list of available commands*
>>>>>>>> *and '[cmd] --help' for help on a specific command.*
>>>>>>>> *Hit '<ctrl-d>' or 'osgi:shutdown' to shutdown Karaf.*
>>>>>>>> *
>>>>>>>> *
>>>>>>>> *karaf@root> ERROR: Bundle org.springframework.batch.test [339]
>>>>>>>> Error starting
>>>>>>>> file:/C:/system/apache-karaf-2.2.8/deploy/spring-batch-test-2.1.8.RELEAS
>>>>>>>> *
>>>>>>>> *E.jar (org.osgi.framework.BundleException: Unable to resolve
>>>>>>>> module org.springframework.batch.core [341.0] because it is
>>>>>>>> exposed to package 'org.sprin*
>>>>>>>> *gframework.context.support' from org.springframework.context
>>>>>>>> [347.0] and org.springframework.context [366.0] via two dependency
>>>>>>>> chains.*
>>>>>>>> *
>>>>>>>> *
>>>>>>>> *Chain 1:*
>>>>>>>> *  org.springframework.batch.core [341.0]*
>>>>>>>> *    import:
>>>>>>>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>>>>>>>> *
>>>>>>>> *     |*
>>>>>>>> *    export: package=org.springframework.context.support*
>>>>>>>> *  org.springframework.context [347.0]*
>>>>>>>> *
>>>>>>>> *
>>>>>>>> *Chain 2:*
>>>>>>>> *  org.springframework.batch.core [341.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 [373.0]*
>>>>>>>> *    import:
>>>>>>>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>>>>>>>> *
>>>>>>>> *     |*
>>>>>>>> *    export: package=org.springframework.context.support*
>>>>>>>> *  org.springframework.context [366.0])*
>>>>>>>> *org.osgi.framework.BundleException: Unable to resolve module
>>>>>>>> org.springframework.batch.core [341.0] because it is exposed to
>>>>>>>> package 'org.springframew*
>>>>>>>> *ork.context.support' from org.springframework.context [347.0] and
>>>>>>>> org.springframework.context [366.0] via two dependency chains.*
>>>>>>>> *
>>>>>>>> *
>>>>>>>> *Chain 1:*
>>>>>>>> *  org.springframework.batch.core [341.0]*
>>>>>>>>  *    import:
>>>>>>>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>>>>>>>> *
>>>>>>>> *     |*
>>>>>>>> *    export: package=org.springframework.context.support*
>>>>>>>>  *  org.springframework.context [347.0]*
>>>>>>>> *
>>>>>>>> *
>>>>>>>> *Chain 2:*
>>>>>>>> *  org.springframework.batch.core [341.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 [373.0]*
>>>>>>>>  *    import:
>>>>>>>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>>>>>>>> *
>>>>>>>> *     |*
>>>>>>>> *    export: package=org.springframework.context.support*
>>>>>>>> *  org.springframework.context [366.0]*
>>>>>>>> *        at
>>>>>>>> org.apache.felix.framework.Felix.resolveBundle(Felix.java:3452)*
>>>>>>>> *        at
>>>>>>>> org.apache.felix.framework.Felix.startBundle(Felix.java:1734)*
>>>>>>>> *        at
>>>>>>>> org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1163)
>>>>>>>> *
>>>>>>>> *        at
>>>>>>>> org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264)
>>>>>>>> *
>>>>>>>> *        at java.lang.Thread.run(Thread.java:662)*
>>>>>>>> *ERROR: Bundle org.springframework.batch.core [341] Error starting
>>>>>>>> file:/C:/system/apache-karaf-2.2.8/deploy/spring-batch-core-2.1.8.RELEASE.jar
>>>>>>>> (org.o*
>>>>>>>> *sgi.framework.BundleException: Unable to resolve module
>>>>>>>> org.springframework.batch.core [341.0] because it is exposed to
>>>>>>>> package 'org.springframework.c*
>>>>>>>> *ontext.support' from org.springframework.context [347.0] and
>>>>>>>> org.springframework.context [366.0] via two dependency chains.*
>>>>>>>> *
>>>>>>>> *
>>>>>>>> *Chain 1:*
>>>>>>>> *  org.springframework.batch.core [341.0]*
>>>>>>>> *    import:
>>>>>>>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>>>>>>>> *
>>>>>>>> *     |*
>>>>>>>> *    export: package=org.springframework.context.support*
>>>>>>>> *  org.springframework.context [347.0]*
>>>>>>>> *
>>>>>>>> *
>>>>>>>> *Chain 2:*
>>>>>>>> *  org.springframework.batch.core [341.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 [373.0]*
>>>>>>>> *    import:
>>>>>>>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>>>>>>>> *
>>>>>>>> *     |*
>>>>>>>> *    export: package=org.springframework.context.support*
>>>>>>>> *  org.springframework.context [366.0])*
>>>>>>>> *org.osgi.framework.BundleException: Unable to resolve module
>>>>>>>> org.springframework.batch.core [341.0] because it is exposed to
>>>>>>>> package 'org.springframew*
>>>>>>>> *ork.context.support' from org.springframework.context [347.0] and
>>>>>>>> org.springframework.context [366.0] via two dependency chains.*
>>>>>>>> *
>>>>>>>> *
>>>>>>>> *Chain 1:*
>>>>>>>> *  org.springframework.batch.core [341.0]*
>>>>>>>>  *    import:
>>>>>>>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>>>>>>>> *
>>>>>>>> *     |*
>>>>>>>> *    export: package=org.springframework.context.support*
>>>>>>>>  *  org.springframework.context [347.0]*
>>>>>>>> *
>>>>>>>> *
>>>>>>>> *Chain 2:*
>>>>>>>> *  org.springframework.batch.core [341.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 [373.0]*
>>>>>>>>  *    import:
>>>>>>>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>>>>>>>> *
>>>>>>>> *     |*
>>>>>>>> *    export: package=org.springframework.context.support*
>>>>>>>> *  org.springframework.context [366.0]*
>>>>>>>> *        at
>>>>>>>> org.apache.felix.framework.Felix.resolveBundle(Felix.java:3452)*
>>>>>>>> *        at
>>>>>>>> org.apache.felix.framework.Felix.startBundle(Felix.java:1734)*
>>>>>>>> *        at
>>>>>>>> org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1163)
>>>>>>>> *
>>>>>>>> *        at
>>>>>>>> org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264)
>>>>>>>> *
>>>>>>>> *        at java.lang.Thread.run(Thread.java:662)*
>>>>>>>> *ERROR: Bundle org.springframework.batch.integration [342] Error
>>>>>>>> starting
>>>>>>>> file:/C:/system/apache-karaf-2.2.8/deploy/spring-batch-integration-1.2.1.RELE
>>>>>>>> *
>>>>>>>> *ASE.jar (org.osgi.framework.BundleException: Unable to resolve
>>>>>>>> module org.springframework.batch.core [341.0] because it is
>>>>>>>> exposed to package 'org.spr*
>>>>>>>> *ingframework.context.support' from org.springframework.context
>>>>>>>> [347.0] and org.springframework.context [366.0] via two dependency
>>>>>>>> chains.*
>>>>>>>> *
>>>>>>>> *
>>>>>>>> *Chain 1:*
>>>>>>>> *  org.springframework.batch.core [341.0]*
>>>>>>>> *    import:
>>>>>>>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>>>>>>>> *
>>>>>>>> *     |*
>>>>>>>> *    export: package=org.springframework.context.support*
>>>>>>>> *  org.springframework.context [347.0]*
>>>>>>>> *
>>>>>>>> *
>>>>>>>> *Chain 2:*
>>>>>>>> *  org.springframework.batch.core [341.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 [373.0]*
>>>>>>>> *    import:
>>>>>>>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>>>>>>>> *
>>>>>>>> *     |*
>>>>>>>> *    export: package=org.springframework.context.support*
>>>>>>>> *  org.springframework.context [366.0])*
>>>>>>>> *org.osgi.framework.BundleException: Unable to resolve module
>>>>>>>> org.springframework.batch.core [341.0] because it is exposed to
>>>>>>>> package 'org.springframew*
>>>>>>>> *ork.context.support' from org.springframework.context [347.0] and
>>>>>>>> org.springframework.context [366.0] via two dependency chains.*
>>>>>>>> *
>>>>>>>> *
>>>>>>>> *Chain 1:*
>>>>>>>> *  org.springframework.batch.core [341.0]*
>>>>>>>>  *    import:
>>>>>>>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>>>>>>>> *
>>>>>>>> *     |*
>>>>>>>> *    export: package=org.springframework.context.support*
>>>>>>>>  *  org.springframework.context [347.0]*
>>>>>>>> *
>>>>>>>> *
>>>>>>>> *Chain 2:*
>>>>>>>> *  org.springframework.batch.core [341.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 [373.0]*
>>>>>>>> *    import:
>>>>>>>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>>>>>>>> *
>>>>>>>> *     |*
>>>>>>>> *    export: package=org.springframework.context.support*
>>>>>>>> *  org.springframework.context [366.0]*
>>>>>>>> *        at
>>>>>>>> org.apache.felix.framework.Felix.resolveBundle(Felix.java:3452)*
>>>>>>>> *        at
>>>>>>>> org.apache.felix.framework.Felix.startBundle(Felix.java:1734)*
>>>>>>>> *        at
>>>>>>>> org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1163)
>>>>>>>> *
>>>>>>>> *        at
>>>>>>>> org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264)
>>>>>>>> *
>>>>>>>> *        at java.lang.Thread.run(Thread.java:662)*
>>>>>>>> *ERROR: Bundle spring-batch-demo-trc-dm [368] Error starting
>>>>>>>> file:/C:/system/apache-karaf-2.2.8/deploy/spring-batch-demo-trc-dm-1.0.0-SNAPSHOT.jar
>>>>>>>> (org*
>>>>>>>> *.osgi.framework.BundleException: Unable to resolve module
>>>>>>>> org.springframework.batch.core [341.0] because it is exposed to
>>>>>>>> package 'org.springframework*
>>>>>>>> *.context.support' from org.springframework.context [347.0] and
>>>>>>>> org.springframework.context [366.0] via two dependency chains.*
>>>>>>>> *
>>>>>>>> *
>>>>>>>> *Chain 1:*
>>>>>>>> *  org.springframework.batch.core [341.0]*
>>>>>>>> *    import:
>>>>>>>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>>>>>>>> *
>>>>>>>> *     |*
>>>>>>>> *    export: package=org.springframework.context.support*
>>>>>>>> *  org.springframework.context [347.0]*
>>>>>>>> *
>>>>>>>> *
>>>>>>>> *Chain 2:*
>>>>>>>> *  org.springframework.batch.core [341.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 [373.0]*
>>>>>>>> *    import:
>>>>>>>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>>>>>>>> *
>>>>>>>> *     |*
>>>>>>>> *    export: package=org.springframework.context.support*
>>>>>>>> *  org.springframework.context [366.0])*
>>>>>>>> *org.osgi.framework.BundleException: Unable to resolve module
>>>>>>>> org.springframework.batch.core [341.0] because it is exposed to package
>>>>>>>> 'org.springframew*
>>>>>>>> *ork.context.support' from org.springframework.context [347.0] and
>>>>>>>> org.springframework.context [366.0] via two dependency chains.*
>>>>>>>> *
>>>>>>>> *
>>>>>>>> *Chain 1:*
>>>>>>>> *  org.springframework.batch.core [341.0]*
>>>>>>>>  *    import:
>>>>>>>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>>>>>>>> *
>>>>>>>> *     |*
>>>>>>>> *    export: package=org.springframework.context.support*
>>>>>>>>  *  org.springframework.context [347.0]*
>>>>>>>> *
>>>>>>>> *
>>>>>>>> *Chain 2:*
>>>>>>>> *  org.springframework.batch.core [341.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 [373.0]*
>>>>>>>> *    import:
>>>>>>>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>>>>>>>> *
>>>>>>>> *     |*
>>>>>>>> *    export: package=org.springframework.context.support*
>>>>>>>> *  org.springframework.context [366.0]*
>>>>>>>> *        at
>>>>>>>> org.apache.felix.framework.Felix.resolveBundle(Felix.java:3452)*
>>>>>>>> *        at
>>>>>>>> org.apache.felix.framework.Felix.startBundle(Felix.java:1734)*
>>>>>>>> *        at
>>>>>>>> org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1163)
>>>>>>>> *
>>>>>>>> *        at
>>>>>>>> org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264)
>>>>>>>> *
>>>>>>>> *        at java.lang.Thread.run(Thread.java:662)*
>>>>>>>> *Exception in thread "Thread-16"
>>>>>>>> java.lang.IllegalArgumentException: Cannot write resource:
>>>>>>>> org/xmlpull/mxp1/MXParser.class :43114: exception: java.io.*
>>>>>>>> *IOException: Pipe closed*
>>>>>>>> *        at aQute.lib.osgi.Jar.writeResource(Jar.java:302)*
>>>>>>>> *        at aQute.lib.osgi.Jar.write(Jar.java:211)*
>>>>>>>> *        at
>>>>>>>> org.ops4j.pax.swissbox.bnd.BndUtils$1.run(BndUtils.java:174)*
>>>>>>>> *^C*
>>>>>>>> *karaf@root>*
>>>>>>>>
>>>>>>>>
>>>>>>>> 2012/8/13 Achim Nierbeck <bc...@googlemail.com>
>>>>>>>>
>>>>>>>>> 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 <ba...@gmail.com>:
>>>>>>>>> > 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 <ch...@gmail.com>
>>>>>>>>> >>
>>>>>>>>> >> 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 <
>>>>>>>>> balteo@gmail.com> 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 <ch...@gmail.com>
>>>>>>>>> >>>>
>>>>>>>>> >>>> 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 <
>>>>>>>>> balteo@gmail.com> wrote:
>>>>>>>>> >>>>>
>>>>>>>>> >>>>> How do I install the Spring batch jars/bundle into Karaf?
>>>>>>>>> >>>>> Regards,
>>>>>>>>> >>>>> J.
>>>>>>>>> >>>>>
>>>>>>>>> >>>>> 2012/8/13 Charles Moulliard <ch...@gmail.com>
>>>>>>>>> >>>>>>
>>>>>>>>> >>>>>> 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 <
>>>>>>>>> balteo@gmail.com>
>>>>>>>>> >>>>>> 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 <ch...@gmail.com>
>>>>>>>>> >>>>>>>>
>>>>>>>>> >>>>>>>> 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 <
>>>>>>>>> balteo@gmail.com>
>>>>>>>>> >>>>>>>> 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 <ch...@gmail.com>
>>>>>>>>> >>>>>>>>>>
>>>>>>>>> >>>>>>>>>> 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 <
>>>>>>>>> balteo@gmail.com>
>>>>>>>>> >>>>>>>>>> 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 <ba...@gmail.com>
>>>>>>>>> >>>>>>>>>>>>
>>>>>>>>> >>>>>>>>>>>> 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 <ba...@gmail.com>
>>>>>>>>> >>>>>>>>>>>>>
>>>>>>>>> >>>>>>>>>>>>> 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é <jb...@nanthrax.net>
>>>>>>>>> >>>>>>>>>>>>>>
>>>>>>>>> >>>>>>>>>>>>>> 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 <balteo@gmail.com
>>>>>>>>> >>>>>>>>>>>>>>> <ma...@gmail.com>>
>>>>>>>>> >>>>>>>>>>>>>>>
>>>>>>>>> >>>>>>>>>>>>>>>
>>>>>>>>> >>>>>>>>>>>>>>>     Thanks to both of you. I'll try as you advised
>>>>>>>>> and let
>>>>>>>>> >>>>>>>>>>>>>>> you know.
>>>>>>>>> >>>>>>>>>>>>>>>     Best regards,
>>>>>>>>> >>>>>>>>>>>>>>>     J.
>>>>>>>>> >>>>>>>>>>>>>>>
>>>>>>>>> >>>>>>>>>>>>>>>
>>>>>>>>> >>>>>>>>>>>>>>>     2012/8/10 Freeman Fang <freeman.fang@gmail.com
>>>>>>>>> >>>>>>>>>>>>>>>     <ma...@gmail.com>>
>>>>>>>>> >>>>>>>>>>>>>>>
>>>>>>>>> >>>>>>>>>>>>>>>
>>>>>>>>> >>>>>>>>>>>>>>>         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:ffang@fusesource.com
>>>>>>>>> >>>>>>>>>>>>>>> <ma...@fusesource.com>
>>>>>>>>> >>>>>>>>>>>>>>>         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 <balteo@gmail.com
>>>>>>>>> >>>>>>>>>>>>>>>>         <ma...@gmail.com>>
>>>>>>>>> >>>>>>>>>>>>>>>>
>>>>>>>>> >>>>>>>>>>>>>>>>
>>>>>>>>> >>>>>>>>>>>>>>>>             thanks Achim
>>>>>>>>> >>>>>>>>>>>>>>>>
>>>>>>>>> >>>>>>>>>>>>>>>>
>>>>>>>>> >>>>>>>>>>>>>>>>             2012/8/9 Achim Nierbeck <
>>>>>>>>> bcanhome@googlemail.com
>>>>>>>>> >>>>>>>>>>>>>>>>             <ma...@googlemail.com>>
>>>>>>>>> >>>>>>>>>>>>>>>>
>>>>>>>>> >>>>>>>>>>>>>>>>
>>>>>>>>> >>>>>>>>>>>>>>>>                 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 <
>>>>>>>>> balteo@gmail.com
>>>>>>>>> >>>>>>>>>>>>>>>>                 <ma...@gmail.com>>:
>>>>>>>>> >>>>>>>>>>>>>>>>
>>>>>>>>> >>>>>>>>>>>>>>>>                 > 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
>>>>>>>>> >>>>>>>>>>>>>>>> <bcanhome@googlemail.com
>>>>>>>>> >>>>>>>>>>>>>>>>                 <ma...@googlemail.com>>
>>>>>>>>> >>>>>>>>>>>>>>>>
>>>>>>>>> >>>>>>>>>>>>>>>>                 >>
>>>>>>>>> >>>>>>>>>>>>>>>>                 >> 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 <
>>>>>>>>> balteo@gmail.com
>>>>>>>>> >>>>>>>>>>>>>>>>                 <ma...@gmail.com>>:
>>>>>>>>> >>>>>>>>>>>>>>>>
>>>>>>>>> >>>>>>>>>>>>>>>>                 >> > 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é
>>>>>>>>> >>>>>>>>>>>>>> jbonofre@apache.org
>>>>>>>>> >>>>>>>>>>>>>> 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/>
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> 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
>>
>>
>>
>

Re: Embedding a Spring Integration app into Apache Karaf

Posted by Julien Martin <ba...@gmail.com>.
Charles,
How did you managed to do that? I followed your advice and I get a
different result...
Do you think I should start from a clean karaf install?
J.

2012/8/13 Charles Moulliard <ch...@gmail.com>

> This is not a bug as I have been able to deploy Spring Batch (core, infra)
>
> karaf@root> list -t 0 | grep -i spring
> [  57] [Active     ] [            ] [       ] [   30] Spring Core
> (3.0.7.RELEASE)
> [  58] [Active     ] [            ] [       ] [   30] Spring ASM
> (3.0.7.RELEASE)
> [  59] [Active     ] [            ] [       ] [   30] Spring Expression
> Language (3.0.7.RELEASE)
> [  60] [Active     ] [            ] [       ] [   30] Spring Beans
> (3.0.7.RELEASE)
> [  61] [Active     ] [            ] [       ] [   30] Spring AOP
> (3.0.7.RELEASE)
> [  62] [Active     ] [            ] [       ] [   30] Spring Context
> (3.0.7.RELEASE)
> [  63] [Active     ] [            ] [       ] [   30] Spring Context
> Support (3.0.7.RELEASE)
> [  77] [Active     ] [            ] [       ] [   30] Spring Transaction
> (3.0.7.RELEASE)
>
> [  92] [Active     ] [            ] [       ] [   80] Spring Batch
> Infrastructure (2.1.8.RELEASE)
> [  93] [Active     ] [            ] [       ] [   80] Spring Batch Core
> (2.1.8.RELEASE)
>
> On Mon, Aug 13, 2012 at 3:34 PM, Julien Martin <ba...@gmail.com> wrote:
>
>> Charles,
>> Do you reckon it is a bug on the springsource side?
>> J.
>>
>> 2012/8/13 Julien Martin <ba...@gmail.com>
>>
>>> Charles,
>>>
>>> I did as you advised and I get the same dependency chain error as before
>>> i.e.:
>>>
>>> *karaf@root> start 380*
>>> *org.osgi.framework.BundleException: Unable to resolve module
>>> org.springframework.batch.core [380.0] because it is exposed to package
>>> 'org.springframew*
>>>  *ork.context.support' from org.springframework.context [347.0] and
>>> org.springframework.context [366.0] via two dependency chains.*
>>> *
>>> *
>>> *Chain 1:*
>>> *  org.springframework.batch.core [380.0]*
>>> *    import:
>>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>>> *
>>> *     |*
>>> *    export: package=org.springframework.context.support*
>>>  *  org.springframework.context [347.0]*
>>> *
>>> *
>>> *Chain 2:*
>>> *  org.springframework.batch.core [380.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 [373.0]*
>>> *    import:
>>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>>> *
>>> *     |*
>>> *    export: package=org.springframework.context.support*
>>> *  org.springframework.context [366.0]*
>>>
>>> 2012/8/13 Charles Moulliard <ch...@gmail.com>
>>>
>>>> I suggest that you install the spring batch jar file as I tell you and
>>>> drop after all the other 38 jars files.
>>>>
>>>>
>>>> On Mon, Aug 13, 2012 at 3:13 PM, Julien Martin <ba...@gmail.com>wrote:
>>>>
>>>>> Hi Charles,
>>>>> Thanks. I actually dropped all my jars into the /deploy folder (for
>>>>> testing purposes) as advised by Achim.
>>>>> The real issue I have now is that of the dependency chains...
>>>>> Regards,
>>>>> J.
>>>>>
>>>>> 2012/8/13 Charles Moulliard <ch...@gmail.com>
>>>>>
>>>>>> Hi Julien,
>>>>>>
>>>>>> You do not need to wrap the Spring Batch jar file as it is already a
>>>>>> bundle -->
>>>>>>
>>>>>> install -s
>>>>>> mvn:org.springframework.batch/spring-batch-infrastructure/2.1.8.RELEASE
>>>>>>
>>>>>> [  92] [Active     ] [            ] [       ] [   80]
>>>>>> mvn:org.springframework.batch/spring-batch-infrastructure/2.1.8.RELEASE
>>>>>>
>>>>>> Regards,
>>>>>>
>>>>>> Charles
>>>>>>
>>>>>>
>>>>>> On Mon, Aug 13, 2012 at 2:57 PM, Julien Martin <ba...@gmail.com>wrote:
>>>>>>
>>>>>>> Hi,
>>>>>>> I am almost there. I dropped the dependencies as well as my app into
>>>>>>> the /deploy folder. I get a multiple dependency chain problem as follows.
>>>>>>> Can anyone please help?
>>>>>>>
>>>>>>> *C:\system\apache-karaf-2.2.8\bin>karaf*
>>>>>>> *        __ __                  ____*
>>>>>>> *       / //_/____ __________ _/ __/*
>>>>>>> *      / ,<  / __ `/ ___/ __ `/ /_*
>>>>>>> *     / /| |/ /_/ / /  / /_/ / __/*
>>>>>>> *    /_/ |_|\__,_/_/   \__,_/_/*
>>>>>>> *
>>>>>>> *
>>>>>>> *  Apache Karaf (2.2.8)*
>>>>>>> *
>>>>>>> *
>>>>>>> *Hit '<tab>' for a list of available commands*
>>>>>>> *and '[cmd] --help' for help on a specific command.*
>>>>>>> *Hit '<ctrl-d>' or 'osgi:shutdown' to shutdown Karaf.*
>>>>>>> *
>>>>>>> *
>>>>>>> *karaf@root> ERROR: Bundle org.springframework.batch.test [339]
>>>>>>> Error starting
>>>>>>> file:/C:/system/apache-karaf-2.2.8/deploy/spring-batch-test-2.1.8.RELEAS
>>>>>>> *
>>>>>>> *E.jar (org.osgi.framework.BundleException: Unable to resolve
>>>>>>> module org.springframework.batch.core [341.0] because it is exposed
>>>>>>> to package 'org.sprin*
>>>>>>> *gframework.context.support' from org.springframework.context [347.0]
>>>>>>> and org.springframework.context [366.0] via two dependency chains.*
>>>>>>> *
>>>>>>> *
>>>>>>> *Chain 1:*
>>>>>>> *  org.springframework.batch.core [341.0]*
>>>>>>> *    import:
>>>>>>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>>>>>>> *
>>>>>>> *     |*
>>>>>>> *    export: package=org.springframework.context.support*
>>>>>>> *  org.springframework.context [347.0]*
>>>>>>> *
>>>>>>> *
>>>>>>> *Chain 2:*
>>>>>>> *  org.springframework.batch.core [341.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 [373.0]*
>>>>>>> *    import:
>>>>>>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>>>>>>> *
>>>>>>> *     |*
>>>>>>> *    export: package=org.springframework.context.support*
>>>>>>> *  org.springframework.context [366.0])*
>>>>>>> *org.osgi.framework.BundleException: Unable to resolve module
>>>>>>> org.springframework.batch.core [341.0] because it is exposed to
>>>>>>> package 'org.springframew*
>>>>>>> *ork.context.support' from org.springframework.context [347.0] and
>>>>>>> org.springframework.context [366.0] via two dependency chains.*
>>>>>>> *
>>>>>>> *
>>>>>>> *Chain 1:*
>>>>>>> *  org.springframework.batch.core [341.0]*
>>>>>>>  *    import:
>>>>>>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>>>>>>> *
>>>>>>> *     |*
>>>>>>> *    export: package=org.springframework.context.support*
>>>>>>>  *  org.springframework.context [347.0]*
>>>>>>> *
>>>>>>> *
>>>>>>> *Chain 2:*
>>>>>>> *  org.springframework.batch.core [341.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 [373.0]*
>>>>>>>  *    import:
>>>>>>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>>>>>>> *
>>>>>>> *     |*
>>>>>>> *    export: package=org.springframework.context.support*
>>>>>>> *  org.springframework.context [366.0]*
>>>>>>> *        at
>>>>>>> org.apache.felix.framework.Felix.resolveBundle(Felix.java:3452)*
>>>>>>> *        at
>>>>>>> org.apache.felix.framework.Felix.startBundle(Felix.java:1734)*
>>>>>>> *        at
>>>>>>> org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1163)
>>>>>>> *
>>>>>>> *        at
>>>>>>> org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264)
>>>>>>> *
>>>>>>> *        at java.lang.Thread.run(Thread.java:662)*
>>>>>>> *ERROR: Bundle org.springframework.batch.core [341] Error starting
>>>>>>> file:/C:/system/apache-karaf-2.2.8/deploy/spring-batch-core-2.1.8.RELEASE.jar
>>>>>>> (org.o*
>>>>>>> *sgi.framework.BundleException: Unable to resolve module
>>>>>>> org.springframework.batch.core [341.0] because it is exposed to
>>>>>>> package 'org.springframework.c*
>>>>>>> *ontext.support' from org.springframework.context [347.0] and
>>>>>>> org.springframework.context [366.0] via two dependency chains.*
>>>>>>> *
>>>>>>> *
>>>>>>> *Chain 1:*
>>>>>>> *  org.springframework.batch.core [341.0]*
>>>>>>> *    import:
>>>>>>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>>>>>>> *
>>>>>>> *     |*
>>>>>>> *    export: package=org.springframework.context.support*
>>>>>>> *  org.springframework.context [347.0]*
>>>>>>> *
>>>>>>> *
>>>>>>> *Chain 2:*
>>>>>>> *  org.springframework.batch.core [341.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 [373.0]*
>>>>>>> *    import:
>>>>>>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>>>>>>> *
>>>>>>> *     |*
>>>>>>> *    export: package=org.springframework.context.support*
>>>>>>> *  org.springframework.context [366.0])*
>>>>>>> *org.osgi.framework.BundleException: Unable to resolve module
>>>>>>> org.springframework.batch.core [341.0] because it is exposed to
>>>>>>> package 'org.springframew*
>>>>>>> *ork.context.support' from org.springframework.context [347.0] and
>>>>>>> org.springframework.context [366.0] via two dependency chains.*
>>>>>>> *
>>>>>>> *
>>>>>>> *Chain 1:*
>>>>>>> *  org.springframework.batch.core [341.0]*
>>>>>>>  *    import:
>>>>>>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>>>>>>> *
>>>>>>> *     |*
>>>>>>> *    export: package=org.springframework.context.support*
>>>>>>>  *  org.springframework.context [347.0]*
>>>>>>> *
>>>>>>> *
>>>>>>> *Chain 2:*
>>>>>>> *  org.springframework.batch.core [341.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 [373.0]*
>>>>>>> *    import:
>>>>>>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>>>>>>> *
>>>>>>> *     |*
>>>>>>> *    export: package=org.springframework.context.support*
>>>>>>> *  org.springframework.context [366.0]*
>>>>>>> *        at
>>>>>>> org.apache.felix.framework.Felix.resolveBundle(Felix.java:3452)*
>>>>>>> *        at
>>>>>>> org.apache.felix.framework.Felix.startBundle(Felix.java:1734)*
>>>>>>> *        at
>>>>>>> org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1163)
>>>>>>> *
>>>>>>> *        at
>>>>>>> org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264)
>>>>>>> *
>>>>>>> *        at java.lang.Thread.run(Thread.java:662)*
>>>>>>> *ERROR: Bundle org.springframework.batch.integration [342] Error
>>>>>>> starting
>>>>>>> file:/C:/system/apache-karaf-2.2.8/deploy/spring-batch-integration-1.2.1.RELE
>>>>>>> *
>>>>>>> *ASE.jar (org.osgi.framework.BundleException: Unable to resolve
>>>>>>> module org.springframework.batch.core [341.0] because it is exposed
>>>>>>> to package 'org.spr*
>>>>>>> *ingframework.context.support' from org.springframework.context
>>>>>>> [347.0] and org.springframework.context [366.0] via two dependency
>>>>>>> chains.*
>>>>>>> *
>>>>>>> *
>>>>>>> *Chain 1:*
>>>>>>> *  org.springframework.batch.core [341.0]*
>>>>>>> *    import:
>>>>>>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>>>>>>> *
>>>>>>> *     |*
>>>>>>> *    export: package=org.springframework.context.support*
>>>>>>> *  org.springframework.context [347.0]*
>>>>>>> *
>>>>>>> *
>>>>>>> *Chain 2:*
>>>>>>> *  org.springframework.batch.core [341.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 [373.0]*
>>>>>>> *    import:
>>>>>>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>>>>>>> *
>>>>>>> *     |*
>>>>>>> *    export: package=org.springframework.context.support*
>>>>>>> *  org.springframework.context [366.0])*
>>>>>>> *org.osgi.framework.BundleException: Unable to resolve module
>>>>>>> org.springframework.batch.core [341.0] because it is exposed to package
>>>>>>> 'org.springframew*
>>>>>>> *ork.context.support' from org.springframework.context [347.0] and
>>>>>>> org.springframework.context [366.0] via two dependency chains.*
>>>>>>> *
>>>>>>> *
>>>>>>> *Chain 1:*
>>>>>>> *  org.springframework.batch.core [341.0]*
>>>>>>>  *    import:
>>>>>>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>>>>>>> *
>>>>>>> *     |*
>>>>>>> *    export: package=org.springframework.context.support*
>>>>>>>  *  org.springframework.context [347.0]*
>>>>>>> *
>>>>>>> *
>>>>>>> *Chain 2:*
>>>>>>> *  org.springframework.batch.core [341.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 [373.0]*
>>>>>>> *    import:
>>>>>>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>>>>>>> *
>>>>>>> *     |*
>>>>>>> *    export: package=org.springframework.context.support*
>>>>>>> *  org.springframework.context [366.0]*
>>>>>>> *        at
>>>>>>> org.apache.felix.framework.Felix.resolveBundle(Felix.java:3452)*
>>>>>>> *        at
>>>>>>> org.apache.felix.framework.Felix.startBundle(Felix.java:1734)*
>>>>>>> *        at
>>>>>>> org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1163)
>>>>>>> *
>>>>>>> *        at
>>>>>>> org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264)
>>>>>>> *
>>>>>>> *        at java.lang.Thread.run(Thread.java:662)*
>>>>>>> *ERROR: Bundle spring-batch-demo-trc-dm [368] Error starting
>>>>>>> file:/C:/system/apache-karaf-2.2.8/deploy/spring-batch-demo-trc-dm-1.0.0-SNAPSHOT.jar
>>>>>>> (org*
>>>>>>> *.osgi.framework.BundleException: Unable to resolve module
>>>>>>> org.springframework.batch.core [341.0] because it is exposed to package
>>>>>>> 'org.springframework*
>>>>>>> *.context.support' from org.springframework.context [347.0] and
>>>>>>> org.springframework.context [366.0] via two dependency chains.*
>>>>>>> *
>>>>>>> *
>>>>>>> *Chain 1:*
>>>>>>> *  org.springframework.batch.core [341.0]*
>>>>>>> *    import:
>>>>>>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>>>>>>> *
>>>>>>> *     |*
>>>>>>> *    export: package=org.springframework.context.support*
>>>>>>> *  org.springframework.context [347.0]*
>>>>>>> *
>>>>>>> *
>>>>>>> *Chain 2:*
>>>>>>> *  org.springframework.batch.core [341.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 [373.0]*
>>>>>>> *    import:
>>>>>>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>>>>>>> *
>>>>>>> *     |*
>>>>>>> *    export: package=org.springframework.context.support*
>>>>>>> *  org.springframework.context [366.0])*
>>>>>>> *org.osgi.framework.BundleException: Unable to resolve module
>>>>>>> org.springframework.batch.core [341.0] because it is exposed to package
>>>>>>> 'org.springframew*
>>>>>>> *ork.context.support' from org.springframework.context [347.0] and
>>>>>>> org.springframework.context [366.0] via two dependency chains.*
>>>>>>> *
>>>>>>> *
>>>>>>> *Chain 1:*
>>>>>>> *  org.springframework.batch.core [341.0]*
>>>>>>>  *    import:
>>>>>>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>>>>>>> *
>>>>>>> *     |*
>>>>>>> *    export: package=org.springframework.context.support*
>>>>>>>  *  org.springframework.context [347.0]*
>>>>>>> *
>>>>>>> *
>>>>>>> *Chain 2:*
>>>>>>> *  org.springframework.batch.core [341.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 [373.0]*
>>>>>>> *    import:
>>>>>>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>>>>>>> *
>>>>>>> *     |*
>>>>>>> *    export: package=org.springframework.context.support*
>>>>>>> *  org.springframework.context [366.0]*
>>>>>>> *        at
>>>>>>> org.apache.felix.framework.Felix.resolveBundle(Felix.java:3452)*
>>>>>>> *        at
>>>>>>> org.apache.felix.framework.Felix.startBundle(Felix.java:1734)*
>>>>>>> *        at
>>>>>>> org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1163)
>>>>>>> *
>>>>>>> *        at
>>>>>>> org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264)
>>>>>>> *
>>>>>>> *        at java.lang.Thread.run(Thread.java:662)*
>>>>>>> *Exception in thread "Thread-16"
>>>>>>> java.lang.IllegalArgumentException: Cannot write resource:
>>>>>>> org/xmlpull/mxp1/MXParser.class :43114: exception: java.io.*
>>>>>>> *IOException: Pipe closed*
>>>>>>> *        at aQute.lib.osgi.Jar.writeResource(Jar.java:302)*
>>>>>>> *        at aQute.lib.osgi.Jar.write(Jar.java:211)*
>>>>>>> *        at
>>>>>>> org.ops4j.pax.swissbox.bnd.BndUtils$1.run(BndUtils.java:174)*
>>>>>>> *^C*
>>>>>>> *karaf@root>*
>>>>>>>
>>>>>>>
>>>>>>> 2012/8/13 Achim Nierbeck <bc...@googlemail.com>
>>>>>>>
>>>>>>>> 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 <ba...@gmail.com>:
>>>>>>>> > 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 <ch...@gmail.com>
>>>>>>>> >>
>>>>>>>> >> 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 <ba...@gmail.com>
>>>>>>>> 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 <ch...@gmail.com>
>>>>>>>> >>>>
>>>>>>>> >>>> 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 <
>>>>>>>> balteo@gmail.com> wrote:
>>>>>>>> >>>>>
>>>>>>>> >>>>> How do I install the Spring batch jars/bundle into Karaf?
>>>>>>>> >>>>> Regards,
>>>>>>>> >>>>> J.
>>>>>>>> >>>>>
>>>>>>>> >>>>> 2012/8/13 Charles Moulliard <ch...@gmail.com>
>>>>>>>> >>>>>>
>>>>>>>> >>>>>> 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 <
>>>>>>>> balteo@gmail.com>
>>>>>>>> >>>>>> 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 <ch...@gmail.com>
>>>>>>>> >>>>>>>>
>>>>>>>> >>>>>>>> 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 <
>>>>>>>> balteo@gmail.com>
>>>>>>>> >>>>>>>> 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 <ch...@gmail.com>
>>>>>>>> >>>>>>>>>>
>>>>>>>> >>>>>>>>>> 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 <
>>>>>>>> balteo@gmail.com>
>>>>>>>> >>>>>>>>>> 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 <ba...@gmail.com>
>>>>>>>> >>>>>>>>>>>>
>>>>>>>> >>>>>>>>>>>> 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 <ba...@gmail.com>
>>>>>>>> >>>>>>>>>>>>>
>>>>>>>> >>>>>>>>>>>>> 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é <jb...@nanthrax.net>
>>>>>>>> >>>>>>>>>>>>>>
>>>>>>>> >>>>>>>>>>>>>> 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 <balteo@gmail.com
>>>>>>>> >>>>>>>>>>>>>>> <ma...@gmail.com>>
>>>>>>>> >>>>>>>>>>>>>>>
>>>>>>>> >>>>>>>>>>>>>>>
>>>>>>>> >>>>>>>>>>>>>>>     Thanks to both of you. I'll try as you advised
>>>>>>>> and let
>>>>>>>> >>>>>>>>>>>>>>> you know.
>>>>>>>> >>>>>>>>>>>>>>>     Best regards,
>>>>>>>> >>>>>>>>>>>>>>>     J.
>>>>>>>> >>>>>>>>>>>>>>>
>>>>>>>> >>>>>>>>>>>>>>>
>>>>>>>> >>>>>>>>>>>>>>>     2012/8/10 Freeman Fang <freeman.fang@gmail.com
>>>>>>>> >>>>>>>>>>>>>>>     <ma...@gmail.com>>
>>>>>>>> >>>>>>>>>>>>>>>
>>>>>>>> >>>>>>>>>>>>>>>
>>>>>>>> >>>>>>>>>>>>>>>         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:ffang@fusesource.com
>>>>>>>> >>>>>>>>>>>>>>> <ma...@fusesource.com>
>>>>>>>> >>>>>>>>>>>>>>>         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 <balteo@gmail.com
>>>>>>>> >>>>>>>>>>>>>>>>         <ma...@gmail.com>>
>>>>>>>> >>>>>>>>>>>>>>>>
>>>>>>>> >>>>>>>>>>>>>>>>
>>>>>>>> >>>>>>>>>>>>>>>>             thanks Achim
>>>>>>>> >>>>>>>>>>>>>>>>
>>>>>>>> >>>>>>>>>>>>>>>>
>>>>>>>> >>>>>>>>>>>>>>>>             2012/8/9 Achim Nierbeck <
>>>>>>>> bcanhome@googlemail.com
>>>>>>>> >>>>>>>>>>>>>>>>             <ma...@googlemail.com>>
>>>>>>>> >>>>>>>>>>>>>>>>
>>>>>>>> >>>>>>>>>>>>>>>>
>>>>>>>> >>>>>>>>>>>>>>>>                 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 <
>>>>>>>> balteo@gmail.com
>>>>>>>> >>>>>>>>>>>>>>>>                 <ma...@gmail.com>>:
>>>>>>>> >>>>>>>>>>>>>>>>
>>>>>>>> >>>>>>>>>>>>>>>>                 > 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
>>>>>>>> >>>>>>>>>>>>>>>> <bcanhome@googlemail.com
>>>>>>>> >>>>>>>>>>>>>>>>                 <ma...@googlemail.com>>
>>>>>>>> >>>>>>>>>>>>>>>>
>>>>>>>> >>>>>>>>>>>>>>>>                 >>
>>>>>>>> >>>>>>>>>>>>>>>>                 >> 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 <
>>>>>>>> balteo@gmail.com
>>>>>>>> >>>>>>>>>>>>>>>>                 <ma...@gmail.com>>:
>>>>>>>> >>>>>>>>>>>>>>>>
>>>>>>>> >>>>>>>>>>>>>>>>                 >> > 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é
>>>>>>>> >>>>>>>>>>>>>> jbonofre@apache.org
>>>>>>>> >>>>>>>>>>>>>> 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/>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> 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
>
>
>

Re: Embedding a Spring Integration app into Apache Karaf

Posted by Charles Moulliard <ch...@gmail.com>.
This is not a bug as I have been able to deploy Spring Batch (core, infra)

karaf@root> list -t 0 | grep -i spring
[  57] [Active     ] [            ] [       ] [   30] Spring Core
(3.0.7.RELEASE)
[  58] [Active     ] [            ] [       ] [   30] Spring ASM
(3.0.7.RELEASE)
[  59] [Active     ] [            ] [       ] [   30] Spring Expression
Language (3.0.7.RELEASE)
[  60] [Active     ] [            ] [       ] [   30] Spring Beans
(3.0.7.RELEASE)
[  61] [Active     ] [            ] [       ] [   30] Spring AOP
(3.0.7.RELEASE)
[  62] [Active     ] [            ] [       ] [   30] Spring Context
(3.0.7.RELEASE)
[  63] [Active     ] [            ] [       ] [   30] Spring Context
Support (3.0.7.RELEASE)
[  77] [Active     ] [            ] [       ] [   30] Spring Transaction
(3.0.7.RELEASE)

[  92] [Active     ] [            ] [       ] [   80] Spring Batch
Infrastructure (2.1.8.RELEASE)
[  93] [Active     ] [            ] [       ] [   80] Spring Batch Core
(2.1.8.RELEASE)

On Mon, Aug 13, 2012 at 3:34 PM, Julien Martin <ba...@gmail.com> wrote:

> Charles,
> Do you reckon it is a bug on the springsource side?
> J.
>
> 2012/8/13 Julien Martin <ba...@gmail.com>
>
>> Charles,
>>
>> I did as you advised and I get the same dependency chain error as before
>> i.e.:
>>
>> *karaf@root> start 380*
>> *org.osgi.framework.BundleException: Unable to resolve module
>> org.springframework.batch.core [380.0] because it is exposed to package
>> 'org.springframew*
>>  *ork.context.support' from org.springframework.context [347.0] and
>> org.springframework.context [366.0] via two dependency chains.*
>> *
>> *
>> *Chain 1:*
>> *  org.springframework.batch.core [380.0]*
>> *    import:
>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>> *
>> *     |*
>> *    export: package=org.springframework.context.support*
>>  *  org.springframework.context [347.0]*
>> *
>> *
>> *Chain 2:*
>> *  org.springframework.batch.core [380.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 [373.0]*
>> *    import:
>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>> *
>> *     |*
>> *    export: package=org.springframework.context.support*
>> *  org.springframework.context [366.0]*
>>
>> 2012/8/13 Charles Moulliard <ch...@gmail.com>
>>
>>> I suggest that you install the spring batch jar file as I tell you and
>>> drop after all the other 38 jars files.
>>>
>>>
>>> On Mon, Aug 13, 2012 at 3:13 PM, Julien Martin <ba...@gmail.com> wrote:
>>>
>>>> Hi Charles,
>>>> Thanks. I actually dropped all my jars into the /deploy folder (for
>>>> testing purposes) as advised by Achim.
>>>> The real issue I have now is that of the dependency chains...
>>>> Regards,
>>>> J.
>>>>
>>>> 2012/8/13 Charles Moulliard <ch...@gmail.com>
>>>>
>>>>> Hi Julien,
>>>>>
>>>>> You do not need to wrap the Spring Batch jar file as it is already a
>>>>> bundle -->
>>>>>
>>>>> install -s
>>>>> mvn:org.springframework.batch/spring-batch-infrastructure/2.1.8.RELEASE
>>>>>
>>>>> [  92] [Active     ] [            ] [       ] [   80]
>>>>> mvn:org.springframework.batch/spring-batch-infrastructure/2.1.8.RELEASE
>>>>>
>>>>> Regards,
>>>>>
>>>>> Charles
>>>>>
>>>>>
>>>>> On Mon, Aug 13, 2012 at 2:57 PM, Julien Martin <ba...@gmail.com>wrote:
>>>>>
>>>>>> Hi,
>>>>>> I am almost there. I dropped the dependencies as well as my app into
>>>>>> the /deploy folder. I get a multiple dependency chain problem as follows.
>>>>>> Can anyone please help?
>>>>>>
>>>>>> *C:\system\apache-karaf-2.2.8\bin>karaf*
>>>>>> *        __ __                  ____*
>>>>>> *       / //_/____ __________ _/ __/*
>>>>>> *      / ,<  / __ `/ ___/ __ `/ /_*
>>>>>> *     / /| |/ /_/ / /  / /_/ / __/*
>>>>>> *    /_/ |_|\__,_/_/   \__,_/_/*
>>>>>> *
>>>>>> *
>>>>>> *  Apache Karaf (2.2.8)*
>>>>>> *
>>>>>> *
>>>>>> *Hit '<tab>' for a list of available commands*
>>>>>> *and '[cmd] --help' for help on a specific command.*
>>>>>> *Hit '<ctrl-d>' or 'osgi:shutdown' to shutdown Karaf.*
>>>>>> *
>>>>>> *
>>>>>> *karaf@root> ERROR: Bundle org.springframework.batch.test [339]
>>>>>> Error starting
>>>>>> file:/C:/system/apache-karaf-2.2.8/deploy/spring-batch-test-2.1.8.RELEAS
>>>>>> *
>>>>>> *E.jar (org.osgi.framework.BundleException: Unable to resolve module
>>>>>> org.springframework.batch.core [341.0] because it is exposed to
>>>>>> package 'org.sprin*
>>>>>> *gframework.context.support' from org.springframework.context [347.0]
>>>>>> and org.springframework.context [366.0] via two dependency chains.*
>>>>>> *
>>>>>> *
>>>>>> *Chain 1:*
>>>>>> *  org.springframework.batch.core [341.0]*
>>>>>> *    import:
>>>>>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>>>>>> *
>>>>>> *     |*
>>>>>> *    export: package=org.springframework.context.support*
>>>>>> *  org.springframework.context [347.0]*
>>>>>> *
>>>>>> *
>>>>>> *Chain 2:*
>>>>>> *  org.springframework.batch.core [341.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 [373.0]*
>>>>>> *    import:
>>>>>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>>>>>> *
>>>>>> *     |*
>>>>>> *    export: package=org.springframework.context.support*
>>>>>> *  org.springframework.context [366.0])*
>>>>>> *org.osgi.framework.BundleException: Unable to resolve module
>>>>>> org.springframework.batch.core [341.0] because it is exposed to
>>>>>> package 'org.springframew*
>>>>>> *ork.context.support' from org.springframework.context [347.0] and
>>>>>> org.springframework.context [366.0] via two dependency chains.*
>>>>>> *
>>>>>> *
>>>>>> *Chain 1:*
>>>>>> *  org.springframework.batch.core [341.0]*
>>>>>>  *    import:
>>>>>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>>>>>> *
>>>>>> *     |*
>>>>>> *    export: package=org.springframework.context.support*
>>>>>>  *  org.springframework.context [347.0]*
>>>>>> *
>>>>>> *
>>>>>> *Chain 2:*
>>>>>> *  org.springframework.batch.core [341.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 [373.0]*
>>>>>>  *    import:
>>>>>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>>>>>> *
>>>>>> *     |*
>>>>>> *    export: package=org.springframework.context.support*
>>>>>> *  org.springframework.context [366.0]*
>>>>>> *        at
>>>>>> org.apache.felix.framework.Felix.resolveBundle(Felix.java:3452)*
>>>>>> *        at
>>>>>> org.apache.felix.framework.Felix.startBundle(Felix.java:1734)*
>>>>>> *        at
>>>>>> org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1163)
>>>>>> *
>>>>>> *        at
>>>>>> org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264)
>>>>>> *
>>>>>> *        at java.lang.Thread.run(Thread.java:662)*
>>>>>> *ERROR: Bundle org.springframework.batch.core [341] Error starting
>>>>>> file:/C:/system/apache-karaf-2.2.8/deploy/spring-batch-core-2.1.8.RELEASE.jar
>>>>>> (org.o*
>>>>>> *sgi.framework.BundleException: Unable to resolve module
>>>>>> org.springframework.batch.core [341.0] because it is exposed to
>>>>>> package 'org.springframework.c*
>>>>>> *ontext.support' from org.springframework.context [347.0] and
>>>>>> org.springframework.context [366.0] via two dependency chains.*
>>>>>> *
>>>>>> *
>>>>>> *Chain 1:*
>>>>>> *  org.springframework.batch.core [341.0]*
>>>>>> *    import:
>>>>>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>>>>>> *
>>>>>> *     |*
>>>>>> *    export: package=org.springframework.context.support*
>>>>>> *  org.springframework.context [347.0]*
>>>>>> *
>>>>>> *
>>>>>> *Chain 2:*
>>>>>> *  org.springframework.batch.core [341.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 [373.0]*
>>>>>> *    import:
>>>>>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>>>>>> *
>>>>>> *     |*
>>>>>> *    export: package=org.springframework.context.support*
>>>>>> *  org.springframework.context [366.0])*
>>>>>> *org.osgi.framework.BundleException: Unable to resolve module
>>>>>> org.springframework.batch.core [341.0] because it is exposed to
>>>>>> package 'org.springframew*
>>>>>> *ork.context.support' from org.springframework.context [347.0] and
>>>>>> org.springframework.context [366.0] via two dependency chains.*
>>>>>> *
>>>>>> *
>>>>>> *Chain 1:*
>>>>>> *  org.springframework.batch.core [341.0]*
>>>>>>  *    import:
>>>>>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>>>>>> *
>>>>>> *     |*
>>>>>> *    export: package=org.springframework.context.support*
>>>>>>  *  org.springframework.context [347.0]*
>>>>>> *
>>>>>> *
>>>>>> *Chain 2:*
>>>>>> *  org.springframework.batch.core [341.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 [373.0]*
>>>>>> *    import:
>>>>>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>>>>>> *
>>>>>> *     |*
>>>>>> *    export: package=org.springframework.context.support*
>>>>>> *  org.springframework.context [366.0]*
>>>>>> *        at
>>>>>> org.apache.felix.framework.Felix.resolveBundle(Felix.java:3452)*
>>>>>> *        at
>>>>>> org.apache.felix.framework.Felix.startBundle(Felix.java:1734)*
>>>>>> *        at
>>>>>> org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1163)
>>>>>> *
>>>>>> *        at
>>>>>> org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264)
>>>>>> *
>>>>>> *        at java.lang.Thread.run(Thread.java:662)*
>>>>>> *ERROR: Bundle org.springframework.batch.integration [342] Error
>>>>>> starting
>>>>>> file:/C:/system/apache-karaf-2.2.8/deploy/spring-batch-integration-1.2.1.RELE
>>>>>> *
>>>>>> *ASE.jar (org.osgi.framework.BundleException: Unable to resolve
>>>>>> module org.springframework.batch.core [341.0] because it is exposed to
>>>>>> package 'org.spr*
>>>>>> *ingframework.context.support' from org.springframework.context
>>>>>> [347.0] and org.springframework.context [366.0] via two dependency chains.
>>>>>> *
>>>>>> *
>>>>>> *
>>>>>> *Chain 1:*
>>>>>> *  org.springframework.batch.core [341.0]*
>>>>>> *    import:
>>>>>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>>>>>> *
>>>>>> *     |*
>>>>>> *    export: package=org.springframework.context.support*
>>>>>> *  org.springframework.context [347.0]*
>>>>>> *
>>>>>> *
>>>>>> *Chain 2:*
>>>>>> *  org.springframework.batch.core [341.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 [373.0]*
>>>>>> *    import:
>>>>>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>>>>>> *
>>>>>> *     |*
>>>>>> *    export: package=org.springframework.context.support*
>>>>>> *  org.springframework.context [366.0])*
>>>>>> *org.osgi.framework.BundleException: Unable to resolve module
>>>>>> org.springframework.batch.core [341.0] because it is exposed to package
>>>>>> 'org.springframew*
>>>>>> *ork.context.support' from org.springframework.context [347.0] and
>>>>>> org.springframework.context [366.0] via two dependency chains.*
>>>>>> *
>>>>>> *
>>>>>> *Chain 1:*
>>>>>> *  org.springframework.batch.core [341.0]*
>>>>>>  *    import:
>>>>>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>>>>>> *
>>>>>> *     |*
>>>>>> *    export: package=org.springframework.context.support*
>>>>>>  *  org.springframework.context [347.0]*
>>>>>> *
>>>>>> *
>>>>>> *Chain 2:*
>>>>>> *  org.springframework.batch.core [341.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 [373.0]*
>>>>>> *    import:
>>>>>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>>>>>> *
>>>>>> *     |*
>>>>>> *    export: package=org.springframework.context.support*
>>>>>> *  org.springframework.context [366.0]*
>>>>>> *        at
>>>>>> org.apache.felix.framework.Felix.resolveBundle(Felix.java:3452)*
>>>>>> *        at
>>>>>> org.apache.felix.framework.Felix.startBundle(Felix.java:1734)*
>>>>>> *        at
>>>>>> org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1163)
>>>>>> *
>>>>>> *        at
>>>>>> org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264)
>>>>>> *
>>>>>> *        at java.lang.Thread.run(Thread.java:662)*
>>>>>> *ERROR: Bundle spring-batch-demo-trc-dm [368] Error starting
>>>>>> file:/C:/system/apache-karaf-2.2.8/deploy/spring-batch-demo-trc-dm-1.0.0-SNAPSHOT.jar
>>>>>> (org*
>>>>>> *.osgi.framework.BundleException: Unable to resolve module
>>>>>> org.springframework.batch.core [341.0] because it is exposed to package
>>>>>> 'org.springframework*
>>>>>> *.context.support' from org.springframework.context [347.0] and
>>>>>> org.springframework.context [366.0] via two dependency chains.*
>>>>>> *
>>>>>> *
>>>>>> *Chain 1:*
>>>>>> *  org.springframework.batch.core [341.0]*
>>>>>> *    import:
>>>>>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>>>>>> *
>>>>>> *     |*
>>>>>> *    export: package=org.springframework.context.support*
>>>>>> *  org.springframework.context [347.0]*
>>>>>> *
>>>>>> *
>>>>>> *Chain 2:*
>>>>>> *  org.springframework.batch.core [341.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 [373.0]*
>>>>>> *    import:
>>>>>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>>>>>> *
>>>>>> *     |*
>>>>>> *    export: package=org.springframework.context.support*
>>>>>> *  org.springframework.context [366.0])*
>>>>>> *org.osgi.framework.BundleException: Unable to resolve module
>>>>>> org.springframework.batch.core [341.0] because it is exposed to package
>>>>>> 'org.springframew*
>>>>>> *ork.context.support' from org.springframework.context [347.0] and
>>>>>> org.springframework.context [366.0] via two dependency chains.*
>>>>>> *
>>>>>> *
>>>>>> *Chain 1:*
>>>>>> *  org.springframework.batch.core [341.0]*
>>>>>>  *    import:
>>>>>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>>>>>> *
>>>>>> *     |*
>>>>>> *    export: package=org.springframework.context.support*
>>>>>>  *  org.springframework.context [347.0]*
>>>>>> *
>>>>>> *
>>>>>> *Chain 2:*
>>>>>> *  org.springframework.batch.core [341.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 [373.0]*
>>>>>> *    import:
>>>>>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>>>>>> *
>>>>>> *     |*
>>>>>> *    export: package=org.springframework.context.support*
>>>>>> *  org.springframework.context [366.0]*
>>>>>> *        at
>>>>>> org.apache.felix.framework.Felix.resolveBundle(Felix.java:3452)*
>>>>>> *        at
>>>>>> org.apache.felix.framework.Felix.startBundle(Felix.java:1734)*
>>>>>> *        at
>>>>>> org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1163)
>>>>>> *
>>>>>> *        at
>>>>>> org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264)
>>>>>> *
>>>>>> *        at java.lang.Thread.run(Thread.java:662)*
>>>>>> *Exception in thread "Thread-16" java.lang.IllegalArgumentException:
>>>>>> Cannot write resource: org/xmlpull/mxp1/MXParser.class :43114: exception:
>>>>>> java.io.*
>>>>>> *IOException: Pipe closed*
>>>>>> *        at aQute.lib.osgi.Jar.writeResource(Jar.java:302)*
>>>>>> *        at aQute.lib.osgi.Jar.write(Jar.java:211)*
>>>>>> *        at
>>>>>> org.ops4j.pax.swissbox.bnd.BndUtils$1.run(BndUtils.java:174)*
>>>>>> *^C*
>>>>>> *karaf@root>*
>>>>>>
>>>>>>
>>>>>> 2012/8/13 Achim Nierbeck <bc...@googlemail.com>
>>>>>>
>>>>>>> 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 <ba...@gmail.com>:
>>>>>>> > 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 <ch...@gmail.com>
>>>>>>> >>
>>>>>>> >> 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 <ba...@gmail.com>
>>>>>>> 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 <ch...@gmail.com>
>>>>>>> >>>>
>>>>>>> >>>> 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 <
>>>>>>> balteo@gmail.com> wrote:
>>>>>>> >>>>>
>>>>>>> >>>>> How do I install the Spring batch jars/bundle into Karaf?
>>>>>>> >>>>> Regards,
>>>>>>> >>>>> J.
>>>>>>> >>>>>
>>>>>>> >>>>> 2012/8/13 Charles Moulliard <ch...@gmail.com>
>>>>>>> >>>>>>
>>>>>>> >>>>>> 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 <
>>>>>>> balteo@gmail.com>
>>>>>>> >>>>>> 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 <ch...@gmail.com>
>>>>>>> >>>>>>>>
>>>>>>> >>>>>>>> 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 <
>>>>>>> balteo@gmail.com>
>>>>>>> >>>>>>>> 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 <ch...@gmail.com>
>>>>>>> >>>>>>>>>>
>>>>>>> >>>>>>>>>> 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 <
>>>>>>> balteo@gmail.com>
>>>>>>> >>>>>>>>>> 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 <ba...@gmail.com>
>>>>>>> >>>>>>>>>>>>
>>>>>>> >>>>>>>>>>>> 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 <ba...@gmail.com>
>>>>>>> >>>>>>>>>>>>>
>>>>>>> >>>>>>>>>>>>> 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é <jb...@nanthrax.net>
>>>>>>> >>>>>>>>>>>>>>
>>>>>>> >>>>>>>>>>>>>> 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 <balteo@gmail.com
>>>>>>> >>>>>>>>>>>>>>> <ma...@gmail.com>>
>>>>>>> >>>>>>>>>>>>>>>
>>>>>>> >>>>>>>>>>>>>>>
>>>>>>> >>>>>>>>>>>>>>>     Thanks to both of you. I'll try as you advised
>>>>>>> and let
>>>>>>> >>>>>>>>>>>>>>> you know.
>>>>>>> >>>>>>>>>>>>>>>     Best regards,
>>>>>>> >>>>>>>>>>>>>>>     J.
>>>>>>> >>>>>>>>>>>>>>>
>>>>>>> >>>>>>>>>>>>>>>
>>>>>>> >>>>>>>>>>>>>>>     2012/8/10 Freeman Fang <freeman.fang@gmail.com
>>>>>>> >>>>>>>>>>>>>>>     <ma...@gmail.com>>
>>>>>>> >>>>>>>>>>>>>>>
>>>>>>> >>>>>>>>>>>>>>>
>>>>>>> >>>>>>>>>>>>>>>         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:ffang@fusesource.com
>>>>>>> >>>>>>>>>>>>>>> <ma...@fusesource.com>
>>>>>>> >>>>>>>>>>>>>>>         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 <balteo@gmail.com
>>>>>>> >>>>>>>>>>>>>>>>         <ma...@gmail.com>>
>>>>>>> >>>>>>>>>>>>>>>>
>>>>>>> >>>>>>>>>>>>>>>>
>>>>>>> >>>>>>>>>>>>>>>>             thanks Achim
>>>>>>> >>>>>>>>>>>>>>>>
>>>>>>> >>>>>>>>>>>>>>>>
>>>>>>> >>>>>>>>>>>>>>>>             2012/8/9 Achim Nierbeck <
>>>>>>> bcanhome@googlemail.com
>>>>>>> >>>>>>>>>>>>>>>>             <ma...@googlemail.com>>
>>>>>>> >>>>>>>>>>>>>>>>
>>>>>>> >>>>>>>>>>>>>>>>
>>>>>>> >>>>>>>>>>>>>>>>                 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 <
>>>>>>> balteo@gmail.com
>>>>>>> >>>>>>>>>>>>>>>>                 <ma...@gmail.com>>:
>>>>>>> >>>>>>>>>>>>>>>>
>>>>>>> >>>>>>>>>>>>>>>>                 > 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
>>>>>>> >>>>>>>>>>>>>>>> <bcanhome@googlemail.com
>>>>>>> >>>>>>>>>>>>>>>>                 <ma...@googlemail.com>>
>>>>>>> >>>>>>>>>>>>>>>>
>>>>>>> >>>>>>>>>>>>>>>>                 >>
>>>>>>> >>>>>>>>>>>>>>>>                 >> 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 <
>>>>>>> balteo@gmail.com
>>>>>>> >>>>>>>>>>>>>>>>                 <ma...@gmail.com>>:
>>>>>>> >>>>>>>>>>>>>>>>
>>>>>>> >>>>>>>>>>>>>>>>                 >> > 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é
>>>>>>> >>>>>>>>>>>>>> jbonofre@apache.org
>>>>>>> >>>>>>>>>>>>>> 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/>
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> 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

Re: Embedding a Spring Integration app into Apache Karaf

Posted by Julien Martin <ba...@gmail.com>.
Charles,
Do you reckon it is a bug on the springsource side?
J.

2012/8/13 Julien Martin <ba...@gmail.com>

> Charles,
>
> I did as you advised and I get the same dependency chain error as before
> i.e.:
>
> *karaf@root> start 380*
> *org.osgi.framework.BundleException: Unable to resolve module
> org.springframework.batch.core [380.0] because it is exposed to package
> 'org.springframew*
> *ork.context.support' from org.springframework.context [347.0] and
> org.springframework.context [366.0] via two dependency chains.*
> *
> *
> *Chain 1:*
> *  org.springframework.batch.core [380.0]*
> *    import:
> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
> *
> *     |*
> *    export: package=org.springframework.context.support*
> *  org.springframework.context [347.0]*
> *
> *
> *Chain 2:*
> *  org.springframework.batch.core [380.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 [373.0]*
> *    import:
> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
> *
> *     |*
> *    export: package=org.springframework.context.support*
> *  org.springframework.context [366.0]*
>
> 2012/8/13 Charles Moulliard <ch...@gmail.com>
>
>> I suggest that you install the spring batch jar file as I tell you and
>> drop after all the other 38 jars files.
>>
>>
>> On Mon, Aug 13, 2012 at 3:13 PM, Julien Martin <ba...@gmail.com> wrote:
>>
>>> Hi Charles,
>>> Thanks. I actually dropped all my jars into the /deploy folder (for
>>> testing purposes) as advised by Achim.
>>> The real issue I have now is that of the dependency chains...
>>> Regards,
>>> J.
>>>
>>> 2012/8/13 Charles Moulliard <ch...@gmail.com>
>>>
>>>> Hi Julien,
>>>>
>>>> You do not need to wrap the Spring Batch jar file as it is already a
>>>> bundle -->
>>>>
>>>> install -s
>>>> mvn:org.springframework.batch/spring-batch-infrastructure/2.1.8.RELEASE
>>>>
>>>> [  92] [Active     ] [            ] [       ] [   80]
>>>> mvn:org.springframework.batch/spring-batch-infrastructure/2.1.8.RELEASE
>>>>
>>>> Regards,
>>>>
>>>> Charles
>>>>
>>>>
>>>> On Mon, Aug 13, 2012 at 2:57 PM, Julien Martin <ba...@gmail.com>wrote:
>>>>
>>>>> Hi,
>>>>> I am almost there. I dropped the dependencies as well as my app into
>>>>> the /deploy folder. I get a multiple dependency chain problem as follows.
>>>>> Can anyone please help?
>>>>>
>>>>> *C:\system\apache-karaf-2.2.8\bin>karaf*
>>>>> *        __ __                  ____*
>>>>> *       / //_/____ __________ _/ __/*
>>>>> *      / ,<  / __ `/ ___/ __ `/ /_*
>>>>> *     / /| |/ /_/ / /  / /_/ / __/*
>>>>> *    /_/ |_|\__,_/_/   \__,_/_/*
>>>>> *
>>>>> *
>>>>> *  Apache Karaf (2.2.8)*
>>>>> *
>>>>> *
>>>>> *Hit '<tab>' for a list of available commands*
>>>>> *and '[cmd] --help' for help on a specific command.*
>>>>> *Hit '<ctrl-d>' or 'osgi:shutdown' to shutdown Karaf.*
>>>>> *
>>>>> *
>>>>> *karaf@root> ERROR: Bundle org.springframework.batch.test [339] Error
>>>>> starting
>>>>> file:/C:/system/apache-karaf-2.2.8/deploy/spring-batch-test-2.1.8.RELEAS
>>>>> *
>>>>> *E.jar (org.osgi.framework.BundleException: Unable to resolve module
>>>>> org.springframework.batch.core [341.0] because it is exposed to
>>>>> package 'org.sprin*
>>>>> *gframework.context.support' from org.springframework.context [347.0]
>>>>> and org.springframework.context [366.0] via two dependency chains.*
>>>>> *
>>>>> *
>>>>> *Chain 1:*
>>>>> *  org.springframework.batch.core [341.0]*
>>>>> *    import:
>>>>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>>>>> *
>>>>> *     |*
>>>>> *    export: package=org.springframework.context.support*
>>>>> *  org.springframework.context [347.0]*
>>>>> *
>>>>> *
>>>>> *Chain 2:*
>>>>> *  org.springframework.batch.core [341.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 [373.0]*
>>>>> *    import:
>>>>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>>>>> *
>>>>> *     |*
>>>>> *    export: package=org.springframework.context.support*
>>>>> *  org.springframework.context [366.0])*
>>>>> *org.osgi.framework.BundleException: Unable to resolve module
>>>>> org.springframework.batch.core [341.0] because it is exposed to
>>>>> package 'org.springframew*
>>>>> *ork.context.support' from org.springframework.context [347.0] and
>>>>> org.springframework.context [366.0] via two dependency chains.*
>>>>> *
>>>>> *
>>>>> *Chain 1:*
>>>>> *  org.springframework.batch.core [341.0]*
>>>>>  *    import:
>>>>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>>>>> *
>>>>> *     |*
>>>>> *    export: package=org.springframework.context.support*
>>>>>  *  org.springframework.context [347.0]*
>>>>> *
>>>>> *
>>>>> *Chain 2:*
>>>>> *  org.springframework.batch.core [341.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 [373.0]*
>>>>>  *    import:
>>>>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>>>>> *
>>>>> *     |*
>>>>> *    export: package=org.springframework.context.support*
>>>>> *  org.springframework.context [366.0]*
>>>>> *        at org.apache.felix.framework.Felix.resolveBundle(Felix.java:
>>>>> 3452)*
>>>>> *        at
>>>>> org.apache.felix.framework.Felix.startBundle(Felix.java:1734)*
>>>>> *        at
>>>>> org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1163)*
>>>>> *        at
>>>>> org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264)
>>>>> *
>>>>> *        at java.lang.Thread.run(Thread.java:662)*
>>>>> *ERROR: Bundle org.springframework.batch.core [341] Error starting
>>>>> file:/C:/system/apache-karaf-2.2.8/deploy/spring-batch-core-2.1.8.RELEASE.jar
>>>>> (org.o*
>>>>> *sgi.framework.BundleException: Unable to resolve module
>>>>> org.springframework.batch.core [341.0] because it is exposed to
>>>>> package 'org.springframework.c*
>>>>> *ontext.support' from org.springframework.context [347.0] and
>>>>> org.springframework.context [366.0] via two dependency chains.*
>>>>> *
>>>>> *
>>>>> *Chain 1:*
>>>>> *  org.springframework.batch.core [341.0]*
>>>>> *    import:
>>>>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>>>>> *
>>>>> *     |*
>>>>> *    export: package=org.springframework.context.support*
>>>>> *  org.springframework.context [347.0]*
>>>>> *
>>>>> *
>>>>> *Chain 2:*
>>>>> *  org.springframework.batch.core [341.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 [373.0]*
>>>>> *    import:
>>>>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>>>>> *
>>>>> *     |*
>>>>> *    export: package=org.springframework.context.support*
>>>>> *  org.springframework.context [366.0])*
>>>>> *org.osgi.framework.BundleException: Unable to resolve module
>>>>> org.springframework.batch.core [341.0] because it is exposed to
>>>>> package 'org.springframew*
>>>>> *ork.context.support' from org.springframework.context [347.0] and
>>>>> org.springframework.context [366.0] via two dependency chains.*
>>>>> *
>>>>> *
>>>>> *Chain 1:*
>>>>> *  org.springframework.batch.core [341.0]*
>>>>>  *    import:
>>>>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>>>>> *
>>>>> *     |*
>>>>> *    export: package=org.springframework.context.support*
>>>>>  *  org.springframework.context [347.0]*
>>>>> *
>>>>> *
>>>>> *Chain 2:*
>>>>> *  org.springframework.batch.core [341.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 [373.0]*
>>>>> *    import:
>>>>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>>>>> *
>>>>> *     |*
>>>>> *    export: package=org.springframework.context.support*
>>>>> *  org.springframework.context [366.0]*
>>>>> *        at
>>>>> org.apache.felix.framework.Felix.resolveBundle(Felix.java:3452)*
>>>>> *        at
>>>>> org.apache.felix.framework.Felix.startBundle(Felix.java:1734)*
>>>>> *        at
>>>>> org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1163)*
>>>>> *        at
>>>>> org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264)
>>>>> *
>>>>> *        at java.lang.Thread.run(Thread.java:662)*
>>>>> *ERROR: Bundle org.springframework.batch.integration [342] Error
>>>>> starting
>>>>> file:/C:/system/apache-karaf-2.2.8/deploy/spring-batch-integration-1.2.1.RELE
>>>>> *
>>>>> *ASE.jar (org.osgi.framework.BundleException: Unable to resolve
>>>>> module org.springframework.batch.core [341.0] because it is exposed to
>>>>> package 'org.spr*
>>>>> *ingframework.context.support' from org.springframework.context
>>>>> [347.0] and org.springframework.context [366.0] via two dependency chains.
>>>>> *
>>>>> *
>>>>> *
>>>>> *Chain 1:*
>>>>> *  org.springframework.batch.core [341.0]*
>>>>> *    import:
>>>>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>>>>> *
>>>>> *     |*
>>>>> *    export: package=org.springframework.context.support*
>>>>> *  org.springframework.context [347.0]*
>>>>> *
>>>>> *
>>>>> *Chain 2:*
>>>>> *  org.springframework.batch.core [341.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 [373.0]*
>>>>> *    import:
>>>>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>>>>> *
>>>>> *     |*
>>>>> *    export: package=org.springframework.context.support*
>>>>> *  org.springframework.context [366.0])*
>>>>> *org.osgi.framework.BundleException: Unable to resolve module
>>>>> org.springframework.batch.core [341.0] because it is exposed to package
>>>>> 'org.springframew*
>>>>> *ork.context.support' from org.springframework.context [347.0] and
>>>>> org.springframework.context [366.0] via two dependency chains.*
>>>>> *
>>>>> *
>>>>> *Chain 1:*
>>>>> *  org.springframework.batch.core [341.0]*
>>>>>  *    import:
>>>>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>>>>> *
>>>>> *     |*
>>>>> *    export: package=org.springframework.context.support*
>>>>>  *  org.springframework.context [347.0]*
>>>>> *
>>>>> *
>>>>> *Chain 2:*
>>>>> *  org.springframework.batch.core [341.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 [373.0]*
>>>>> *    import:
>>>>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>>>>> *
>>>>> *     |*
>>>>> *    export: package=org.springframework.context.support*
>>>>> *  org.springframework.context [366.0]*
>>>>> *        at
>>>>> org.apache.felix.framework.Felix.resolveBundle(Felix.java:3452)*
>>>>> *        at
>>>>> org.apache.felix.framework.Felix.startBundle(Felix.java:1734)*
>>>>> *        at
>>>>> org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1163)*
>>>>> *        at
>>>>> org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264)
>>>>> *
>>>>> *        at java.lang.Thread.run(Thread.java:662)*
>>>>> *ERROR: Bundle spring-batch-demo-trc-dm [368] Error starting
>>>>> file:/C:/system/apache-karaf-2.2.8/deploy/spring-batch-demo-trc-dm-1.0.0-SNAPSHOT.jar
>>>>> (org*
>>>>> *.osgi.framework.BundleException: Unable to resolve module
>>>>> org.springframework.batch.core [341.0] because it is exposed to package
>>>>> 'org.springframework*
>>>>> *.context.support' from org.springframework.context [347.0] and
>>>>> org.springframework.context [366.0] via two dependency chains.*
>>>>> *
>>>>> *
>>>>> *Chain 1:*
>>>>> *  org.springframework.batch.core [341.0]*
>>>>> *    import:
>>>>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>>>>> *
>>>>> *     |*
>>>>> *    export: package=org.springframework.context.support*
>>>>> *  org.springframework.context [347.0]*
>>>>> *
>>>>> *
>>>>> *Chain 2:*
>>>>> *  org.springframework.batch.core [341.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 [373.0]*
>>>>> *    import:
>>>>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>>>>> *
>>>>> *     |*
>>>>> *    export: package=org.springframework.context.support*
>>>>> *  org.springframework.context [366.0])*
>>>>> *org.osgi.framework.BundleException: Unable to resolve module
>>>>> org.springframework.batch.core [341.0] because it is exposed to package
>>>>> 'org.springframew*
>>>>> *ork.context.support' from org.springframework.context [347.0] and
>>>>> org.springframework.context [366.0] via two dependency chains.*
>>>>> *
>>>>> *
>>>>> *Chain 1:*
>>>>> *  org.springframework.batch.core [341.0]*
>>>>>  *    import:
>>>>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>>>>> *
>>>>> *     |*
>>>>> *    export: package=org.springframework.context.support*
>>>>>  *  org.springframework.context [347.0]*
>>>>> *
>>>>> *
>>>>> *Chain 2:*
>>>>> *  org.springframework.batch.core [341.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 [373.0]*
>>>>> *    import:
>>>>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>>>>> *
>>>>> *     |*
>>>>> *    export: package=org.springframework.context.support*
>>>>> *  org.springframework.context [366.0]*
>>>>> *        at
>>>>> org.apache.felix.framework.Felix.resolveBundle(Felix.java:3452)*
>>>>> *        at
>>>>> org.apache.felix.framework.Felix.startBundle(Felix.java:1734)*
>>>>> *        at
>>>>> org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1163)*
>>>>> *        at
>>>>> org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264)
>>>>> *
>>>>> *        at java.lang.Thread.run(Thread.java:662)*
>>>>> *Exception in thread "Thread-16" java.lang.IllegalArgumentException:
>>>>> Cannot write resource: org/xmlpull/mxp1/MXParser.class :43114: exception:
>>>>> java.io.*
>>>>> *IOException: Pipe closed*
>>>>> *        at aQute.lib.osgi.Jar.writeResource(Jar.java:302)*
>>>>> *        at aQute.lib.osgi.Jar.write(Jar.java:211)*
>>>>> *        at
>>>>> org.ops4j.pax.swissbox.bnd.BndUtils$1.run(BndUtils.java:174)*
>>>>> *^C*
>>>>> *karaf@root>*
>>>>>
>>>>>
>>>>> 2012/8/13 Achim Nierbeck <bc...@googlemail.com>
>>>>>
>>>>>> 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 <ba...@gmail.com>:
>>>>>> > 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 <ch...@gmail.com>
>>>>>> >>
>>>>>> >> 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 <ba...@gmail.com>
>>>>>> 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 <ch...@gmail.com>
>>>>>> >>>>
>>>>>> >>>> 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 <ba...@gmail.com>
>>>>>> wrote:
>>>>>> >>>>>
>>>>>> >>>>> How do I install the Spring batch jars/bundle into Karaf?
>>>>>> >>>>> Regards,
>>>>>> >>>>> J.
>>>>>> >>>>>
>>>>>> >>>>> 2012/8/13 Charles Moulliard <ch...@gmail.com>
>>>>>> >>>>>>
>>>>>> >>>>>> 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 <
>>>>>> balteo@gmail.com>
>>>>>> >>>>>> 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 <ch...@gmail.com>
>>>>>> >>>>>>>>
>>>>>> >>>>>>>> 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 <
>>>>>> balteo@gmail.com>
>>>>>> >>>>>>>> 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 <ch...@gmail.com>
>>>>>> >>>>>>>>>>
>>>>>> >>>>>>>>>> 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 <
>>>>>> balteo@gmail.com>
>>>>>> >>>>>>>>>> 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 <ba...@gmail.com>
>>>>>> >>>>>>>>>>>>
>>>>>> >>>>>>>>>>>> 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 <ba...@gmail.com>
>>>>>> >>>>>>>>>>>>>
>>>>>> >>>>>>>>>>>>> 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é <jb...@nanthrax.net>
>>>>>> >>>>>>>>>>>>>>
>>>>>> >>>>>>>>>>>>>> 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 <balteo@gmail.com
>>>>>> >>>>>>>>>>>>>>> <ma...@gmail.com>>
>>>>>> >>>>>>>>>>>>>>>
>>>>>> >>>>>>>>>>>>>>>
>>>>>> >>>>>>>>>>>>>>>     Thanks to both of you. I'll try as you advised
>>>>>> and let
>>>>>> >>>>>>>>>>>>>>> you know.
>>>>>> >>>>>>>>>>>>>>>     Best regards,
>>>>>> >>>>>>>>>>>>>>>     J.
>>>>>> >>>>>>>>>>>>>>>
>>>>>> >>>>>>>>>>>>>>>
>>>>>> >>>>>>>>>>>>>>>     2012/8/10 Freeman Fang <freeman.fang@gmail.com
>>>>>> >>>>>>>>>>>>>>>     <ma...@gmail.com>>
>>>>>> >>>>>>>>>>>>>>>
>>>>>> >>>>>>>>>>>>>>>
>>>>>> >>>>>>>>>>>>>>>         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:ffang@fusesource.com
>>>>>> >>>>>>>>>>>>>>> <ma...@fusesource.com>
>>>>>> >>>>>>>>>>>>>>>         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 <balteo@gmail.com
>>>>>> >>>>>>>>>>>>>>>>         <ma...@gmail.com>>
>>>>>> >>>>>>>>>>>>>>>>
>>>>>> >>>>>>>>>>>>>>>>
>>>>>> >>>>>>>>>>>>>>>>             thanks Achim
>>>>>> >>>>>>>>>>>>>>>>
>>>>>> >>>>>>>>>>>>>>>>
>>>>>> >>>>>>>>>>>>>>>>             2012/8/9 Achim Nierbeck <
>>>>>> bcanhome@googlemail.com
>>>>>> >>>>>>>>>>>>>>>>             <ma...@googlemail.com>>
>>>>>> >>>>>>>>>>>>>>>>
>>>>>> >>>>>>>>>>>>>>>>
>>>>>> >>>>>>>>>>>>>>>>                 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 <
>>>>>> balteo@gmail.com
>>>>>> >>>>>>>>>>>>>>>>                 <ma...@gmail.com>>:
>>>>>> >>>>>>>>>>>>>>>>
>>>>>> >>>>>>>>>>>>>>>>                 > 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
>>>>>> >>>>>>>>>>>>>>>> <bcanhome@googlemail.com
>>>>>> >>>>>>>>>>>>>>>>                 <ma...@googlemail.com>>
>>>>>> >>>>>>>>>>>>>>>>
>>>>>> >>>>>>>>>>>>>>>>                 >>
>>>>>> >>>>>>>>>>>>>>>>                 >> 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 <
>>>>>> balteo@gmail.com
>>>>>> >>>>>>>>>>>>>>>>                 <ma...@gmail.com>>:
>>>>>> >>>>>>>>>>>>>>>>
>>>>>> >>>>>>>>>>>>>>>>                 >> > 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é
>>>>>> >>>>>>>>>>>>>> jbonofre@apache.org
>>>>>> >>>>>>>>>>>>>> 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/>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> 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
>>
>>
>>
>

Re: Embedding a Spring Integration app into Apache Karaf

Posted by Julien Martin <ba...@gmail.com>.
Charles,

I did as you advised and I get the same dependency chain error as before
i.e.:

*karaf@root> start 380*
*org.osgi.framework.BundleException: Unable to resolve module
org.springframework.batch.core [380.0] because it is exposed to package
'org.springframew*
*ork.context.support' from org.springframework.context [347.0] and
org.springframework.context [366.0] via two dependency chains.*
*
*
*Chain 1:*
*  org.springframework.batch.core [380.0]*
*    import:
(&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
*
*     |*
*    export: package=org.springframework.context.support*
*  org.springframework.context [347.0]*
*
*
*Chain 2:*
*  org.springframework.batch.core [380.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 [373.0]*
*    import:
(&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
*
*     |*
*    export: package=org.springframework.context.support*
*  org.springframework.context [366.0]*

2012/8/13 Charles Moulliard <ch...@gmail.com>

> I suggest that you install the spring batch jar file as I tell you and
> drop after all the other 38 jars files.
>
>
> On Mon, Aug 13, 2012 at 3:13 PM, Julien Martin <ba...@gmail.com> wrote:
>
>> Hi Charles,
>> Thanks. I actually dropped all my jars into the /deploy folder (for
>> testing purposes) as advised by Achim.
>> The real issue I have now is that of the dependency chains...
>> Regards,
>> J.
>>
>> 2012/8/13 Charles Moulliard <ch...@gmail.com>
>>
>>> Hi Julien,
>>>
>>> You do not need to wrap the Spring Batch jar file as it is already a
>>> bundle -->
>>>
>>> install -s
>>> mvn:org.springframework.batch/spring-batch-infrastructure/2.1.8.RELEASE
>>>
>>> [  92] [Active     ] [            ] [       ] [   80]
>>> mvn:org.springframework.batch/spring-batch-infrastructure/2.1.8.RELEASE
>>>
>>> Regards,
>>>
>>> Charles
>>>
>>>
>>> On Mon, Aug 13, 2012 at 2:57 PM, Julien Martin <ba...@gmail.com> wrote:
>>>
>>>> Hi,
>>>> I am almost there. I dropped the dependencies as well as my app into
>>>> the /deploy folder. I get a multiple dependency chain problem as follows.
>>>> Can anyone please help?
>>>>
>>>> *C:\system\apache-karaf-2.2.8\bin>karaf*
>>>> *        __ __                  ____*
>>>> *       / //_/____ __________ _/ __/*
>>>> *      / ,<  / __ `/ ___/ __ `/ /_*
>>>> *     / /| |/ /_/ / /  / /_/ / __/*
>>>> *    /_/ |_|\__,_/_/   \__,_/_/*
>>>> *
>>>> *
>>>> *  Apache Karaf (2.2.8)*
>>>> *
>>>> *
>>>> *Hit '<tab>' for a list of available commands*
>>>> *and '[cmd] --help' for help on a specific command.*
>>>> *Hit '<ctrl-d>' or 'osgi:shutdown' to shutdown Karaf.*
>>>> *
>>>> *
>>>> *karaf@root> ERROR: Bundle org.springframework.batch.test [339] Error
>>>> starting
>>>> file:/C:/system/apache-karaf-2.2.8/deploy/spring-batch-test-2.1.8.RELEAS
>>>> *
>>>> *E.jar (org.osgi.framework.BundleException: Unable to resolve module
>>>> org.springframework.batch.core [341.0] because it is exposed to
>>>> package 'org.sprin*
>>>> *gframework.context.support' from org.springframework.context [347.0]
>>>> and org.springframework.context [366.0] via two dependency chains.*
>>>> *
>>>> *
>>>> *Chain 1:*
>>>> *  org.springframework.batch.core [341.0]*
>>>> *    import:
>>>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>>>> *
>>>> *     |*
>>>> *    export: package=org.springframework.context.support*
>>>> *  org.springframework.context [347.0]*
>>>> *
>>>> *
>>>> *Chain 2:*
>>>> *  org.springframework.batch.core [341.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 [373.0]*
>>>> *    import:
>>>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>>>> *
>>>> *     |*
>>>> *    export: package=org.springframework.context.support*
>>>> *  org.springframework.context [366.0])*
>>>> *org.osgi.framework.BundleException: Unable to resolve module
>>>> org.springframework.batch.core [341.0] because it is exposed to
>>>> package 'org.springframew*
>>>> *ork.context.support' from org.springframework.context [347.0] and
>>>> org.springframework.context [366.0] via two dependency chains.*
>>>> *
>>>> *
>>>> *Chain 1:*
>>>> *  org.springframework.batch.core [341.0]*
>>>>  *    import:
>>>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>>>> *
>>>> *     |*
>>>> *    export: package=org.springframework.context.support*
>>>>  *  org.springframework.context [347.0]*
>>>> *
>>>> *
>>>> *Chain 2:*
>>>> *  org.springframework.batch.core [341.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 [373.0]*
>>>> *    import:
>>>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>>>> *
>>>> *     |*
>>>> *    export: package=org.springframework.context.support*
>>>> *  org.springframework.context [366.0]*
>>>> *        at org.apache.felix.framework.Felix.resolveBundle(Felix.java:
>>>> 3452)*
>>>> *        at
>>>> org.apache.felix.framework.Felix.startBundle(Felix.java:1734)*
>>>> *        at
>>>> org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1163)*
>>>> *        at
>>>> org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264)*
>>>> *        at java.lang.Thread.run(Thread.java:662)*
>>>> *ERROR: Bundle org.springframework.batch.core [341] Error starting
>>>> file:/C:/system/apache-karaf-2.2.8/deploy/spring-batch-core-2.1.8.RELEASE.jar
>>>> (org.o*
>>>> *sgi.framework.BundleException: Unable to resolve module
>>>> org.springframework.batch.core [341.0] because it is exposed to
>>>> package 'org.springframework.c*
>>>> *ontext.support' from org.springframework.context [347.0] and
>>>> org.springframework.context [366.0] via two dependency chains.*
>>>> *
>>>> *
>>>> *Chain 1:*
>>>> *  org.springframework.batch.core [341.0]*
>>>> *    import:
>>>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>>>> *
>>>> *     |*
>>>> *    export: package=org.springframework.context.support*
>>>> *  org.springframework.context [347.0]*
>>>> *
>>>> *
>>>> *Chain 2:*
>>>> *  org.springframework.batch.core [341.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 [373.0]*
>>>> *    import:
>>>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>>>> *
>>>> *     |*
>>>> *    export: package=org.springframework.context.support*
>>>> *  org.springframework.context [366.0])*
>>>> *org.osgi.framework.BundleException: Unable to resolve module
>>>> org.springframework.batch.core [341.0] because it is exposed to package
>>>> 'org.springframew*
>>>> *ork.context.support' from org.springframework.context [347.0] and
>>>> org.springframework.context [366.0] via two dependency chains.*
>>>> *
>>>> *
>>>> *Chain 1:*
>>>> *  org.springframework.batch.core [341.0]*
>>>>  *    import:
>>>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>>>> *
>>>> *     |*
>>>> *    export: package=org.springframework.context.support*
>>>>  *  org.springframework.context [347.0]*
>>>> *
>>>> *
>>>> *Chain 2:*
>>>> *  org.springframework.batch.core [341.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 [373.0]*
>>>> *    import:
>>>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>>>> *
>>>> *     |*
>>>> *    export: package=org.springframework.context.support*
>>>> *  org.springframework.context [366.0]*
>>>> *        at
>>>> org.apache.felix.framework.Felix.resolveBundle(Felix.java:3452)*
>>>> *        at
>>>> org.apache.felix.framework.Felix.startBundle(Felix.java:1734)*
>>>> *        at
>>>> org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1163)*
>>>> *        at
>>>> org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264)*
>>>> *        at java.lang.Thread.run(Thread.java:662)*
>>>> *ERROR: Bundle org.springframework.batch.integration [342] Error
>>>> starting
>>>> file:/C:/system/apache-karaf-2.2.8/deploy/spring-batch-integration-1.2.1.RELE
>>>> *
>>>> *ASE.jar (org.osgi.framework.BundleException: Unable to resolve module
>>>> org.springframework.batch.core [341.0] because it is exposed to package
>>>> 'org.spr*
>>>> *ingframework.context.support' from org.springframework.context
>>>> [347.0] and org.springframework.context [366.0] via two dependency chains.
>>>> *
>>>> *
>>>> *
>>>> *Chain 1:*
>>>> *  org.springframework.batch.core [341.0]*
>>>> *    import:
>>>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>>>> *
>>>> *     |*
>>>> *    export: package=org.springframework.context.support*
>>>> *  org.springframework.context [347.0]*
>>>> *
>>>> *
>>>> *Chain 2:*
>>>> *  org.springframework.batch.core [341.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 [373.0]*
>>>> *    import:
>>>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>>>> *
>>>> *     |*
>>>> *    export: package=org.springframework.context.support*
>>>> *  org.springframework.context [366.0])*
>>>> *org.osgi.framework.BundleException: Unable to resolve module
>>>> org.springframework.batch.core [341.0] because it is exposed to package
>>>> 'org.springframew*
>>>> *ork.context.support' from org.springframework.context [347.0] and
>>>> org.springframework.context [366.0] via two dependency chains.*
>>>> *
>>>> *
>>>> *Chain 1:*
>>>> *  org.springframework.batch.core [341.0]*
>>>>  *    import:
>>>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>>>> *
>>>> *     |*
>>>> *    export: package=org.springframework.context.support*
>>>>  *  org.springframework.context [347.0]*
>>>> *
>>>> *
>>>> *Chain 2:*
>>>> *  org.springframework.batch.core [341.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 [373.0]*
>>>> *    import:
>>>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>>>> *
>>>> *     |*
>>>> *    export: package=org.springframework.context.support*
>>>> *  org.springframework.context [366.0]*
>>>> *        at
>>>> org.apache.felix.framework.Felix.resolveBundle(Felix.java:3452)*
>>>> *        at
>>>> org.apache.felix.framework.Felix.startBundle(Felix.java:1734)*
>>>> *        at
>>>> org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1163)*
>>>> *        at
>>>> org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264)*
>>>> *        at java.lang.Thread.run(Thread.java:662)*
>>>> *ERROR: Bundle spring-batch-demo-trc-dm [368] Error starting
>>>> file:/C:/system/apache-karaf-2.2.8/deploy/spring-batch-demo-trc-dm-1.0.0-SNAPSHOT.jar
>>>> (org*
>>>> *.osgi.framework.BundleException: Unable to resolve module
>>>> org.springframework.batch.core [341.0] because it is exposed to package
>>>> 'org.springframework*
>>>> *.context.support' from org.springframework.context [347.0] and
>>>> org.springframework.context [366.0] via two dependency chains.*
>>>> *
>>>> *
>>>> *Chain 1:*
>>>> *  org.springframework.batch.core [341.0]*
>>>> *    import:
>>>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>>>> *
>>>> *     |*
>>>> *    export: package=org.springframework.context.support*
>>>> *  org.springframework.context [347.0]*
>>>> *
>>>> *
>>>> *Chain 2:*
>>>> *  org.springframework.batch.core [341.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 [373.0]*
>>>> *    import:
>>>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>>>> *
>>>> *     |*
>>>> *    export: package=org.springframework.context.support*
>>>> *  org.springframework.context [366.0])*
>>>> *org.osgi.framework.BundleException: Unable to resolve module
>>>> org.springframework.batch.core [341.0] because it is exposed to package
>>>> 'org.springframew*
>>>> *ork.context.support' from org.springframework.context [347.0] and
>>>> org.springframework.context [366.0] via two dependency chains.*
>>>> *
>>>> *
>>>> *Chain 1:*
>>>> *  org.springframework.batch.core [341.0]*
>>>>  *    import:
>>>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>>>> *
>>>> *     |*
>>>> *    export: package=org.springframework.context.support*
>>>>  *  org.springframework.context [347.0]*
>>>> *
>>>> *
>>>> *Chain 2:*
>>>> *  org.springframework.batch.core [341.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 [373.0]*
>>>> *    import:
>>>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>>>> *
>>>> *     |*
>>>> *    export: package=org.springframework.context.support*
>>>> *  org.springframework.context [366.0]*
>>>> *        at
>>>> org.apache.felix.framework.Felix.resolveBundle(Felix.java:3452)*
>>>> *        at
>>>> org.apache.felix.framework.Felix.startBundle(Felix.java:1734)*
>>>> *        at
>>>> org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1163)*
>>>> *        at
>>>> org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264)*
>>>> *        at java.lang.Thread.run(Thread.java:662)*
>>>> *Exception in thread "Thread-16" java.lang.IllegalArgumentException:
>>>> Cannot write resource: org/xmlpull/mxp1/MXParser.class :43114: exception:
>>>> java.io.*
>>>> *IOException: Pipe closed*
>>>> *        at aQute.lib.osgi.Jar.writeResource(Jar.java:302)*
>>>> *        at aQute.lib.osgi.Jar.write(Jar.java:211)*
>>>> *        at
>>>> org.ops4j.pax.swissbox.bnd.BndUtils$1.run(BndUtils.java:174)*
>>>> *^C*
>>>> *karaf@root>*
>>>>
>>>>
>>>> 2012/8/13 Achim Nierbeck <bc...@googlemail.com>
>>>>
>>>>> 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 <ba...@gmail.com>:
>>>>> > 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 <ch...@gmail.com>
>>>>> >>
>>>>> >> 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 <ba...@gmail.com>
>>>>> 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 <ch...@gmail.com>
>>>>> >>>>
>>>>> >>>> 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 <ba...@gmail.com>
>>>>> wrote:
>>>>> >>>>>
>>>>> >>>>> How do I install the Spring batch jars/bundle into Karaf?
>>>>> >>>>> Regards,
>>>>> >>>>> J.
>>>>> >>>>>
>>>>> >>>>> 2012/8/13 Charles Moulliard <ch...@gmail.com>
>>>>> >>>>>>
>>>>> >>>>>> 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 <
>>>>> balteo@gmail.com>
>>>>> >>>>>> 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 <ch...@gmail.com>
>>>>> >>>>>>>>
>>>>> >>>>>>>> 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 <
>>>>> balteo@gmail.com>
>>>>> >>>>>>>> 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 <ch...@gmail.com>
>>>>> >>>>>>>>>>
>>>>> >>>>>>>>>> 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 <
>>>>> balteo@gmail.com>
>>>>> >>>>>>>>>> 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 <ba...@gmail.com>
>>>>> >>>>>>>>>>>>
>>>>> >>>>>>>>>>>> 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 <ba...@gmail.com>
>>>>> >>>>>>>>>>>>>
>>>>> >>>>>>>>>>>>> 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é <jb...@nanthrax.net>
>>>>> >>>>>>>>>>>>>>
>>>>> >>>>>>>>>>>>>> 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 <balteo@gmail.com
>>>>> >>>>>>>>>>>>>>> <ma...@gmail.com>>
>>>>> >>>>>>>>>>>>>>>
>>>>> >>>>>>>>>>>>>>>
>>>>> >>>>>>>>>>>>>>>     Thanks to both of you. I'll try as you advised and
>>>>> let
>>>>> >>>>>>>>>>>>>>> you know.
>>>>> >>>>>>>>>>>>>>>     Best regards,
>>>>> >>>>>>>>>>>>>>>     J.
>>>>> >>>>>>>>>>>>>>>
>>>>> >>>>>>>>>>>>>>>
>>>>> >>>>>>>>>>>>>>>     2012/8/10 Freeman Fang <freeman.fang@gmail.com
>>>>> >>>>>>>>>>>>>>>     <ma...@gmail.com>>
>>>>> >>>>>>>>>>>>>>>
>>>>> >>>>>>>>>>>>>>>
>>>>> >>>>>>>>>>>>>>>         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:ffang@fusesource.com
>>>>> >>>>>>>>>>>>>>> <ma...@fusesource.com>
>>>>> >>>>>>>>>>>>>>>         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 <balteo@gmail.com
>>>>> >>>>>>>>>>>>>>>>         <ma...@gmail.com>>
>>>>> >>>>>>>>>>>>>>>>
>>>>> >>>>>>>>>>>>>>>>
>>>>> >>>>>>>>>>>>>>>>             thanks Achim
>>>>> >>>>>>>>>>>>>>>>
>>>>> >>>>>>>>>>>>>>>>
>>>>> >>>>>>>>>>>>>>>>             2012/8/9 Achim Nierbeck <
>>>>> bcanhome@googlemail.com
>>>>> >>>>>>>>>>>>>>>>             <ma...@googlemail.com>>
>>>>> >>>>>>>>>>>>>>>>
>>>>> >>>>>>>>>>>>>>>>
>>>>> >>>>>>>>>>>>>>>>                 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 <
>>>>> balteo@gmail.com
>>>>> >>>>>>>>>>>>>>>>                 <ma...@gmail.com>>:
>>>>> >>>>>>>>>>>>>>>>
>>>>> >>>>>>>>>>>>>>>>                 > 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
>>>>> >>>>>>>>>>>>>>>> <bcanhome@googlemail.com
>>>>> >>>>>>>>>>>>>>>>                 <ma...@googlemail.com>>
>>>>> >>>>>>>>>>>>>>>>
>>>>> >>>>>>>>>>>>>>>>                 >>
>>>>> >>>>>>>>>>>>>>>>                 >> 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 <
>>>>> balteo@gmail.com
>>>>> >>>>>>>>>>>>>>>>                 <ma...@gmail.com>>:
>>>>> >>>>>>>>>>>>>>>>
>>>>> >>>>>>>>>>>>>>>>                 >> > 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é
>>>>> >>>>>>>>>>>>>> jbonofre@apache.org
>>>>> >>>>>>>>>>>>>> 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/>
>>>>>
>>>>
>>>>
>>>
>>>
>>> --
>>> 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
>
>
>

Re: Embedding a Spring Integration app into Apache Karaf

Posted by Charles Moulliard <ch...@gmail.com>.
I suggest that you install the spring batch jar file as I tell you and drop
after all the other 38 jars files.

On Mon, Aug 13, 2012 at 3:13 PM, Julien Martin <ba...@gmail.com> wrote:

> Hi Charles,
> Thanks. I actually dropped all my jars into the /deploy folder (for
> testing purposes) as advised by Achim.
> The real issue I have now is that of the dependency chains...
> Regards,
> J.
>
> 2012/8/13 Charles Moulliard <ch...@gmail.com>
>
>> Hi Julien,
>>
>> You do not need to wrap the Spring Batch jar file as it is already a
>> bundle -->
>>
>> install -s
>> mvn:org.springframework.batch/spring-batch-infrastructure/2.1.8.RELEASE
>>
>> [  92] [Active     ] [            ] [       ] [   80]
>> mvn:org.springframework.batch/spring-batch-infrastructure/2.1.8.RELEASE
>>
>> Regards,
>>
>> Charles
>>
>>
>> On Mon, Aug 13, 2012 at 2:57 PM, Julien Martin <ba...@gmail.com> wrote:
>>
>>> Hi,
>>> I am almost there. I dropped the dependencies as well as my app into the
>>> /deploy folder. I get a multiple dependency chain problem as follows. Can
>>> anyone please help?
>>>
>>> *C:\system\apache-karaf-2.2.8\bin>karaf*
>>> *        __ __                  ____*
>>> *       / //_/____ __________ _/ __/*
>>> *      / ,<  / __ `/ ___/ __ `/ /_*
>>> *     / /| |/ /_/ / /  / /_/ / __/*
>>> *    /_/ |_|\__,_/_/   \__,_/_/*
>>> *
>>> *
>>> *  Apache Karaf (2.2.8)*
>>> *
>>> *
>>> *Hit '<tab>' for a list of available commands*
>>> *and '[cmd] --help' for help on a specific command.*
>>> *Hit '<ctrl-d>' or 'osgi:shutdown' to shutdown Karaf.*
>>> *
>>> *
>>> *karaf@root> ERROR: Bundle org.springframework.batch.test [339] Error
>>> starting
>>> file:/C:/system/apache-karaf-2.2.8/deploy/spring-batch-test-2.1.8.RELEAS
>>> *
>>> *E.jar (org.osgi.framework.BundleException: Unable to resolve module
>>> org.springframework.batch.core [341.0] because it is exposed to package
>>> 'org.sprin*
>>> *gframework.context.support' from org.springframework.context [347.0]
>>> and org.springframework.context [366.0] via two dependency chains.*
>>> *
>>> *
>>> *Chain 1:*
>>> *  org.springframework.batch.core [341.0]*
>>> *    import:
>>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>>> *
>>> *     |*
>>> *    export: package=org.springframework.context.support*
>>> *  org.springframework.context [347.0]*
>>> *
>>> *
>>> *Chain 2:*
>>> *  org.springframework.batch.core [341.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 [373.0]*
>>> *    import:
>>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>>> *
>>> *     |*
>>> *    export: package=org.springframework.context.support*
>>> *  org.springframework.context [366.0])*
>>> *org.osgi.framework.BundleException: Unable to resolve module
>>> org.springframework.batch.core [341.0] because it is exposed to package
>>> 'org.springframew*
>>> *ork.context.support' from org.springframework.context [347.0] and
>>> org.springframework.context [366.0] via two dependency chains.*
>>> *
>>> *
>>> *Chain 1:*
>>> *  org.springframework.batch.core [341.0]*
>>>  *    import:
>>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>>> *
>>> *     |*
>>> *    export: package=org.springframework.context.support*
>>>  *  org.springframework.context [347.0]*
>>> *
>>> *
>>> *Chain 2:*
>>> *  org.springframework.batch.core [341.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 [373.0]*
>>> *    import:
>>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>>> *
>>> *     |*
>>> *    export: package=org.springframework.context.support*
>>> *  org.springframework.context [366.0]*
>>> *        at
>>> org.apache.felix.framework.Felix.resolveBundle(Felix.java:3452)*
>>> *        at
>>> org.apache.felix.framework.Felix.startBundle(Felix.java:1734)*
>>> *        at
>>> org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1163)*
>>> *        at
>>> org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264)*
>>> *        at java.lang.Thread.run(Thread.java:662)*
>>> *ERROR: Bundle org.springframework.batch.core [341] Error starting
>>> file:/C:/system/apache-karaf-2.2.8/deploy/spring-batch-core-2.1.8.RELEASE.jar
>>> (org.o*
>>> *sgi.framework.BundleException: Unable to resolve module
>>> org.springframework.batch.core [341.0] because it is exposed to package
>>> 'org.springframework.c*
>>> *ontext.support' from org.springframework.context [347.0] and
>>> org.springframework.context [366.0] via two dependency chains.*
>>> *
>>> *
>>> *Chain 1:*
>>> *  org.springframework.batch.core [341.0]*
>>> *    import:
>>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>>> *
>>> *     |*
>>> *    export: package=org.springframework.context.support*
>>> *  org.springframework.context [347.0]*
>>> *
>>> *
>>> *Chain 2:*
>>> *  org.springframework.batch.core [341.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 [373.0]*
>>> *    import:
>>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>>> *
>>> *     |*
>>> *    export: package=org.springframework.context.support*
>>> *  org.springframework.context [366.0])*
>>> *org.osgi.framework.BundleException: Unable to resolve module
>>> org.springframework.batch.core [341.0] because it is exposed to package
>>> 'org.springframew*
>>> *ork.context.support' from org.springframework.context [347.0] and
>>> org.springframework.context [366.0] via two dependency chains.*
>>> *
>>> *
>>> *Chain 1:*
>>> *  org.springframework.batch.core [341.0]*
>>>  *    import:
>>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>>> *
>>> *     |*
>>> *    export: package=org.springframework.context.support*
>>>  *  org.springframework.context [347.0]*
>>> *
>>> *
>>> *Chain 2:*
>>> *  org.springframework.batch.core [341.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 [373.0]*
>>> *    import:
>>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>>> *
>>> *     |*
>>> *    export: package=org.springframework.context.support*
>>> *  org.springframework.context [366.0]*
>>> *        at
>>> org.apache.felix.framework.Felix.resolveBundle(Felix.java:3452)*
>>> *        at
>>> org.apache.felix.framework.Felix.startBundle(Felix.java:1734)*
>>> *        at
>>> org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1163)*
>>> *        at
>>> org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264)*
>>> *        at java.lang.Thread.run(Thread.java:662)*
>>> *ERROR: Bundle org.springframework.batch.integration [342] Error
>>> starting
>>> file:/C:/system/apache-karaf-2.2.8/deploy/spring-batch-integration-1.2.1.RELE
>>> *
>>> *ASE.jar (org.osgi.framework.BundleException: Unable to resolve module
>>> org.springframework.batch.core [341.0] because it is exposed to package
>>> 'org.spr*
>>> *ingframework.context.support' from org.springframework.context [347.0]
>>> and org.springframework.context [366.0] via two dependency chains.*
>>> *
>>> *
>>> *Chain 1:*
>>> *  org.springframework.batch.core [341.0]*
>>> *    import:
>>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>>> *
>>> *     |*
>>> *    export: package=org.springframework.context.support*
>>> *  org.springframework.context [347.0]*
>>> *
>>> *
>>> *Chain 2:*
>>> *  org.springframework.batch.core [341.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 [373.0]*
>>> *    import:
>>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>>> *
>>> *     |*
>>> *    export: package=org.springframework.context.support*
>>> *  org.springframework.context [366.0])*
>>> *org.osgi.framework.BundleException: Unable to resolve module
>>> org.springframework.batch.core [341.0] because it is exposed to package
>>> 'org.springframew*
>>> *ork.context.support' from org.springframework.context [347.0] and
>>> org.springframework.context [366.0] via two dependency chains.*
>>> *
>>> *
>>> *Chain 1:*
>>> *  org.springframework.batch.core [341.0]*
>>>  *    import:
>>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>>> *
>>> *     |*
>>> *    export: package=org.springframework.context.support*
>>>  *  org.springframework.context [347.0]*
>>> *
>>> *
>>> *Chain 2:*
>>> *  org.springframework.batch.core [341.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 [373.0]*
>>> *    import:
>>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>>> *
>>> *     |*
>>> *    export: package=org.springframework.context.support*
>>> *  org.springframework.context [366.0]*
>>> *        at
>>> org.apache.felix.framework.Felix.resolveBundle(Felix.java:3452)*
>>> *        at
>>> org.apache.felix.framework.Felix.startBundle(Felix.java:1734)*
>>> *        at
>>> org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1163)*
>>> *        at
>>> org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264)*
>>> *        at java.lang.Thread.run(Thread.java:662)*
>>> *ERROR: Bundle spring-batch-demo-trc-dm [368] Error starting
>>> file:/C:/system/apache-karaf-2.2.8/deploy/spring-batch-demo-trc-dm-1.0.0-SNAPSHOT.jar
>>> (org*
>>> *.osgi.framework.BundleException: Unable to resolve module
>>> org.springframework.batch.core [341.0] because it is exposed to package
>>> 'org.springframework*
>>> *.context.support' from org.springframework.context [347.0] and
>>> org.springframework.context [366.0] via two dependency chains.*
>>> *
>>> *
>>> *Chain 1:*
>>> *  org.springframework.batch.core [341.0]*
>>> *    import:
>>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>>> *
>>> *     |*
>>> *    export: package=org.springframework.context.support*
>>> *  org.springframework.context [347.0]*
>>> *
>>> *
>>> *Chain 2:*
>>> *  org.springframework.batch.core [341.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 [373.0]*
>>> *    import:
>>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>>> *
>>> *     |*
>>> *    export: package=org.springframework.context.support*
>>> *  org.springframework.context [366.0])*
>>> *org.osgi.framework.BundleException: Unable to resolve module
>>> org.springframework.batch.core [341.0] because it is exposed to package
>>> 'org.springframew*
>>> *ork.context.support' from org.springframework.context [347.0] and
>>> org.springframework.context [366.0] via two dependency chains.*
>>> *
>>> *
>>> *Chain 1:*
>>> *  org.springframework.batch.core [341.0]*
>>>  *    import:
>>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>>> *
>>> *     |*
>>> *    export: package=org.springframework.context.support*
>>>  *  org.springframework.context [347.0]*
>>> *
>>> *
>>> *Chain 2:*
>>> *  org.springframework.batch.core [341.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 [373.0]*
>>> *    import:
>>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>>> *
>>> *     |*
>>> *    export: package=org.springframework.context.support*
>>> *  org.springframework.context [366.0]*
>>> *        at
>>> org.apache.felix.framework.Felix.resolveBundle(Felix.java:3452)*
>>> *        at
>>> org.apache.felix.framework.Felix.startBundle(Felix.java:1734)*
>>> *        at
>>> org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1163)*
>>> *        at
>>> org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264)*
>>> *        at java.lang.Thread.run(Thread.java:662)*
>>> *Exception in thread "Thread-16" java.lang.IllegalArgumentException:
>>> Cannot write resource: org/xmlpull/mxp1/MXParser.class :43114: exception:
>>> java.io.*
>>> *IOException: Pipe closed*
>>> *        at aQute.lib.osgi.Jar.writeResource(Jar.java:302)*
>>> *        at aQute.lib.osgi.Jar.write(Jar.java:211)*
>>> *        at org.ops4j.pax.swissbox.bnd.BndUtils$1.run(BndUtils.java:174)
>>> *
>>> *^C*
>>> *karaf@root>*
>>>
>>>
>>> 2012/8/13 Achim Nierbeck <bc...@googlemail.com>
>>>
>>>> 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 <ba...@gmail.com>:
>>>> > 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 <ch...@gmail.com>
>>>> >>
>>>> >> 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 <ba...@gmail.com>
>>>> 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 <ch...@gmail.com>
>>>> >>>>
>>>> >>>> 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 <ba...@gmail.com>
>>>> wrote:
>>>> >>>>>
>>>> >>>>> How do I install the Spring batch jars/bundle into Karaf?
>>>> >>>>> Regards,
>>>> >>>>> J.
>>>> >>>>>
>>>> >>>>> 2012/8/13 Charles Moulliard <ch...@gmail.com>
>>>> >>>>>>
>>>> >>>>>> 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 <
>>>> balteo@gmail.com>
>>>> >>>>>> 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 <ch...@gmail.com>
>>>> >>>>>>>>
>>>> >>>>>>>> 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 <
>>>> balteo@gmail.com>
>>>> >>>>>>>> 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 <ch...@gmail.com>
>>>> >>>>>>>>>>
>>>> >>>>>>>>>> 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 <
>>>> balteo@gmail.com>
>>>> >>>>>>>>>> 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 <ba...@gmail.com>
>>>> >>>>>>>>>>>>
>>>> >>>>>>>>>>>> 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 <ba...@gmail.com>
>>>> >>>>>>>>>>>>>
>>>> >>>>>>>>>>>>> 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é <jb...@nanthrax.net>
>>>> >>>>>>>>>>>>>>
>>>> >>>>>>>>>>>>>> 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 <balteo@gmail.com
>>>> >>>>>>>>>>>>>>> <ma...@gmail.com>>
>>>> >>>>>>>>>>>>>>>
>>>> >>>>>>>>>>>>>>>
>>>> >>>>>>>>>>>>>>>     Thanks to both of you. I'll try as you advised and
>>>> let
>>>> >>>>>>>>>>>>>>> you know.
>>>> >>>>>>>>>>>>>>>     Best regards,
>>>> >>>>>>>>>>>>>>>     J.
>>>> >>>>>>>>>>>>>>>
>>>> >>>>>>>>>>>>>>>
>>>> >>>>>>>>>>>>>>>     2012/8/10 Freeman Fang <freeman.fang@gmail.com
>>>> >>>>>>>>>>>>>>>     <ma...@gmail.com>>
>>>> >>>>>>>>>>>>>>>
>>>> >>>>>>>>>>>>>>>
>>>> >>>>>>>>>>>>>>>         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:ffang@fusesource.com
>>>> >>>>>>>>>>>>>>> <ma...@fusesource.com>
>>>> >>>>>>>>>>>>>>>         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 <balteo@gmail.com
>>>> >>>>>>>>>>>>>>>>         <ma...@gmail.com>>
>>>> >>>>>>>>>>>>>>>>
>>>> >>>>>>>>>>>>>>>>
>>>> >>>>>>>>>>>>>>>>             thanks Achim
>>>> >>>>>>>>>>>>>>>>
>>>> >>>>>>>>>>>>>>>>
>>>> >>>>>>>>>>>>>>>>             2012/8/9 Achim Nierbeck <
>>>> bcanhome@googlemail.com
>>>> >>>>>>>>>>>>>>>>             <ma...@googlemail.com>>
>>>> >>>>>>>>>>>>>>>>
>>>> >>>>>>>>>>>>>>>>
>>>> >>>>>>>>>>>>>>>>                 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 <
>>>> balteo@gmail.com
>>>> >>>>>>>>>>>>>>>>                 <ma...@gmail.com>>:
>>>> >>>>>>>>>>>>>>>>
>>>> >>>>>>>>>>>>>>>>                 > 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
>>>> >>>>>>>>>>>>>>>> <bcanhome@googlemail.com
>>>> >>>>>>>>>>>>>>>>                 <ma...@googlemail.com>>
>>>> >>>>>>>>>>>>>>>>
>>>> >>>>>>>>>>>>>>>>                 >>
>>>> >>>>>>>>>>>>>>>>                 >> 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 <
>>>> balteo@gmail.com
>>>> >>>>>>>>>>>>>>>>                 <ma...@gmail.com>>:
>>>> >>>>>>>>>>>>>>>>
>>>> >>>>>>>>>>>>>>>>                 >> > 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é
>>>> >>>>>>>>>>>>>> jbonofre@apache.org
>>>> >>>>>>>>>>>>>> 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/>
>>>>
>>>
>>>
>>
>>
>> --
>> 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

Re: Embedding a Spring Integration app into Apache Karaf

Posted by Julien Martin <ba...@gmail.com>.
Hi Charles,
Thanks. I actually dropped all my jars into the /deploy folder (for testing
purposes) as advised by Achim.
The real issue I have now is that of the dependency chains...
Regards,
J.

2012/8/13 Charles Moulliard <ch...@gmail.com>

> Hi Julien,
>
> You do not need to wrap the Spring Batch jar file as it is already a
> bundle -->
>
> install -s
> mvn:org.springframework.batch/spring-batch-infrastructure/2.1.8.RELEASE
>
> [  92] [Active     ] [            ] [       ] [   80]
> mvn:org.springframework.batch/spring-batch-infrastructure/2.1.8.RELEASE
>
> Regards,
>
> Charles
>
>
> On Mon, Aug 13, 2012 at 2:57 PM, Julien Martin <ba...@gmail.com> wrote:
>
>> Hi,
>> I am almost there. I dropped the dependencies as well as my app into the
>> /deploy folder. I get a multiple dependency chain problem as follows. Can
>> anyone please help?
>>
>> *C:\system\apache-karaf-2.2.8\bin>karaf*
>> *        __ __                  ____*
>> *       / //_/____ __________ _/ __/*
>> *      / ,<  / __ `/ ___/ __ `/ /_*
>> *     / /| |/ /_/ / /  / /_/ / __/*
>> *    /_/ |_|\__,_/_/   \__,_/_/*
>> *
>> *
>> *  Apache Karaf (2.2.8)*
>> *
>> *
>> *Hit '<tab>' for a list of available commands*
>> *and '[cmd] --help' for help on a specific command.*
>> *Hit '<ctrl-d>' or 'osgi:shutdown' to shutdown Karaf.*
>> *
>> *
>> *karaf@root> ERROR: Bundle org.springframework.batch.test [339] Error
>> starting
>> file:/C:/system/apache-karaf-2.2.8/deploy/spring-batch-test-2.1.8.RELEAS*
>> *E.jar (org.osgi.framework.BundleException: Unable to resolve module
>> org.springframework.batch.core [341.0] because it is exposed to package
>> 'org.sprin*
>> *gframework.context.support' from org.springframework.context [347.0]
>> and org.springframework.context [366.0] via two dependency chains.*
>> *
>> *
>> *Chain 1:*
>> *  org.springframework.batch.core [341.0]*
>> *    import:
>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>> *
>> *     |*
>> *    export: package=org.springframework.context.support*
>> *  org.springframework.context [347.0]*
>> *
>> *
>> *Chain 2:*
>> *  org.springframework.batch.core [341.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 [373.0]*
>> *    import:
>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>> *
>> *     |*
>> *    export: package=org.springframework.context.support*
>> *  org.springframework.context [366.0])*
>> *org.osgi.framework.BundleException: Unable to resolve module
>> org.springframework.batch.core [341.0] because it is exposed to package
>> 'org.springframew*
>> *ork.context.support' from org.springframework.context [347.0] and
>> org.springframework.context [366.0] via two dependency chains.*
>> *
>> *
>> *Chain 1:*
>> *  org.springframework.batch.core [341.0]*
>>  *    import:
>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>> *
>> *     |*
>> *    export: package=org.springframework.context.support*
>>  *  org.springframework.context [347.0]*
>> *
>> *
>> *Chain 2:*
>> *  org.springframework.batch.core [341.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 [373.0]*
>> *    import:
>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>> *
>> *     |*
>> *    export: package=org.springframework.context.support*
>> *  org.springframework.context [366.0]*
>> *        at
>> org.apache.felix.framework.Felix.resolveBundle(Felix.java:3452)*
>> *        at org.apache.felix.framework.Felix.startBundle(Felix.java:1734)
>> *
>> *        at
>> org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1163)*
>> *        at
>> org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264)*
>> *        at java.lang.Thread.run(Thread.java:662)*
>> *ERROR: Bundle org.springframework.batch.core [341] Error starting
>> file:/C:/system/apache-karaf-2.2.8/deploy/spring-batch-core-2.1.8.RELEASE.jar
>> (org.o*
>> *sgi.framework.BundleException: Unable to resolve module
>> org.springframework.batch.core [341.0] because it is exposed to package
>> 'org.springframework.c*
>> *ontext.support' from org.springframework.context [347.0] and
>> org.springframework.context [366.0] via two dependency chains.*
>> *
>> *
>> *Chain 1:*
>> *  org.springframework.batch.core [341.0]*
>> *    import:
>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>> *
>> *     |*
>> *    export: package=org.springframework.context.support*
>> *  org.springframework.context [347.0]*
>> *
>> *
>> *Chain 2:*
>> *  org.springframework.batch.core [341.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 [373.0]*
>> *    import:
>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>> *
>> *     |*
>> *    export: package=org.springframework.context.support*
>> *  org.springframework.context [366.0])*
>> *org.osgi.framework.BundleException: Unable to resolve module
>> org.springframework.batch.core [341.0] because it is exposed to package
>> 'org.springframew*
>> *ork.context.support' from org.springframework.context [347.0] and
>> org.springframework.context [366.0] via two dependency chains.*
>> *
>> *
>> *Chain 1:*
>> *  org.springframework.batch.core [341.0]*
>>  *    import:
>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>> *
>> *     |*
>> *    export: package=org.springframework.context.support*
>>  *  org.springframework.context [347.0]*
>> *
>> *
>> *Chain 2:*
>> *  org.springframework.batch.core [341.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 [373.0]*
>> *    import:
>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>> *
>> *     |*
>> *    export: package=org.springframework.context.support*
>> *  org.springframework.context [366.0]*
>> *        at
>> org.apache.felix.framework.Felix.resolveBundle(Felix.java:3452)*
>> *        at org.apache.felix.framework.Felix.startBundle(Felix.java:1734)
>> *
>> *        at
>> org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1163)*
>> *        at
>> org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264)*
>> *        at java.lang.Thread.run(Thread.java:662)*
>> *ERROR: Bundle org.springframework.batch.integration [342] Error
>> starting
>> file:/C:/system/apache-karaf-2.2.8/deploy/spring-batch-integration-1.2.1.RELE
>> *
>> *ASE.jar (org.osgi.framework.BundleException: Unable to resolve module
>> org.springframework.batch.core [341.0] because it is exposed to package
>> 'org.spr*
>> *ingframework.context.support' from org.springframework.context [347.0]
>> and org.springframework.context [366.0] via two dependency chains.*
>> *
>> *
>> *Chain 1:*
>> *  org.springframework.batch.core [341.0]*
>> *    import:
>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>> *
>> *     |*
>> *    export: package=org.springframework.context.support*
>> *  org.springframework.context [347.0]*
>> *
>> *
>> *Chain 2:*
>> *  org.springframework.batch.core [341.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 [373.0]*
>> *    import:
>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>> *
>> *     |*
>> *    export: package=org.springframework.context.support*
>> *  org.springframework.context [366.0])*
>> *org.osgi.framework.BundleException: Unable to resolve module
>> org.springframework.batch.core [341.0] because it is exposed to package
>> 'org.springframew*
>> *ork.context.support' from org.springframework.context [347.0] and
>> org.springframework.context [366.0] via two dependency chains.*
>> *
>> *
>> *Chain 1:*
>> *  org.springframework.batch.core [341.0]*
>>  *    import:
>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>> *
>> *     |*
>> *    export: package=org.springframework.context.support*
>>  *  org.springframework.context [347.0]*
>> *
>> *
>> *Chain 2:*
>> *  org.springframework.batch.core [341.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 [373.0]*
>> *    import:
>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>> *
>> *     |*
>> *    export: package=org.springframework.context.support*
>> *  org.springframework.context [366.0]*
>> *        at
>> org.apache.felix.framework.Felix.resolveBundle(Felix.java:3452)*
>> *        at org.apache.felix.framework.Felix.startBundle(Felix.java:1734)
>> *
>> *        at
>> org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1163)*
>> *        at
>> org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264)*
>> *        at java.lang.Thread.run(Thread.java:662)*
>> *ERROR: Bundle spring-batch-demo-trc-dm [368] Error starting
>> file:/C:/system/apache-karaf-2.2.8/deploy/spring-batch-demo-trc-dm-1.0.0-SNAPSHOT.jar
>> (org*
>> *.osgi.framework.BundleException: Unable to resolve module
>> org.springframework.batch.core [341.0] because it is exposed to package
>> 'org.springframework*
>> *.context.support' from org.springframework.context [347.0] and
>> org.springframework.context [366.0] via two dependency chains.*
>> *
>> *
>> *Chain 1:*
>> *  org.springframework.batch.core [341.0]*
>> *    import:
>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>> *
>> *     |*
>> *    export: package=org.springframework.context.support*
>> *  org.springframework.context [347.0]*
>> *
>> *
>> *Chain 2:*
>> *  org.springframework.batch.core [341.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 [373.0]*
>> *    import:
>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>> *
>> *     |*
>> *    export: package=org.springframework.context.support*
>> *  org.springframework.context [366.0])*
>> *org.osgi.framework.BundleException: Unable to resolve module
>> org.springframework.batch.core [341.0] because it is exposed to package
>> 'org.springframew*
>> *ork.context.support' from org.springframework.context [347.0] and
>> org.springframework.context [366.0] via two dependency chains.*
>> *
>> *
>> *Chain 1:*
>> *  org.springframework.batch.core [341.0]*
>>  *    import:
>> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
>> *
>> *     |*
>> *    export: package=org.springframework.context.support*
>>  *  org.springframework.context [347.0]*
>> *
>> *
>> *Chain 2:*
>> *  org.springframework.batch.core [341.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 [373.0]*
>> *    import:
>> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
>> *
>> *     |*
>> *    export: package=org.springframework.context.support*
>> *  org.springframework.context [366.0]*
>> *        at
>> org.apache.felix.framework.Felix.resolveBundle(Felix.java:3452)*
>> *        at org.apache.felix.framework.Felix.startBundle(Felix.java:1734)
>> *
>> *        at
>> org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1163)*
>> *        at
>> org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264)*
>> *        at java.lang.Thread.run(Thread.java:662)*
>> *Exception in thread "Thread-16" java.lang.IllegalArgumentException:
>> Cannot write resource: org/xmlpull/mxp1/MXParser.class :43114: exception:
>> java.io.*
>> *IOException: Pipe closed*
>> *        at aQute.lib.osgi.Jar.writeResource(Jar.java:302)*
>> *        at aQute.lib.osgi.Jar.write(Jar.java:211)*
>> *        at org.ops4j.pax.swissbox.bnd.BndUtils$1.run(BndUtils.java:174)*
>> *^C*
>> *karaf@root>*
>>
>>
>> 2012/8/13 Achim Nierbeck <bc...@googlemail.com>
>>
>>> 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 <ba...@gmail.com>:
>>> > 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 <ch...@gmail.com>
>>> >>
>>> >> 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 <ba...@gmail.com>
>>> 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 <ch...@gmail.com>
>>> >>>>
>>> >>>> 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 <ba...@gmail.com>
>>> wrote:
>>> >>>>>
>>> >>>>> How do I install the Spring batch jars/bundle into Karaf?
>>> >>>>> Regards,
>>> >>>>> J.
>>> >>>>>
>>> >>>>> 2012/8/13 Charles Moulliard <ch...@gmail.com>
>>> >>>>>>
>>> >>>>>> 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 <balteo@gmail.com
>>> >
>>> >>>>>> 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 <ch...@gmail.com>
>>> >>>>>>>>
>>> >>>>>>>> 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 <
>>> balteo@gmail.com>
>>> >>>>>>>> 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 <ch...@gmail.com>
>>> >>>>>>>>>>
>>> >>>>>>>>>> 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 <
>>> balteo@gmail.com>
>>> >>>>>>>>>> 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 <ba...@gmail.com>
>>> >>>>>>>>>>>>
>>> >>>>>>>>>>>> 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 <ba...@gmail.com>
>>> >>>>>>>>>>>>>
>>> >>>>>>>>>>>>> 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é <jb...@nanthrax.net>
>>> >>>>>>>>>>>>>>
>>> >>>>>>>>>>>>>> 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 <balteo@gmail.com
>>> >>>>>>>>>>>>>>> <ma...@gmail.com>>
>>> >>>>>>>>>>>>>>>
>>> >>>>>>>>>>>>>>>
>>> >>>>>>>>>>>>>>>     Thanks to both of you. I'll try as you advised and
>>> let
>>> >>>>>>>>>>>>>>> you know.
>>> >>>>>>>>>>>>>>>     Best regards,
>>> >>>>>>>>>>>>>>>     J.
>>> >>>>>>>>>>>>>>>
>>> >>>>>>>>>>>>>>>
>>> >>>>>>>>>>>>>>>     2012/8/10 Freeman Fang <freeman.fang@gmail.com
>>> >>>>>>>>>>>>>>>     <ma...@gmail.com>>
>>> >>>>>>>>>>>>>>>
>>> >>>>>>>>>>>>>>>
>>> >>>>>>>>>>>>>>>         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:ffang@fusesource.com
>>> >>>>>>>>>>>>>>> <ma...@fusesource.com>
>>> >>>>>>>>>>>>>>>         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 <balteo@gmail.com
>>> >>>>>>>>>>>>>>>>         <ma...@gmail.com>>
>>> >>>>>>>>>>>>>>>>
>>> >>>>>>>>>>>>>>>>
>>> >>>>>>>>>>>>>>>>             thanks Achim
>>> >>>>>>>>>>>>>>>>
>>> >>>>>>>>>>>>>>>>
>>> >>>>>>>>>>>>>>>>             2012/8/9 Achim Nierbeck <
>>> bcanhome@googlemail.com
>>> >>>>>>>>>>>>>>>>             <ma...@googlemail.com>>
>>> >>>>>>>>>>>>>>>>
>>> >>>>>>>>>>>>>>>>
>>> >>>>>>>>>>>>>>>>                 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 <
>>> balteo@gmail.com
>>> >>>>>>>>>>>>>>>>                 <ma...@gmail.com>>:
>>> >>>>>>>>>>>>>>>>
>>> >>>>>>>>>>>>>>>>                 > 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
>>> >>>>>>>>>>>>>>>> <bcanhome@googlemail.com
>>> >>>>>>>>>>>>>>>>                 <ma...@googlemail.com>>
>>> >>>>>>>>>>>>>>>>
>>> >>>>>>>>>>>>>>>>                 >>
>>> >>>>>>>>>>>>>>>>                 >> 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 <
>>> balteo@gmail.com
>>> >>>>>>>>>>>>>>>>                 <ma...@gmail.com>>:
>>> >>>>>>>>>>>>>>>>
>>> >>>>>>>>>>>>>>>>                 >> > 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é
>>> >>>>>>>>>>>>>> jbonofre@apache.org
>>> >>>>>>>>>>>>>> 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/>
>>>
>>
>>
>
>
> --
> Charles Moulliard
> Apache Committer / Sr. Pr. Consultant at FuseSource.com
> Twitter : @cmoulliard
> Blog : http://cmoulliard.blogspot.com
>
>
>

Re: Embedding a Spring Integration app into Apache Karaf

Posted by Charles Moulliard <ch...@gmail.com>.
Hi Julien,

You do not need to wrap the Spring Batch jar file as it is already a bundle
-->

install -s
mvn:org.springframework.batch/spring-batch-infrastructure/2.1.8.RELEASE

[  92] [Active     ] [            ] [       ] [   80]
mvn:org.springframework.batch/spring-batch-infrastructure/2.1.8.RELEASE

Regards,

Charles


On Mon, Aug 13, 2012 at 2:57 PM, Julien Martin <ba...@gmail.com> wrote:

> Hi,
> I am almost there. I dropped the dependencies as well as my app into the
> /deploy folder. I get a multiple dependency chain problem as follows. Can
> anyone please help?
>
> *C:\system\apache-karaf-2.2.8\bin>karaf*
> *        __ __                  ____*
> *       / //_/____ __________ _/ __/*
> *      / ,<  / __ `/ ___/ __ `/ /_*
> *     / /| |/ /_/ / /  / /_/ / __/*
> *    /_/ |_|\__,_/_/   \__,_/_/*
> *
> *
> *  Apache Karaf (2.2.8)*
> *
> *
> *Hit '<tab>' for a list of available commands*
> *and '[cmd] --help' for help on a specific command.*
> *Hit '<ctrl-d>' or 'osgi:shutdown' to shutdown Karaf.*
> *
> *
> *karaf@root> ERROR: Bundle org.springframework.batch.test [339] Error
> starting
> file:/C:/system/apache-karaf-2.2.8/deploy/spring-batch-test-2.1.8.RELEAS*
> *E.jar (org.osgi.framework.BundleException: Unable to resolve module
> org.springframework.batch.core [341.0] because it is exposed to package
> 'org.sprin*
> *gframework.context.support' from org.springframework.context [347.0] and
> org.springframework.context [366.0] via two dependency chains.*
> *
> *
> *Chain 1:*
> *  org.springframework.batch.core [341.0]*
> *    import:
> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
> *
> *     |*
> *    export: package=org.springframework.context.support*
> *  org.springframework.context [347.0]*
> *
> *
> *Chain 2:*
> *  org.springframework.batch.core [341.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 [373.0]*
> *    import:
> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
> *
> *     |*
> *    export: package=org.springframework.context.support*
> *  org.springframework.context [366.0])*
> *org.osgi.framework.BundleException: Unable to resolve module
> org.springframework.batch.core [341.0] because it is exposed to package
> 'org.springframew*
> *ork.context.support' from org.springframework.context [347.0] and
> org.springframework.context [366.0] via two dependency chains.*
> *
> *
> *Chain 1:*
> *  org.springframework.batch.core [341.0]*
> *    import:
> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
> *
> *     |*
> *    export: package=org.springframework.context.support*
> *  org.springframework.context [347.0]*
> *
> *
> *Chain 2:*
> *  org.springframework.batch.core [341.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 [373.0]*
> *    import:
> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
> *
> *     |*
> *    export: package=org.springframework.context.support*
> *  org.springframework.context [366.0]*
> *        at
> org.apache.felix.framework.Felix.resolveBundle(Felix.java:3452)*
> *        at org.apache.felix.framework.Felix.startBundle(Felix.java:1734)*
> *        at
> org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1163)*
> *        at
> org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264)*
> *        at java.lang.Thread.run(Thread.java:662)*
> *ERROR: Bundle org.springframework.batch.core [341] Error starting
> file:/C:/system/apache-karaf-2.2.8/deploy/spring-batch-core-2.1.8.RELEASE.jar
> (org.o*
> *sgi.framework.BundleException: Unable to resolve module
> org.springframework.batch.core [341.0] because it is exposed to package
> 'org.springframework.c*
> *ontext.support' from org.springframework.context [347.0] and
> org.springframework.context [366.0] via two dependency chains.*
> *
> *
> *Chain 1:*
> *  org.springframework.batch.core [341.0]*
> *    import:
> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
> *
> *     |*
> *    export: package=org.springframework.context.support*
> *  org.springframework.context [347.0]*
> *
> *
> *Chain 2:*
> *  org.springframework.batch.core [341.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 [373.0]*
> *    import:
> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
> *
> *     |*
> *    export: package=org.springframework.context.support*
> *  org.springframework.context [366.0])*
> *org.osgi.framework.BundleException: Unable to resolve module
> org.springframework.batch.core [341.0] because it is exposed to package
> 'org.springframew*
> *ork.context.support' from org.springframework.context [347.0] and
> org.springframework.context [366.0] via two dependency chains.*
> *
> *
> *Chain 1:*
> *  org.springframework.batch.core [341.0]*
> *    import:
> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
> *
> *     |*
> *    export: package=org.springframework.context.support*
> *  org.springframework.context [347.0]*
> *
> *
> *Chain 2:*
> *  org.springframework.batch.core [341.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 [373.0]*
> *    import:
> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
> *
> *     |*
> *    export: package=org.springframework.context.support*
> *  org.springframework.context [366.0]*
> *        at
> org.apache.felix.framework.Felix.resolveBundle(Felix.java:3452)*
> *        at org.apache.felix.framework.Felix.startBundle(Felix.java:1734)*
> *        at
> org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1163)*
> *        at
> org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264)*
> *        at java.lang.Thread.run(Thread.java:662)*
> *ERROR: Bundle org.springframework.batch.integration [342] Error starting
> file:/C:/system/apache-karaf-2.2.8/deploy/spring-batch-integration-1.2.1.RELE
> *
> *ASE.jar (org.osgi.framework.BundleException: Unable to resolve module
> org.springframework.batch.core [341.0] because it is exposed to package
> 'org.spr*
> *ingframework.context.support' from org.springframework.context [347.0]
> and org.springframework.context [366.0] via two dependency chains.*
> *
> *
> *Chain 1:*
> *  org.springframework.batch.core [341.0]*
> *    import:
> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
> *
> *     |*
> *    export: package=org.springframework.context.support*
> *  org.springframework.context [347.0]*
> *
> *
> *Chain 2:*
> *  org.springframework.batch.core [341.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 [373.0]*
> *    import:
> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
> *
> *     |*
> *    export: package=org.springframework.context.support*
> *  org.springframework.context [366.0])*
> *org.osgi.framework.BundleException: Unable to resolve module
> org.springframework.batch.core [341.0] because it is exposed to package
> 'org.springframew*
> *ork.context.support' from org.springframework.context [347.0] and
> org.springframework.context [366.0] via two dependency chains.*
> *
> *
> *Chain 1:*
> *  org.springframework.batch.core [341.0]*
> *    import:
> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
> *
> *     |*
> *    export: package=org.springframework.context.support*
> *  org.springframework.context [347.0]*
> *
> *
> *Chain 2:*
> *  org.springframework.batch.core [341.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 [373.0]*
> *    import:
> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
> *
> *     |*
> *    export: package=org.springframework.context.support*
> *  org.springframework.context [366.0]*
> *        at
> org.apache.felix.framework.Felix.resolveBundle(Felix.java:3452)*
> *        at org.apache.felix.framework.Felix.startBundle(Felix.java:1734)*
> *        at
> org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1163)*
> *        at
> org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264)*
> *        at java.lang.Thread.run(Thread.java:662)*
> *ERROR: Bundle spring-batch-demo-trc-dm [368] Error starting
> file:/C:/system/apache-karaf-2.2.8/deploy/spring-batch-demo-trc-dm-1.0.0-SNAPSHOT.jar
> (org*
> *.osgi.framework.BundleException: Unable to resolve module
> org.springframework.batch.core [341.0] because it is exposed to package
> 'org.springframework*
> *.context.support' from org.springframework.context [347.0] and
> org.springframework.context [366.0] via two dependency chains.*
> *
> *
> *Chain 1:*
> *  org.springframework.batch.core [341.0]*
> *    import:
> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
> *
> *     |*
> *    export: package=org.springframework.context.support*
> *  org.springframework.context [347.0]*
> *
> *
> *Chain 2:*
> *  org.springframework.batch.core [341.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 [373.0]*
> *    import:
> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
> *
> *     |*
> *    export: package=org.springframework.context.support*
> *  org.springframework.context [366.0])*
> *org.osgi.framework.BundleException: Unable to resolve module
> org.springframework.batch.core [341.0] because it is exposed to package
> 'org.springframew*
> *ork.context.support' from org.springframework.context [347.0] and
> org.springframework.context [366.0] via two dependency chains.*
> *
> *
> *Chain 1:*
> *  org.springframework.batch.core [341.0]*
> *    import:
> (&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
> *
> *     |*
> *    export: package=org.springframework.context.support*
> *  org.springframework.context [347.0]*
> *
> *
> *Chain 2:*
> *  org.springframework.batch.core [341.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 [373.0]*
> *    import:
> (&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
> *
> *     |*
> *    export: package=org.springframework.context.support*
> *  org.springframework.context [366.0]*
> *        at
> org.apache.felix.framework.Felix.resolveBundle(Felix.java:3452)*
> *        at org.apache.felix.framework.Felix.startBundle(Felix.java:1734)*
> *        at
> org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1163)*
> *        at
> org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264)*
> *        at java.lang.Thread.run(Thread.java:662)*
> *Exception in thread "Thread-16" java.lang.IllegalArgumentException:
> Cannot write resource: org/xmlpull/mxp1/MXParser.class :43114: exception:
> java.io.*
> *IOException: Pipe closed*
> *        at aQute.lib.osgi.Jar.writeResource(Jar.java:302)*
> *        at aQute.lib.osgi.Jar.write(Jar.java:211)*
> *        at org.ops4j.pax.swissbox.bnd.BndUtils$1.run(BndUtils.java:174)*
> *^C*
> *karaf@root>*
>
>
> 2012/8/13 Achim Nierbeck <bc...@googlemail.com>
>
>> 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 <ba...@gmail.com>:
>> > 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 <ch...@gmail.com>
>> >>
>> >> 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 <ba...@gmail.com>
>> 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 <ch...@gmail.com>
>> >>>>
>> >>>> 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 <ba...@gmail.com>
>> wrote:
>> >>>>>
>> >>>>> How do I install the Spring batch jars/bundle into Karaf?
>> >>>>> Regards,
>> >>>>> J.
>> >>>>>
>> >>>>> 2012/8/13 Charles Moulliard <ch...@gmail.com>
>> >>>>>>
>> >>>>>> 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 <ba...@gmail.com>
>> >>>>>> 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 <ch...@gmail.com>
>> >>>>>>>>
>> >>>>>>>> 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 <
>> balteo@gmail.com>
>> >>>>>>>> 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 <ch...@gmail.com>
>> >>>>>>>>>>
>> >>>>>>>>>> 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 <
>> balteo@gmail.com>
>> >>>>>>>>>> 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 <ba...@gmail.com>
>> >>>>>>>>>>>>
>> >>>>>>>>>>>> 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 <ba...@gmail.com>
>> >>>>>>>>>>>>>
>> >>>>>>>>>>>>> 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é <jb...@nanthrax.net>
>> >>>>>>>>>>>>>>
>> >>>>>>>>>>>>>> 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 <balteo@gmail.com
>> >>>>>>>>>>>>>>> <ma...@gmail.com>>
>> >>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>     Thanks to both of you. I'll try as you advised and let
>> >>>>>>>>>>>>>>> you know.
>> >>>>>>>>>>>>>>>     Best regards,
>> >>>>>>>>>>>>>>>     J.
>> >>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>     2012/8/10 Freeman Fang <freeman.fang@gmail.com
>> >>>>>>>>>>>>>>>     <ma...@gmail.com>>
>> >>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>         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:ffang@fusesource.com
>> >>>>>>>>>>>>>>> <ma...@fusesource.com>
>> >>>>>>>>>>>>>>>         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 <balteo@gmail.com
>> >>>>>>>>>>>>>>>>         <ma...@gmail.com>>
>> >>>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>>             thanks Achim
>> >>>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>>             2012/8/9 Achim Nierbeck <
>> bcanhome@googlemail.com
>> >>>>>>>>>>>>>>>>             <ma...@googlemail.com>>
>> >>>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>>                 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 <balteo@gmail.com
>> >>>>>>>>>>>>>>>>                 <ma...@gmail.com>>:
>> >>>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>>                 > 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
>> >>>>>>>>>>>>>>>> <bcanhome@googlemail.com
>> >>>>>>>>>>>>>>>>                 <ma...@googlemail.com>>
>> >>>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>>                 >>
>> >>>>>>>>>>>>>>>>                 >> 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 <
>> balteo@gmail.com
>> >>>>>>>>>>>>>>>>                 <ma...@gmail.com>>:
>> >>>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>>                 >> > 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é
>> >>>>>>>>>>>>>> jbonofre@apache.org
>> >>>>>>>>>>>>>> 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/>
>>
>
>


-- 
Charles Moulliard
Apache Committer / Sr. Pr. Consultant at FuseSource.com
Twitter : @cmoulliard
Blog : http://cmoulliard.blogspot.com

Re: Embedding a Spring Integration app into Apache Karaf

Posted by Julien Martin <ba...@gmail.com>.
Hi,
I am almost there. I dropped the dependencies as well as my app into the
/deploy folder. I get a multiple dependency chain problem as follows. Can
anyone please help?

*C:\system\apache-karaf-2.2.8\bin>karaf*
*        __ __                  ____*
*       / //_/____ __________ _/ __/*
*      / ,<  / __ `/ ___/ __ `/ /_*
*     / /| |/ /_/ / /  / /_/ / __/*
*    /_/ |_|\__,_/_/   \__,_/_/*
*
*
*  Apache Karaf (2.2.8)*
*
*
*Hit '<tab>' for a list of available commands*
*and '[cmd] --help' for help on a specific command.*
*Hit '<ctrl-d>' or 'osgi:shutdown' to shutdown Karaf.*
*
*
*karaf@root> ERROR: Bundle org.springframework.batch.test [339] Error
starting
file:/C:/system/apache-karaf-2.2.8/deploy/spring-batch-test-2.1.8.RELEAS*
*E.jar (org.osgi.framework.BundleException: Unable to resolve module
org.springframework.batch.core [341.0] because it is exposed to package
'org.sprin*
*gframework.context.support' from org.springframework.context [347.0] and
org.springframework.context [366.0] via two dependency chains.*
*
*
*Chain 1:*
*  org.springframework.batch.core [341.0]*
*    import:
(&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
*
*     |*
*    export: package=org.springframework.context.support*
*  org.springframework.context [347.0]*
*
*
*Chain 2:*
*  org.springframework.batch.core [341.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 [373.0]*
*    import:
(&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
*
*     |*
*    export: package=org.springframework.context.support*
*  org.springframework.context [366.0])*
*org.osgi.framework.BundleException: Unable to resolve module
org.springframework.batch.core [341.0] because it is exposed to package
'org.springframew*
*ork.context.support' from org.springframework.context [347.0] and
org.springframework.context [366.0] via two dependency chains.*
*
*
*Chain 1:*
*  org.springframework.batch.core [341.0]*
*    import:
(&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
*
*     |*
*    export: package=org.springframework.context.support*
*  org.springframework.context [347.0]*
*
*
*Chain 2:*
*  org.springframework.batch.core [341.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 [373.0]*
*    import:
(&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
*
*     |*
*    export: package=org.springframework.context.support*
*  org.springframework.context [366.0]*
*        at org.apache.felix.framework.Felix.resolveBundle(Felix.java:3452)*
*        at org.apache.felix.framework.Felix.startBundle(Felix.java:1734)*
*        at
org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1163)*
*        at
org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264)*
*        at java.lang.Thread.run(Thread.java:662)*
*ERROR: Bundle org.springframework.batch.core [341] Error starting
file:/C:/system/apache-karaf-2.2.8/deploy/spring-batch-core-2.1.8.RELEASE.jar
(org.o*
*sgi.framework.BundleException: Unable to resolve module
org.springframework.batch.core [341.0] because it is exposed to package
'org.springframework.c*
*ontext.support' from org.springframework.context [347.0] and
org.springframework.context [366.0] via two dependency chains.*
*
*
*Chain 1:*
*  org.springframework.batch.core [341.0]*
*    import:
(&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
*
*     |*
*    export: package=org.springframework.context.support*
*  org.springframework.context [347.0]*
*
*
*Chain 2:*
*  org.springframework.batch.core [341.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 [373.0]*
*    import:
(&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
*
*     |*
*    export: package=org.springframework.context.support*
*  org.springframework.context [366.0])*
*org.osgi.framework.BundleException: Unable to resolve module
org.springframework.batch.core [341.0] because it is exposed to package
'org.springframew*
*ork.context.support' from org.springframework.context [347.0] and
org.springframework.context [366.0] via two dependency chains.*
*
*
*Chain 1:*
*  org.springframework.batch.core [341.0]*
*    import:
(&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
*
*     |*
*    export: package=org.springframework.context.support*
*  org.springframework.context [347.0]*
*
*
*Chain 2:*
*  org.springframework.batch.core [341.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 [373.0]*
*    import:
(&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
*
*     |*
*    export: package=org.springframework.context.support*
*  org.springframework.context [366.0]*
*        at org.apache.felix.framework.Felix.resolveBundle(Felix.java:3452)*
*        at org.apache.felix.framework.Felix.startBundle(Felix.java:1734)*
*        at
org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1163)*
*        at
org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264)*
*        at java.lang.Thread.run(Thread.java:662)*
*ERROR: Bundle org.springframework.batch.integration [342] Error starting
file:/C:/system/apache-karaf-2.2.8/deploy/spring-batch-integration-1.2.1.RELE
*
*ASE.jar (org.osgi.framework.BundleException: Unable to resolve module
org.springframework.batch.core [341.0] because it is exposed to package
'org.spr*
*ingframework.context.support' from org.springframework.context [347.0] and
org.springframework.context [366.0] via two dependency chains.*
*
*
*Chain 1:*
*  org.springframework.batch.core [341.0]*
*    import:
(&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
*
*     |*
*    export: package=org.springframework.context.support*
*  org.springframework.context [347.0]*
*
*
*Chain 2:*
*  org.springframework.batch.core [341.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 [373.0]*
*    import:
(&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
*
*     |*
*    export: package=org.springframework.context.support*
*  org.springframework.context [366.0])*
*org.osgi.framework.BundleException: Unable to resolve module
org.springframework.batch.core [341.0] because it is exposed to package
'org.springframew*
*ork.context.support' from org.springframework.context [347.0] and
org.springframework.context [366.0] via two dependency chains.*
*
*
*Chain 1:*
*  org.springframework.batch.core [341.0]*
*    import:
(&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
*
*     |*
*    export: package=org.springframework.context.support*
*  org.springframework.context [347.0]*
*
*
*Chain 2:*
*  org.springframework.batch.core [341.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 [373.0]*
*    import:
(&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
*
*     |*
*    export: package=org.springframework.context.support*
*  org.springframework.context [366.0]*
*        at org.apache.felix.framework.Felix.resolveBundle(Felix.java:3452)*
*        at org.apache.felix.framework.Felix.startBundle(Felix.java:1734)*
*        at
org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1163)*
*        at
org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264)*
*        at java.lang.Thread.run(Thread.java:662)*
*ERROR: Bundle spring-batch-demo-trc-dm [368] Error starting
file:/C:/system/apache-karaf-2.2.8/deploy/spring-batch-demo-trc-dm-1.0.0-SNAPSHOT.jar
(org*
*.osgi.framework.BundleException: Unable to resolve module
org.springframework.batch.core [341.0] because it is exposed to package
'org.springframework*
*.context.support' from org.springframework.context [347.0] and
org.springframework.context [366.0] via two dependency chains.*
*
*
*Chain 1:*
*  org.springframework.batch.core [341.0]*
*    import:
(&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
*
*     |*
*    export: package=org.springframework.context.support*
*  org.springframework.context [347.0]*
*
*
*Chain 2:*
*  org.springframework.batch.core [341.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 [373.0]*
*    import:
(&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
*
*     |*
*    export: package=org.springframework.context.support*
*  org.springframework.context [366.0])*
*org.osgi.framework.BundleException: Unable to resolve module
org.springframework.batch.core [341.0] because it is exposed to package
'org.springframew*
*ork.context.support' from org.springframework.context [347.0] and
org.springframework.context [366.0] via two dependency chains.*
*
*
*Chain 1:*
*  org.springframework.batch.core [341.0]*
*    import:
(&(package=org.springframework.context.support)(version>=2.5.5)(!(version>=4.0.0)))
*
*     |*
*    export: package=org.springframework.context.support*
*  org.springframework.context [347.0]*
*
*
*Chain 2:*
*  org.springframework.batch.core [341.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 [373.0]*
*    import:
(&(package=org.springframework.context.support)(version>=2.5.6)(!(version>=4.0.0)))
*
*     |*
*    export: package=org.springframework.context.support*
*  org.springframework.context [366.0]*
*        at org.apache.felix.framework.Felix.resolveBundle(Felix.java:3452)*
*        at org.apache.felix.framework.Felix.startBundle(Felix.java:1734)*
*        at
org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1163)*
*        at
org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264)*
*        at java.lang.Thread.run(Thread.java:662)*
*Exception in thread "Thread-16" java.lang.IllegalArgumentException: Cannot
write resource: org/xmlpull/mxp1/MXParser.class :43114: exception: java.io.*
*IOException: Pipe closed*
*        at aQute.lib.osgi.Jar.writeResource(Jar.java:302)*
*        at aQute.lib.osgi.Jar.write(Jar.java:211)*
*        at org.ops4j.pax.swissbox.bnd.BndUtils$1.run(BndUtils.java:174)*
*^C*
*karaf@root>*


2012/8/13 Achim Nierbeck <bc...@googlemail.com>

> 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 <ba...@gmail.com>:
> > 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 <ch...@gmail.com>
> >>
> >> 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 <ba...@gmail.com>
> 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 <ch...@gmail.com>
> >>>>
> >>>> 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 <ba...@gmail.com>
> wrote:
> >>>>>
> >>>>> How do I install the Spring batch jars/bundle into Karaf?
> >>>>> Regards,
> >>>>> J.
> >>>>>
> >>>>> 2012/8/13 Charles Moulliard <ch...@gmail.com>
> >>>>>>
> >>>>>> 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 <ba...@gmail.com>
> >>>>>> 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 <ch...@gmail.com>
> >>>>>>>>
> >>>>>>>> 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 <balteo@gmail.com
> >
> >>>>>>>> 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 <ch...@gmail.com>
> >>>>>>>>>>
> >>>>>>>>>> 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 <
> balteo@gmail.com>
> >>>>>>>>>> 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 <ba...@gmail.com>
> >>>>>>>>>>>>
> >>>>>>>>>>>> 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 <ba...@gmail.com>
> >>>>>>>>>>>>>
> >>>>>>>>>>>>> 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é <jb...@nanthrax.net>
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>> 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 <balteo@gmail.com
> >>>>>>>>>>>>>>> <ma...@gmail.com>>
> >>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>     Thanks to both of you. I'll try as you advised and let
> >>>>>>>>>>>>>>> you know.
> >>>>>>>>>>>>>>>     Best regards,
> >>>>>>>>>>>>>>>     J.
> >>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>     2012/8/10 Freeman Fang <freeman.fang@gmail.com
> >>>>>>>>>>>>>>>     <ma...@gmail.com>>
> >>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>         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:ffang@fusesource.com
> >>>>>>>>>>>>>>> <ma...@fusesource.com>
> >>>>>>>>>>>>>>>         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 <balteo@gmail.com
> >>>>>>>>>>>>>>>>         <ma...@gmail.com>>
> >>>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>>             thanks Achim
> >>>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>>             2012/8/9 Achim Nierbeck <
> bcanhome@googlemail.com
> >>>>>>>>>>>>>>>>             <ma...@googlemail.com>>
> >>>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>>                 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 <balteo@gmail.com
> >>>>>>>>>>>>>>>>                 <ma...@gmail.com>>:
> >>>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>>                 > 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
> >>>>>>>>>>>>>>>> <bcanhome@googlemail.com
> >>>>>>>>>>>>>>>>                 <ma...@googlemail.com>>
> >>>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>>                 >>
> >>>>>>>>>>>>>>>>                 >> 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 <
> balteo@gmail.com
> >>>>>>>>>>>>>>>>                 <ma...@gmail.com>>:
> >>>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>>                 >> > 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é
> >>>>>>>>>>>>>> jbonofre@apache.org
> >>>>>>>>>>>>>> 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/>
>

Re: Embedding a Spring Integration app into Apache Karaf

Posted by Achim Nierbeck <bc...@googlemail.com>.
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 <ba...@gmail.com>:
> 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 <ch...@gmail.com>
>>
>> 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 <ba...@gmail.com> 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 <ch...@gmail.com>
>>>>
>>>> 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 <ba...@gmail.com> wrote:
>>>>>
>>>>> How do I install the Spring batch jars/bundle into Karaf?
>>>>> Regards,
>>>>> J.
>>>>>
>>>>> 2012/8/13 Charles Moulliard <ch...@gmail.com>
>>>>>>
>>>>>> 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 <ba...@gmail.com>
>>>>>> 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 <ch...@gmail.com>
>>>>>>>>
>>>>>>>> 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 <ba...@gmail.com>
>>>>>>>> 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 <ch...@gmail.com>
>>>>>>>>>>
>>>>>>>>>> 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 <ba...@gmail.com>
>>>>>>>>>> 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 <ba...@gmail.com>
>>>>>>>>>>>>
>>>>>>>>>>>> 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 <ba...@gmail.com>
>>>>>>>>>>>>>
>>>>>>>>>>>>> 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é <jb...@nanthrax.net>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> 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 <balteo@gmail.com
>>>>>>>>>>>>>>> <ma...@gmail.com>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>     Thanks to both of you. I'll try as you advised and let
>>>>>>>>>>>>>>> you know.
>>>>>>>>>>>>>>>     Best regards,
>>>>>>>>>>>>>>>     J.
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>     2012/8/10 Freeman Fang <freeman.fang@gmail.com
>>>>>>>>>>>>>>>     <ma...@gmail.com>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>         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:ffang@fusesource.com
>>>>>>>>>>>>>>> <ma...@fusesource.com>
>>>>>>>>>>>>>>>         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 <balteo@gmail.com
>>>>>>>>>>>>>>>>         <ma...@gmail.com>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>             thanks Achim
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>             2012/8/9 Achim Nierbeck <bcanhome@googlemail.com
>>>>>>>>>>>>>>>>             <ma...@googlemail.com>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>                 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 <balteo@gmail.com
>>>>>>>>>>>>>>>>                 <ma...@gmail.com>>:
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>                 > 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
>>>>>>>>>>>>>>>> <bcanhome@googlemail.com
>>>>>>>>>>>>>>>>                 <ma...@googlemail.com>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>                 >>
>>>>>>>>>>>>>>>>                 >> 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 <balteo@gmail.com
>>>>>>>>>>>>>>>>                 <ma...@gmail.com>>:
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>                 >> > 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é
>>>>>>>>>>>>>> jbonofre@apache.org
>>>>>>>>>>>>>> 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/>

Re: Embedding a Spring Integration app into Apache Karaf

Posted by Julien Martin <ba...@gmail.com>.
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 <ch...@gmail.com>

> 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 <ba...@gmail.com> 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 <ch...@gmail.com>
>>
>>> 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 <ba...@gmail.com> wrote:
>>>
>>>> How do I install the Spring batch jars/bundle into Karaf?
>>>> Regards,
>>>> J.
>>>>
>>>> 2012/8/13 Charles Moulliard <ch...@gmail.com>
>>>>
>>>>> 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 <ba...@gmail.com>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 <ch...@gmail.com>
>>>>>>
>>>>>>> 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 <ba...@gmail.com>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 <ch...@gmail.com>
>>>>>>>>
>>>>>>>>> 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 <ba...@gmail.com>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 <ba...@gmail.com>
>>>>>>>>>>
>>>>>>>>>>> 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 <ba...@gmail.com>
>>>>>>>>>>>
>>>>>>>>>>>> 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é <jb...@nanthrax.net>
>>>>>>>>>>>>
>>>>>>>>>>>>> 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 <balteo@gmail.com <mailto:
>>>>>>>>>>>>>> balteo@gmail.com>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>     Thanks to both of you. I'll try as you advised and let
>>>>>>>>>>>>>> you know.
>>>>>>>>>>>>>>     Best regards,
>>>>>>>>>>>>>>     J.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>     2012/8/10 Freeman Fang <freeman.fang@gmail.com
>>>>>>>>>>>>>>     <mailto:freeman.fang@gmail.com**>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>         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:ffang@fusesource.com <mailto:Email%3Affang@**
>>>>>>>>>>>>>> fusesource.com <Em...@fusesource.com>>
>>>>>>>>>>>>>>         Web: fusesource.com <http://fusesource.com>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>         Twitter: freemanfang
>>>>>>>>>>>>>>         Blog: http://freemanfang.blogspot.**com<http://freemanfang.blogspot.com>
>>>>>>>>>>>>>>         http://blog.sina.com.cn/u/**1473905042<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 <balteo@gmail.com
>>>>>>>>>>>>>>>         <ma...@gmail.com>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>             thanks Achim
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>             2012/8/9 Achim Nierbeck <bcanhome@googlemail.com
>>>>>>>>>>>>>>>             <ma...@googlemail.com>
>>>>>>>>>>>>>>> >>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>                 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 <balteo@gmail.com
>>>>>>>>>>>>>>>                 <ma...@gmail.com>>:
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>                 > 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 <
>>>>>>>>>>>>>>> bcanhome@googlemail.com
>>>>>>>>>>>>>>>                 <ma...@googlemail.com>
>>>>>>>>>>>>>>> >>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>                 >>
>>>>>>>>>>>>>>>                 >> 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/<http://static.springsource.org/osgi/docs/1.2.1/reference/html/>
>>>>>>>>>>>>>>>                 >>
>>>>>>>>>>>>>>>                 >> 2012/8/9 Julien Martin <balteo@gmail.com
>>>>>>>>>>>>>>>                 <ma...@gmail.com>>:
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>                 >> > 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/<http://wiki.ops4j.org/display/paxweb/Pax+Web/>
>>>>>>>>>>>>>>> >
>>>>>>>>>>>>>>>                 >> Committer & Project Lead
>>>>>>>>>>>>>>>                 >> OPS4J Pax for Vaadin
>>>>>>>>>>>>>>>                 >> <http://team.ops4j.org/wiki/**
>>>>>>>>>>>>>>> display/PAXVAADIN/Home<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/<http://wiki.ops4j.org/display/paxweb/Pax+Web/>
>>>>>>>>>>>>>>> >
>>>>>>>>>>>>>>>                 Committer & Project Lead
>>>>>>>>>>>>>>>                 OPS4J Pax for Vaadin
>>>>>>>>>>>>>>>                 <http://team.ops4j.org/wiki/**
>>>>>>>>>>>>>>> display/PAXVAADIN/Home<http://team.ops4j.org/wiki/display/PAXVAADIN/Home>
>>>>>>>>>>>>>>> >
>>>>>>>>>>>>>>>                 Commiter & Project
>>>>>>>>>>>>>>>                 Lead
>>>>>>>>>>>>>>>                 blog <http://notizblog.nierbeck.de/**>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>> --
>>>>>>>>>>>>> Jean-Baptiste Onofré
>>>>>>>>>>>>> jbonofre@apache.org
>>>>>>>>>>>>> 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
>
>
>

Re: Embedding a Spring Integration app into Apache Karaf

Posted by Charles Moulliard <ch...@gmail.com>.
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 <ba...@gmail.com> 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 <ch...@gmail.com>
>
>> 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 <ba...@gmail.com> wrote:
>>
>>> How do I install the Spring batch jars/bundle into Karaf?
>>> Regards,
>>> J.
>>>
>>> 2012/8/13 Charles Moulliard <ch...@gmail.com>
>>>
>>>> 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 <ba...@gmail.com>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 <ch...@gmail.com>
>>>>>
>>>>>> 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 <ba...@gmail.com>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 <ch...@gmail.com>
>>>>>>>
>>>>>>>> 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 <ba...@gmail.com>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 <ba...@gmail.com>
>>>>>>>>>
>>>>>>>>>> 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 <ba...@gmail.com>
>>>>>>>>>>
>>>>>>>>>>> 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é <jb...@nanthrax.net>
>>>>>>>>>>>
>>>>>>>>>>>> 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 <balteo@gmail.com <mailto:
>>>>>>>>>>>>> balteo@gmail.com>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>     Thanks to both of you. I'll try as you advised and let you
>>>>>>>>>>>>> know.
>>>>>>>>>>>>>     Best regards,
>>>>>>>>>>>>>     J.
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>     2012/8/10 Freeman Fang <freeman.fang@gmail.com
>>>>>>>>>>>>>     <mailto:freeman.fang@gmail.com**>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>         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:ffang@fusesource.com <mailto:Email%3Affang@**
>>>>>>>>>>>>> fusesource.com <Em...@fusesource.com>>
>>>>>>>>>>>>>         Web: fusesource.com <http://fusesource.com>
>>>>>>>>>>>>>
>>>>>>>>>>>>>         Twitter: freemanfang
>>>>>>>>>>>>>         Blog: http://freemanfang.blogspot.**com<http://freemanfang.blogspot.com>
>>>>>>>>>>>>>         http://blog.sina.com.cn/u/**1473905042<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 <balteo@gmail.com
>>>>>>>>>>>>>>         <ma...@gmail.com>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>             thanks Achim
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>             2012/8/9 Achim Nierbeck <bcanhome@googlemail.com
>>>>>>>>>>>>>>             <ma...@googlemail.com>
>>>>>>>>>>>>>> >>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>                 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 <balteo@gmail.com
>>>>>>>>>>>>>>                 <ma...@gmail.com>>:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>                 > 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 <
>>>>>>>>>>>>>> bcanhome@googlemail.com
>>>>>>>>>>>>>>                 <ma...@googlemail.com>
>>>>>>>>>>>>>> >>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>                 >>
>>>>>>>>>>>>>>                 >> 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/<http://static.springsource.org/osgi/docs/1.2.1/reference/html/>
>>>>>>>>>>>>>>                 >>
>>>>>>>>>>>>>>                 >> 2012/8/9 Julien Martin <balteo@gmail.com
>>>>>>>>>>>>>>                 <ma...@gmail.com>>:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>                 >> > 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/<http://wiki.ops4j.org/display/paxweb/Pax+Web/>
>>>>>>>>>>>>>> >
>>>>>>>>>>>>>>                 >> Committer & Project Lead
>>>>>>>>>>>>>>                 >> OPS4J Pax for Vaadin
>>>>>>>>>>>>>>                 >> <http://team.ops4j.org/wiki/**
>>>>>>>>>>>>>> display/PAXVAADIN/Home<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/<http://wiki.ops4j.org/display/paxweb/Pax+Web/>
>>>>>>>>>>>>>> >
>>>>>>>>>>>>>>                 Committer & Project Lead
>>>>>>>>>>>>>>                 OPS4J Pax for Vaadin
>>>>>>>>>>>>>>                 <http://team.ops4j.org/wiki/**
>>>>>>>>>>>>>> display/PAXVAADIN/Home<http://team.ops4j.org/wiki/display/PAXVAADIN/Home>
>>>>>>>>>>>>>> >
>>>>>>>>>>>>>>                 Commiter & Project
>>>>>>>>>>>>>>                 Lead
>>>>>>>>>>>>>>                 blog <http://notizblog.nierbeck.de/**>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>> --
>>>>>>>>>>>> Jean-Baptiste Onofré
>>>>>>>>>>>> jbonofre@apache.org
>>>>>>>>>>>> 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

Re: Embedding a Spring Integration app into Apache Karaf

Posted by Julien Martin <ba...@gmail.com>.
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 <ch...@gmail.com>

> 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 <ba...@gmail.com> wrote:
>
>> How do I install the Spring batch jars/bundle into Karaf?
>> Regards,
>> J.
>>
>> 2012/8/13 Charles Moulliard <ch...@gmail.com>
>>
>>> 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 <ba...@gmail.com>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 <ch...@gmail.com>
>>>>
>>>>> 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 <ba...@gmail.com>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 <ch...@gmail.com>
>>>>>>
>>>>>>> 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 <ba...@gmail.com>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 <ba...@gmail.com>
>>>>>>>>
>>>>>>>>> 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 <ba...@gmail.com>
>>>>>>>>>
>>>>>>>>>> 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é <jb...@nanthrax.net>
>>>>>>>>>>
>>>>>>>>>>> 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 <balteo@gmail.com <mailto:
>>>>>>>>>>>> balteo@gmail.com>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>     Thanks to both of you. I'll try as you advised and let you
>>>>>>>>>>>> know.
>>>>>>>>>>>>     Best regards,
>>>>>>>>>>>>     J.
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>     2012/8/10 Freeman Fang <freeman.fang@gmail.com
>>>>>>>>>>>>     <mailto:freeman.fang@gmail.com**>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>         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:ffang@fusesource.com <mailto:Email%3Affang@**
>>>>>>>>>>>> fusesource.com <Em...@fusesource.com>>
>>>>>>>>>>>>         Web: fusesource.com <http://fusesource.com>
>>>>>>>>>>>>
>>>>>>>>>>>>         Twitter: freemanfang
>>>>>>>>>>>>         Blog: http://freemanfang.blogspot.**com<http://freemanfang.blogspot.com>
>>>>>>>>>>>>         http://blog.sina.com.cn/u/**1473905042<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 <balteo@gmail.com
>>>>>>>>>>>>>         <ma...@gmail.com>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>             thanks Achim
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>             2012/8/9 Achim Nierbeck <bcanhome@googlemail.com
>>>>>>>>>>>>>             <ma...@googlemail.com>
>>>>>>>>>>>>> >>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>                 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 <balteo@gmail.com
>>>>>>>>>>>>>                 <ma...@gmail.com>>:
>>>>>>>>>>>>>
>>>>>>>>>>>>>                 > 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 <
>>>>>>>>>>>>> bcanhome@googlemail.com
>>>>>>>>>>>>>                 <ma...@googlemail.com>
>>>>>>>>>>>>> >>
>>>>>>>>>>>>>
>>>>>>>>>>>>>                 >>
>>>>>>>>>>>>>                 >> 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/<http://static.springsource.org/osgi/docs/1.2.1/reference/html/>
>>>>>>>>>>>>>                 >>
>>>>>>>>>>>>>                 >> 2012/8/9 Julien Martin <balteo@gmail.com
>>>>>>>>>>>>>                 <ma...@gmail.com>>:
>>>>>>>>>>>>>
>>>>>>>>>>>>>                 >> > 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/<http://wiki.ops4j.org/display/paxweb/Pax+Web/>
>>>>>>>>>>>>> >
>>>>>>>>>>>>>                 >> Committer & Project Lead
>>>>>>>>>>>>>                 >> OPS4J Pax for Vaadin
>>>>>>>>>>>>>                 >> <http://team.ops4j.org/wiki/**
>>>>>>>>>>>>> display/PAXVAADIN/Home<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/<http://wiki.ops4j.org/display/paxweb/Pax+Web/>
>>>>>>>>>>>>> >
>>>>>>>>>>>>>                 Committer & Project Lead
>>>>>>>>>>>>>                 OPS4J Pax for Vaadin
>>>>>>>>>>>>>                 <http://team.ops4j.org/wiki/**
>>>>>>>>>>>>> display/PAXVAADIN/Home<http://team.ops4j.org/wiki/display/PAXVAADIN/Home>
>>>>>>>>>>>>> >
>>>>>>>>>>>>>                 Commiter & Project
>>>>>>>>>>>>>                 Lead
>>>>>>>>>>>>>                 blog <http://notizblog.nierbeck.de/**>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>> --
>>>>>>>>>>> Jean-Baptiste Onofré
>>>>>>>>>>> jbonofre@apache.org
>>>>>>>>>>> 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
>
>
>

Re: Embedding a Spring Integration app into Apache Karaf

Posted by Charles Moulliard <ch...@gmail.com>.
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 <ba...@gmail.com> wrote:

> How do I install the Spring batch jars/bundle into Karaf?
> Regards,
> J.
>
> 2012/8/13 Charles Moulliard <ch...@gmail.com>
>
>> 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 <ba...@gmail.com> 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 <ch...@gmail.com>
>>>
>>>> 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 <ba...@gmail.com>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 <ch...@gmail.com>
>>>>>
>>>>>> 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 <ba...@gmail.com>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 <ba...@gmail.com>
>>>>>>>
>>>>>>>> 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 <ba...@gmail.com>
>>>>>>>>
>>>>>>>>> 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é <jb...@nanthrax.net>
>>>>>>>>>
>>>>>>>>>> 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 <balteo@gmail.com <mailto:
>>>>>>>>>>> balteo@gmail.com>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>     Thanks to both of you. I'll try as you advised and let you
>>>>>>>>>>> know.
>>>>>>>>>>>     Best regards,
>>>>>>>>>>>     J.
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>     2012/8/10 Freeman Fang <freeman.fang@gmail.com
>>>>>>>>>>>     <mailto:freeman.fang@gmail.com**>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>         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:ffang@fusesource.com <mailto:Email%3Affang@**
>>>>>>>>>>> fusesource.com <Em...@fusesource.com>>
>>>>>>>>>>>         Web: fusesource.com <http://fusesource.com>
>>>>>>>>>>>
>>>>>>>>>>>         Twitter: freemanfang
>>>>>>>>>>>         Blog: http://freemanfang.blogspot.**com<http://freemanfang.blogspot.com>
>>>>>>>>>>>         http://blog.sina.com.cn/u/**1473905042<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 <balteo@gmail.com
>>>>>>>>>>>>         <ma...@gmail.com>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>             thanks Achim
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>             2012/8/9 Achim Nierbeck <bcanhome@googlemail.com
>>>>>>>>>>>>             <ma...@googlemail.com>
>>>>>>>>>>>> >>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>                 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 <balteo@gmail.com
>>>>>>>>>>>>                 <ma...@gmail.com>>:
>>>>>>>>>>>>
>>>>>>>>>>>>                 > 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 <
>>>>>>>>>>>> bcanhome@googlemail.com
>>>>>>>>>>>>                 <ma...@googlemail.com>
>>>>>>>>>>>> >>
>>>>>>>>>>>>
>>>>>>>>>>>>                 >>
>>>>>>>>>>>>                 >> 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/<http://static.springsource.org/osgi/docs/1.2.1/reference/html/>
>>>>>>>>>>>>                 >>
>>>>>>>>>>>>                 >> 2012/8/9 Julien Martin <balteo@gmail.com
>>>>>>>>>>>>                 <ma...@gmail.com>>:
>>>>>>>>>>>>
>>>>>>>>>>>>                 >> > 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/<http://wiki.ops4j.org/display/paxweb/Pax+Web/>
>>>>>>>>>>>> >
>>>>>>>>>>>>                 >> Committer & Project Lead
>>>>>>>>>>>>                 >> OPS4J Pax for Vaadin
>>>>>>>>>>>>                 >> <http://team.ops4j.org/wiki/**
>>>>>>>>>>>> display/PAXVAADIN/Home<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/<http://wiki.ops4j.org/display/paxweb/Pax+Web/>
>>>>>>>>>>>> >
>>>>>>>>>>>>                 Committer & Project Lead
>>>>>>>>>>>>                 OPS4J Pax for Vaadin
>>>>>>>>>>>>                 <http://team.ops4j.org/wiki/**
>>>>>>>>>>>> display/PAXVAADIN/Home<http://team.ops4j.org/wiki/display/PAXVAADIN/Home>
>>>>>>>>>>>> >
>>>>>>>>>>>>                 Commiter & Project
>>>>>>>>>>>>                 Lead
>>>>>>>>>>>>                 blog <http://notizblog.nierbeck.de/**>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>> --
>>>>>>>>>> Jean-Baptiste Onofré
>>>>>>>>>> jbonofre@apache.org
>>>>>>>>>> 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

Re: Embedding a Spring Integration app into Apache Karaf

Posted by Julien Martin <ba...@gmail.com>.
How do I install the Spring batch jars/bundle into Karaf?
Regards,
J.

2012/8/13 Charles Moulliard <ch...@gmail.com>

> 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 <ba...@gmail.com> 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 <ch...@gmail.com>
>>
>>> 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 <ba...@gmail.com>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 <ch...@gmail.com>
>>>>
>>>>> 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 <ba...@gmail.com>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 <ba...@gmail.com>
>>>>>>
>>>>>>> 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 <ba...@gmail.com>
>>>>>>>
>>>>>>>> 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é <jb...@nanthrax.net>
>>>>>>>>
>>>>>>>>> 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 <balteo@gmail.com <mailto:
>>>>>>>>>> balteo@gmail.com>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>     Thanks to both of you. I'll try as you advised and let you
>>>>>>>>>> know.
>>>>>>>>>>     Best regards,
>>>>>>>>>>     J.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>     2012/8/10 Freeman Fang <freeman.fang@gmail.com
>>>>>>>>>>     <mailto:freeman.fang@gmail.com**>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>         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:ffang@fusesource.com <mailto:Email%3Affang@**
>>>>>>>>>> fusesource.com <Em...@fusesource.com>>
>>>>>>>>>>         Web: fusesource.com <http://fusesource.com>
>>>>>>>>>>
>>>>>>>>>>         Twitter: freemanfang
>>>>>>>>>>         Blog: http://freemanfang.blogspot.**com<http://freemanfang.blogspot.com>
>>>>>>>>>>         http://blog.sina.com.cn/u/**1473905042<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 <balteo@gmail.com
>>>>>>>>>>>         <ma...@gmail.com>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>             thanks Achim
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>             2012/8/9 Achim Nierbeck <bcanhome@googlemail.com
>>>>>>>>>>>             <ma...@googlemail.com>
>>>>>>>>>>> >>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>                 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 <balteo@gmail.com
>>>>>>>>>>>                 <ma...@gmail.com>>:
>>>>>>>>>>>
>>>>>>>>>>>                 > 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 <
>>>>>>>>>>> bcanhome@googlemail.com
>>>>>>>>>>>                 <ma...@googlemail.com>
>>>>>>>>>>> >>
>>>>>>>>>>>
>>>>>>>>>>>                 >>
>>>>>>>>>>>                 >> 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/<http://static.springsource.org/osgi/docs/1.2.1/reference/html/>
>>>>>>>>>>>                 >>
>>>>>>>>>>>                 >> 2012/8/9 Julien Martin <balteo@gmail.com
>>>>>>>>>>>                 <ma...@gmail.com>>:
>>>>>>>>>>>
>>>>>>>>>>>                 >> > 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/<http://wiki.ops4j.org/display/paxweb/Pax+Web/>
>>>>>>>>>>> >
>>>>>>>>>>>                 >> Committer & Project Lead
>>>>>>>>>>>                 >> OPS4J Pax for Vaadin
>>>>>>>>>>>                 >> <http://team.ops4j.org/wiki/**
>>>>>>>>>>> display/PAXVAADIN/Home<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/<http://wiki.ops4j.org/display/paxweb/Pax+Web/>
>>>>>>>>>>> >
>>>>>>>>>>>                 Committer & Project Lead
>>>>>>>>>>>                 OPS4J Pax for Vaadin
>>>>>>>>>>>                 <http://team.ops4j.org/wiki/**
>>>>>>>>>>> display/PAXVAADIN/Home<http://team.ops4j.org/wiki/display/PAXVAADIN/Home>
>>>>>>>>>>> >
>>>>>>>>>>>                 Commiter & Project
>>>>>>>>>>>                 Lead
>>>>>>>>>>>                 blog <http://notizblog.nierbeck.de/**>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> Jean-Baptiste Onofré
>>>>>>>>> jbonofre@apache.org
>>>>>>>>> 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
>
>
>

Re: Embedding a Spring Integration app into Apache Karaf

Posted by Charles Moulliard <ch...@gmail.com>.
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 <ba...@gmail.com> 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 <ch...@gmail.com>
>
>> 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 <ba...@gmail.com> 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 <ch...@gmail.com>
>>>
>>>> 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 <ba...@gmail.com>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 <ba...@gmail.com>
>>>>>
>>>>>> 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 <ba...@gmail.com>
>>>>>>
>>>>>>> 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é <jb...@nanthrax.net>
>>>>>>>
>>>>>>>> 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 <balteo@gmail.com <mailto:balteo@gmail.com
>>>>>>>>> >>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>     Thanks to both of you. I'll try as you advised and let you
>>>>>>>>> know.
>>>>>>>>>     Best regards,
>>>>>>>>>     J.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>     2012/8/10 Freeman Fang <freeman.fang@gmail.com
>>>>>>>>>     <mailto:freeman.fang@gmail.com**>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>         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:ffang@fusesource.com <mailto:Email%3Affang@**
>>>>>>>>> fusesource.com <Em...@fusesource.com>>
>>>>>>>>>         Web: fusesource.com <http://fusesource.com>
>>>>>>>>>
>>>>>>>>>         Twitter: freemanfang
>>>>>>>>>         Blog: http://freemanfang.blogspot.**com<http://freemanfang.blogspot.com>
>>>>>>>>>         http://blog.sina.com.cn/u/**1473905042<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 <balteo@gmail.com
>>>>>>>>>>         <ma...@gmail.com>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>             thanks Achim
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>             2012/8/9 Achim Nierbeck <bcanhome@googlemail.com
>>>>>>>>>>             <ma...@googlemail.com>
>>>>>>>>>> >>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>                 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 <balteo@gmail.com
>>>>>>>>>>                 <ma...@gmail.com>>:
>>>>>>>>>>
>>>>>>>>>>                 > 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 <
>>>>>>>>>> bcanhome@googlemail.com
>>>>>>>>>>                 <ma...@googlemail.com>
>>>>>>>>>> >>
>>>>>>>>>>
>>>>>>>>>>                 >>
>>>>>>>>>>                 >> 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/<http://static.springsource.org/osgi/docs/1.2.1/reference/html/>
>>>>>>>>>>                 >>
>>>>>>>>>>                 >> 2012/8/9 Julien Martin <balteo@gmail.com
>>>>>>>>>>                 <ma...@gmail.com>>:
>>>>>>>>>>
>>>>>>>>>>                 >> > 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/<http://wiki.ops4j.org/display/paxweb/Pax+Web/>
>>>>>>>>>> >
>>>>>>>>>>                 >> Committer & Project Lead
>>>>>>>>>>                 >> OPS4J Pax for Vaadin
>>>>>>>>>>                 >> <http://team.ops4j.org/wiki/**
>>>>>>>>>> display/PAXVAADIN/Home<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/<http://wiki.ops4j.org/display/paxweb/Pax+Web/>
>>>>>>>>>> >
>>>>>>>>>>                 Committer & Project Lead
>>>>>>>>>>                 OPS4J Pax for Vaadin
>>>>>>>>>>                 <http://team.ops4j.org/wiki/**
>>>>>>>>>> display/PAXVAADIN/Home<http://team.ops4j.org/wiki/display/PAXVAADIN/Home>
>>>>>>>>>> >
>>>>>>>>>>                 Commiter & Project
>>>>>>>>>>                 Lead
>>>>>>>>>>                 blog <http://notizblog.nierbeck.de/**>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>> --
>>>>>>>> Jean-Baptiste Onofré
>>>>>>>> jbonofre@apache.org
>>>>>>>> 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

Re: Embedding a Spring Integration app into Apache Karaf

Posted by Julien Martin <ba...@gmail.com>.
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 <ch...@gmail.com>

> 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 <ba...@gmail.com> 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 <ch...@gmail.com>
>>
>>> 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 <ba...@gmail.com>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 <ba...@gmail.com>
>>>>
>>>>> 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 <ba...@gmail.com>
>>>>>
>>>>>> 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é <jb...@nanthrax.net>
>>>>>>
>>>>>>> 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 <balteo@gmail.com <mailto:balteo@gmail.com
>>>>>>>> >>
>>>>>>>>
>>>>>>>>
>>>>>>>>     Thanks to both of you. I'll try as you advised and let you know.
>>>>>>>>     Best regards,
>>>>>>>>     J.
>>>>>>>>
>>>>>>>>
>>>>>>>>     2012/8/10 Freeman Fang <freeman.fang@gmail.com
>>>>>>>>     <mailto:freeman.fang@gmail.com**>>
>>>>>>>>
>>>>>>>>
>>>>>>>>         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:ffang@fusesource.com <mailto:Email%3Affang@**
>>>>>>>> fusesource.com <Em...@fusesource.com>>
>>>>>>>>         Web: fusesource.com <http://fusesource.com>
>>>>>>>>
>>>>>>>>         Twitter: freemanfang
>>>>>>>>         Blog: http://freemanfang.blogspot.**com<http://freemanfang.blogspot.com>
>>>>>>>>         http://blog.sina.com.cn/u/**1473905042<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 <balteo@gmail.com
>>>>>>>>>         <ma...@gmail.com>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>             thanks Achim
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>             2012/8/9 Achim Nierbeck <bcanhome@googlemail.com
>>>>>>>>>             <ma...@googlemail.com>
>>>>>>>>> >>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>                 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 <balteo@gmail.com
>>>>>>>>>                 <ma...@gmail.com>>:
>>>>>>>>>
>>>>>>>>>                 > 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 <bcanhome@googlemail.com
>>>>>>>>>                 <ma...@googlemail.com>
>>>>>>>>> >>
>>>>>>>>>
>>>>>>>>>                 >>
>>>>>>>>>                 >> 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/<http://static.springsource.org/osgi/docs/1.2.1/reference/html/>
>>>>>>>>>                 >>
>>>>>>>>>                 >> 2012/8/9 Julien Martin <balteo@gmail.com
>>>>>>>>>                 <ma...@gmail.com>>:
>>>>>>>>>
>>>>>>>>>                 >> > 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/<http://wiki.ops4j.org/display/paxweb/Pax+Web/>
>>>>>>>>> >
>>>>>>>>>                 >> Committer & Project Lead
>>>>>>>>>                 >> OPS4J Pax for Vaadin
>>>>>>>>>                 >> <http://team.ops4j.org/wiki/**
>>>>>>>>> display/PAXVAADIN/Home<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/<http://wiki.ops4j.org/display/paxweb/Pax+Web/>
>>>>>>>>> >
>>>>>>>>>                 Committer & Project Lead
>>>>>>>>>                 OPS4J Pax for Vaadin
>>>>>>>>>                 <http://team.ops4j.org/wiki/**
>>>>>>>>> display/PAXVAADIN/Home<http://team.ops4j.org/wiki/display/PAXVAADIN/Home>
>>>>>>>>> >
>>>>>>>>>                 Commiter & Project
>>>>>>>>>                 Lead
>>>>>>>>>                 blog <http://notizblog.nierbeck.de/**>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>> --
>>>>>>> Jean-Baptiste Onofré
>>>>>>> jbonofre@apache.org
>>>>>>> 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
>
>
>

Re: Embedding a Spring Integration app into Apache Karaf

Posted by Charles Moulliard <ch...@gmail.com>.
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 <ba...@gmail.com> 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 <ch...@gmail.com>
>
>> 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 <ba...@gmail.com> 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 <ba...@gmail.com>
>>>
>>>> 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 <ba...@gmail.com>
>>>>
>>>>> 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é <jb...@nanthrax.net>
>>>>>
>>>>>> 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 <balteo@gmail.com <ma...@gmail.com>>
>>>>>>>
>>>>>>>
>>>>>>>     Thanks to both of you. I'll try as you advised and let you know.
>>>>>>>     Best regards,
>>>>>>>     J.
>>>>>>>
>>>>>>>
>>>>>>>     2012/8/10 Freeman Fang <freeman.fang@gmail.com
>>>>>>>     <mailto:freeman.fang@gmail.com**>>
>>>>>>>
>>>>>>>
>>>>>>>         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:ffang@fusesource.com <mailto:Email%3Affang@**
>>>>>>> fusesource.com <Em...@fusesource.com>>
>>>>>>>         Web: fusesource.com <http://fusesource.com>
>>>>>>>
>>>>>>>         Twitter: freemanfang
>>>>>>>         Blog: http://freemanfang.blogspot.**com<http://freemanfang.blogspot.com>
>>>>>>>         http://blog.sina.com.cn/u/**1473905042<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 <balteo@gmail.com
>>>>>>>>         <ma...@gmail.com>>
>>>>>>>>
>>>>>>>>
>>>>>>>>             thanks Achim
>>>>>>>>
>>>>>>>>
>>>>>>>>             2012/8/9 Achim Nierbeck <bcanhome@googlemail.com
>>>>>>>>             <ma...@googlemail.com>
>>>>>>>> >>
>>>>>>>>
>>>>>>>>
>>>>>>>>                 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 <balteo@gmail.com
>>>>>>>>                 <ma...@gmail.com>>:
>>>>>>>>
>>>>>>>>                 > 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 <bcanhome@googlemail.com
>>>>>>>>                 <ma...@googlemail.com>
>>>>>>>> >>
>>>>>>>>
>>>>>>>>                 >>
>>>>>>>>                 >> 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/<http://static.springsource.org/osgi/docs/1.2.1/reference/html/>
>>>>>>>>                 >>
>>>>>>>>                 >> 2012/8/9 Julien Martin <balteo@gmail.com
>>>>>>>>                 <ma...@gmail.com>>:
>>>>>>>>
>>>>>>>>                 >> > 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/<http://wiki.ops4j.org/display/paxweb/Pax+Web/>
>>>>>>>> >
>>>>>>>>                 >> Committer & Project Lead
>>>>>>>>                 >> OPS4J Pax for Vaadin
>>>>>>>>                 >> <http://team.ops4j.org/wiki/**
>>>>>>>> display/PAXVAADIN/Home<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/<http://wiki.ops4j.org/display/paxweb/Pax+Web/>
>>>>>>>> >
>>>>>>>>                 Committer & Project Lead
>>>>>>>>                 OPS4J Pax for Vaadin
>>>>>>>>                 <http://team.ops4j.org/wiki/**
>>>>>>>> display/PAXVAADIN/Home<http://team.ops4j.org/wiki/display/PAXVAADIN/Home>
>>>>>>>> >
>>>>>>>>                 Commiter & Project
>>>>>>>>                 Lead
>>>>>>>>                 blog <http://notizblog.nierbeck.de/**>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>> --
>>>>>> Jean-Baptiste Onofré
>>>>>> jbonofre@apache.org
>>>>>> 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

Re: Embedding a Spring Integration app into Apache Karaf

Posted by Julien Martin <ba...@gmail.com>.
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 <ch...@gmail.com>

> 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 <ba...@gmail.com> 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 <ba...@gmail.com>
>>
>>> 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 <ba...@gmail.com>
>>>
>>>> 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é <jb...@nanthrax.net>
>>>>
>>>>> 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 <balteo@gmail.com <ma...@gmail.com>>
>>>>>>
>>>>>>
>>>>>>     Thanks to both of you. I'll try as you advised and let you know.
>>>>>>     Best regards,
>>>>>>     J.
>>>>>>
>>>>>>
>>>>>>     2012/8/10 Freeman Fang <freeman.fang@gmail.com
>>>>>>     <mailto:freeman.fang@gmail.com**>>
>>>>>>
>>>>>>
>>>>>>         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:ffang@fusesource.com <mailto:Email%3Affang@**
>>>>>> fusesource.com <Em...@fusesource.com>>
>>>>>>         Web: fusesource.com <http://fusesource.com>
>>>>>>
>>>>>>         Twitter: freemanfang
>>>>>>         Blog: http://freemanfang.blogspot.**com<http://freemanfang.blogspot.com>
>>>>>>         http://blog.sina.com.cn/u/**1473905042<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 <balteo@gmail.com
>>>>>>>         <ma...@gmail.com>>
>>>>>>>
>>>>>>>
>>>>>>>             thanks Achim
>>>>>>>
>>>>>>>
>>>>>>>             2012/8/9 Achim Nierbeck <bcanhome@googlemail.com
>>>>>>>             <ma...@googlemail.com>
>>>>>>> >>
>>>>>>>
>>>>>>>
>>>>>>>                 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 <balteo@gmail.com
>>>>>>>                 <ma...@gmail.com>>:
>>>>>>>
>>>>>>>                 > 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 <bcanhome@googlemail.com
>>>>>>>                 <ma...@googlemail.com>
>>>>>>> >>
>>>>>>>
>>>>>>>                 >>
>>>>>>>                 >> 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/<http://static.springsource.org/osgi/docs/1.2.1/reference/html/>
>>>>>>>                 >>
>>>>>>>                 >> 2012/8/9 Julien Martin <balteo@gmail.com
>>>>>>>                 <ma...@gmail.com>>:
>>>>>>>
>>>>>>>                 >> > 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/<http://wiki.ops4j.org/display/paxweb/Pax+Web/>
>>>>>>> >
>>>>>>>                 >> Committer & Project Lead
>>>>>>>                 >> OPS4J Pax for Vaadin
>>>>>>>                 >> <http://team.ops4j.org/wiki/**
>>>>>>> display/PAXVAADIN/Home<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/<http://wiki.ops4j.org/display/paxweb/Pax+Web/>
>>>>>>> >
>>>>>>>                 Committer & Project Lead
>>>>>>>                 OPS4J Pax for Vaadin
>>>>>>>                 <http://team.ops4j.org/wiki/**display/PAXVAADIN/Home<http://team.ops4j.org/wiki/display/PAXVAADIN/Home>
>>>>>>> >
>>>>>>>                 Commiter & Project
>>>>>>>                 Lead
>>>>>>>                 blog <http://notizblog.nierbeck.de/**>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>> --
>>>>> Jean-Baptiste Onofré
>>>>> jbonofre@apache.org
>>>>> 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
>
>
>

Re: Embedding a Spring Integration app into Apache Karaf

Posted by Charles Moulliard <ch...@gmail.com>.
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 <ba...@gmail.com> 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 <ba...@gmail.com>
>
>> 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 <ba...@gmail.com>
>>
>>> 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é <jb...@nanthrax.net>
>>>
>>>> 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 <balteo@gmail.com <ma...@gmail.com>>
>>>>>
>>>>>
>>>>>     Thanks to both of you. I'll try as you advised and let you know.
>>>>>     Best regards,
>>>>>     J.
>>>>>
>>>>>
>>>>>     2012/8/10 Freeman Fang <freeman.fang@gmail.com
>>>>>     <mailto:freeman.fang@gmail.com**>>
>>>>>
>>>>>
>>>>>         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:ffang@fusesource.com <mailto:Email%3Affang@**
>>>>> fusesource.com <Em...@fusesource.com>>
>>>>>         Web: fusesource.com <http://fusesource.com>
>>>>>
>>>>>         Twitter: freemanfang
>>>>>         Blog: http://freemanfang.blogspot.**com<http://freemanfang.blogspot.com>
>>>>>         http://blog.sina.com.cn/u/**1473905042<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 <balteo@gmail.com
>>>>>>         <ma...@gmail.com>>
>>>>>>
>>>>>>
>>>>>>             thanks Achim
>>>>>>
>>>>>>
>>>>>>             2012/8/9 Achim Nierbeck <bcanhome@googlemail.com
>>>>>>             <ma...@googlemail.com>
>>>>>> >>
>>>>>>
>>>>>>
>>>>>>                 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 <balteo@gmail.com
>>>>>>                 <ma...@gmail.com>>:
>>>>>>
>>>>>>                 > 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 <bcanhome@googlemail.com
>>>>>>                 <ma...@googlemail.com>
>>>>>> >>
>>>>>>
>>>>>>                 >>
>>>>>>                 >> 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/<http://static.springsource.org/osgi/docs/1.2.1/reference/html/>
>>>>>>                 >>
>>>>>>                 >> 2012/8/9 Julien Martin <balteo@gmail.com
>>>>>>                 <ma...@gmail.com>>:
>>>>>>
>>>>>>                 >> > 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/<http://wiki.ops4j.org/display/paxweb/Pax+Web/>
>>>>>> >
>>>>>>                 >> Committer & Project Lead
>>>>>>                 >> OPS4J Pax for Vaadin
>>>>>>                 >> <http://team.ops4j.org/wiki/**
>>>>>> display/PAXVAADIN/Home<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/<http://wiki.ops4j.org/display/paxweb/Pax+Web/>
>>>>>> >
>>>>>>                 Committer & Project Lead
>>>>>>                 OPS4J Pax for Vaadin
>>>>>>                 <http://team.ops4j.org/wiki/**display/PAXVAADIN/Home<http://team.ops4j.org/wiki/display/PAXVAADIN/Home>
>>>>>> >
>>>>>>                 Commiter & Project
>>>>>>                 Lead
>>>>>>                 blog <http://notizblog.nierbeck.de/**>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>> --
>>>> Jean-Baptiste Onofré
>>>> jbonofre@apache.org
>>>> 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

Re: Embedding a Spring Integration app into Apache Karaf

Posted by Julien Martin <ba...@gmail.com>.
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 <ba...@gmail.com>

> 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 <ba...@gmail.com>
>
>> 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é <jb...@nanthrax.net>
>>
>>> 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 <balteo@gmail.com <ma...@gmail.com>>
>>>>
>>>>
>>>>     Thanks to both of you. I'll try as you advised and let you know.
>>>>     Best regards,
>>>>     J.
>>>>
>>>>
>>>>     2012/8/10 Freeman Fang <freeman.fang@gmail.com
>>>>     <mailto:freeman.fang@gmail.com**>>
>>>>
>>>>
>>>>         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:ffang@fusesource.com <mailto:Email%3Affang@**
>>>> fusesource.com <Em...@fusesource.com>>
>>>>         Web: fusesource.com <http://fusesource.com>
>>>>
>>>>         Twitter: freemanfang
>>>>         Blog: http://freemanfang.blogspot.**com<http://freemanfang.blogspot.com>
>>>>         http://blog.sina.com.cn/u/**1473905042<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 <balteo@gmail.com
>>>>>         <ma...@gmail.com>>
>>>>>
>>>>>
>>>>>             thanks Achim
>>>>>
>>>>>
>>>>>             2012/8/9 Achim Nierbeck <bcanhome@googlemail.com
>>>>>             <ma...@googlemail.com>
>>>>> >>
>>>>>
>>>>>
>>>>>                 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 <balteo@gmail.com
>>>>>                 <ma...@gmail.com>>:
>>>>>
>>>>>                 > 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 <bcanhome@googlemail.com
>>>>>                 <ma...@googlemail.com>
>>>>> >>
>>>>>
>>>>>                 >>
>>>>>                 >> 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/<http://static.springsource.org/osgi/docs/1.2.1/reference/html/>
>>>>>                 >>
>>>>>                 >> 2012/8/9 Julien Martin <balteo@gmail.com
>>>>>                 <ma...@gmail.com>>:
>>>>>
>>>>>                 >> > 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/<http://wiki.ops4j.org/display/paxweb/Pax+Web/>
>>>>> >
>>>>>                 >> Committer & Project Lead
>>>>>                 >> OPS4J Pax for Vaadin
>>>>>                 >> <http://team.ops4j.org/wiki/**
>>>>> display/PAXVAADIN/Home<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/<http://wiki.ops4j.org/display/paxweb/Pax+Web/>
>>>>> >
>>>>>                 Committer & Project Lead
>>>>>                 OPS4J Pax for Vaadin
>>>>>                 <http://team.ops4j.org/wiki/**display/PAXVAADIN/Home<http://team.ops4j.org/wiki/display/PAXVAADIN/Home>
>>>>> >
>>>>>                 Commiter & Project
>>>>>                 Lead
>>>>>                 blog <http://notizblog.nierbeck.de/**>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>> --
>>> Jean-Baptiste Onofré
>>> jbonofre@apache.org
>>> http://blog.nanthrax.net
>>> Talend - http://www.talend.com
>>>
>>
>>
>

Re: Embedding a Spring Integration app into Apache Karaf

Posted by Julien Martin <ba...@gmail.com>.
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 <ba...@gmail.com>

> 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é <jb...@nanthrax.net>
>
>> 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 <balteo@gmail.com <ma...@gmail.com>>
>>>
>>>
>>>     Thanks to both of you. I'll try as you advised and let you know.
>>>     Best regards,
>>>     J.
>>>
>>>
>>>     2012/8/10 Freeman Fang <freeman.fang@gmail.com
>>>     <mailto:freeman.fang@gmail.com**>>
>>>
>>>
>>>         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:ffang@fusesource.com <mailto:Email%3Affang@**
>>> fusesource.com <Em...@fusesource.com>>
>>>         Web: fusesource.com <http://fusesource.com>
>>>
>>>         Twitter: freemanfang
>>>         Blog: http://freemanfang.blogspot.**com<http://freemanfang.blogspot.com>
>>>         http://blog.sina.com.cn/u/**1473905042<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 <balteo@gmail.com
>>>>         <ma...@gmail.com>>
>>>>
>>>>
>>>>             thanks Achim
>>>>
>>>>
>>>>             2012/8/9 Achim Nierbeck <bcanhome@googlemail.com
>>>>             <mailto:bcanhome@googlemail.**com <bc...@googlemail.com>
>>>> >>
>>>>
>>>>
>>>>                 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 <balteo@gmail.com
>>>>                 <ma...@gmail.com>>:
>>>>
>>>>                 > 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 <bcanhome@googlemail.com
>>>>                 <ma...@googlemail.com>
>>>> >>
>>>>
>>>>                 >>
>>>>                 >> 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/<http://static.springsource.org/osgi/docs/1.2.1/reference/html/>
>>>>                 >>
>>>>                 >> 2012/8/9 Julien Martin <balteo@gmail.com
>>>>                 <ma...@gmail.com>>:
>>>>
>>>>                 >> > 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/<http://wiki.ops4j.org/display/paxweb/Pax+Web/>
>>>> >
>>>>                 >> Committer & Project Lead
>>>>                 >> OPS4J Pax for Vaadin
>>>>                 >> <http://team.ops4j.org/wiki/**display/PAXVAADIN/Home<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/<http://wiki.ops4j.org/display/paxweb/Pax+Web/>
>>>> >
>>>>                 Committer & Project Lead
>>>>                 OPS4J Pax for Vaadin
>>>>                 <http://team.ops4j.org/wiki/**display/PAXVAADIN/Home<http://team.ops4j.org/wiki/display/PAXVAADIN/Home>
>>>> >
>>>>                 Commiter & Project
>>>>                 Lead
>>>>                 blog <http://notizblog.nierbeck.de/**>
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>>
>> --
>> Jean-Baptiste Onofré
>> jbonofre@apache.org
>> http://blog.nanthrax.net
>> Talend - http://www.talend.com
>>
>
>

Re: Embedding a Spring Integration app into Apache Karaf

Posted by Julien Martin <ba...@gmail.com>.
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é <jb...@nanthrax.net>

> 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 <balteo@gmail.com <ma...@gmail.com>>
>>
>>
>>     Thanks to both of you. I'll try as you advised and let you know.
>>     Best regards,
>>     J.
>>
>>
>>     2012/8/10 Freeman Fang <freeman.fang@gmail.com
>>     <mailto:freeman.fang@gmail.com**>>
>>
>>
>>         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:ffang@fusesource.com <ma...@fusesource.com>
>> >
>>         Web: fusesource.com <http://fusesource.com>
>>
>>         Twitter: freemanfang
>>         Blog: http://freemanfang.blogspot.**com<http://freemanfang.blogspot.com>
>>         http://blog.sina.com.cn/u/**1473905042<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 <balteo@gmail.com
>>>         <ma...@gmail.com>>
>>>
>>>
>>>             thanks Achim
>>>
>>>
>>>             2012/8/9 Achim Nierbeck <bcanhome@googlemail.com
>>>             <mailto:bcanhome@googlemail.**com <bc...@googlemail.com>
>>> >>
>>>
>>>
>>>                 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 <balteo@gmail.com
>>>                 <ma...@gmail.com>>:
>>>
>>>                 > 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 <bcanhome@googlemail.com
>>>                 <ma...@googlemail.com>
>>> >>
>>>
>>>                 >>
>>>                 >> 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/<http://static.springsource.org/osgi/docs/1.2.1/reference/html/>
>>>                 >>
>>>                 >> 2012/8/9 Julien Martin <balteo@gmail.com
>>>                 <ma...@gmail.com>>:
>>>
>>>                 >> > 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/<http://wiki.ops4j.org/display/paxweb/Pax+Web/>
>>> >
>>>                 >> Committer & Project Lead
>>>                 >> OPS4J Pax for Vaadin
>>>                 >> <http://team.ops4j.org/wiki/**display/PAXVAADIN/Home<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/<http://wiki.ops4j.org/display/paxweb/Pax+Web/>
>>> >
>>>                 Committer & Project Lead
>>>                 OPS4J Pax for Vaadin
>>>                 <http://team.ops4j.org/wiki/**display/PAXVAADIN/Home<http://team.ops4j.org/wiki/display/PAXVAADIN/Home>
>>> >
>>>                 Commiter & Project
>>>                 Lead
>>>                 blog <http://notizblog.nierbeck.de/**>
>>>
>>>
>>>
>>>
>>
>>
>>
> --
> Jean-Baptiste Onofré
> jbonofre@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com
>

Re: Embedding a Spring Integration app into Apache Karaf

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
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 <balteo@gmail.com <ma...@gmail.com>>
>
>     Thanks to both of you. I'll try as you advised and let you know.
>     Best regards,
>     J.
>
>
>     2012/8/10 Freeman Fang <freeman.fang@gmail.com
>     <ma...@gmail.com>>
>
>         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:ffang@fusesource.com <ma...@fusesource.com>
>         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 <balteo@gmail.com
>>         <ma...@gmail.com>>
>>
>>             thanks Achim
>>
>>
>>             2012/8/9 Achim Nierbeck <bcanhome@googlemail.com
>>             <ma...@googlemail.com>>
>>
>>                 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 <balteo@gmail.com
>>                 <ma...@gmail.com>>:
>>                 > 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 <bcanhome@googlemail.com
>>                 <ma...@googlemail.com>>
>>                 >>
>>                 >> 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 <balteo@gmail.com
>>                 <ma...@gmail.com>>:
>>                 >> > 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é
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Embedding a Spring Integration app into Apache Karaf

Posted by Julien Martin <ba...@gmail.com>.
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 <ba...@gmail.com>

> Thanks to both of you. I'll try as you advised and let you know.
> Best regards,
> J.
>
>
> 2012/8/10 Freeman Fang <fr...@gmail.com>
>
>> 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:ffang@fusesource.com
>> Web: 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 <ba...@gmail.com>
>>
>>> thanks Achim
>>>
>>>
>>> 2012/8/9 Achim Nierbeck <bc...@googlemail.com>
>>>
>>>> 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 <ba...@gmail.com>:
>>>> > 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 <bc...@googlemail.com>
>>>> >>
>>>> >> 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 <ba...@gmail.com>:
>>>> >> > 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/>
>>>>
>>>
>>>
>>
>>
>

Re: Embedding a Spring Integration app into Apache Karaf

Posted by Julien Martin <ba...@gmail.com>.
Thanks to both of you. I'll try as you advised and let you know.
Best regards,
J.

2012/8/10 Freeman Fang <fr...@gmail.com>

> 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:ffang@fusesource.com
> Web: 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 <ba...@gmail.com>
>
>> thanks Achim
>>
>>
>> 2012/8/9 Achim Nierbeck <bc...@googlemail.com>
>>
>>> 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 <ba...@gmail.com>:
>>> > 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 <bc...@googlemail.com>
>>> >>
>>> >> 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 <ba...@gmail.com>:
>>> >> > 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/>
>>>
>>
>>
>
>

Re: Embedding a Spring Integration app into Apache Karaf

Posted by Freeman Fang <fr...@gmail.com>.
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:ffang@fusesource.com
Web: 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 <ba...@gmail.com>
> thanks Achim
> 
> 
> 2012/8/9 Achim Nierbeck <bc...@googlemail.com>
> 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 <ba...@gmail.com>:
> > 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 <bc...@googlemail.com>
> >>
> >> 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 <ba...@gmail.com>:
> >> > 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/>
> 
> 


Re: Embedding a Spring Integration app into Apache Karaf

Posted by Achim Nierbeck <bc...@googlemail.com>.
Hi

well this is a special deployer that helps you if you develop "small"
spring applications that are capable of just beeing runnable through
some basic
classes available through spring.
How does it work, it takes the deployed spring.xml file and wrapps a
bundle around it with a dynamic-import.
One can use those for example to provide a datasource as osgi service.
(but i tend to use blueprint for that)
So for you I'd say you are probably more set with your spring jar
depending on the spring-dm features.


regards, Achim

2012/8/10 Julien Martin <ba...@gmail.com>:
> 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 <ba...@gmail.com>
>>
>> thanks Achim
>>
>>
>> 2012/8/9 Achim Nierbeck <bc...@googlemail.com>
>>>
>>> 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 <ba...@gmail.com>:
>>> > 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 <bc...@googlemail.com>
>>> >>
>>> >> 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 <ba...@gmail.com>:
>>> >> > 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/>
>>
>>
>



-- 

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/>

Re: Embedding a Spring Integration app into Apache Karaf

Posted by Julien Martin <ba...@gmail.com>.
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 <ba...@gmail.com>

> thanks Achim
>
>
> 2012/8/9 Achim Nierbeck <bc...@googlemail.com>
>
>> 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 <ba...@gmail.com>:
>> > 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 <bc...@googlemail.com>
>> >>
>> >> 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 <ba...@gmail.com>:
>> >> > 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/>
>>
>
>

Re: Embedding a Spring Integration app into Apache Karaf

Posted by Julien Martin <ba...@gmail.com>.
thanks Achim

2012/8/9 Achim Nierbeck <bc...@googlemail.com>

> 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 <ba...@gmail.com>:
> > 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 <bc...@googlemail.com>
> >>
> >> 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 <ba...@gmail.com>:
> >> > 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/>
>

Re: Embedding a Spring Integration app into Apache Karaf

Posted by Achim Nierbeck <bc...@googlemail.com>.
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 <ba...@gmail.com>:
> 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 <bc...@googlemail.com>
>>
>> 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 <ba...@gmail.com>:
>> > 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/>

Re: Embedding a Spring Integration app into Apache Karaf

Posted by Julien Martin <ba...@gmail.com>.
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 <bc...@googlemail.com>

> 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 <ba...@gmail.com>:
> > 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/>
>

Re: Embedding a Spring Integration app into Apache Karaf

Posted by Achim Nierbeck <bc...@googlemail.com>.
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 <ba...@gmail.com>:
> 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/>