Found that some of the servlets did not have the init() invoked on start up. Found that if the servlet implements javax.servlet.SingleThreadModel, their init() methods are not called.
Sample snippnet from web.xml
<servlet> <servlet-name>testServlet</servlet-name> <servlet-class>TestServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet>
Sample servlet
@Slf4j public class TestServlet extends HttpServlet implements SingleThreadModel { @Override public void init(ServletConfig config) throws ServletException { log.info("init() in TestServlet"); super.init(config); } @Override public void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { log.info("doGet() in TestServlet"); } @Override public void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { log.info("doPost() in TestServlet"); } }
If the servlet does not implements SingleThreadModel , the init() method is called on start up.
- clones
-
UNDERTOW-734 Undertow does not call the init() method of servlets that implements SingleThreadModel even when load-on-startup is set
- Resolved
- is incorporated by
-
JBEAP-5060 Upgrade Undertow from 1.3.22.Final to 1.3.23.Final
- Closed