You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by "Muller, Anthony" <an...@sap.com> on 2011/02/02 16:36:06 UTC

Felix - File Install

Hello,

I'm trying to use FileInstall but it doesn't work :-/

I wrote an eclipse project with an only dependency with Felix.

I put "org.apache.felix.fileinstall-3.1.4.jar" in a "bundles" directory and this one is properly deploy by Felix.

But I cannot configure FileInstall to manage a "dropins" directory in order to automatically start bundles present here.

Thanks for help,
Anthony


public class FelixLauncher {

	private final HostActivator activator = new HostActivator();

	private Framework felix;

	public FelixLauncher() {
		// Create a configuration property map.
		final Map<Object, Object> configMap = new HashMap<Object, Object>();

		// Create host activator;
		final List<Object> list = new ArrayList<Object>();
		list.add(activator);
		configMap.put(FelixConstants.SYSTEMBUNDLE_ACTIVATORS_PROP, list);
		configMap.put(AutoProcessor.AUTO_DEPLOY_DIR_PROPERY, "bundles");
		configMap.put(AutoProcessor.AUTO_DEPLOY_ACTION_PROPERY, AutoProcessor.AUTO_DEPLOY_INSTALL_VALUE);

		try {
			felix = new Felix(configMap);
			felix.init();

			AutoProcessor.process(configMap, felix.getBundleContext());

			felix.start();

			Bundle[] bnds = felix.getBundleContext().getBundles();
			for (Bundle bundle : bnds) {
				bundle.start();
				System.out.println(bundle + " : " + bundle.getState());
			}
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}

	public Framework getFramework() {
		return felix;
	}
}

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Felix - File Install

Posted by "Richard S. Hall" <he...@ungoverned.org>.
On 2/2/11 10:36, Muller, Anthony wrote:
> Hello,
>
> I'm trying to use FileInstall but it doesn't work :-/
>
> I wrote an eclipse project with an only dependency with Felix.
>
> I put "org.apache.felix.fileinstall-3.1.4.jar" in a "bundles" directory and this one is properly deploy by Felix.
>
> But I cannot configure FileInstall to manage a "dropins" directory in order to automatically start bundles present here.
>
> Thanks for help,
> Anthony
>
>
> public class FelixLauncher {
>
> 	private final HostActivator activator = new HostActivator();
>
> 	private Framework felix;
>
> 	public FelixLauncher() {
> 		// Create a configuration property map.
> 		final Map<Object, Object>  configMap = new HashMap<Object, Object>();
>
> 		// Create host activator;
> 		final List<Object>  list = new ArrayList<Object>();
> 		list.add(activator);
> 		configMap.put(FelixConstants.SYSTEMBUNDLE_ACTIVATORS_PROP, list);
> 		configMap.put(AutoProcessor.AUTO_DEPLOY_DIR_PROPERY, "bundles");
> 		configMap.put(AutoProcessor.AUTO_DEPLOY_ACTION_PROPERY, AutoProcessor.AUTO_DEPLOY_INSTALL_VALUE);

You are only telling the auto-deploy mechanism to install bundles, you 
want to set the value to "install, start" so that it installs and starts 
the auto-deploy bundles.

-> richard

> 		try {
> 			felix = new Felix(configMap);
> 			felix.init();
>
> 			AutoProcessor.process(configMap, felix.getBundleContext());
>
> 			felix.start();
>
> 			Bundle[] bnds = felix.getBundleContext().getBundles();
> 			for (Bundle bundle : bnds) {
> 				bundle.start();
> 				System.out.println(bundle + " : " + bundle.getState());
> 			}
> 		} catch (Exception ex) {
> 			ex.printStackTrace();
> 		}
> 	}
>
> 	public Framework getFramework() {
> 		return felix;
> 	}
> }
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


RE: Felix - File Install

Posted by "Muller, Anthony" <an...@sap.com>.
Thnks Richard & Guillaume, I read this webpage and I understand how to configure Felix and deployed bundles now:
http://felix.apache.org/site/apache-felix-framework-usage-documentation.html#ApacheFelixFrameworkUsageDocumentation-configuringframework

Regards,
Anthony

-----Original Message-----
From: Guillaume Nodet [mailto:gnodet@gmail.com] 
Sent: mercredi 2 février 2011 18:03
To: users@felix.apache.org
Subject: Re: Felix - File Install

It should find the default values in the system proeprties or
framework properties, so if you append those at the end of the felix
configuration file, it should work.

On Wed, Feb 2, 2011 at 17:26, Richard S. Hall <he...@ungoverned.org> wrote:
> On 2/2/11 11:12, Muller, Anthony wrote:
>>
>> Richard,
>>
>> According your advice, I changed the auto-deploy value to "install,
>> start".
>>
>> So, when I print out bundles present in context, I have:
>> org.apache.felix.framework [0] : 32
>> org.apache.felix.fileinstall [1] : 32
>>
>> But, FileInstall is still not properly configured. Where must I put the
>> configuration file? Must I use a specific file name?
>
> I'll let the File Install experts answer that...
>
> -> richard
>
>> Thanks and regards,
>> Anthony
>>
>>
>>
>> "You are only telling the auto-deploy mechanism to install bundles, you
>> want to set the value to "install, start" so that it installs and starts the
>> auto-deploy bundles.
>> ->  richard"
>>
>> -----Original Message-----
>> From: Muller, Anthony [mailto:anthony.muller@sap.com]
>> Sent: mercredi 2 février 2011 16:40
>> To: users@felix.apache.org
>> Subject: RE: Felix - File Install
>>
>> I forgot to say that I wrote a configuration file:
>>
>> [conf/config.properties]
>> felix.fileinstall.poll=12000
>> felix.fileinstall.dir=dropins
>> felix.fileinstall.debug=-1
>> felix.fileinstall.bundles.new.start=true
>>
>> But I don't know how FileInstall can be able to find this configuration
>> file... :(
>>
>> Anthony
>>
>>
>> -----Original Message-----
>> From: Muller, Anthony [mailto:anthony.muller@sap.com]
>> Sent: mercredi 2 février 2011 16:36
>> To: users@felix.apache.org
>> Subject: Felix - File Install
>>
>> Hello,
>>
>> I'm trying to use FileInstall but it doesn't work :-/
>>
>> I wrote an eclipse project with an only dependency with Felix.
>>
>> I put "org.apache.felix.fileinstall-3.1.4.jar" in a "bundles" directory
>> and this one is properly deploy by Felix.
>>
>> But I cannot configure FileInstall to manage a "dropins" directory in
>> order to automatically start bundles present here.
>>
>> Thanks for help,
>> Anthony
>>
>>
>> public class FelixLauncher {
>>
>>        private final HostActivator activator = new HostActivator();
>>
>>        private Framework felix;
>>
>>        public FelixLauncher() {
>>                // Create a configuration property map.
>>                final Map<Object, Object>  configMap = new HashMap<Object,
>> Object>();
>>
>>                // Create host activator;
>>                final List<Object>  list = new ArrayList<Object>();
>>                list.add(activator);
>>                configMap.put(FelixConstants.SYSTEMBUNDLE_ACTIVATORS_PROP,
>> list);
>>                configMap.put(AutoProcessor.AUTO_DEPLOY_DIR_PROPERY,
>> "bundles");
>>                configMap.put(AutoProcessor.AUTO_DEPLOY_ACTION_PROPERY,
>> AutoProcessor.AUTO_DEPLOY_INSTALL_VALUE);
>>
>>                try {
>>                        felix = new Felix(configMap);
>>                        felix.init();
>>
>>                        AutoProcessor.process(configMap,
>> felix.getBundleContext());
>>
>>                        felix.start();
>>
>>                        Bundle[] bnds =
>> felix.getBundleContext().getBundles();
>>                        for (Bundle bundle : bnds) {
>>                                bundle.start();
>>                                System.out.println(bundle + " : " +
>> bundle.getState());
>>                        }
>>                } catch (Exception ex) {
>>                        ex.printStackTrace();
>>                }
>>        }
>>
>>        public Framework getFramework() {
>>                return felix;
>>        }
>> }
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>



-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Felix - File Install

Posted by Guillaume Nodet <gn...@gmail.com>.
It should find the default values in the system proeprties or
framework properties, so if you append those at the end of the felix
configuration file, it should work.

On Wed, Feb 2, 2011 at 17:26, Richard S. Hall <he...@ungoverned.org> wrote:
> On 2/2/11 11:12, Muller, Anthony wrote:
>>
>> Richard,
>>
>> According your advice, I changed the auto-deploy value to "install,
>> start".
>>
>> So, when I print out bundles present in context, I have:
>> org.apache.felix.framework [0] : 32
>> org.apache.felix.fileinstall [1] : 32
>>
>> But, FileInstall is still not properly configured. Where must I put the
>> configuration file? Must I use a specific file name?
>
> I'll let the File Install experts answer that...
>
> -> richard
>
>> Thanks and regards,
>> Anthony
>>
>>
>>
>> "You are only telling the auto-deploy mechanism to install bundles, you
>> want to set the value to "install, start" so that it installs and starts the
>> auto-deploy bundles.
>> ->  richard"
>>
>> -----Original Message-----
>> From: Muller, Anthony [mailto:anthony.muller@sap.com]
>> Sent: mercredi 2 février 2011 16:40
>> To: users@felix.apache.org
>> Subject: RE: Felix - File Install
>>
>> I forgot to say that I wrote a configuration file:
>>
>> [conf/config.properties]
>> felix.fileinstall.poll=12000
>> felix.fileinstall.dir=dropins
>> felix.fileinstall.debug=-1
>> felix.fileinstall.bundles.new.start=true
>>
>> But I don't know how FileInstall can be able to find this configuration
>> file... :(
>>
>> Anthony
>>
>>
>> -----Original Message-----
>> From: Muller, Anthony [mailto:anthony.muller@sap.com]
>> Sent: mercredi 2 février 2011 16:36
>> To: users@felix.apache.org
>> Subject: Felix - File Install
>>
>> Hello,
>>
>> I'm trying to use FileInstall but it doesn't work :-/
>>
>> I wrote an eclipse project with an only dependency with Felix.
>>
>> I put "org.apache.felix.fileinstall-3.1.4.jar" in a "bundles" directory
>> and this one is properly deploy by Felix.
>>
>> But I cannot configure FileInstall to manage a "dropins" directory in
>> order to automatically start bundles present here.
>>
>> Thanks for help,
>> Anthony
>>
>>
>> public class FelixLauncher {
>>
>>        private final HostActivator activator = new HostActivator();
>>
>>        private Framework felix;
>>
>>        public FelixLauncher() {
>>                // Create a configuration property map.
>>                final Map<Object, Object>  configMap = new HashMap<Object,
>> Object>();
>>
>>                // Create host activator;
>>                final List<Object>  list = new ArrayList<Object>();
>>                list.add(activator);
>>                configMap.put(FelixConstants.SYSTEMBUNDLE_ACTIVATORS_PROP,
>> list);
>>                configMap.put(AutoProcessor.AUTO_DEPLOY_DIR_PROPERY,
>> "bundles");
>>                configMap.put(AutoProcessor.AUTO_DEPLOY_ACTION_PROPERY,
>> AutoProcessor.AUTO_DEPLOY_INSTALL_VALUE);
>>
>>                try {
>>                        felix = new Felix(configMap);
>>                        felix.init();
>>
>>                        AutoProcessor.process(configMap,
>> felix.getBundleContext());
>>
>>                        felix.start();
>>
>>                        Bundle[] bnds =
>> felix.getBundleContext().getBundles();
>>                        for (Bundle bundle : bnds) {
>>                                bundle.start();
>>                                System.out.println(bundle + " : " +
>> bundle.getState());
>>                        }
>>                } catch (Exception ex) {
>>                        ex.printStackTrace();
>>                }
>>        }
>>
>>        public Framework getFramework() {
>>                return felix;
>>        }
>> }
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>



-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Felix - File Install

Posted by "Richard S. Hall" <he...@ungoverned.org>.
On 2/2/11 11:12, Muller, Anthony wrote:
> Richard,
>
> According your advice, I changed the auto-deploy value to "install, start".
>
> So, when I print out bundles present in context, I have:
> org.apache.felix.framework [0] : 32
> org.apache.felix.fileinstall [1] : 32
>
> But, FileInstall is still not properly configured. Where must I put the configuration file? Must I use a specific file name?

I'll let the File Install experts answer that...

-> richard

> Thanks and regards,
> Anthony
>
>
>
> "You are only telling the auto-deploy mechanism to install bundles, you want to set the value to "install, start" so that it installs and starts the auto-deploy bundles.
> ->  richard"
>
> -----Original Message-----
> From: Muller, Anthony [mailto:anthony.muller@sap.com]
> Sent: mercredi 2 février 2011 16:40
> To: users@felix.apache.org
> Subject: RE: Felix - File Install
>
> I forgot to say that I wrote a configuration file:
>
> [conf/config.properties]
> felix.fileinstall.poll=12000
> felix.fileinstall.dir=dropins
> felix.fileinstall.debug=-1
> felix.fileinstall.bundles.new.start=true
>
> But I don't know how FileInstall can be able to find this configuration file... :(
>
> Anthony
>
>
> -----Original Message-----
> From: Muller, Anthony [mailto:anthony.muller@sap.com]
> Sent: mercredi 2 février 2011 16:36
> To: users@felix.apache.org
> Subject: Felix - File Install
>
> Hello,
>
> I'm trying to use FileInstall but it doesn't work :-/
>
> I wrote an eclipse project with an only dependency with Felix.
>
> I put "org.apache.felix.fileinstall-3.1.4.jar" in a "bundles" directory and this one is properly deploy by Felix.
>
> But I cannot configure FileInstall to manage a "dropins" directory in order to automatically start bundles present here.
>
> Thanks for help,
> Anthony
>
>
> public class FelixLauncher {
>
> 	private final HostActivator activator = new HostActivator();
>
> 	private Framework felix;
>
> 	public FelixLauncher() {
> 		// Create a configuration property map.
> 		final Map<Object, Object>  configMap = new HashMap<Object, Object>();
>
> 		// Create host activator;
> 		final List<Object>  list = new ArrayList<Object>();
> 		list.add(activator);
> 		configMap.put(FelixConstants.SYSTEMBUNDLE_ACTIVATORS_PROP, list);
> 		configMap.put(AutoProcessor.AUTO_DEPLOY_DIR_PROPERY, "bundles");
> 		configMap.put(AutoProcessor.AUTO_DEPLOY_ACTION_PROPERY, AutoProcessor.AUTO_DEPLOY_INSTALL_VALUE);
>
> 		try {
> 			felix = new Felix(configMap);
> 			felix.init();
>
> 			AutoProcessor.process(configMap, felix.getBundleContext());
>
> 			felix.start();
>
> 			Bundle[] bnds = felix.getBundleContext().getBundles();
> 			for (Bundle bundle : bnds) {
> 				bundle.start();
> 				System.out.println(bundle + " : " + bundle.getState());
> 			}
> 		} catch (Exception ex) {
> 			ex.printStackTrace();
> 		}
> 	}
>
> 	public Framework getFramework() {
> 		return felix;
> 	}
> }
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


RE: Felix - File Install

Posted by "Muller, Anthony" <an...@sap.com>.
Richard,

According your advice, I changed the auto-deploy value to "install, start".

So, when I print out bundles present in context, I have:
org.apache.felix.framework [0] : 32
org.apache.felix.fileinstall [1] : 32

But, FileInstall is still not properly configured. Where must I put the configuration file? Must I use a specific file name?

Thanks and regards,
Anthony



"You are only telling the auto-deploy mechanism to install bundles, you want to set the value to "install, start" so that it installs and starts the auto-deploy bundles.
-> richard"

-----Original Message-----
From: Muller, Anthony [mailto:anthony.muller@sap.com] 
Sent: mercredi 2 février 2011 16:40
To: users@felix.apache.org
Subject: RE: Felix - File Install

I forgot to say that I wrote a configuration file:

[conf/config.properties]
felix.fileinstall.poll=12000
felix.fileinstall.dir=dropins
felix.fileinstall.debug=-1
felix.fileinstall.bundles.new.start=true

But I don't know how FileInstall can be able to find this configuration file... :(

Anthony


-----Original Message-----
From: Muller, Anthony [mailto:anthony.muller@sap.com] 
Sent: mercredi 2 février 2011 16:36
To: users@felix.apache.org
Subject: Felix - File Install

Hello,

I'm trying to use FileInstall but it doesn't work :-/

I wrote an eclipse project with an only dependency with Felix.

I put "org.apache.felix.fileinstall-3.1.4.jar" in a "bundles" directory and this one is properly deploy by Felix.

But I cannot configure FileInstall to manage a "dropins" directory in order to automatically start bundles present here.

Thanks for help,
Anthony


public class FelixLauncher {

	private final HostActivator activator = new HostActivator();

	private Framework felix;

	public FelixLauncher() {
		// Create a configuration property map.
		final Map<Object, Object> configMap = new HashMap<Object, Object>();

		// Create host activator;
		final List<Object> list = new ArrayList<Object>();
		list.add(activator);
		configMap.put(FelixConstants.SYSTEMBUNDLE_ACTIVATORS_PROP, list);
		configMap.put(AutoProcessor.AUTO_DEPLOY_DIR_PROPERY, "bundles");
		configMap.put(AutoProcessor.AUTO_DEPLOY_ACTION_PROPERY, AutoProcessor.AUTO_DEPLOY_INSTALL_VALUE);

		try {
			felix = new Felix(configMap);
			felix.init();

			AutoProcessor.process(configMap, felix.getBundleContext());

			felix.start();

			Bundle[] bnds = felix.getBundleContext().getBundles();
			for (Bundle bundle : bnds) {
				bundle.start();
				System.out.println(bundle + " : " + bundle.getState());
			}
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}

	public Framework getFramework() {
		return felix;
	}
}

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


RE: Felix - File Install

Posted by "Muller, Anthony" <an...@sap.com>.
I forgot to say that I wrote a configuration file:

[conf/config.properties]
felix.fileinstall.poll=12000
felix.fileinstall.dir=dropins
felix.fileinstall.debug=-1
felix.fileinstall.bundles.new.start=true

But I don't know how FileInstall can be able to find this configuration file... :(

Anthony


-----Original Message-----
From: Muller, Anthony [mailto:anthony.muller@sap.com] 
Sent: mercredi 2 février 2011 16:36
To: users@felix.apache.org
Subject: Felix - File Install

Hello,

I'm trying to use FileInstall but it doesn't work :-/

I wrote an eclipse project with an only dependency with Felix.

I put "org.apache.felix.fileinstall-3.1.4.jar" in a "bundles" directory and this one is properly deploy by Felix.

But I cannot configure FileInstall to manage a "dropins" directory in order to automatically start bundles present here.

Thanks for help,
Anthony


public class FelixLauncher {

	private final HostActivator activator = new HostActivator();

	private Framework felix;

	public FelixLauncher() {
		// Create a configuration property map.
		final Map<Object, Object> configMap = new HashMap<Object, Object>();

		// Create host activator;
		final List<Object> list = new ArrayList<Object>();
		list.add(activator);
		configMap.put(FelixConstants.SYSTEMBUNDLE_ACTIVATORS_PROP, list);
		configMap.put(AutoProcessor.AUTO_DEPLOY_DIR_PROPERY, "bundles");
		configMap.put(AutoProcessor.AUTO_DEPLOY_ACTION_PROPERY, AutoProcessor.AUTO_DEPLOY_INSTALL_VALUE);

		try {
			felix = new Felix(configMap);
			felix.init();

			AutoProcessor.process(configMap, felix.getBundleContext());

			felix.start();

			Bundle[] bnds = felix.getBundleContext().getBundles();
			for (Bundle bundle : bnds) {
				bundle.start();
				System.out.println(bundle + " : " + bundle.getState());
			}
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}

	public Framework getFramework() {
		return felix;
	}
}

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org