我正在尝试将我们的应用程序使用的 tomcat Web 容器从版本 8.5 升级到 9.x。我们在启用了 JMX 的上下文 xml 文件上定义了 JDBC 资源。当应用程序启动时,由于java.time.Duration
没有对应的 OpenType,在向 MBeanServer 注册 bean 时会引发异常。
发生这种情况的org.apache.tomcat.dbcp.dbcp2.BasicDataSource
方法具有返回类型值的方法java.time.Duration
例外:
Caused by: java.lang.IllegalArgumentException: Method org.apache.tomcat.dbcp.dbcp2.DataSourceMXBean.getMaxConnDuration has parameter or return type that cannot be translated into an OpenType
...
...
Caused by: javax.management.openmbean.OpenDataException: Cannot convert type: java.time.Duration
...
...
Caused by: javax.management.openmbean.OpenDataException: Cannot convert type: java.time.temporal.TemporalUnit
...
...
Caused by: javax.management.openmbean.OpenDataException: Recursive data structure, including java.time.Duration
https://tomcat.apache.org/tomcat-9.0-doc/api/org/apache/tomcat/dbcp/dbcp2/BasicDataSource.html
有解决方法吗?
谢谢!