felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Camila Nunes" <cami...@gmail.com>
Subject Fwd: Start felix
Date Wed, 15 Nov 2006 17:15:24 GMT
---------- Forwarded message ----------
From: Camila Nunes <camilan@gmail.com>
Date: 15/11/2006 10:13
Subject: Start felix
To: Felix <felix-dev-subscribe@incubator.apache.org>

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.


-- 
Camila Nunes
Instituto de Computação (IC)
Universidade Federal de Alagoas - UFAL

-- 
Camila Nunes
Instituto de Computação (IC)
Universidade Federal de Alagoas - UFAL

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message