You should. Try to use the current trunk (aka, 4.1.0-SNAPSHOT) and see if
that makes it work.

regards,

Karl


On Wed, Jan 2, 2013 at 5:03 PM, itay hindy <[email protected]> wrote:

> Thanks Karl,
>
> I upgraded from 4.0.2 to 4.0.3
>
> Now I have an exception for the second war: *java.lang.Error: factory
> already defined *and the bundle *does not start*.
>
> Probably because in URLHandlers
>
> *try*
> * {*
> *     URL.setURLStreamHandlerFactory(currentFactory);*
> *  }*
> *  catch (Exception ex)*
> *  {*
> *      // Ignore, this is a best effort (maybe log it or something)*
> *  }*
>
> and in *URL.setURLStreamHandlerFactory*
> if (factory != null) {
> throw new Error("factory already defined");
> }
>
> So I can not have 2 wars both with *felix.service.urlhandlers*=true?
>
> On Wed, Jan 2, 2013 at 5:48 PM, Karl Pauls <[email protected]> wrote:
>
> > did you try with the latest felix trunk? That should at least fix your
> > urlhandlers issue...
> >
> > regards,
> >
> > Karl
> >
> >
> > On Wed, Jan 2, 2013 at 4:41 PM, itay hindy <[email protected]> wrote:
> >
> > > Hi,
> > >
> > > I have tomcat war with embedded felix and it works great. I took it
> from
> > > the
> > > instructions at
> > >
> > >
> >
> http://felix.apache.org/site/apache-felix-framework-launching-and-embedding.html
> > >
> > > I am trying to run now multiple wars each with felix embedded. I am
> > having
> > > some problems:
> > >
> > > 1 - I configure *felix.cache.rootdir* for each war to be different. Is
> it
> > > correct?
> > > 2 - what should be the  *felix.service.urlhandlers* property? When I
> put
> > it
> > > *true *the first war works great and the second one fails with *Unknown
> > > protocol: obr*. This is because inside *URLHandlers *class the
> > > *m_streamHandlerFactory
> > > *field is different between the first and second war. So should *
> > > felix.service.urlhandlers* be *false*? in that case what should be the
> j*
> > > ava.protocol.handler.pkgs*?
> > > 3 - The next lines:
> > > *        url =
> > >
> > >
> >
>  
> this.servletContext.getResource("/WEB-INF/lib/org.apache.felix.http.bridge-2.2.0.jar");
> > > *
> > > *     bundle = context.installBundle(url.toExternalForm());*
> > > *     bundle.start(); *
> > > works for the first war but for the second I get:
> > > ERROR: Bundle org.apache.felix.http.bridge [2] Error starting
> > >
> >
> jndi:/localhost/itay/qa/WEB-INF/lib/org.apache.felix.http.bridge-2.2.0.jar
> > > (org.osgi.framework.BundleException: Activator start error in bundle
> > > org.apache.felix.http.bridge [2].)
> > > java.lang.LinkageError: loader constraint violation: when resolving
> > > overridden method
> > >
> > >
> >
> "org.apache.felix.http.base.internal.listener.AbstractListenerManager.addingService(Lorg/osgi/framework/ServiceReference;)Ljava/lang/Object;"
> > > the class lo
> > > ader (instance of
> > > org/apache/felix/framework/BundleWiringImpl$BundleClassLoaderJava5) of
> > the
> > > current class,
> > > org/apache/felix/http/base/internal/listener/AbstractListenerManager,
> and
> > > its superclass loader (instance of org/apache/catalina/loa
> > > der/WebappClassLoader), have different Class objects for the type
> > > org/osgi/framework/ServiceReference used in the signature
> > >         at
> > >
> > >
> >
> org.apache.felix.http.base.internal.HttpServiceController.<init>(HttpServiceController.java:76)
> > >
> > >
> > > Does anyone have an example for multiple wars each with felix embedded?
> > >
> > > Thanks in advance.
> > >
> > > --
> > > Regards,
> > >
> > > Itay Hindy
> > > Software Solutions
> > > +972-54-5935042
> > > linkedin: http://www.linkedin.com/in/itayhindy
> > >
> >
> >
> >
> > --
> > Karl Pauls
> > [email protected]
> > http://twitter.com/karlpauls
> > http://www.linkedin.com/in/karlpauls
> > https://profiles.google.com/karlpauls
> >
>
>
>
> --
> Regards,
>
> Itay Hindy
> Software Solutions
> +972-54-5935042
> linkedin: http://www.linkedin.com/in/itayhindy
>



-- 
Karl Pauls
[email protected]
http://twitter.com/karlpauls
http://www.linkedin.com/in/karlpauls
https://profiles.google.com/karlpauls

Reply via email to