You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by Craig Phillips <lc...@praxiseng.com> on 2009/10/30 19:18:19 UTC

launching felix: changes from 1.x to 2.x

Hi,
 
I'm posting to the group, sort of as a way of cheating... I printed out the 17 pages on embedding felix for release 2.0.1 and I'm sort of trying to empty my head and to in to it as if "cold"; I tried playing around with my existing 1.x launcher and sort of tweak a few lines, but that went no where (AFAICT), and started to get a little frustrated... So, in a cheat way,  was wondering if someone out there could maybe take a look at my 1.x snippet and reply back with an equivalent 2.x snippet.. To no avail, my 1.x snippet:
----------------------------------------------------------------------
import org.apache.felix.main.Main;
import org.apache.felix.framework.Felix;
import org.apache.felix.main.AutoActivator; // now defunct
 
Felix felix = null
 
System.getProperties().setProperty(Main.CONFIG_PROPERTIES_PROP, "file:conf/config.properties");
Main.loadSystemProperties();
Properties configProps = Main.loadConfigProperties();
List<AutoActivator> list = new ArrayList<AutoActivator>();
list.add(new AutoActivator(configProps));
Map map = new StringMap(configProps, false);
felix = new Felix(map, list);
felix.start();
------------------------------------------------------
 
If someone out there can do a translation, I'd be much appreciative...
 
Thanks, Craig Phillips, Praxis Engineering, Inc.
 
 

Re: Success: launching felix: changes from 1.x to 2.x

Posted by "Richard S. Hall" <he...@ungoverned.org>.
On 11/2/09 8:14, Craig Phillips wrote:
> Hello,
>
> felix.auto.deploy.dir  -- this was the trick...  I had to set 
> this...   The default config.properties has this commented out with a 
> default of "bundle" which I presume to be relative...  Once I set 
> this, all was fine...

That doesn't totally make sense. The "bundle" directory is the default 
for the auto-deploy directory whether you set it or not, check a normal 
Felix framework installation and you can see we do not set it. The 
felix.auto.deploy.actions is what does not have a default setting, so no 
value is the same as disabling auto-deploy.

The auto-install/start properties should still work as before, so I 
guess something is still messed up. But as long as you got it working, 
then I guess that is good.

-> richard

