Skip to content

Fix warnings about java security manager - #152

Open
mgaffigan wants to merge 1 commit into
OpenIntegrationEngine:mainfrom
mgaffigan:maint/remove-jsm
Open

mgaffigan wants to merge 1 commit into
OpenIntegrationEngine:mainfrom
mgaffigan:maint/remove-jsm

Conversation

@mgaffigan

@mgaffigan mgaffigan commented Jul 29, 2025 •

Copy link
Copy Markdown
Contributor

Fixes javac build warnings present on Java 8 and Java 17.

Split from #148

Release Note

Removed Java Security Manager Support

As announced in the previous release, we have removed all legacy integrations with the Java Security Manager, aligning with its deprecation in Java 17 and removal in Java 24+.

API proxies and JavaScript worker threads no longer perform privileged AccessController lookups. Standard deployments are completely unaffected. On the rare chance you are still running a custom restrictive policy via -Djava.security.manager, you may now need to explicitly grant RuntimePermission "getClassLoader" in your policy file.

@mgaffigan

mgaffigan commented Jul 29, 2025 •

Copy link
Copy Markdown
Contributor Author

@tonygermano, I think this is still safe to merge. JWS was removed in Java 11, and is non-default in Java 8. That's 10-years+ of this being a non-default issue.

@kpalang
kpalang requested review from a team, gibson9583, jonbartels, kayyagari and kpalang and removed request for a team August 1, 2025 12:06
@tonygermano

Copy link
Copy Markdown
Member

@tonygermano, I think this is still safe to merge. JWS was removed in Java 11, and is non-default in Java 8. That's 10-years+ of this being a non-default issue.

Java WebStart utilized the SecurityManager, but SecurityManager is not a JWS specific technology. Some of these changes modify server classes as well as client classes.

I'm not saying that we shouldn't do this, only that we need to do it carefully. The technology is deprecated, but not dead, and someone could be using it (potentially with 2nd- or 3rd-party libraries.) There is no positive impact to this change other than removing a few compiler warnings, and there are potential negative impacts if we put it in the next release without giving adequate warning that it will be removed.

I appreciate you splitting it off from #148, which Kaur merged earlier today.

@mgaffigan

Copy link
Copy Markdown
Contributor Author

Can you comment on what conceivable use that might be that these five spots are sufficient? My experience with restricted trust environments is that such things are more prevalent in the codebase, and require frequent maintenance. I normally agree with a cautionary stance, but it's a dead technology that is disabled by default and spews warnings at runtime if enabled on the current release (Java 17). If someone has so custom an environment that they are using this, a line in the release notes is probably sufficient.

Regardless, it's a lot easier to say "there should be no warnings" not "ignore the JSM" warnings, so I've submitted #154 until this can merge.

@NicoPiel

NicoPiel commented Sep 3, 2025 •

Copy link
Copy Markdown
Contributor

someone could be using it (potentially with 2nd- or 3rd-party libraries.)

Yes, but it's not feasible for OIE to consider every possible deprecated use-case of disabled-by-default technology, right? Getting rid of stuff like this will only facilitate getting of Mirth's rat tail of ancient dependencies and technologies in the future.

@tonygermano

Copy link
Copy Markdown
Member

Language to deprecate this code was added to the 4.7.0 release notes. Pending any objections, we should be safe to remove it before the next version.

@tonygermano tonygermano added this to the Next Release milestone Oct 22, 2026
@tonygermano
tonygermano requested review from a team, pacmano1, ssrowe and tonygermano November 17, 2026 12:24
tonygermano
tonygermano previously approved these changes Nov 17, 2026

@tonygermano tonygermano left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I already updated the release note in the PR description.

@tonygermano
tonygermano requested a review from NicoPiel November 17, 2026 12:35
The Java Security Manager is deprecated for removal (JEP 411), and
javac warns about the remaining uses. Drop the
AccessController.doPrivileged class loader lookups and the
SecurityManager thread group lookup, along with the
@SuppressWarnings("removal") annotations that are no longer needed.

Proxy classes now get their class loader directly from the interface.
A custom restrictive policy may need RuntimePermission "getClassLoader".

Signed-off-by: Mitch Gaffigan <mitch.gaffigan@comcast.net>
Signed-off-by: Tony Germano <tony@germano.name>

@tonygermano tonygermano left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rebased to resolve merge conflicts and revert changes from #154

@github-actions

Copy link
Copy Markdown

Test Results

  145 files  ±0    145 suites  ±0   4m 29s ⏱️ +40s
  976 tests ±0    976 ✅ ±0  0 💤 ±0  0 ❌ ±0 
1 258 runs  ±0  1 252 ✅ ±0  6 💤 ±0  0 ❌ ±0 

Results for commit e37bdde. ± Comparison against base commit 4878ed1.

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.

3 participants