Jack,
On 2/11/25 5:56 AM, Jack Green wrote:
When you try to start `11.0.3` via:
```
new Tomcat();
```
An error is thrown:
```
Exception in thread "main" java.lang.ExceptionInInitializerError
at TomcatReproducer.main(TomcatReproducer.java:6)
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make field static final
boolean java.io.FileSystem.useCanonCaches accessible: module java.base does not "opens
java.io <http://java.io/>" to unnamed module @5a4041cc
at
java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)
at
java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
at
java.base/java.lang.reflect.Field.checkCanSetAccessible(Field.java:178)
at java.base/java.lang.reflect.Field.setAccessible(Field.java:172)
at org.apache.tomcat.util.compat.JreCompat.<clinit>(JreCompat.java:87)
... 1 more
```
And Tomcat fails to start.
This does _not_ affect `11.0.2` and appears to be introduced in
https://github.com/apache/tomcat/commit/bda730151a77a959e851104fe35e8c40ae6045d5.
`org.apache.tomcat.util.compat.JreCompat` tries to make
`java.io.FileSystem.useCanonCaches` accessible via reflection, which fails due to
module accessibility. There is a `catch` for `ReflectiveOperationException` &
`IllegalArgumentException`, but `InaccessibleObjectException` is neither of those.
You can _probably_ workaround the issue by adding an `--add-opens` VM argument
but this isn’t ideal, especially for a patch release.
Which version of Java is this?
-chris
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org