Skip to main content

How to obtain ExtHttpService from OSGI registry

1 reply [Last post]
csrinaldi
Offline
Joined: 2006-06-26
Points: 0

Hi

I'm developing a WAB application where I want to register Servlet Filters in BundleActivator.start() method. I'm getting null references when I try to locate ExtHttpService:

ServiceReference sRef = bc.getServiceReference(ExtHttpService.class.getName());

However, the HttpService reference is correctly bound, but it doesn't allows filter registration.

Thanks in advance.

- Cristian

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
ss141213
Offline
Joined: 2005-03-30
Points: 0

Hi Cristian,

ExtHttpService is not a standard OSGi service. I think you are referring
to this service which is really a Felix proprietary service. Currently,
OSGi/HttpService spec does not allow one to register filters. Instead of
you programmatically registering filters, I recommend you package your
filters in your WAB and let GlassFish automatically register the filters
while processing your WAB.

Thanks,
Sahoo

On Wednesday 05 December 2012 03:15 AM, forums@java.net wrote:
> Hi I'm developing a WAB application where I want to register Servlet
> Filters
> in BundleActivator.start() method. I'm getting null references when I
> try to
> locate ExtHttpService: ServiceReference sRef =
> bc.getServiceReference(ExtHttpService.class.getName()); However, the
> HttpService reference is correctly bound, but it doesn't allows filter
> registration. Thanks in advance. - Cristian
>
> --
>
> [Message sent by forum member 'csrinaldi']
>
> View Post: http://forums.java.net/node/892941
>
>