felix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "PN. Truong Phuc" <pn.truongp...@gmail.com>
Subject Issue when using Felix Http service bundle package.
Date Tue, 01 Feb 2011 12:08:11 GMT
Hi all,

I'm new to osgi and felix.
I have read the tutorial about the Http service on felix site. I have try to
create the simple servlet like the tutorial mention.
I have start the bundle org.apache.felix.http.bundle-2.0.4.jar but when I
start to start my bundle the Http service did not run.
Below is my code:

 public class Main implements BundleActivator{
>
>
>>  public void start(BundleContext bc) throws Exception {
>
>  ServiceReference sRef =
>> bc.getServiceReference(HttpService.class.getName());
>
>  if (sRef != null)
>
>  {
>
>   HttpService service = (HttpService) bc.getService(sRef);
>
>   service.registerServlet("/hello", new Service(), null, null);
>
>  }
>
>  else{
>
>  System.out.println("No http service");
>
>  }
>
>  }
>
>
>>  public void stop(BundleContext bc) throws Exception {
>
>  }
>
>
>>
>> }
>
>
I'm appreciate your help.

Thanks,
Regards,


Trường Phúc

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