Re: Unable to create default RequestDispatcher
Hi Part of the fix is this example: https://github.com/ops4j/org.ops4j.pax.web/tree/pax-web-8.0.x/samples/samples-war/war-dispatcher with this web.xml: http://xmlns.jcp.org/xml/ns/javaee; xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd; version="4.0"> dispatch-servlet org.ops4j.pax.web.samples.war.osgi.JustDispatchServlet dispatch-servlet / and this org.ops4j.pax.web.samples.war.osgi.JustDispatchServlet: public class JustDispatchServlet extends HttpServlet { @Override protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { // https://github.com/ops4j/org.ops4j.pax.web/issues/1794: // we want to delegate to "default" servlet hoping to use it's functionality getServletContext().getNamedDispatcher("default").include(req, resp); } } the test checks the behavior on three runtimes (Jetty, Tomcat, Undertow). regards Grzegorz Grzybek śr., 16 lis 2022 o 14:57 Prashanth Ettaboina napisał(a): > Hi Grzegorz, > > I hope the latest version(8.0.13) should solve the issue. > Thank you for taking up the issue and being supportive, your responses are > deeply appreciated. > > Regards, > Prashanth > > From: Prashanth Ettaboina > Sent: 16 November 2022 15:33 > To: 'iss...@karaf.apache.org' ; ' > dev@karaf.apache.org' ; 'u...@karaf.apache.org' < > u...@karaf.apache.org> > Subject: RE: Unable to create default RequestDispatcher > > Hi Grzegorz, > > Thank you for your response. > I have gone through your explanation; I have seen that "/" is overriding > the default servlet. Thank you for letting me know. > But we had that web.xml configuration from last several years below is the > web.xml which was being used from older karaf versions (before 4.4.1). > > > helloboard > com.console.helloboard.HelloboardServlet > > > helloboard > / > > > Previously HelloboardServlet used to take in all the requests and process > them, below is the code block which is used to be executed. > > public class HelloboardServlet extends HttpServlet { > >protected void doGet(HttpServletRequest request, > HttpServletResponse response) throws ServletException, IOException { > if (request.getServletPath().equals("/")) { > response.sendRedirect("views/welcome.jsp"); > } else if (request.getServletPath().startsWith("/resources/")){ > if(request.getServletPath().endsWith(".css")) { > response.setContentType("text/css"); > } else if (request.getServletPath().endsWith(".js")) { >response.setContentType("text/javascript"); > } > RequestDispatcher rd = > getServletContext().getNamedDispatcher("default"); > rd.include(request, response); > } >} > } > > I want to know why it was able to create a default RequestDispatcher back > then and why not now? are there any changes in the implementation as part > of the upgrades, if yes can I get some information of what has been > modified. > > As per your directions I have changed the web.xml servlet mapping from / > to /*, now I'm able to create the default servlet but the above code block > will not be working because I have changed the url-pattern from / to /* all > the request objects are containing servletPath as "" (empty string). Which > will break the existing flow. > > I'm sorry that I cannot share the WAB and can give any further inputs > regarding this issue. > > Thanks, > Prashanth Ettaboina. > > > From: Prashanth Ettaboina > Sent: 16 November 2022 14:02 > To: 'iss...@karaf.apache.org' iss...@karaf.apache.org>>; 'dev@karaf.apache.org' <mailto:dev@karaf.apache.org>>; 'u...@karaf.apache.org' < > u...@karaf.apache.org<mailto:u...@karaf.apache.org>> > Subject: RE: Unable to create default RequestDispatcher > > Hi Grzegorz, > > Thank you for your response. > I have gone through your explanation; I have seen that "/" is overriding > the default servlet. Thank you for letting me know. > But we had that web.xml configuration from last several years below is the > web.xml which was being used from older karaf versions (before 4.4.1). > > > helloboard > com.console.helloboard.HelloboardServlet > > > helloboard > / > > > Previously HelloboardServlet
RE: Unable to create default RequestDispatcher
Hi Grzegorz, I hope the latest version(8.0.13) should solve the issue. Thank you for taking up the issue and being supportive, your responses are deeply appreciated. Regards, Prashanth From: Prashanth Ettaboina Sent: 16 November 2022 15:33 To: 'iss...@karaf.apache.org' ; 'dev@karaf.apache.org' ; 'u...@karaf.apache.org' Subject: RE: Unable to create default RequestDispatcher Hi Grzegorz, Thank you for your response. I have gone through your explanation; I have seen that "/" is overriding the default servlet. Thank you for letting me know. But we had that web.xml configuration from last several years below is the web.xml which was being used from older karaf versions (before 4.4.1). helloboard com.console.helloboard.HelloboardServlet helloboard / Previously HelloboardServlet used to take in all the requests and process them, below is the code block which is used to be executed. public class HelloboardServlet extends HttpServlet { protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { if (request.getServletPath().equals("/")) { response.sendRedirect("views/welcome.jsp"); } else if (request.getServletPath().startsWith("/resources/")){ if(request.getServletPath().endsWith(".css")) { response.setContentType("text/css"); } else if (request.getServletPath().endsWith(".js")) { response.setContentType("text/javascript"); } RequestDispatcher rd = getServletContext().getNamedDispatcher("default"); rd.include(request, response); } } } I want to know why it was able to create a default RequestDispatcher back then and why not now? are there any changes in the implementation as part of the upgrades, if yes can I get some information of what has been modified. As per your directions I have changed the web.xml servlet mapping from / to /*, now I'm able to create the default servlet but the above code block will not be working because I have changed the url-pattern from / to /* all the request objects are containing servletPath as "" (empty string). Which will break the existing flow. I'm sorry that I cannot share the WAB and can give any further inputs regarding this issue. Thanks, Prashanth Ettaboina. From: Prashanth Ettaboina Sent: 16 November 2022 14:02 To: 'iss...@karaf.apache.org' mailto:iss...@karaf.apache.org>>; 'dev@karaf.apache.org' mailto:dev@karaf.apache.org>>; 'u...@karaf.apache.org' mailto:u...@karaf.apache.org>> Subject: RE: Unable to create default RequestDispatcher Hi Grzegorz, Thank you for your response. I have gone through your explanation; I have seen that "/" is overriding the default servlet. Thank you for letting me know. But we had that web.xml configuration from last several years below is the web.xml which was being used from older karaf versions (before 4.4.1). helloboard com.console.helloboard.HelloboardServlet helloboard / Previously HelloboardServlet used to take in all the requests and process them, below is the code block which is used to be executed. public class HelloboardServlet extends HttpServlet { protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { if (request.getServletPath().equals("/")) { response.sendRedirect("views/welcome.jsp"); } else if (request.getServletPath().startsWith("/resources/")){ if(request.getServletPath().endsWith(".css")) { response.setContentType("text/css"); } else if (request.getServletPath().endsWith(".js")) { response.setContentType("text/javascript"); } RequestDispatcher rd = getServletContext().getNamedDispatcher("default"); rd.include(request, response); } } } I want to know why it was able to create a default RequestDispatcher back then and why not now? are there any changes in the implementation as part of the upgrades, if yes can I get some information of what has been modified. As per your directions I have changed the web.xml servlet mapping from / to /*, now I'm able to create the default servlet but the above code block will not be working because I have changed the url-pattern from / to /* all the request objects are containing servletPath as "" (empty string). Which will break the existing flow. I'm sorry that I cannot share the WAB and can give any further inputs regarding th
Re: Unable to create default RequestDispatcher
Hello I've fixed the problem here: https://github.com/ops4j/org.ops4j.pax.web/commit/19696d4dcabe8b5663d33f894a8d40fc2b742c88 The problem was that during WAR scanning, if there was any servlet mapped to "/", "default" servlet was removed entirely - now it's still registered, but with empty mapping - so you can't invoke it, but you can get a named dispatcher for it. I'm going to release Pax Web 8.0.13 today. Thanks Prashanth for the report! regards Grzegorz Grzybek śr., 16 lis 2022 o 12:21 Grzegorz Grzybek napisał(a): > Hello Prashanth > > I've added some findings to > https://github.com/ops4j/org.ops4j.pax.web/issues/1794 and I see there's > a problem in Tomcat and Jetty runtimes for Pax Web. > I've just checked it in pure standalone Tomcat and indeed - the "default" > dispatcher should NEVER be removed - I'm working on a fix. > > regards > Grzegorz Grzybek > > śr., 16 lis 2022 o 12:02 Prashanth Ettaboina > napisał(a): > >> Hi Grzegorz, >> >> Thank you for your response. >> I have gone through your explanation; I have seen that "/" is overriding >> the default servlet. Thank you for letting me know. >> But we had that web.xml configuration from last several years below is >> the web.xml which was being used from older karaf versions (before 4.4.1). >> >> >> helloboard >> >> com.console.helloboard.HelloboardServlet >> >> >> helloboard >> / >> >> >> Previously HelloboardServlet used to take in all the requests and process >> them, below is the code block which is used to be executed. >> >> public class HelloboardServlet extends HttpServlet { >> >>protected void doGet(HttpServletRequest request, >> HttpServletResponse response) throws ServletException, IOException { >> if (request.getServletPath().equals("/")) { >> response.sendRedirect("views/welcome.jsp"); >> } else if >> (request.getServletPath().startsWith("/resources/")){ >> if(request.getServletPath().endsWith(".css")) { >> response.setContentType("text/css"); >> } else if (request.getServletPath().endsWith(".js")) { >>response.setContentType("text/javascript"); >> } >> RequestDispatcher rd = >> getServletContext().getNamedDispatcher("default"); >> rd.include(request, response); >> } >>} >> } >> >> I want to know why it was able to create a default RequestDispatcher back >> then and why not now? are there any changes in the implementation as part >> of the upgrades, if yes can I get some information of what has been >> modified. >> >> As per your directions I have changed the web.xml servlet mapping from / >> to /*, now I'm able to create the default servlet but the above code block >> will not be working because I have changed the url-pattern from / to /* all >> the request objects are containing servletPath as "" (empty string). Which >> will break the existing flow. >> >> I'm sorry that I cannot share the WAB and can give any further inputs >> regarding this issue. >> >> Thanks, >> Prashanth Ettaboina. >> >> >> From: Prashanth Ettaboina >> Sent: 16 November 2022 14:02 >> To: 'iss...@karaf.apache.org' ; ' >> dev@karaf.apache.org' ; 'u...@karaf.apache.org' < >> u...@karaf.apache.org> >> Subject: RE: Unable to create default RequestDispatcher >> >> Hi Grzegorz, >> >> Thank you for your response. >> I have gone through your explanation; I have seen that "/" is overriding >> the default servlet. Thank you for letting me know. >> But we had that web.xml configuration from last several years below is >> the web.xml which was being used from older karaf versions (before 4.4.1). >> >> >> helloboard >> >> com.console.helloboard.HelloboardServlet >> >> >> helloboard >> / >> >> >> Previously HelloboardServlet used to take in all the requests and process >> them, below is the code block which is used to be executed. >> >> public class HelloboardServlet extends HttpServlet { >> >>protected void doGet(HttpServletRequest request, >> HttpServletResponse response) throws ServletException, IOException { >> if (request.getServletPath().equals(&quo
Re: Unable to create default RequestDispatcher
Hello Prashanth I've added some findings to https://github.com/ops4j/org.ops4j.pax.web/issues/1794 and I see there's a problem in Tomcat and Jetty runtimes for Pax Web. I've just checked it in pure standalone Tomcat and indeed - the "default" dispatcher should NEVER be removed - I'm working on a fix. regards Grzegorz Grzybek śr., 16 lis 2022 o 12:02 Prashanth Ettaboina napisał(a): > Hi Grzegorz, > > Thank you for your response. > I have gone through your explanation; I have seen that "/" is overriding > the default servlet. Thank you for letting me know. > But we had that web.xml configuration from last several years below is the > web.xml which was being used from older karaf versions (before 4.4.1). > > > helloboard > com.console.helloboard.HelloboardServlet > > > helloboard > / > > > Previously HelloboardServlet used to take in all the requests and process > them, below is the code block which is used to be executed. > > public class HelloboardServlet extends HttpServlet { > >protected void doGet(HttpServletRequest request, > HttpServletResponse response) throws ServletException, IOException { > if (request.getServletPath().equals("/")) { > response.sendRedirect("views/welcome.jsp"); > } else if (request.getServletPath().startsWith("/resources/")){ > if(request.getServletPath().endsWith(".css")) { > response.setContentType("text/css"); > } else if (request.getServletPath().endsWith(".js")) { >response.setContentType("text/javascript"); > } > RequestDispatcher rd = > getServletContext().getNamedDispatcher("default"); > rd.include(request, response); > } >} > } > > I want to know why it was able to create a default RequestDispatcher back > then and why not now? are there any changes in the implementation as part > of the upgrades, if yes can I get some information of what has been > modified. > > As per your directions I have changed the web.xml servlet mapping from / > to /*, now I'm able to create the default servlet but the above code block > will not be working because I have changed the url-pattern from / to /* all > the request objects are containing servletPath as "" (empty string). Which > will break the existing flow. > > I'm sorry that I cannot share the WAB and can give any further inputs > regarding this issue. > > Thanks, > Prashanth Ettaboina. > > > From: Prashanth Ettaboina > Sent: 16 November 2022 14:02 > To: 'iss...@karaf.apache.org' ; ' > dev@karaf.apache.org' ; 'u...@karaf.apache.org' < > u...@karaf.apache.org> > Subject: RE: Unable to create default RequestDispatcher > > Hi Grzegorz, > > Thank you for your response. > I have gone through your explanation; I have seen that "/" is overriding > the default servlet. Thank you for letting me know. > But we had that web.xml configuration from last several years below is the > web.xml which was being used from older karaf versions (before 4.4.1). > > > helloboard > com.console.helloboard.HelloboardServlet > > > helloboard > / > > > Previously HelloboardServlet used to take in all the requests and process > them, below is the code block which is used to be executed. > > public class HelloboardServlet extends HttpServlet { > >protected void doGet(HttpServletRequest request, > HttpServletResponse response) throws ServletException, IOException { > if (request.getServletPath().equals("/")) { > response.sendRedirect("views/welcome.jsp"); > } else if (request.getServletPath().startsWith("/resources/")){ > if(request.getServletPath().endsWith(".css")) { > response.setContentType("text/css"); > } else if (request.getServletPath().endsWith(".js")) { >response.setContentType("text/javascript"); > } > RequestDispatcher rd = > getServletContext().getNamedDispatcher("default"); > rd.include(request, response); > } >} > } > > I want to know why it was able to create a default RequestDispatcher back > then and why not now? are there any changes in the implementation as part > of the upgrades, if yes can I get some information of what has been > modified. >
RE: Unable to create default RequestDispatcher
Hi Grzegorz, Thank you for your response. I have gone through your explanation; I have seen that "/" is overriding the default servlet. Thank you for letting me know. But we had that web.xml configuration from last several years below is the web.xml which was being used from older karaf versions (before 4.4.1). helloboard com.console.helloboard.HelloboardServlet helloboard / Previously HelloboardServlet used to take in all the requests and process them, below is the code block which is used to be executed. public class HelloboardServlet extends HttpServlet { protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { if (request.getServletPath().equals("/")) { response.sendRedirect("views/welcome.jsp"); } else if (request.getServletPath().startsWith("/resources/")){ if(request.getServletPath().endsWith(".css")) { response.setContentType("text/css"); } else if (request.getServletPath().endsWith(".js")) { response.setContentType("text/javascript"); } RequestDispatcher rd = getServletContext().getNamedDispatcher("default"); rd.include(request, response); } } } I want to know why it was able to create a default RequestDispatcher back then and why not now? are there any changes in the implementation as part of the upgrades, if yes can I get some information of what has been modified. As per your directions I have changed the web.xml servlet mapping from / to /*, now I'm able to create the default servlet but the above code block will not be working because I have changed the url-pattern from / to /* all the request objects are containing servletPath as "" (empty string). Which will break the existing flow. I'm sorry that I cannot share the WAB and can give any further inputs regarding this issue. Thanks, Prashanth Ettaboina. From: Prashanth Ettaboina Sent: 15 November 2022 20:03 To: 'iss...@karaf.apache.org' ; 'dev@karaf.apache.org' ; 'u...@karaf.apache.org' Subject: RE: Unable to create default RequestDispatcher Hi Grzegorz, I'm generating a WAR file of the bundle(which will have the web application). Adding the war file in the feature.xml and installing it in the karaf as a kar file. mvn:com.server.console/helloboard/${project.version}/war karaf@root()> kar: install file :filepath*** snapshot.kar below are the logs from karaf which are generated while I installed the kar file. 2022-11-15T19:19:11.401+0530 CEF:1 | org.apache.karaf.kar.core | 4.4.1 | INFO | ID=168 THR=0.0-SNAPSHOT.kar CAT=KarServiceImpl MSG=Added feature repository 'mvn:com.server.kars/example-console/51.0.0-SNAPSHOT/xml/features' 2022-11-15T19:19:11.403+0530 CEF:1 | org.apache.karaf.features.core | 4.4.1 | INFO | ID=19 THR=0.0-SNAPSHOT.kar CAT=FeaturesServiceImpl MSG=Adding features: example-console/[51.0.0.SNAPSHOT,51.0.0.SNAPSHOT] 2022-11-15T19:19:15.041+0530 CEF:1 | org.apache.karaf.features.core | 4.4.1 | INFO | ID=19 THR=tures-3-thread-1 CAT=FeaturesServiceImpl MSG=Changes to perform: 2022-11-15T19:19:15.041+0530 CEF:1 | org.apache.karaf.features.core | 4.4.1 | INFO | ID=19 THR=tures-3-thread-1 CAT=FeaturesServiceImpl MSG= Region: root 2022-11-15T19:19:15.042+0530 CEF:1 | org.apache.karaf.features.core | 4.4.1 | INFO | ID=19 THR=tures-3-thread-1 CAT=FeaturesServiceImpl MSG= Bundles to install: 2022-11-15T19:19:15.042+0530 CEF:1 | org.apache.karaf.features.core | 4.4.1 | INFO | ID=19 THR=tures-3-thread-1 CAT=FeaturesServiceImpl MSG= mvn:com.server.console/helloboard/51.0.0-SNAPSHOT/war 2022-11-15T19:19:20.621+0530 CEF:1 | org.apache.karaf.features.core | 4.4.1 | INFO | ID=19 THR=tures-3-thread-1 CAT=FeaturesServiceImpl MSG= helloboard/51.0.0.SNAPSHOT 2022-11-15T19:19:20.634+0530 CEF:1 | org.ops4j.pax.web.pax-web-extender-war | 8.0.6 | INFO | ID=269 THR=ender-1-thread-1 CAT=BundleWebApplication MSG=Configuring Web Application "/helloboard" for bundle helloboard/51.0.0.SNAPSHOT 2022-11-15T19:19:20.635+0530 CEF:1 | org.apache.karaf.features.core | 4.4.1 | INFO | ID=19 THR=tures-3-thread-1 CAT=FeaturesServiceImpl MSG=Done. 2022-11-15T19:19:32.512+0530 CEF:1 | org.ops4j.pax.web.pax-web-runtime | 8.0.6 | INFO | ID=272 THR=ender-1-thread-1 CAT=StoppableHttpServiceFactory MSG=Binding HTTP Service for bundle: [helloboard [318]] 2022-11-15T19:19:32.514+0530 CEF:1 | org.ops4j.pax.web.pax-web-extender-war | 8.0.6 | INFO | ID=269 THR=ender-1-thread-1 CAT=BundleWebApplication MSG=Allocated context for /helloboard: OsgiC
RE: Unable to create default RequestDispatcher
Hi Grzegorz, Thank you for your response. I have gone through your explanation; I have seen that "/" is overriding the default servlet. Thank you for letting me know. But we had that web.xml configuration from last several years below is the web.xml which was being used from older karaf versions (before 4.4.1). helloboard com.console.helloboard.HelloboardServlet helloboard / Previously HelloboardServlet used to take in all the requests and process them, below is the code block which is used to be executed. public class HelloboardServlet extends HttpServlet { protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { if (request.getServletPath().equals("/")) { response.sendRedirect("views/welcome.jsp"); } else if (request.getServletPath().startsWith("/resources/")){ if(request.getServletPath().endsWith(".css")) { response.setContentType("text/css"); } else if (request.getServletPath().endsWith(".js")) { response.setContentType("text/javascript"); } RequestDispatcher rd = getServletContext().getNamedDispatcher("default"); rd.include(request, response); } } } I want to know why it was able to create a default RequestDispatcher back then and why not now? are there any changes in the implementation as part of the upgrades, if yes can I get some information of what has been modified. As per your directions I have changed the web.xml servlet mapping from / to /*, now I'm able to create the default servlet but the above code block will not be working because I have changed the url-pattern from / to /* all the request objects are containing servletPath as "" (empty string). Which will break the existing flow. I'm sorry that I cannot share the WAB and can give any further inputs regarding this issue. Thanks, Prashanth Ettaboina. From: Prashanth Ettaboina Sent: 16 November 2022 14:02 To: 'iss...@karaf.apache.org' ; 'dev@karaf.apache.org' ; 'u...@karaf.apache.org' Subject: RE: Unable to create default RequestDispatcher Hi Grzegorz, Thank you for your response. I have gone through your explanation; I have seen that "/" is overriding the default servlet. Thank you for letting me know. But we had that web.xml configuration from last several years below is the web.xml which was being used from older karaf versions (before 4.4.1). helloboard com.console.helloboard.HelloboardServlet helloboard / Previously HelloboardServlet used to take in all the requests and process them, below is the code block which is used to be executed. public class HelloboardServlet extends HttpServlet { protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { if (request.getServletPath().equals("/")) { response.sendRedirect("views/welcome.jsp"); } else if (request.getServletPath().startsWith("/resources/")){ if(request.getServletPath().endsWith(".css")) { response.setContentType("text/css"); } else if (request.getServletPath().endsWith(".js")) { response.setContentType("text/javascript"); } RequestDispatcher rd = getServletContext().getNamedDispatcher("default"); rd.include(request, response); } } } I want to know why it was able to create a default RequestDispatcher back then and why not now? are there any changes in the implementation as part of the upgrades, if yes can I get some information of what has been modified. As per your directions I have changed the web.xml servlet mapping from / to /*, now I'm able to create the default servlet but the above code block will not be working because I have changed the url-pattern from / to /* all the request objects are containing servletPath as "" (empty string). Which will break the existing flow. I'm sorry that I cannot share the WAB and can give any further inputs regarding this issue. Thanks, Prashanth Ettaboina. From: Prashanth Ettaboina Sent: 15 November 2022 20:03 To: 'iss...@karaf.apache.org' mailto:iss...@karaf.apache.org>>; 'dev@karaf.apache.org' mailto:dev@karaf.apache.org>>; 'u...@karaf.apache.org' mailto:u...@karaf.apache.org>> Subject: RE: Unable to create default RequestDispatcher Hi Grzegorz, I'm generating a WAR file of the bundle(which will have the web application). Adding the war file in the feature.xml and installing it in
Re: Unable to create default RequestDispatcher
ContainerContextWrapper{bundle=helloboard > [318],contextId='/helloboard',delegate=org.ops4j.pax.web.extender.war.internal.WebApplicationHelper@1641e385 > }} > 2022-11-15T19:19:32.528+0530 CEF:1 | org.ops4j.pax.web.pax-web-jsp | 8.0.6 > | INFO | ID=271 THR=ploy /helloboard) CAT=PaxWebTldScanner > MSG=Searching for TLDs in pax-web-jsp bundle > 2022-11-15T19:19:32.639+0530 CEF:1 | org.ops4j.pax.web.pax-web-jsp | 8.0.6 > | INFO | ID=271 THR=ploy /helloboard) CAT=PaxWebTldScanner > MSG=Searching for TLDs in context configuration (web.xml) > 2022-11-15T19:19:32.639+0530 CEF:1 | org.ops4j.pax.web.pax-web-jsp | 8.0.6 > | INFO | ID=271 THR=ploy /helloboard) CAT=PaxWebTldScanner > MSG=Searching for TLDs in /WEB-INF/ > 2022-11-15T19:19:32.640+0530 CEF:1 | org.ops4j.pax.web.pax-web-jsp | 8.0.6 > | INFO | ID=271 THR=ploy /helloboard) CAT=PaxWebTldScanner > MSG=Searching for TLDs in bundle helloboard [318] > 2022-11-15T19:19:32.828+0530 CEF:1 | org.ops4j.pax.web.pax-web-runtime | > 8.0.6 | INFO | ID=272 THR=ploy /helloboard) CAT=HttpServiceEnabled >MSG=Registering > EventListenerModel{id=EventListenerModel-252,listener='ch.qos.logback.classic.servlet.LogbackServletContextListener@70476be6 > ',contexts=[{WAB,OCM-233,/helloboard,/helloboard}]} > 2022-11-15T19:19:32.828+0530 CEF:1 | org.ops4j.pax.web.pax-web-jetty | > 8.0.6 | INFO | ID=270 THR=ploy /helloboard) CAT=JettyServerController > MSG=Receiving Batch{"Registration of > EventListenerModel{id=EventListenerModel-252,listener='ch.qos.logback.classic.servlet.LogbackServletContextListener@70476be6',contexts=[{WAB,OCM-233,/helloboard,/helloboard}]}", > size=1} > 2022-11-15T19:19:32.830+0530 CEF:1 | org.ops4j.pax.web.pax-web-runtime | > 8.0.6 | INFO | ID=272 THR=ploy /helloboard) CAT=HttpServiceEnabled >MSG=Registering > EventListenerModel{id=EventListenerModel-251,listener='org.eclipse.jetty.websocket.jsr356.server.deploy.WebSocketServerContainerInitializer$ContextDestroyListener@526531fa > ',contexts=[{WAB,OCM-233,/helloboard,/helloboard}]} > 2022-11-15T19:19:32.831+0530 CEF:1 | org.ops4j.pax.web.pax-web-jetty | > 8.0.6 | INFO | ID=270 THR=ploy /helloboard) CAT=JettyServerController > MSG=Receiving Batch{"Registration of > EventListenerModel{id=EventListenerModel-251,listener='org.eclipse.jetty.websocket.jsr356.server.deploy.WebSocketServerContainerInitializer$ContextDestroyListener@526531fa',contexts=[{WAB,OCM-233,/helloboard,/helloboard}]}", > size=1} > 2022-11-15T19:19:32.834+0530 CEF:1 | org.eclipse.jetty.util | > 9.4.48.v20220622 | INFO | ID=243 THR=ploy /helloboard) CAT=ContextHandler > MSG=Started > o.o.p.w.s.j.i.PaxWebServletContextHandler@6ae38bdd > {ServerHelloboard,/helloboard,null,AVAILABLE} o.o.p.w.s.j.i.PaxWebServletContextHandler@6ae38bdd > %7bServerDashboard,/dashboard,null,AVAILABLE%7d> > > > > From: Prashanth Ettaboina > Sent: 15 November 2022 16:28 > To: 'iss...@karaf.apache.org' ; ' > dev@karaf.apache.org' ; 'u...@karaf.apache.org' < > u...@karaf.apache.org> > Subject: RE: Unable to create default RequestDispatcher > > Hi Grzegorz, > > I'm not registering the ExampleServlet anywhere, I'm configuring them in > web.xml. > In the web.xml we are giving the servlet and servlet mapping with > url-pattern and class path. > > Thanks, > Prashanth Ettaboina. > > From: Prashanth Ettaboina > Sent: 14 November 2022 19:11 > To: iss...@karaf.apache.org<mailto:iss...@karaf.apache.org>; > dev@karaf.apache.org<mailto:dev@karaf.apache.org>; u...@karaf.apache.org > <mailto:u...@karaf.apache.org> > Subject: Unable to create default RequestDispatcher > > Hi Team, > > I have updated my KARAF version from 4.2.15 to 4.4.1 and Java from 8 to 11 > in my application. > Gone through the official Release notes and updated some dependencies as > well. > > Upgraded OSGI-Core from 6.0.0 to 8.0.0. > Upgraded osgi.compendium 5.0.0 to osgi.cmpn 7.0.0 > Upgraded Jetty from 9.4.43.v20210629 to 9.4.46.v20220331. > Upgraded pax-web-spi from 4.3.4 to 7.2.11. > I'm using javax.servlet-api 3.1.0 version in my application. > > I'm unable to create default RequestDispatcher. > Please check the below code lines. > > public class ExampleServlet extends HttpServlet { > protected void doGet(HttpServletRequest request, HttpServletResponse > response) throws ServletException, IOException { > RequestDispatcher requestDispatcher = > getServletContext().getNamedDispatcher("default"); // get > getServletContext() is calling the method in GenericServlet. > requestDispatcher.include(request, response); > } > } > > the above code used to work fine before the version upgrades but now I'm > getting the requestDispatcher as null. > > Can anyone please look at it, let me know if I'm missing something. > > Thanks, > Prashanth Ettaboina > > > >
RE: Unable to create default RequestDispatcher
O | ID=272 THR=ploy /helloboard) CAT=HttpServiceEnabled MSG=Registering EventListenerModel{id=EventListenerModel-252,listener='ch.qos.logback.classic.servlet.LogbackServletContextListener@70476be6',contexts=[{WAB,OCM-233,/helloboard,/helloboard}]} 2022-11-15T19:19:32.828+0530 CEF:1 | org.ops4j.pax.web.pax-web-jetty | 8.0.6 | INFO | ID=270 THR=ploy /helloboard) CAT=JettyServerController MSG=Receiving Batch{"Registration of EventListenerModel{id=EventListenerModel-252,listener='ch.qos.logback.classic.servlet.LogbackServletContextListener@70476be6',contexts=[{WAB,OCM-233,/helloboard,/helloboard}]}", size=1} 2022-11-15T19:19:32.830+0530 CEF:1 | org.ops4j.pax.web.pax-web-runtime | 8.0.6 | INFO | ID=272 THR=ploy /helloboard) CAT=HttpServiceEnabled MSG=Registering EventListenerModel{id=EventListenerModel-251,listener='org.eclipse.jetty.websocket.jsr356.server.deploy.WebSocketServerContainerInitializer$ContextDestroyListener@526531fa',contexts=[{WAB,OCM-233,/helloboard,/helloboard}]} 2022-11-15T19:19:32.831+0530 CEF:1 | org.ops4j.pax.web.pax-web-jetty | 8.0.6 | INFO | ID=270 THR=ploy /helloboard) CAT=JettyServerController MSG=Receiving Batch{"Registration of EventListenerModel{id=EventListenerModel-251,listener='org.eclipse.jetty.websocket.jsr356.server.deploy.WebSocketServerContainerInitializer$ContextDestroyListener@526531fa',contexts=[{WAB,OCM-233,/helloboard,/helloboard}]}", size=1} 2022-11-15T19:19:32.834+0530 CEF:1 | org.eclipse.jetty.util | 9.4.48.v20220622 | INFO | ID=243 THR=ploy /helloboard) CAT=ContextHandler MSG=Started o.o.p.w.s.j.i.PaxWebServletContextHandler@6ae38bdd{ServerHelloboard,/helloboard,null,AVAILABLE}<mailto:o.o.p.w.s.j.i.PaxWebServletContextHandler@6ae38bdd%7bServerDashboard,/dashboard,null,AVAILABLE%7d> From: Prashanth Ettaboina Sent: 15 November 2022 16:28 To: 'iss...@karaf.apache.org' ; 'dev@karaf.apache.org' ; 'u...@karaf.apache.org' Subject: RE: Unable to create default RequestDispatcher Hi Grzegorz, I'm not registering the ExampleServlet anywhere, I'm configuring them in web.xml. In the web.xml we are giving the servlet and servlet mapping with url-pattern and class path. Thanks, Prashanth Ettaboina. From: Prashanth Ettaboina Sent: 14 November 2022 19:11 To: iss...@karaf.apache.org<mailto:iss...@karaf.apache.org>; dev@karaf.apache.org<mailto:dev@karaf.apache.org>; u...@karaf.apache.org<mailto:u...@karaf.apache.org> Subject: Unable to create default RequestDispatcher Hi Team, I have updated my KARAF version from 4.2.15 to 4.4.1 and Java from 8 to 11 in my application. Gone through the official Release notes and updated some dependencies as well. Upgraded OSGI-Core from 6.0.0 to 8.0.0. Upgraded osgi.compendium 5.0.0 to osgi.cmpn 7.0.0 Upgraded Jetty from 9.4.43.v20210629 to 9.4.46.v20220331. Upgraded pax-web-spi from 4.3.4 to 7.2.11. I'm using javax.servlet-api 3.1.0 version in my application. I'm unable to create default RequestDispatcher. Please check the below code lines. public class ExampleServlet extends HttpServlet { protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { RequestDispatcher requestDispatcher = getServletContext().getNamedDispatcher("default"); // get getServletContext() is calling the method in GenericServlet. requestDispatcher.include(request, response); } } the above code used to work fine before the version upgrades but now I'm getting the requestDispatcher as null. Can anyone please look at it, let me know if I'm missing something. Thanks, Prashanth Ettaboina
Re: Unable to create default RequestDispatcher
Hello Prashanth I've added a link to Github issue to your https://stackoverflow.com/questions/74432966/unable-to-create-default-requestdispatcher I checked simplest web.xml with a servlet mapped to `/*` (so I can grab all the requests) and getNamedDispatcher("default") simply worked. Please share your entire WAB if possible. regards Grzegorz Grzybek wt., 15 lis 2022 o 13:56 Grzegorz Grzybek napisał(a): > Ah - so you're installing a WAR/WAB? Can you give some details under > https://github.com/ops4j/org.ops4j.pax.web/issues/1794 ? > > Or if you don't use Github, please share: > - information about the WAR you're installing > - some logs from Karaf when you install the WAR > > regards > Grzegorz Grzybek > > wt., 15 lis 2022 o 12:04 Prashanth Ettaboina > napisał(a): > >> Hi Grzegorz, >> >> I'm not registering the ExampleServlet anywhere, I'm configuring them in >> web.xml. >> In the web.xml we are giving the servlet and servlet mapping with >> url-pattern and class path. >> >> Thanks, >> Prashanth Ettaboina. >> >> From: Prashanth Ettaboina >> Sent: 14 November 2022 19:11 >> To: iss...@karaf.apache.org; dev@karaf.apache.org; u...@karaf.apache.org >> Subject: Unable to create default RequestDispatcher >> >> Hi Team, >> >> I have updated my KARAF version from 4.2.15 to 4.4.1 and Java from 8 to >> 11 in my application. >> Gone through the official Release notes and updated some dependencies as >> well. >> >> Upgraded OSGI-Core from 6.0.0 to 8.0.0. >> Upgraded osgi.compendium 5.0.0 to osgi.cmpn 7.0.0 >> Upgraded Jetty from 9.4.43.v20210629 to 9.4.46.v20220331. >> Upgraded pax-web-spi from 4.3.4 to 7.2.11. >> I'm using javax.servlet-api 3.1.0 version in my application. >> >> I'm unable to create default RequestDispatcher. >> Please check the below code lines. >> >> public class ExampleServlet extends HttpServlet { >> protected void doGet(HttpServletRequest request, >> HttpServletResponse response) throws ServletException, IOException { >> RequestDispatcher requestDispatcher = >> getServletContext().getNamedDispatcher("default"); // get >> getServletContext() is calling the method in GenericServlet. >> requestDispatcher.include(request, response); >> } >> } >> >> the above code used to work fine before the version upgrades but now I'm >> getting the requestDispatcher as null. >> >> Can anyone please look at it, let me know if I'm missing something. >> >> Thanks, >> Prashanth Ettaboina >> >> >> >>
Re: Unable to create default RequestDispatcher
Ah - so you're installing a WAR/WAB? Can you give some details under https://github.com/ops4j/org.ops4j.pax.web/issues/1794 ? Or if you don't use Github, please share: - information about the WAR you're installing - some logs from Karaf when you install the WAR regards Grzegorz Grzybek wt., 15 lis 2022 o 12:04 Prashanth Ettaboina napisał(a): > Hi Grzegorz, > > I'm not registering the ExampleServlet anywhere, I'm configuring them in > web.xml. > In the web.xml we are giving the servlet and servlet mapping with > url-pattern and class path. > > Thanks, > Prashanth Ettaboina. > > From: Prashanth Ettaboina > Sent: 14 November 2022 19:11 > To: iss...@karaf.apache.org; dev@karaf.apache.org; u...@karaf.apache.org > Subject: Unable to create default RequestDispatcher > > Hi Team, > > I have updated my KARAF version from 4.2.15 to 4.4.1 and Java from 8 to 11 > in my application. > Gone through the official Release notes and updated some dependencies as > well. > > Upgraded OSGI-Core from 6.0.0 to 8.0.0. > Upgraded osgi.compendium 5.0.0 to osgi.cmpn 7.0.0 > Upgraded Jetty from 9.4.43.v20210629 to 9.4.46.v20220331. > Upgraded pax-web-spi from 4.3.4 to 7.2.11. > I'm using javax.servlet-api 3.1.0 version in my application. > > I'm unable to create default RequestDispatcher. > Please check the below code lines. > > public class ExampleServlet extends HttpServlet { > protected void doGet(HttpServletRequest request, HttpServletResponse > response) throws ServletException, IOException { > RequestDispatcher requestDispatcher = > getServletContext().getNamedDispatcher("default"); // get > getServletContext() is calling the method in GenericServlet. > requestDispatcher.include(request, response); > } > } > > the above code used to work fine before the version upgrades but now I'm > getting the requestDispatcher as null. > > Can anyone please look at it, let me know if I'm missing something. > > Thanks, > Prashanth Ettaboina > > > >
RE: Unable to create default RequestDispatcher
Hi Grzegorz, I'm not registering the ExampleServlet anywhere, I'm configuring them in web.xml. In the web.xml we are giving the servlet and servlet mapping with url-pattern and class path. Thanks, Prashanth Ettaboina. From: Prashanth Ettaboina Sent: 14 November 2022 19:11 To: iss...@karaf.apache.org; dev@karaf.apache.org; u...@karaf.apache.org Subject: Unable to create default RequestDispatcher Hi Team, I have updated my KARAF version from 4.2.15 to 4.4.1 and Java from 8 to 11 in my application. Gone through the official Release notes and updated some dependencies as well. Upgraded OSGI-Core from 6.0.0 to 8.0.0. Upgraded osgi.compendium 5.0.0 to osgi.cmpn 7.0.0 Upgraded Jetty from 9.4.43.v20210629 to 9.4.46.v20220331. Upgraded pax-web-spi from 4.3.4 to 7.2.11. I'm using javax.servlet-api 3.1.0 version in my application. I'm unable to create default RequestDispatcher. Please check the below code lines. public class ExampleServlet extends HttpServlet { protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { RequestDispatcher requestDispatcher = getServletContext().getNamedDispatcher("default"); // get getServletContext() is calling the method in GenericServlet. requestDispatcher.include(request, response); } } the above code used to work fine before the version upgrades but now I'm getting the requestDispatcher as null. Can anyone please look at it, let me know if I'm missing something. Thanks, Prashanth Ettaboina
Re: Unable to create default RequestDispatcher
Prashanth - just one thing - what's the method you're using to register ExampleServlet? Because according to HttpService and Whiteboard specifications, there's no "default" servlet registered. See - in Karaf 4.4.2, I've installed hawtio application (mvn:io.hawt/hawtio-osgi/2.15.0/war) and this "showcase" bundle from Pax Web: karaf@root()> install mvn:org.ops4j.pax.web.samples/showcase/8.0.11 Bundle ID: 79 karaf@root()> start 79 karaf@root()> sample:whiteboard servlet s1 /s1/* >> Using context for bundle org.ops4j.pax.web.samples.showcase [79] >> Registering a servlet with "s1" name, "/s1/*" pattern, "( osgi.http.whiteboard.context.name=default)" context selector and for org.ops4j.pax.web.samples.showcase [79]. >>>> Registered successfully. You can test it using `curl -i http://127.0.0.1:8181/s1/anything` karaf@root()> web:servlet-list Bundle ID │ Name │ Class │ Context Path(s) │ URLs │ Type │ Context Filter ──┼───┼───┼─┼──┼┼ 75│ default │ org.ops4j.pax.web.service.jetty.internal.web.JettyResourceServlet │ /hawtio │ /│ WAB│ - 75│ jolokia-agent │ io.hawt.web.servlets.JolokiaConfiguredAgentServlet│ /hawtio │ /jolokia/* │ WAB│ - 75│ jolokia-proxy │ io.hawt.web.proxy.ProxyServlet │ /hawtio │ /proxy/* │ WAB│ - 75│ keycloak │ io.hawt.web.auth.keycloak.KeycloakServlet │ /hawtio │ /keycloak/* │ WAB│ - 75│ login │ io.hawt.web.auth.LoginServlet │ /hawtio │ /auth/login │ WAB│ - 75│ logout│ io.hawt.web.auth.LogoutServlet │ /hawtio │ /auth/logout │ WAB│ - 75│ plugin│ io.hawt.web.plugin.PluginServlet │ /hawtio │ /plugin/*│ WAB│ - 75│ user │ io.hawt.web.auth.keycloak.KeycloakUserServlet │ /hawtio │ /user/* │ WAB│ - 79│ s1│ org.ops4j.pax.web.samples.config.commands.web.TestServlet │ / │ /s1/*│ Whiteboard │ (osgi.http.whiteboard.context.name =default) And there's no "defaul" servlet in "/" context. "default" servlet is installed by default only for WAB scenarios (WAR). regards Grzegorz Grzybek pon., 14 lis 2022 o 15:05 Grzegorz Grzybek napisał(a): > Hello > > There were a lot of changes in Pax Web 8 and in previous versions, > getNamedDispatch() was simply delegated to underlying web server. Now the > servlet context is always OSGi-specific and there indeed may be something > missing. > > I've created https://github.com/ops4j/org.ops4j.pax.web/issues/1794 to > track this problem - please give me ~1 day to find the reason of the > problem. > > kind regards > Grzegorz Grzybek > > pon., 14 lis 2022 o 14:56 Prashanth Ettaboina > napisał(a): > >> Hi Team, >> >> I have updated my KARAF version from 4.2.15 to 4.4.1 and Java from 8 to >> 11 in my application. >> Gone through the official Release notes and updated some dependencies as >> well. >> >> Upgraded OSGI-Core from 6.0.0 to 8.0.0. >> Upgraded osgi.compendium 5.0.0 to osgi.cmpn 7.0.0 >> Upgraded Jetty from 9.4.43.v20210629 to 9.4.46.v20220331. >> Upgraded pax-web-spi from 4.3.4 to 7.2.11. >> I'm using javax.servlet-api 3.1.0 version in my application. >> >> I'm unable to create default RequestDispatcher. >> Please check the below code lines. >> >> public class ExampleServlet extends HttpServlet { >> protected void doGet(HttpServletRequest request, >> HttpServletResponse response) throws ServletException, IOException { >> RequestDispatcher requestDispatcher = >> getServletContext().getNamedDispatcher("default"); // get >> getServletContext() is calling the method in GenericServlet. >> requestDispatcher.include(request, response); >> } >> } >> >> the above code used to work fine before the version upgrades but now I'm >> getting the requestDispatcher as null. >> >> Can anyone please look at it, let me know if I'm missing something. >> >> Thanks, >> Prashanth Ettaboina >> >> >> >>
Re: Unable to create default RequestDispatcher
Hello There were a lot of changes in Pax Web 8 and in previous versions, getNamedDispatch() was simply delegated to underlying web server. Now the servlet context is always OSGi-specific and there indeed may be something missing. I've created https://github.com/ops4j/org.ops4j.pax.web/issues/1794 to track this problem - please give me ~1 day to find the reason of the problem. kind regards Grzegorz Grzybek pon., 14 lis 2022 o 14:56 Prashanth Ettaboina napisał(a): > Hi Team, > > I have updated my KARAF version from 4.2.15 to 4.4.1 and Java from 8 to 11 > in my application. > Gone through the official Release notes and updated some dependencies as > well. > > Upgraded OSGI-Core from 6.0.0 to 8.0.0. > Upgraded osgi.compendium 5.0.0 to osgi.cmpn 7.0.0 > Upgraded Jetty from 9.4.43.v20210629 to 9.4.46.v20220331. > Upgraded pax-web-spi from 4.3.4 to 7.2.11. > I'm using javax.servlet-api 3.1.0 version in my application. > > I'm unable to create default RequestDispatcher. > Please check the below code lines. > > public class ExampleServlet extends HttpServlet { > protected void doGet(HttpServletRequest request, HttpServletResponse > response) throws ServletException, IOException { > RequestDispatcher requestDispatcher = > getServletContext().getNamedDispatcher("default"); // get > getServletContext() is calling the method in GenericServlet. > requestDispatcher.include(request, response); > } > } > > the above code used to work fine before the version upgrades but now I'm > getting the requestDispatcher as null. > > Can anyone please look at it, let me know if I'm missing something. > > Thanks, > Prashanth Ettaboina > > > >
Unable to create default RequestDispatcher
Hi Team, I have updated my KARAF version from 4.2.15 to 4.4.1 and Java from 8 to 11 in my application. Gone through the official Release notes and updated some dependencies as well. Upgraded OSGI-Core from 6.0.0 to 8.0.0. Upgraded osgi.compendium 5.0.0 to osgi.cmpn 7.0.0 Upgraded Jetty from 9.4.43.v20210629 to 9.4.46.v20220331. Upgraded pax-web-spi from 4.3.4 to 7.2.11. I'm using javax.servlet-api 3.1.0 version in my application. I'm unable to create default RequestDispatcher. Please check the below code lines. public class ExampleServlet extends HttpServlet { protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { RequestDispatcher requestDispatcher = getServletContext().getNamedDispatcher("default"); // get getServletContext() is calling the method in GenericServlet. requestDispatcher.include(request, response); } } the above code used to work fine before the version upgrades but now I'm getting the requestDispatcher as null. Can anyone please look at it, let me know if I'm missing something. Thanks, Prashanth Ettaboina