When you are launching Felix yourself, then the config.properties file
is never read...that file is only read by the Main launcher. Since you
are creating your own launcher, you can just add the property to your
configMap.
-> richard
Camila Nunes wrote:
---------- Forwarded message ----------
From: Camila Nunes <[EMAIL PROTECTED]>
Date: 15/11/2006 10:13
Subject: Start felix
To: Felix <[EMAIL PROTECTED]>
Hi everybody,
I am still problems to start the felix inside the tomcat. I want to
integrate the tomcat with felix to provide dinamicity. So, in start
method
of Tomcat, I want to start
felix and install the bundles are in lib folder.
The error is:
ERROR: Unable to start system bundle.
(org.osgi.framework.BundleException: Unable to start system bundle.)
java.lang.Error: factory already defined.
Richard tell me the problem it is related to setting the URL stream
handler
factory and you can disable Felix from setting this, read about disabling
the URL Handlers service.
However, I got the (framework folder) framework source because I changed
some class access modifiers, and this is the jar I put in my project.
And in
this folder the config.properties file stays in etc folder and in this
file
I added:
felix.service.urlhandlers =false.
However, it does not work.
File _dir = new File(ctx.getServletContext().getRealPath(
"/WEB-INF/lib"));
Bundle _bundle;
InputStream _input;
File[] _bundles = _dir.listFiles(new FileFilter() {
public boolean accept(File file){
return file.getName().endsWith(".jar");
}
});
if (_bundles != null) {
Map configMap = new StringMap(false);
configMap.put(Constants.FRAMEWORK_SYSTEMPACKAGES,
"org.osgi.framework; version=1.3.0," +
" org.osgi.service.packageadmin;
version=1.2.0,"
+
"org.osgi.service.startlevel;
version=1.0.0," +
"org.osgi.service.url; version=1.0.0");
for (File _file : _bundles) {
configMap.put(FelixConstants.AUTO_START_PROP +
".1",
"file:" + _file.getPath());
}
configMap.put(BundleCache.CACHE_PROFILE_PROP,
getContainer()
.getName());
Felix _felix = new Felix();
_felix.start(new
MutablePropertyResolverImpl(configMap),
null);
}
Can Anybory help me to solve this issue?
Thanks
Camila.