Skip to content

Test for JSP recompilation - #8236

Merged
labkey-adam merged 1 commit into
developfrom
fb_fix_jsp_recompilation
Oct 27, 2026
Merged

labkey-adam merged 1 commit into
developfrom
fb_fix_jsp_recompilation

Conversation

@labkey-adam

@labkey-adam labkey-adam commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Rationale

We had no coverage for runtime JSP recompilation. This meant a break in that capability went unnoticed initially.

Related Pull Requests

Changes

  • Add a unit test that ensures JspC loads and can compile a simple JSP file

@labkey-adam
labkey-adam requested a review from a team October 26, 2026 22:36
@labkey-adam
labkey-adam merged commit 6c6e372 into develop Oct 27, 2026
9 of 10 checks passed
@labkey-adam
labkey-adam deleted the fb_fix_jsp_recompilation branch October 27, 2026 15:51
labkey-adam added a commit to LabKey/server that referenced this pull request Oct 27, 2026
## Rationale
After updating to Tomcat 11.0.27, attempts to recompile JSP files at
runtime resulted in stack traces like:
```
java.lang.NoClassDefFoundError: org/apache/tools/ant/taskdefs/LogOutputStream
    at org.labkey.api.jsp.RecompilingJspClassLoader.getCompiledClassFile(RecompilingJspClassLoader.java:126)
    at org.labkey.api.jsp.RecompilingJspClassLoader.loadClass(RecompilingJspClassLoader.java:81)
    at org.labkey.api.jsp.JspLoader.createPage(JspLoader.java:76)
    at org.labkey.api.view.JspView.<init>(JspView.java:94)
    at org.labkey.api.view.JspView.<init>(JspView.java:84)
    at org.labkey.oauth2.ConnectedAppsViewProvider.getViews(ConnectedAppsViewProvider.java:29)
```
## Related Pull Requests
- #1538
- LabKey/platform#8236

## Changes
- Tomcat 11.0.27 added a reference to
`org.apache.tools.ant.taskdefs.LogOutputStream` in JspC, its JSP
compiler. Instead of bundling a full version of ant.jar in our product,
in the past, we've been able to supply just a few stub classes, enough
to keep JspC happy. That continues to be the case here: a simple stub
version of LogOutputStream is sufficient.
- While investigating, I realized that no product dependencies require
ant.jar, so I removed the unnecessary property and `force`. A comment
claimed that `eigenbase-xom` pulled it in, but it's optional in the
version we currently use.
- Refresh `FileUtils` from latest Ant sources. This is the only stub
that has any actual code in it. Code was at least 10 years old, so this
keeps are code aligned with the official sources and modernizes it with
generics, `StringBuilder` instead of `StringBuffer`, and a few cosmetic
changes.

## Tasks
- [x] Claude Code Review
- [x] Test Automation - added a [unit test for JSP
recompilation](LabKey/platform#8236)
- [x] Manual Testing @labkey-tchad
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants