Skip to content

OSGiServlet not working in an enRoute Setup #181

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Sandared opened this issue May 10, 2019 · 7 comments
Closed

OSGiServlet not working in an enRoute Setup #181

Sandared opened this issue May 10, 2019 · 7 comments

Comments

@Sandared
Copy link

Hi,

I tried to setup a minimal example on how to use your GraphQL Servlet in a pure enRoute OSGi setup. First I tried to merely include your library and then copy&paste the example code of your Karaf example in my own component.

Unfortunately this didn't work, as the OsgiGraphQLHttpServlet wasn't registered via the HttpWhiteboard.

I think this might stem from the component properties of OsgiGraphQLHttpServlet that are incorrect according to the standard. Instead of using alias=/graphql you should use either the new annotations like this @HttpWhiteboardServletPattern("/graphql") or use the old style property like this osgi.http.whiteboard.servlet.pattern=/graphql

I've created a small runnable example that you can inspect via Gitpod if you want: Open in Gitpod

Just cd in to /graphql , type resolve app and when maven is finished run app/target/debug.jar

Maybe you could change the properties accordingly so that the OsgiGraphQLHttpServlet is usable in a plain OSGi environment too.

Kind regards,
Thomas

@sergehuber
Copy link
Contributor

I think this was a problem with support for older OSGi platforms. I wonder if we can put both properties at the same time ?

@Sandared
Copy link
Author

Also for older OSGi platforms the new approach should work, if they are compliant to the standard. I think this property might rather be to satisfy a proprietary framework. However, I think there is no problem in adding both properties.

@oliemansm
Copy link
Member

I don't have any OSGi experience myself unfortunately. Is one of you able to create a PR for this one?

@oliemansm
Copy link
Member

@benfortuna You seem to have OSGi experience. Any chance you could help out with this one?

@oliemansm oliemansm added the osgi label Mar 20, 2020
@benfortuna
Copy link
Contributor

@oliemansm I don't have a specific fix for supporting the HttpWhiteboard service, but perhaps the change applied in #237 (servlet is not automatically registered) could help in that users can register their own servlet using HttpWhiteboard.

@Sandared
Copy link
Author

AFAIK the changes in the mentioned PR indeed fix the issue by using standard OSGi annotations instead of the outdated ones from biz.aQute 😊

@oliemansm
Copy link
Member

This should be fixed with the recently release 9.1.0 version as mentioned above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants