Hi devs,

With the new 4.5.x kernel release we are upgrading the tomcat version from
7 to 9. I am currently trying to update the tomcat version to 9.0.21 in
product-is. This mail is to discuss the upgrade process.

Now the web apps got deployed and working with tomcat 9. But the management
console and the service calls are not working. This may be due to
the JspServlet customizations. I am working on it now.

We have the following customized classes of the tomcat.

   - SCIRegistrarContextConfig - This class customized to process
   ServletContainerInitializers in the form of jars or OSGi bundles. This
   class overrides the 'processServletContainerInitializers' method in
   org.apache.catalina.startup.ContextConfig class.
   - CarbonTomcatRealm - This is a custom Tomcat realm that uses Carbon
   realm inside.
   - ExtendedStandardService - This class customized to stop starting of
   the  transport connectors, because we need to start the connector after all
   the OSGi bundles are wired
   - CarbonTomcatJarScanner - This class customized to load the TLD scanner
   classes reside in the OSGi bundles during the web app loading. According to
   the servlet 3.0 spec, tldScanner classes are picked up during web app
   loading phase from the classPath. However, the StandardJarScanner fails to
   pick up the TLD scanner classes reside in the OSGi bundles. Because in the
   StandardJarScanner scan the classes if the classloader is an instance of
   the URLClassLoader. But ModuleClassLoader (the OSGi classloader which is
   the parent classLoader of tomcat web app class loader) is not an instance
   of it.
   - CarbonWebappLoader and CarbonWebappClassLoader - This customization
   allows to change the classloading pattern based on the
   webapp-classloading.xml file. There is room for improvements in these
   classes because the common environmental libraries have been loaded for
   each web app which causes memory and start-up delay. We can create a new
   classloader for each environment and create the class loader hierarchy.
   - JspServlet - JSPServlet wraps the Apache Jasper Servlet making it
   appropriate for running in an OSGi environment under the Http Service. The
   Jasper JSPServlet makes use of the Thread Context Classloader to support
   compile and runtime of JSPs and to accommodate running in an OSGi
   environment, a Bundle is used to provide the similar context normally
   provided by the web app.
   - Other classes with session-related customizations,
      - CarbonTomcatSimpleTcpCluster
      - CarbonSessionReplicationMessage
      - CarbonTomcatClusterableSessionManager
      - CarbonTomcatSessionMessage
      - CarbonTomcatSessionManager
      - CarbonTomcatSessionPersistentManager

We also have the following patched classes of the tomcat,

   - org.apache.catalina.startup.ExpandWar : Patch to unpack web apps of
   tenants inside the tenant's webapps/ directory. This needs to be refactored
   with the new improvements done in the tomcat 9.
   - org.apache.coyote.RequestInfo : Patch to record bandwidth statistics
   data. There are some new methods added need to refactor.


I have done the necessary changes in the
SCIRegistrarContextConfig, ExtendedStandardService,
CarbonTomcatJarScanner, CarbonWebappLoader and CarbonWebappClassLoader to
support tomcat 9. As mentioned above the classloading customizations can be
improved. IMO, we can look into it once we completely upgrade and stables
the products with tomcat 9. Currently, I am working on the JspServlet to
fix the JSP issues. Next, I have planned to work in the patched classes and
then in other session-related customizations.

Other than these, tomcat 9 also has new features like HTTP/2 support, TLS
virtual hosting and multiple certificate support for connectors. We can
also look into the possibilities of using these new features as well. We
tomcat 9 have contains configuration changes. I will update this mail with
the list of config changes.

Thanks,
Senthalan
-- 
Senthalan Kanagalingam | Software Engineer | WSO2 Inc.
(m) +94 (0) 77 18 77 466 | (w) +94117435800 | (e) [email protected]

<http://wso2.com/signature>
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to