Hello If you set DEBUG logging level for org.ops4j.pax.web logger, you should see A LOT of information about how servlets are discovered and registered into the runtime. Without the logs, I can't tell much - especially if (as you've mentioned) it's sporadic problem...
regards Grzegorz Grzybek pon., 8 sie 2022 o 08:23 Richard Hierlmeier <[email protected]> napisaĆ(a): > > I upgraded last week a system to Karaf 4.4.1. I have a sporadic problem > with this system. > > The system contains a small bundle with this default servlet: > > @Component(service = Servlet.class, scope = ServiceScope.PROTOTYPE) > @HttpWhiteboardServletPattern("/") > @HttpWhiteboardContextSelect("(osgi.http.whiteboard.context.path=/)") > public class RootServlet extends HttpServlet { > > @Override > protected void doGet(final HttpServletRequest req, final > HttpServletResponse resp) > throws ServletException, IOException { > resp.sendRedirect("/welcome/welcome.html"); > } > } > > However sometimes after the start of Karaf the bundle is active but this > servlet is not available: > > de@root()> la -u | grep web-root > 37 | Active | 80 | 1.0.0.SNAPSHOT | > mvn:de.hierlmeier.testPaxWeb8/web-root/1.0.0-SNAPSHOT > > de@root()> ls javax.servlet.Servlet > [javax.servlet.Servlet] > ----------------------- > component.id = 20 > component.name = de.hierlmeier.testPaxWeb8.webRoot.RootServlet > osgi.ds.satisfying.condition.target = (osgi.condition.id=true) > osgi.http.whiteboard.context.select = > (osgi.http.whiteboard.context.path=/) > osgi.http.whiteboard.servlet.pattern = [/] > service.bundleid = 37 > service.id = 206 > service.scope = prototype > Provided by : > web-root (37) > Used by: > web-root (37) > > de@root()> web:servlet-list | grep RootServlet > de@root()> > > How can I diagnose this problem? > > I am running Karaf 4.4.1 with PAX-WEB 8.0.6 on Java 8. > > Regards > > Richard > > > > > > > > >
