首页 > 解决方案 > 当我包含 jax 依赖项 java 11 时,tomcat 9 没有启动

问题描述

我为我的 pom 添加了以下依赖项

        <dependency>
            <groupId>com.sun.xml.ws</groupId>
            <artifactId>jaxws-ri</artifactId>
            <version>2.3.2</version>
            <type>pom</type>
        </dependency>
        <dependency>
            <groupId>javax.xml.ws</groupId>
            <artifactId>jaxws-api</artifactId>
            <version>2.2.9</version>
        </dependency>

因为java 11需要单独的依赖但是我构建我的项目并启动tomcat它没有在下面的行之后启动

WARNING: Illegal reflective access by com.thoughtworks.xstream.core.util.Fields (file:/C:/Users/Manoj/Music/tritium-tomcat-9-java-11/lib/ext/xstream-1.3.1.jar) to field java.util.Properties.defaults
WARNING: Please consider reporting this to the maintainers of com.thoughtworks.xstream.core.util.Fields
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

流提供了依赖关系,当我从战争 tomcat 中删除我的 Jax 依赖关系时,它可以正常启动也提供上述警告,那么我该怎么做才能解决这个问题?

标签: javajax-rsjax-wsjava-11tomcat9

解决方案


我找到了一个解决方案,因为我使用了 XStream 和 Jax 依赖 jars 相同的 war 文件,所以它使用类来反映我删除 xstream 并在识别问题后使用替代方法。


推荐阅读