question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

OSGi : RouteRegistryInitializer which is responsible for servlet initialization logic is not invoked in OSGi

See original GitHub issue

This issue is specific for Jetty in Felix OSGi container (both org.apache.felix.http.jetty and jetty osgi boot). May be this is a question of the web server bundle in OSGi and there is nothing to do on our side.

I register the servlet manually via the bundle activator (using HttpServiceTracker and manual servlet instance creation). And the application doesn’t have any routes available even though I have class with @Route annotation. It seems that RouteRegistryInitializer doesn’t do its job.

See #4367 for the servlet registration source code.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:12 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
plekucommented, Oct 2, 2018

We should first test the approach recommended here https://github.com/vaadin/flow/issues/4376#issuecomment-405214203 (thanks @Sandared !) for the routes, and if that works, then use it for every other servlet context initializer we have. That can be left for future issues.

0reactions
denis-anisimovcommented, Oct 5, 2018

There is no anything specifically done for our code base. So nothing to change generically.

But our current tests uses jetty-osgi-boot which has an ability to run ServletContainerInitializer. But to enable this the appropriate classes are registered: https://github.com/vaadin/flow/blob/master/flow-tests/test-root-context/src/main/resources/META-INF/services/javax.servlet.ServletContainerInitializer

So either this file needs to be removed completely or all Flow initializers should be removed. This will disable automatic types discovering.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Servlet not getting invoked using osgi.service.http.whiteboard ...
I need to customize the error message using whiteboard pattern (osgi.service.http.whiteboard). I registered a new servlet with the errorpage ...
Read more >
102 Http Service Specification - OSGi Compendium 8
The initialization is done by calling the Servlet object's Servlet.init(ServletConfig) method. The ServletConfig parameter provides access to the ...
Read more >
Web OSGi Bundle runtime error - Forums - IBM Support
I see this ERROR when I hit an OSGi Web bundle (on Liberty 8.5.5.1) ... SRVE0276E: Error while initializing Servlet [JAX-RS Servlet]: javax.servlet....
Read more >
AEM6.4 @Reference not working in SlingServlet
We have a class named MySimpleService that reads OSGi config values. In the Servlet in this article - we use a @Refence to...
Read more >
Top 50 Servlet Interview Questions and Answers in 2023
But, by default, Container will not initialize the servlet, ... Servlet is robust and called as a server-side programming language.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found