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 Re: Issue when using Felix Http service bundle package.
Date Wed, 02 Feb 2011 03:44:31 GMT
Hi Richard,

The state of osgi bundle is:

    0|Active     |    0|System Bundle (3.0.6)
    1|Active     |    1|Apache Felix Bundle Repository (1.6.2)
    2|Active     |    1|Apache Felix Gogo Command (0.6.1)
    3|Active     |    1|Apache Felix Gogo Runtime (0.6.1)
    4|Active     |    1|Apache Felix Gogo Shell (0.6.1)
    5|Active     |    1|Apache Felix Http Bundle (2.0.4)

Thanks,

Phuc PN. Truong


On Tue, Feb 1, 2011 at 10:22 PM, Richard S. Hall <heavy@ungoverned.org>wrote:

> On 2/1/11 7:08, PN. Truong Phuc wrote:
>
>> 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.
>>
>
> Are you saying that your bundle cannot find the HTTP Service?
>
> Assuming you are running with Felix framework 3.0.x, if you type "lb" in
> the OSGi shell, what is the state of the OSGi bundle?
>
> -> richard
>
>
>  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
>>
>>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>

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