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: [email protected]
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.



Reply via email to