Hi Allen, It works out as you suggest. I found that the jetty must be run so that the Http Service works. As I read in the tutorial on felix site, I thought that there is a standard http service other than jetty.
I have replace the Felix Http bundle package with Felix http jetty. And It's working now. Thanks, Regards __________________________________ Phan Nguyễn Trường Phúc Mobile : 090.2297.669 - 093.7879.948 YM : pn.truongphuc Skype : pn.truongphuc Email : [email protected] Công ty cổ phần tin học Lạc Tiên - Lac Tien JSC Địa chỉ : 4C1 Đường 32 – Khu dân cư Tân Quy Đông – Phường Tân Phong – Quận 7- Tp Hồ Chí Minh Điện thoại : (84-8) 22 11 50 70 Fax : (84-8) 37 75 26 46 Email : [email protected]; [email protected] Website : http://www.lactien.com This e-mail is confidential. It may also be legally privileged. If you are not the addressee you may not copy, forward, disclose or use any part of it. If you have received this message in error, please delete it and all copies from your system and notify the sender immediately by return e-mail. Internet communications cannot be guaranteed to be timely, secure, error or virus-free. The sender does not accept liability for any errors or omissions. On Wed, Feb 2, 2011 at 2:07 PM, Allen Lau <[email protected]> wrote: > Have you check the HTTP service bundle properties? I think by default, the > bundle starts the bridge service and you need to set the > org.apache.felix.http.jettyEnabled=true > to get the HTTP service to work. Also check that the > org.osgi.service.http.port > is set to an unused port. You can set these in the config.properties if > you don't have the config admin installed. > > Allen > On Tue, Feb 1, 2011 at 9:48 PM, PN. Truong Phuc <[email protected] > >wrote: > > > Hi Rob, > > I see that my bundle should be started after the HTTP service. I had > > started > > my bundle after the HTTP service bundle package start and still it can't > > see > > any http service. > > > > I found that, the HTTP bundle just start the bridge service not HTTP > > service. > > > > Thanks, > > Regards > > > > > > Phuc PN. Truong > > > > > > On Wed, Feb 2, 2011 at 12:23 PM, Rob Walker <[email protected]> wrote: > > > > > > > > > > > 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, > > >> > > > It does look to be started here - although I note you aren't running > any > > > kind of log service, which might help you be showing log and diagnostic > > > messages > > > > > > 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); > > >>>>> > > >>>>> } > > >>>>> > > >>>> One thing to be very careful of here is startup timing. You cannot > > > simply assume in your start() method that other services will be > started > > at > > > this point. And if they aren't, you won't get a service reference for > > them. > > > > > > There are various approaches around this - the easiest is to use one of > > the > > > lifecycle handlers, like Felix DS, to manage this for you. > > > > > > An alternative is to use your own service listeners, but this can > involve > > a > > > lot more coding on your part - especially for boundary cases. > > > > > > As a simple/quick hack to see if this is the problem - you could put > all > > > your base bundles in a lower start level than your test bundle. This > > isn't > > > an especially nice solution, but it can work. > > > > > > - Rob Walker > > > > > > > > > > > > > > > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: [email protected] > > > For additional commands, e-mail: [email protected] > > > > > > > > >

