users@glassfish.java.net

Re: Loading log util bundle before the rest

From: Sahoo <sanjeeb.sahoo_at_oracle.com>
Date: Tue, 12 Jul 2011 22:53:09 +0530

This can be achieved by using fileinstall like this:

a) Add a fileinstall configuration called
org.apache.felix.fileinstall-sl2.cfg files in domain1/autodeploy/ to
monitor a directory (say domain1/autodeploy/bundle2) where you will
deploy your log4j bundles and let them be started at start level 2.
Its content will be something like this:

# Directory being watched by fileinstall.
felix.fileinstall.dir=${com.sun.aas.instanceRoot}/autodeploy/bundles2/
# Time period fileinstaller thread in ms.
felix.fileinstall.poll=5000
# log level
felix.fileinstall.log.level=3
# should new bundles be started or installed only? true => start, false
=> only install
felix.fileinstall.bundles.new.start=true
# should bundles be started transiently?
felix.fileinstall.bundles.startTransient=false
# start level of bundles in this dir.
felix.fileinstall.bundles.start.level=2

Drop your log4j related bundles to this dir (domain1/autodeploy/bundles2/)

b) Add another fileinstall configuration called
org.apache.felix.fileinstall-sl2.cfg files in domain1/autodeploy/ to
monitor a directory (say domain1/autodeploy/bundles3) where you will
deploy your application bundles and let them be started at start level 3.
It will look similar to the above except that it will use start level 3.
Drop your application bundles to this watched directory(i.e.,
domain1/autodeploy/bundles3/).

c) Now, you need to instruct Felix to set the framework start level to 3
by setting org.osgi.framework.startlevel.beginning=3 in felix's
config.properties.

HTH,
Sahoo

On Tuesday 12 July 2011 08:32 PM, forums_at_java.net wrote:
> Probably I didn't explain myself properly. My log4j util should be loaded
> *before *the rest of my *application *bundles. It can be loaded after
> glassfish bundles.
>
> sorry for this misunderstanding
>
>
> --
>
> [Message sent by forum member 'okna2000']
>
> View Post: http://forums.java.net/node/819498
>
>