Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » OSGI Whiteboard registered Resource not working
OSGI Whiteboard registered Resource not working [message #1756480] Fri, 17 March 2017 15:13 Go to next message
Marco Descher is currently offline Marco DescherFriend
Messages: 197
Registered: October 2010
Location: Austria
Senior Member
Hy there,

I am trying to register an HTTP Service using the whiteboard pattern (for a german article have a look here https://jaxenter.de/webkomponenten-mit-osgi-einfach-und-elegant-23731 )

Everything concerning the listener, servlet and filters does work out just great. But I can't seem to get the resource working.

That is, according to docu you should create a class like

@Component(service = MyResourceService.class , 
           property= {"osgi.http.whiteboard.resource.pattern=/static/*",
                      "osgi.http.whiteboard.resource.prefix=/www"})
public class MyResourceService{
    // nothing to implement
    }


and have the resource available under http://localhost:8080/static/*

But this never works out. It does however, when I use the resp. extension point definition (see enclosed pic). I use Neon.2 as target and its contained bundles.

index.php/fa/28789/0/

I would really like to do it all as Whiteboard, what am I missing out???

Thanks for any help!
Re: OSGI Whiteboard registered Resource not working [message #1759478 is a reply to message #1756480] Tue, 11 April 2017 22:43 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
Which are the "contained bundles" you are using? Are servlets registered via whiteboard pattern are working?

I haven't tested resources yet, but I would assume that either not all required bundles are included in your use case, or the required bundles are not started automatically.
Re: OSGI Whiteboard registered Resource not working [message #1759855 is a reply to message #1759478] Wed, 19 April 2017 07:34 Go to previous message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
OK, I played around with the HTTP Whiteboard implementation in Equinox. It works pretty fine. Actually I came also to the point where the resources are not shown, but it turned out that the issue was created by myself because I added a servlet filter that added a common HTML header to all resources (pattern = /*). With a more precise pattern/regex that excludes the resources folder also the resource servlet is working correctly.

So do you have a servlet filter in place?
Re: OSGI Whiteboard registered Resource not working [message #1759856 is a reply to message #1759855] Tue, 18 April 2017 23:35 Go to previous message
Marco Descher is currently offline Marco DescherFriend
Messages: 197
Registered: October 2010
Location: Austria
Senior Member
Hy Dirk, thanks a lot for your feedback! I am currently deeply involved in a different project, and will come back to the topic as soon as I work on the problem again! Smile
Previous Topic:Decoded URI in equinox
Next Topic:Timeout from ds.SCRManager
Goto Forum:
  


Current Time: Thu Apr 18 09:51:24 GMT 2024

Powered by FUDForum. Page generated in 0.02280 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top