Thoughts on Tomcat setting development mode to false in web.xml

4 views
Skip to first unread message

Aaron Grant

unread,
Jun 21, 2019, 1:45:37 PM6/21/19
to uPortal Developers
I we just had a course on Tomcat at OU one of the things the instructor saw in uPortal that suggested against was having development mode on. This allows for Jasper to look for live updates to JSP every 4 seconds and then if it finds one recompile the JSP file to a class file in the work directory. This is nice for development, however for production use shouldn't really be done, especially on a code base as large as ours. 

From an implementor point of view OU uses it on occasion (maybe 2 or 3 times at year) for quick hot patches before we do a formal release and take the uPortal service down. However I could see the benefits of reducing scanning over hot patching for performance improvements.

To add this we'd need to add the Tomcat default web.xml into https://github.com/Jasig/uPortal-start/tree/master/etc/tomcat/conf/web.xml

This is an example of what use in MySAIL (I'd suggest also we adopt xpoweredBy in uPortal proper also to suppress what version of Tomcat we are using on error pages, etc.)

    <servlet>
        <servlet-name>jsp</servlet-name>
        <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
        <init-param>
            <param-name>development</param-name>
            <param-value>false</param-value>
        </init-param>
        <init-param>
            <param-name>fork</param-name>
            <param-value>false</param-value>
        </init-param>
        <init-param>
            <param-name>xpoweredBy</param-name>
            <param-value>false</param-value>
        </init-param>
        <load-on-startup>3</load-on-startup>
    </servlet>

  • development - Is Jasper used in development mode? If true, the frequency at which JSPs are checked for modification may be specified via the modificationTestInterval parameter.true or false, default true.
If everyone think this is okay, I can pull together a PR to add these changes to uportal-start and upgrade to Tomcat 8.5.42 while I'm at it.

Thanks,
Aaron
--
Aaron Grant
Associate Director Emerging Technology
Oakland University - UTS

Jackson, Allan

unread,
Jun 21, 2019, 2:01:18 PM6/21/19
to uPortal Developers

That seems like it would severely hamper development with standard hot-reloading type technologies. What if it was added as development=true and then documented as an optional performance tweak when deploying to production?

 

Allan

--
You received this message because you are subscribed to the Google Groups "uPortal Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to uportal-dev...@apereo.org.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/uportal-dev/CAOsfLuT4m%3D-6976HibETBhJgksRqK5YYMsEZYwN_mahMaJ_LnA%40mail.gmail.com.

Benito Gonzalez

unread,
Jun 21, 2019, 2:11:11 PM6/21/19
to uPortal Developers
Hmm, we are running into cases where we want to configure Tomcat differently between dev, test, and prod. We should at least add a doc on "Tuning Tomcat for uPortal".

We are currently suggesting a shell script to run that defines system properties. Then, in setenv.sh/.bat, those properties are picked up and passed to Tomcat for substitution in the config files.

I might want to extend this to using setenv to load different "cluster" files (e.g. dev.sh, test.sh) based on a system value, like UP_CLUSTER ...?

Best,
--bjagg


From: "Aaron Grant" <asg...@oakland.edu>
To: "uPortal Developers" <uport...@apereo.org>
Sent: Friday, June 21, 2019 10:45:24 AM

Subject: [uportal-dev] Thoughts on Tomcat setting development mode to false in web.xml

Aaron Grant

unread,
Jun 21, 2019, 2:17:58 PM6/21/19
to Benito Gonzalez, uPortal Developers
What we end up doing is putting our production configs into master. When we develop locally we have overlays that we place onto the repo to allow us to developer faster on uPortal. I like the idea of different system properties and bringing those in. Also we are working on a tuning doc internally for all Tomcat applications (Spring Boot and regular Tomcat monoliths), might be something we can share. uPortal sort of has one, although it could use some updates: https://github.com/Jasig/uPortal-start/blob/master/docs/en/tomcat/README.md I think maybe two new docs would be helpful, security hardening and performance tuning.

Benito Gonzalez

unread,
Jun 21, 2019, 4:12:30 PM6/21/19
to Aaron Grant, uPortal Developers
++1


From: "Aaron Grant" <asg...@oakland.edu>
To: "Benito Gonzalez" <bgon...@unicon.net>
Cc: "uPortal Developers" <uport...@apereo.org>
Sent: Friday, June 21, 2019 11:17:45 AM
Subject: Re: [uportal-dev] Thoughts on Tomcat setting development mode to false in web.xml

Christian Cousquer

unread,
Jun 24, 2019, 5:15:50 AM6/24/19
to Benito Gonzalez, Aaron Grant, uPortal Developers
Reply all
Reply to author
Forward
0 new messages