Can you make a simple example of this available to me?

regards,

Karl


On Wed, Jan 2, 2013 at 9:21 AM, itay hindy <[email protected]> wrote:

> Sorry, I had some issues and I was not clear enough.
>
> Let me summarize:
> 1 - I manage to run the war with the embedded felix and everything works
> great.
> 2 - I had to run the below lines in order that the ProxyServlet will pass
> requests to my bundle that use a servlet
> *     //need it for the dispatcher to work*
> *    url =
>
>  
> this.servletContext.getResource("/WEB-INF/lib/org.apache.felix.http.bridge-2.2.0.jar");
> *
> *    bundle = context.installBundle(url.toExternalForm());*
> *    bundle.start(); *
> 3 - As I said everything works great with one war running in tomcat. When I
> try to use 2 wars side by side I get the below exception:
> 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)
>
> Thanks
>
>
> On Tue, Jan 1, 2013 at 4:23 PM, Richard S. Hall <[email protected]
> >wrote:
>
> > On 1/1/13 06:12, itay hindy wrote:
> >
> >> Ignore my last mail, I figure it out. It was because of activators
> order.
> >>
> >> Another question, I manage now to run the war that used the embedded
> >> felix.
> >> I try to execute http requests but fail on the the ProxyServlet. The
> >> DispatcherTracker has not been initialize so
> this.tracker.getDispatcher()
> >> returns null.
> >>
> >> How can I activate it?
> >>
> >
> > Sorry, I don't know what you are talking about.
> >
> > -> richard
> >
> >
> >> Thanks in advance
> >>
> >> On Tue, Jan 1, 2013 at 10:10 AM, itay hindy <[email protected]>
> wrote:
> >>
> >>  Thanks Richard, I followed your advice and make it works.
> >>> Now I have a new Issue:
> >>>
> >>> I try to use *bundle.update() *and I get next exception:
> >>> *Caused by: java.net.**MalformedURLException: Unknown protocol: obr
> >>> *
> >>> When I run felix *not *embedded from tomcat everything works.
> >>>
> >>>
> >>> I looked into it and the problem seems to be that when running embedded
> >>> felix within tomcat the URLHandlersStreamHandlerProxy class is not
> used.
> >>>
> >>> The next line:
> >>> *return new URL(context, "obr:...", handler)*
> >>>
> >>> for embedded felix just tries to create url while for stand alone felix
> >>> it
> >>> uses the URLHandlersStreamHandlerProxy.
> >>>
> >>> Any Idea how to config it?
> >>>
> >>> On Thu, Dec 27, 2012 at 4:08 PM, Richard S. Hall <[email protected]
> >>> >wrote:
> >>>
> >>>  On 12/27/12 07:25, itay hindy wrote:
> >>>>
> >>>>  Hi All,
> >>>>>
> >>>>> I have a question about running embedded felix within tomcat.
> >>>>>
> >>>>> I had follow the instructions at
> >>>>> http://felix.apache.org/site/****apache-felix-framework-**<
> http://felix.apache.org/site/**apache-felix-framework-**>
> >>>>> launching-and-embedding.html<h**ttp://felix.apache.org/site/**
> >>>>> apache-felix-framework-**launching-and-embedding.html<
> http://felix.apache.org/site/apache-felix-framework-launching-and-embedding.html
> >
> >>>>> >
> >>>>>
> >>>>>
> >>>>> I manage to run felix within tomcat, however I have a problem with
> >>>>>  class
> >>>>> loaders.
> >>>>>
> >>>>> Here is the scenario:
> >>>>> 1 - My host application needs to use the RepositoryAdmin service
> >>>>> from org.apache.felix.****bundlerepository-1.6.6.jar bundle
> >>>>> 2 - I add the org.apache.felix.****bundlerepository-1.6.6.jar to my
> >>>>> class
> >>>>>
> >>>>> path
> >>>>> so I can access its interfaces
> >>>>> 3 - I install this bundle on my host application activator code
> >>>>>        URL url =
> >>>>>    this.servletContext.****getResource("/WEB-INF/lib/org.****
> >>>>> apache.felix.bundlerepository-****1.6.6.jar");
> >>>>>       Bundle bundle =
> context.installBundle(url.****toExternalForm());
> >>>>>
> >>>>>       bundle.start();
> >>>>> 4 - I have created ServiceTracker for the RepositoryAdmin service
> >>>>> 5 - In the ServiceTracker the next bold line fails with class cast
> >>>>> exception
> >>>>> public Object addingService(ServiceReference reference) {
> >>>>>                   Object serviceObject =
> super.addingService(reference)
> >>>>> ****
> >>>>> ;
> >>>>>               try {
> >>>>>                       *repositoryAdmin = (RepositoryAdmin)**
> >>>>>
> >>>>> serviceObject*;
> >>>>>
> >>>>> } catch (Exception e) {
> >>>>> e.printStackTrace();
> >>>>> }
> >>>>>                   return repositoryAdmin;
> >>>>>               }
> >>>>>
> >>>>> The reason seems to be because RepositoryAdmin interface classloader
> >>>>>   comes
> >>>>> from org.apache.catalina.loader.****WebappClassLoader and the
> >>>>>
> >>>>> actual RepositoryAdminImpl  object (the *serviceObject*) is coming
> from
> >>>>> BundleWiringImpl$****BundleClassLoaderJava5
> >>>>>
> >>>>>  Yes, of course. The bundle doesn't have access to your outer
> >>>> repository
> >>>> classes and your host doesn't have access to the bundle's repository
> >>>> classes.
> >>>>
> >>>> You will need to try to export the repository packages from your host
> >>>> app
> >>>> via the system bundle. Of course, this will only work if the
> repository
> >>>> bundle properly imports AND exports the repository packages. Even if
> it
> >>>> does, it is tricky and might not work if there are any "uses"
> constraint
> >>>> issues, but you could try. If that doesn't work, you could look into
> >>>> boot
> >>>> delegating the packages from your class path, but that is a last
> resort.
> >>>>
> >>>> -> richard
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>  Any Idea?
> >>>>>
> >>>>> Regards,
> >>>>> Itay Hindy
> >>>>>
> >>>>>
> >>>>>  ------------------------------****----------------------------**
> >>>> --**---------
> >>>> To unsubscribe, e-mail: users-unsubscribe@felix.**apac**he.org<
> http://apache.org>
> >>>> <users-unsubscribe@**felix.apache.org<
> [email protected]>
> >>>> >
> >>>>
> >>>> For additional commands, e-mail: [email protected]
> >>>>
> >>>>
> >>>>
> >>> --
> >>> Regards,
> >>>
> >>> Itay Hindy
> >>> Software Solutions
> >>> +972-54-5935042
> >>> linkedin: http://www.linkedin.com/in/**itayhindy<
> http://www.linkedin.com/in/itayhindy>
> >>>
> >>>
> >>
> >>
> >
> > ------------------------------**------------------------------**---------
> > To unsubscribe, e-mail: users-unsubscribe@felix.**apache.org<
> [email protected]>
> > For additional commands, e-mail: [email protected]
> >
> >
>
>
> --
> 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