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