felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Richard S. Hall" <he...@ungoverned.org>
Subject Re: felix starter script
Date Fri, 19 Oct 2007 19:07:16 GMT
Jonhnny,

In truth, that start script in etc/ is really a legacy thing and should 
probably be deleted. I think this topic was brought up before, but we 
never concluded what to do about it. I would vote to delete it, since 
typing "java -jar bin/felix.jar" is not too difficult.

The issue you are having about not finding the auto-start bundles is not 
really related. The auto-start properties use relative bundle paths to 
load the bundles from the Felix bundle/ directory, thus if you start 
Felix from any other directory than its install directory it cannot find 
its bundles.

If you edit the conf/config.properties file to use absolute paths to 
your bundles, then you should be able to start Felix from any directory. 
Since Felix doesn't currently have an installer, we don't do any 
post-processing of the config file to change the bundles to the precise 
directory...further, I am not sure we would want to because then it 
means you cannot relocate the directory easily.

Your idea for creating a script should work fine. I think you could also 
define your felix.home system property in conf/system.properties so that 
you don't have to specify it each time.

-> richard


Jonhnny Weslley wrote:
> Hi,
>
> In Felix 1.0.1 release a script file is available to start the felix.
> However, this script is placed at 'etc' directory, when usually
> scripts are placed at 'bin' directory! Why?
>
> The script is very simple, then I did another script attached in this 
> mail.
> But when I executed my script, or when I start felix from another
> directory different of the installation directory, felix isn't able to 
> find
> my auto-started bundles.
>
> The console output is:
>
>
> CONSOLE ==============================
> ============
>
> jonhnny@argus:~ $ felix
>
> Welcome to Felix.
> =================
>
> Enter profile name: jonhnny
>
> ERROR: Auto-properties install. (org.osgi.framework.BundleException : 
> Unable to cache bundle: file:bundle/org.apache.felix.shell-1.0.0.jar)
> java.io.FileNotFoundException: bundle/org.apache.felix.shell-1.0.0.jar 
> (No such file or directory)
> ...
> ERROR: Auto-properties install. (org.osgi.framework.BundleException: 
> Unable to cache bundle: file:bundle/org.apache.felix.shell.tui- 1.0.0.jar)
> java.io.FileNotFoundException: 
> bundle/org.apache.felix.shell.tui-1.0.0.jar (No such file or directory)
> ...
> and other auto-started bundles
>
> My felix was installed at ' /usr/local/felix' directory.
> However when I start felix, independently to be by shell script or 
> directly executing java comand, it searchs the auto-start bundles 
> configured in the config.properties at the local directory where the 
> command was executed.
> Then when I execute ' java -jar /usr/local/felix/bin/felix.jar' at my 
> home directory, it searchs my bundles at
> '~/bundles/mybundlename.jar'.
>
> I thought in a basic solution.
> 1. Define a system property felix.home, this value is assigned at the 
> script file
> 2. Change the config.properties file to:
> ...
> felix.auto.start.1= \
>  file:${felix.home}/bundle/org.apache.felix.shell-1.0.0.jar \
>  file:${felix.home}/bundle/org.apache.felix.shell.tui-1.0.0.jar \
>  file:${felix.home}/bundle/org.apache.felix.bundlerepository-1.0.0.jar
> ...
>
> The script assumes the follow hierarchy directory:
> FELIX_HOME/
>    |- bin/
>    |    |- felix     (the script file)
>    |- lib/
>    |    |-felix.jar  (the felix jar)
>    |- bundle/
>    |- conf/
>    |
>  others

Mime
View raw message