Camila Nunes wrote:
In relation to get the bundle classloader, is not possible ?
There is no standard way of getting a bundle class loader. You can use
Bundle.loadClass() and Bundle.getResource() to basically construct a
class loader for a bundle, however.
-> richard
Because I want to implement a new loader for tomcat, in other words,
public class OSGiWebappLoader implements Loader. So, I would have a
root-bundle and this bundle would import all the packages other bundles.
I would have:
Root-Bundle
---BundleA --- BundleB..
2006/11/16, Richard S. Hall <[EMAIL PROTECTED]>:
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.
>
>