Bug 65645 - illegal reflective access warning when deploying app using Tomcat manager
Summary: illegal reflective access warning when deploying app using Tomcat manager
Status: RESOLVED INVALID
Alias: None
Product: Tomcat 9
Classification: Unclassified
Component: Catalina (show other bugs)
Version: 9.0.54
Hardware: Other Linux
: P2 normal (vote)
Target Milestone: -----
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-10-21 18:33 UTC by abhishekm
Modified: 2021-10-25 10:50 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description abhishekm 2021-10-21 18:33:17 UTC
We recently upgraded to Java 11 and seeing the following warning when using Tomcat manager to deploy an app.


WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.apache.catalina.loader.WebappClassLoaderBase (file:/opt/apache-tomcat-9.0.54/lib/catalina.jar) to field java.io.ObjectStreamClass$Caches.localDescs
WARNING: Please consider reporting this to the maintainers of org.apache.catalina.loader.WebappClassLoaderBase
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

Command to deploy the app is:

wget --connect-timeout=60 --http-user=$TC_MGR_USERNAME --http-password=$TC_MGR_PASSWORD --no-check-certificate --header='Host: $hostname' 'https://$ip_address/mgr/text/deploy?war=file:$WAR&path=/app1&update=true' -O -

Environment: 
Tomcat 9.0.54
Cent OS 7 
# java -version
openjdk version "11.0.12" 2021-07-20 LTS
OpenJDK Runtime Environment 18.9 (build 11.0.12+7-LTS)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.12+7-LTS, mixed mode, sharing)


I see that it was fixed in https://bz.apache.org/bugzilla/show_bug.cgi?id=62901 but I am able to see the problem.

Thank you in for looking into this. Please let me know if you need any additional information.
Comment 1 Mark Thomas 2021-10-25 10:50:59 UTC
If you don't use the startup scripts provided with the standard Tomcat distribution from the ASF then you have to take responsibility for ensuring that all the configuration performed by those scripts is still performed.

In this particular instance you have not set:

--add-opens=java.base/java.io=ALL-UNNAMED