【问题标题】:Java + Maven for org.eclipse.jetty Error: failed to access class org.eclipse.jetty.util.ArrayTernaryTrieorg.eclipse.jetty 的 Java + Maven 错误:无法访问类 org.eclipse.jetty.util.ArrayTernaryTrie
【发布时间】:2022-06-17 07:55:26
【问题描述】:

我正在尝试将以下码头依赖项添加到现有 Java 项目中:

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-jetty</artifactId>
</dependency>
<dependency>
    <groupId>org.eclipse.jetty</groupId>
    <artifactId>jetty-alpn-server</artifactId>
    <version>11.0.8</version>
</dependency>
    <dependency>
        <groupId>org.eclipse.jetty</groupId>
        <artifactId>jetty-alpn-conscrypt-server</artifactId>
        <version>11.0.8</version>
    </dependency>
<dependency>
    <groupId>org.eclipse.jetty.http2</groupId>
    <artifactId>http2-server</artifactId>
    <version>11.0.8</version>
</dependency>
<dependency>
    <groupId>org.eclipse.jetty</groupId>
    <artifactId>jetty-server</artifactId>
    <version>11.0.8</version>
</dependency>
<dependency>
    <groupId>org.eclipse.jetty</groupId>
    <artifactId>jetty-util</artifactId>
    <version>11.0.8</version>
</dependency>

在运行项目时出现以下错误(mvn spring-boot:run):

Caused by: java.lang.IllegalAccessError: failed to access class org.eclipse.jetty.util.ArrayTernaryTrie from 
class org.eclipse.jetty.http.PathMap (org.eclipse.jetty.util.ArrayTernaryTrie and org.eclipse.jetty.http.PathMap are in unnamed module of loader 'app')

        at org.eclipse.jetty.http.PathMap.<init>(PathMap.java:96)
        at org.eclipse.jetty.http.PathMap.<init>(PathMap.java:117)
        at org.eclipse.jetty.http.PathMap.<init>(PathMap.java:107)
        at org.eclipse.jetty.security.ConstraintSecurityHandler.<init>(ConstraintSecurityHandler.java:68)
        ... 25 more

我在它上面做了 mvn 依赖树,没有看到任何重叠的库。同样,我在尝试运行项目时看到了这个错误(mvn spring-boot:run),它构建得很好。我也尝试过 11.0.9 版本,但仍然出现此错误。它似乎与 jetty-util 包有关,但没有它我收到此错误:

java.lang.ClassNotFoundException: org.eclipse.jetty.util.Index$Builder

我希望有人知道这是怎么回事。

【问题讨论】:

    标签: java maven jetty


    【解决方案1】:

    尝试添加 jetty-security 依赖项

    【讨论】:

      猜你喜欢
      • 2013-08-17
      • 1970-01-01
      • 2022-11-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-02-08
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多