>
> Thanks for your consideration, support, shoulder, et al, much 
> appreciated, Craig Phillips, Praxis
>
>
>
> From: Craig Phillips
> Sent: Mon 11/2/2009 8:06 AM
> To: dev@felix.apache.org
> Subject: RE: launching felix: changes from 1.x to 2.x
>
>
> Hello,
>
> Unfortunately, this didn't work, for which I'll try to describe...  
> From what I can tell, there is no evidence that the auto-start 
> occurred...  a 'felix-cache' directory was created and a 'bundle0' 
> directory was created, but that is the extent of any evidence that 
> anything occurred...   there are no stdout System.out messages that I 
> can use to diagnose and no exceptions where thrown...
>
> I can run the "sandbox" by hand and it works perfectly...   So, what I 
> do is, in the parent embedding layer, create a "sandbox" in the normal 
> way:  a directory structure with "bin" and "bundle" and 
> "conf/config.properties" and follow the code you outline below...  If 
> I manually cd to the directory structure ('er, the "sandbox") and run 
> felix.jar, all is well...
>
> I believe that it had to pick up the config.properties (for which I 
> supply the full path... note I am running on Linux, but that shouldn't 
> matter as I use 'File.separator') -- the reason I believe it did find 
> config.properties is because it new where to put the 'felix-cache' 
> directory structure... without config.properties, it would not have 
> found that location, since my CWD is somewhere else;
>
> I'm guessing it was the autostart that didn't engage, although I have 
> no exceptions or other evidence to trace / trap / diagnose...
>
> Thanks for your consideration, Craig Phillips, Praxis
>
> PS - I am using the standard config.properties (felix 2.0.1) out of 
> the box without any modification, other than the bootdelegation line 
> for the embedding layer class(es);
>
>
>
> From: Richard S. Hall
> Sent: Fri 10/30/2009 3:10 PM
> To: dev@felix.apache.org
> Subject: Re: launching felix: changes from 1.x to 2.x
>
>
> On 10/30/09 14:18, Craig Phillips wrote:
>> Hi,
>>
>> I'm posting to the group, sort of as a way of cheating... I printed 
>> out the 17 pages on embedding felix for release 2.0.1 and I'm sort of 
>> trying to empty my head and to in to it as if "cold"; I tried playing 
>> around with my existing 1.x launcher and sort of tweak a few lines, 
>> but that went no where (AFAICT), and started to get a little 
>> frustrated... So, in a cheat way,  was wondering if someone out there 
>> could maybe take a look at my 1.x snippet and reply back with an 
>> equivalent 2.x snippet.. To no avail, my 1.x snippet:
>> ----------------------------------------------------------------------
>> import org.apache.felix.main.Main;
>> import org.apache.felix.framework.Felix;
>> import org.apache.felix.main.AutoActivator; // now defunct
>>
>> Felix felix = null
>>
>> System.getProperties().setProperty(Main.CONFIG_PROPERTIES_PROP, 
>> "file:conf/config.properties");
>> Main.loadSystemProperties();
>> Properties configProps = Main.loadConfigProperties();
>> List<AutoActivator>  list = new ArrayList<AutoActivator>();
>> list.add(new AutoActivator(configProps));
>> Map map = new StringMap(configProps, false);
>> felix = new Felix(map, list);
>> felix.start();
>> ------------------------------------------------------
>>
>> If someone out there can do a translation, I'd be much appreciative...
>>
>
> Yeah, this stuff changed a lot to be compliant with the new R4.2 
> embedding API. I think it should be sufficient to do:
>
>     System.getProperties().setProperty(
>         Main.CONFIG_PROPERTIES_PROP, "file:conf/config.properties");
>     Main.loadSystemProperties();
>     Properties configProps = Main.loadConfigProperties();
>     Main.copySystemProperties(configProps);
>     Felix felix = new Felix(configProps);
>     felix.init();
>     AutoProcessor.process(configProps, felix.getBundleContext());
>     felix.start();
>     felix.waitForStop(0);
>     System.exit(0);
>
> -> richard
>
>> Thanks, Craig Phillips, Praxis Engineering, Inc.
>>
>>
>>
>

Success: launching felix: changes from 1.x to 2.x

Posted by Craig Phillips <lc...@praxiseng.com>.
Hello,

felix.auto.deploy.dir  -- this was the trick...  I had to set this...   The default config.properties has this commented out with a default of "bundle" which I presume to be relative...  Once I set this, all was fine...

Thanks for your consideration, support, shoulder, et al, much appreciated, Craig Phillips, Praxis



From: Craig Phillips
Sent: Mon 11/2/2009 8:06 AM
To: dev@felix.apache.org
Subject: RE: launching felix: changes from 1.x to 2.x


Hello,

Unfortunately, this didn't work, for which I'll try to describe...  From what I can tell, there is no evidence that the auto-start occurred...  a 'felix-cache' directory was created and a 'bundle0' directory was created, but that is the extent of any evidence that anything occurred...   there are no stdout System.out messages that I can use to diagnose and no exceptions where thrown...

I can run the "sandbox" by hand and it works perfectly...   So, what I do is, in the parent embedding layer, create a "sandbox" in the normal way:  a directory structure with "bin" and "bundle" and "conf/config.properties" and follow the code you outline below...  If I manually cd to the directory structure ('er, the "sandbox") and run felix.jar, all is well...

I believe that it had to pick up the config.properties (for which I supply the full path... note I am running on Linux, but that shouldn't matter as I use 'File.separator') -- the reason I believe it did find config.properties is because it new where to put the 'felix-cache' directory structure... without config.properties, it would not have found that location, since my CWD is somewhere else;

I'm guessing it was the autostart that didn't engage, although I have no exceptions or other evidence to trace / trap / diagnose...

Thanks for your consideration, Craig Phillips, Praxis

PS - I am using the standard config.properties (felix 2.0.1) out of the box without any modification, other than the bootdelegation line for the embedding layer class(es);



From: Richard S. Hall
Sent: Fri 10/30/2009 3:10 PM
To: dev@felix.apache.org
Subject: Re: launching felix: changes from 1.x to 2.x


On 10/30/09 14:18, Craig Phillips wrote:
> Hi,
>
> I'm posting to the group, sort of as a way of cheating... I printed out the 17 pages on embedding felix for release 2.0.1 and I'm sort of trying to empty my head and to in to it as if "cold"; I tried playing around with my existing 1.x launcher and sort of tweak a few lines, but that went no where (AFAICT), and started to get a little frustrated... So, in a cheat way,  was wondering if someone out there could maybe take a look at my 1.x snippet and reply back with an equivalent 2.x snippet.. To no avail, my 1.x snippet:
> ----------------------------------------------------------------------
> import org.apache.felix.main.Main;
> import org.apache.felix.framework.Felix;
> import org.apache.felix.main.AutoActivator; // now defunct
>
> Felix felix = null
>
> System.getProperties().setProperty(Main.CONFIG_PROPERTIES_PROP, "file:conf/config.properties");
> Main.loadSystemProperties();
> Properties configProps = Main.loadConfigProperties();
> List<AutoActivator>  list = new ArrayList<AutoActivator>();
> list.add(new AutoActivator(configProps));
> Map map = new StringMap(configProps, false);
> felix = new Felix(map, list);
> felix.start();
> ------------------------------------------------------
>
> If someone out there can do a translation, I'd be much appreciative...
>
>    

Yeah, this stuff changed a lot to be compliant with the new R4.2 
embedding API. I think it should be sufficient to do:

     System.getProperties().setProperty(
         Main.CONFIG_PROPERTIES_PROP, "file:conf/config.properties");
     Main.loadSystemProperties();
     Properties configProps = Main.loadConfigProperties();
     Main.copySystemProperties(configProps);
     Felix felix = new Felix(configProps);
     felix.init();
     AutoProcessor.process(configProps, felix.getBundleContext());
     felix.start();
     felix.waitForStop(0);
     System.exit(0);

-> richard

> Thanks, Craig Phillips, Praxis Engineering, Inc.
>
>
>
>    

RE: launching felix: changes from 1.x to 2.x

Posted by Craig Phillips <lc...@praxiseng.com>.
Hello,

Unfortunately, this didn't work, for which I'll try to describe...  From what I can tell, there is no evidence that the auto-start occurred...  a 'felix-cache' directory was created and a 'bundle0' directory was created, but that is the extent of any evidence that anything occurred...   there are no stdout System.out messages that I can use to diagnose and no exceptions where thrown...

I can run the "sandbox" by hand and it works perfectly...   So, what I do is, in the parent embedding layer, create a "sandbox" in the normal way:  a directory structure with "bin" and "bundle" and "conf/config.properties" and follow the code you outline below...  If I manually cd to the directory structure ('er, the "sandbox") and run felix.jar, all is well...

I believe that it had to pick up the config.properties (for which I supply the full path... note I am running on Linux, but that shouldn't matter as I use 'File.separator') -- the reason I believe it did find config.properties is because it new where to put the 'felix-cache' directory structure... without config.properties, it would not have found that location, since my CWD is somewhere else;

I'm guessing it was the autostart that didn't engage, although I have no exceptions or other evidence to trace / trap / diagnose...

Thanks for your consideration, Craig Phillips, Praxis

PS - I am using the standard config.properties (felix 2.0.1) out of the box without any modification, other than the bootdelegation line for the embedding layer class(es);



From: Richard S. Hall
Sent: Fri 10/30/2009 3:10 PM
To: dev@felix.apache.org
Subject: Re: launching felix: changes from 1.x to 2.x


On 10/30/09 14:18, Craig Phillips wrote:
> Hi,
>
> I'm posting to the group, sort of as a way of cheating... I printed out the 17 pages on embedding felix for release 2.0.1 and I'm sort of trying to empty my head and to in to it as if "cold"; I tried playing around with my existing 1.x launcher and sort of tweak a few lines, but that went no where (AFAICT), and started to get a little frustrated... So, in a cheat way,  was wondering if someone out there could maybe take a look at my 1.x snippet and reply back with an equivalent 2.x snippet.. To no avail, my 1.x snippet:
> ----------------------------------------------------------------------
> import org.apache.felix.main.Main;
> import org.apache.felix.framework.Felix;
> import org.apache.felix.main.AutoActivator; // now defunct
>
> Felix felix = null
>
> System.getProperties().setProperty(Main.CONFIG_PROPERTIES_PROP, "file:conf/config.properties");
> Main.loadSystemProperties();
> Properties configProps = Main.loadConfigProperties();
> List<AutoActivator>  list = new ArrayList<AutoActivator>();
> list.add(new AutoActivator(configProps));
> Map map = new StringMap(configProps, false);
> felix = new Felix(map, list);
> felix.start();
> ------------------------------------------------------
>
> If someone out there can do a translation, I'd be much appreciative...
>
>    

Yeah, this stuff changed a lot to be compliant with the new R4.2 
embedding API. I think it should be sufficient to do:

     System.getProperties().setProperty(
         Main.CONFIG_PROPERTIES_PROP, "file:conf/config.properties");
     Main.loadSystemProperties();
     Properties configProps = Main.loadConfigProperties();
     Main.copySystemProperties(configProps);
     Felix felix = new Felix(configProps);
     felix.init();
     AutoProcessor.process(configProps, felix.getBundleContext());
     felix.start();
     felix.waitForStop(0);
     System.exit(0);

-> richard

> Thanks, Craig Phillips, Praxis Engineering, Inc.
>
>
>
>    

Re: launching felix: changes from 1.x to 2.x

Posted by "Richard S. Hall" <he...@ungoverned.org>.
On 10/30/09 14:18, Craig Phillips wrote:
> Hi,
>
> I'm posting to the group, sort of as a way of cheating... I printed out the 17 pages on embedding felix for release 2.0.1 and I'm sort of trying to empty my head and to in to it as if "cold"; I tried playing around with my existing 1.x launcher and sort of tweak a few lines, but that went no where (AFAICT), and started to get a little frustrated... So, in a cheat way,  was wondering if someone out there could maybe take a look at my 1.x snippet and reply back with an equivalent 2.x snippet.. To no avail, my 1.x snippet:
> ----------------------------------------------------------------------
> import org.apache.felix.main.Main;
> import org.apache.felix.framework.Felix;
> import org.apache.felix.main.AutoActivator; // now defunct
>
> Felix felix = null
>
> System.getProperties().setProperty(Main.CONFIG_PROPERTIES_PROP, "file:conf/config.properties");
> Main.loadSystemProperties();
> Properties configProps = Main.loadConfigProperties();
> List<AutoActivator>  list = new ArrayList<AutoActivator>();
> list.add(new AutoActivator(configProps));
> Map map = new StringMap(configProps, false);
> felix = new Felix(map, list);
> felix.start();
> ------------------------------------------------------
>
> If someone out there can do a translation, I'd be much appreciative...
>
>    

Yeah, this stuff changed a lot to be compliant with the new R4.2 
embedding API. I think it should be sufficient to do:

     System.getProperties().setProperty(
         Main.CONFIG_PROPERTIES_PROP, "file:conf/config.properties");
     Main.loadSystemProperties();
     Properties configProps = Main.loadConfigProperties();
     Main.copySystemProperties(configProps);
     Felix felix = new Felix(configProps);
     felix.init();
     AutoProcessor.process(configProps, felix.getBundleContext());
     felix.start();
     felix.waitForStop(0);
     System.exit(0);

-> richard

> Thanks, Craig Phillips, Praxis Engineering, Inc.
>
>
>
>