I'm currently embedding Jetty in the felix framework, using the examples provided on the felix webside:

http://felix.apache.org/site/apache-felix-framework-launching-and-embedding.html

and

http://felix.apache.org/documentation/subprojects/apache-felix-http-service.html

The problem in when I try to use the context to get the HttpService:

public class Activator implements BundleActivator
{
  public void start(BundleContext context) throws Exception
  {
ServiceReference sRef = context.getServiceReference(HttpService.class.getName());
    if (sRef != null)
    {
      HttpService service = (HttpService) context.getService(sRef);
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

      HttpContext myHttpContext = new MyHttpContext());
      service.registerResources("/static", "/etc/www", myHttpContext);
    }
  }
}

When this line is executed, I get this exception:

Error starting framework: java.lang.ClassCastException: org.apache.felix.http.base.internal.service.HttpServiceImpl cannot be cast to org.osgi.service.http.HttpService java.lang.ClassCastException: org.apache.felix.http.base.internal.service.HttpSe
rviceImpl cannot be cast to org.osgi.service.http.HttpService
        at main.HostApplication.main(HostApplication.java:197)


What I am doing wrong?

        fulvio

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to