当前位置: 首页 > 知识库问答 >
问题:

Swagger生成的带有ElasticSearch依赖项的JAX-RS服务器中断

白赞
2023-03-14

我使用Swagger生成了JAX-RS服务器代码,该代码使用以下命令运行:

mvn clean package jetty:run

现在,服务器的目的之一是在ElasticSearch中索引POST请求。但是,在pom中添加弹性搜索高级rest客户端会使服务器在启动时中断。请参阅底部的错误消息。

我还会在底部附上POM文件的内容。

底部附加的Maven依赖项树。

根据Joakim Erdfelt的建议,我尝试将javax-servlet更改为3.1版和Jetty 9.2.28.V20190418版。问题仍然存在,但出现了新的错误消息,se bottom。

在org.eclipse.jetty.Annotations.AnnotationConfiguration.Configure(AnnotationConfiguration.java:447)

在org.eclipse.jetty.webapp.webappcontext.configure(webappcontext.java:479)

在org.eclipse.jetty.webapp.webappcontext.startcontext(webappcontext.java:1337)

在org.eclipse.jetty.webapp.webappcontext.doStart(webappcontext.java:505)

在org.eclipse.jetty.maven.plugin.jettywebappcontext.doStart(jettywebappcontext.java:365)

在org.eclipse.jetty.util.component.abstractLifecycle.start(abstractLifecycle.java:68)

在org.eclipse.jetty.util.component.containerlifecycle.doStart(containerlifecycle.java:114)

在org.eclipse.jetty.server.handler.abstractHandler.doStart(abstractHandler.java:61)

在org.eclipse.jetty.server.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:163)

在org.eclipse.jetty.util.component.abstractLifecycle.start(abstractLifecycle.java:68)

在org.eclipse.jetty.util.component.containerlifecycle.start(containerlifecycle.java:132)

在org.eclipse.jetty.util.component.containerlifecycle.doStart(containerlifecycle.java:114)

在org.eclipse.jetty.util.component.containerlifecycle.doStart(containerlifecycle.java:114)

在org.eclipse.jetty.server.handler.abstractHandler.doStart(abstractHandler.java:61)

在org.eclipse.jetty.server.server.doStart(server.java:354)

在org.eclipse.jetty.maven.plugin.jettyrunmojo.execute(jettyrunmojo.java:167)

在org.apache.maven.plugin.defaultBuildPluginManager.ExecuteMojo(defaultBuildPluginManager.java:137)

在org.apache.maven.lifecycle.internal.mojoexecutor.execute(mojoexecutor.java:210)

在org.apache.maven.lifecycle.internal.mojoexecutor.execute(mojoexecutor.java:148)

在org.apache.maven.lifecycle.internal.lifecycleModuleBuilder.BuildProject(lifecycleModuleBuilder.java:117)

在org.apache.maven.lifecycle.internal.lifecycleModuleBuilder.BuildProject(lifecycleModuleBuilder.java:81)

在org.apache.maven.lifecycle.internal.lifecyclestarter.execute(lifecyclestarter.java:128)

在org.apache.maven.defaultmaven.doexecute(defaultmaven.java:305)

在org.apache.maven.defaultmaven.doexecute(defaultmaven.java:192)

在org.apache.maven.cli.mavencli.domain(mavencli.java:288)

在org.apache.maven.cli.mavencli.main(mavencli.java:192)

在Sun.Reflect.NativeMethodAccessorImpl.Invoke0(本机方法)

在org.codehaus.plexus.classworlds.launcher.launcher.LaunchEnhanced(launcher.java:289)

在org.codehaus.plexus.classworlds.launcher.launcher.launcher(launcher.java:229)

在org.codehaus.plexus.classworlds.launcher.launcher.MainwithExitCode(launcher.java:415)

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>io.swagger</groupId>
  <artifactId>swagger-jaxrs-server</artifactId>
  <packaging>jar</packaging>
  <name>swagger-jaxrs-server</name>
  <version>1.0.0</version>

  <licenses>
    <license>
      <name>Unlicense</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <build>
    <sourceDirectory>src/main/java</sourceDirectory>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <version>3.1.0</version>
      </plugin>
      <plugin>
        <artifactId>maven-failsafe-plugin</artifactId>
        <version>2.6</version>
        <executions>
          <execution>
            <goals>
              <goal>integration-test</goal>
              <goal>verify</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.eclipse.jetty</groupId>
        <artifactId>jetty-maven-plugin</artifactId>
        <version>${jetty-version}</version>
        <configuration>
          <webApp>
            <contextPath>/</contextPath>
          </webApp>
          <webAppSourceDirectory>target/${project.artifactId}-${project.version}</webAppSourceDirectory>
          <stopPort>8079</stopPort>
          <stopKey>stopit</stopKey>
          <stopWait>10</stopWait>
          <httpConnector>
            <port>8080</port>
            <idleTimeout>60000</idleTimeout>
          </httpConnector>
        </configuration>
        <executions>
          <execution>
            <id>start-jetty</id>
            <phase>pre-integration-test</phase>
            <goals>
              <goal>start</goal>
            </goals>
            <configuration>
              <scanIntervalSeconds>0</scanIntervalSeconds>
              <daemon>true</daemon>
            </configuration>
          </execution>
          <execution>
            <id>stop-jetty</id>
            <phase>post-integration-test</phase>
            <goals>
              <goal>stop</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>1.9.1</version>
        <executions>
          <execution>
            <id>add-source</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>add-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>src/gen/java</source>
              </sources>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <dependencies>
    <dependency>
      <groupId>io.swagger</groupId>
      <artifactId>swagger-jersey2-jaxrs</artifactId>
      <scope>compile</scope>
      <version>${swagger-core-version}</version>
    </dependency>
    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-classic</artifactId>
      <version>${logback-version}</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-core</artifactId>
      <version>${logback-version}</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>${junit-version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>servlet-api</artifactId>
      <version>${servlet-api-version}</version>
    </dependency>
    <dependency>
      <groupId>org.glassfish.jersey.containers</groupId>
      <artifactId>jersey-container-servlet-core</artifactId>
      <version>${jersey2-version}</version>
    </dependency>
    <dependency>
      <groupId>org.glassfish.jersey.media</groupId>
      <artifactId>jersey-media-multipart</artifactId>
      <version>${jersey2-version}</version>
    </dependency>
    <dependency>
        <groupId>com.fasterxml.jackson.datatype</groupId>
        <artifactId>jackson-datatype-joda</artifactId>
        <version>${jackson-version}</version>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.jaxrs</groupId>
      <artifactId>jackson-jaxrs-json-provider</artifactId>
      <version>${jackson-version}</version>
    </dependency>
    <!-- Base64 encoding that works in both JVM and Android -->
    <dependency>
      <groupId>com.brsanthu</groupId>
      <artifactId>migbase64</artifactId>
      <version>2.2</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/org.elasticsearch.client/elasticsearch-rest-high-level-client -->
    <dependency>
      <groupId>org.elasticsearch.client</groupId>
      <artifactId>elasticsearch-rest-high-level-client</artifactId>
      <version>7.0.0</version>
    </dependency>

    <!-- Bean Validation API support -->
    <dependency>
        <groupId>javax.validation</groupId>
        <artifactId>validation-api</artifactId>
        <version>1.1.0.Final</version>
    </dependency>

  </dependencies>
  <repositories>
    <repository>
      <id>sonatype-snapshots</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
    </repository>
  </repositories>
  <properties>
    <java.version>1.7</java.version>
    <maven.compiler.source>${java.version}</maven.compiler.source>
    <maven.compiler.target>${java.version}</maven.compiler.target>
    <swagger-core-version>1.5.18</swagger-core-version>
    <jetty-version>9.2.9.v20150224</jetty-version>
    <jersey2-version>2.22.2</jersey2-version>
    <jackson-version>2.8.9</jackson-version>
    <junit-version>4.12</junit-version>
    <logback-version>1.1.7</logback-version>
    <servlet-api-version>2.5</servlet-api-version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>
</project>

mvn依赖项:树

[INFO] io.swagger:swagger-jaxrs-server:jar:1.0.0
[INFO] +- org.elasticsearch.client:elasticsearch-rest-high-level-client:jar:7.0.0:compile
[INFO] |  +- org.elasticsearch:elasticsearch:jar:7.0.0:compile
[INFO] |  |  +- org.elasticsearch:elasticsearch-core:jar:7.0.0:compile
[INFO] |  |  +- org.elasticsearch:elasticsearch-secure-sm:jar:7.0.0:compile
[INFO] |  |  +- org.elasticsearch:elasticsearch-x-content:jar:7.0.0:compile
[INFO] |  |  |  +- org.yaml:snakeyaml:jar:1.17:compile
[INFO] |  |  |  +- com.fasterxml.jackson.dataformat:jackson-dataformat-smile:jar:2.8.11:compile
[INFO] |  |  |  +- com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:jar:2.8.11:compile
[INFO] |  |  |  \- com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:jar:2.8.11:compile
[INFO] |  |  +- org.elasticsearch:elasticsearch-geo:jar:7.0.0:compile
[INFO] |  |  +- org.apache.lucene:lucene-core:jar:8.0.0:compile
[INFO] |  |  +- org.apache.lucene:lucene-analyzers-common:jar:8.0.0:compile
[INFO] |  |  +- org.apache.lucene:lucene-backward-codecs:jar:8.0.0:compile
[INFO] |  |  +- org.apache.lucene:lucene-grouping:jar:8.0.0:compile
[INFO] |  |  +- org.apache.lucene:lucene-highlighter:jar:8.0.0:compile
[INFO] |  |  +- org.apache.lucene:lucene-join:jar:8.0.0:compile
[INFO] |  |  +- org.apache.lucene:lucene-memory:jar:8.0.0:compile
[INFO] |  |  +- org.apache.lucene:lucene-misc:jar:8.0.0:compile
[INFO] |  |  +- org.apache.lucene:lucene-queries:jar:8.0.0:compile
[INFO] |  |  +- org.apache.lucene:lucene-queryparser:jar:8.0.0:compile
[INFO] |  |  +- org.apache.lucene:lucene-sandbox:jar:8.0.0:compile
[INFO] |  |  +- org.apache.lucene:lucene-spatial:jar:8.0.0:compile
[INFO] |  |  +- org.apache.lucene:lucene-spatial-extras:jar:8.0.0:compile
[INFO] |  |  +- org.apache.lucene:lucene-spatial3d:jar:8.0.0:compile
[INFO] |  |  +- org.apache.lucene:lucene-suggest:jar:8.0.0:compile
[INFO] |  |  +- org.elasticsearch:elasticsearch-cli:jar:7.0.0:compile
[INFO] |  |  |  \- net.sf.jopt-simple:jopt-simple:jar:5.0.2:compile
[INFO] |  |  +- com.carrotsearch:hppc:jar:0.7.1:compile
[INFO] |  |  +- com.tdunning:t-digest:jar:3.2:compile
[INFO] |  |  +- org.hdrhistogram:HdrHistogram:jar:2.1.9:compile
[INFO] |  |  +- org.apache.logging.log4j:log4j-api:jar:2.11.1:compile
[INFO] |  |  \- org.elasticsearch:jna:jar:4.5.1:compile
[INFO] |  +- org.elasticsearch.client:elasticsearch-rest-client:jar:7.0.0:compile
[INFO] |  |  +- org.apache.httpcomponents:httpclient:jar:4.5.7:compile
[INFO] |  |  +- org.apache.httpcomponents:httpcore:jar:4.4.11:compile
[INFO] |  |  +- org.apache.httpcomponents:httpasyncclient:jar:4.1.4:compile
[INFO] |  |  +- org.apache.httpcomponents:httpcore-nio:jar:4.4.11:compile
[INFO] |  |  +- commons-codec:commons-codec:jar:1.11:compile
[INFO] |  |  \- commons-logging:commons-logging:jar:1.1.3:compile
[INFO] |  +- org.elasticsearch.plugin:parent-join-client:jar:7.0.0:compile
[INFO] |  +- org.elasticsearch.plugin:aggs-matrix-stats-client:jar:7.0.0:compile
[INFO] |  +- org.elasticsearch.plugin:rank-eval-client:jar:7.0.0:compile
[INFO] |  \- org.elasticsearch.plugin:lang-mustache-client:jar:7.0.0:compile
[INFO] |     \- com.github.spullara.mustache.java:compiler:jar:0.9.3:compile
[INFO] +- io.swagger:swagger-jersey2-jaxrs:jar:1.5.18:compile
[INFO] |  \- io.swagger:swagger-jaxrs:jar:1.5.18:compile
[INFO] |     +- io.swagger:swagger-core:jar:1.5.18:compile
[INFO] |     |  +- org.apache.commons:commons-lang3:jar:3.2.1:compile
[INFO] |     |  \- io.swagger:swagger-models:jar:1.5.18:compile
[INFO] |     |     \- io.swagger:swagger-annotations:jar:1.5.18:compile
[INFO] |     +- org.reflections:reflections:jar:0.9.11:compile
[INFO] |     |  \- org.javassist:javassist:jar:3.21.0-GA:compile
[INFO] |     \- com.google.guava:guava:jar:20.0:compile
[INFO] +- ch.qos.logback:logback-classic:jar:1.1.7:compile
[INFO] |  \- org.slf4j:slf4j-api:jar:1.7.20:compile
[INFO] +- ch.qos.logback:logback-core:jar:1.1.7:compile
[INFO] +- junit:junit:jar:4.12:test
[INFO] |  \- org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] +- javax.servlet:servlet-api:jar:2.5:compile
[INFO] +- org.glassfish.jersey.containers:jersey-container-servlet-core:jar:2.22.2:compile
[INFO] |  +- org.glassfish.hk2.external:javax.inject:jar:2.4.0-b34:compile
[INFO] |  +- org.glassfish.jersey.core:jersey-common:jar:2.22.2:compile
[INFO] |  |  +- javax.annotation:javax.annotation-api:jar:1.2:compile
[INFO] |  |  +- org.glassfish.jersey.bundles.repackaged:jersey-guava:jar:2.22.2:compile
[INFO] |  |  +- org.glassfish.hk2:hk2-api:jar:2.4.0-b34:compile
[INFO] |  |  |  +- org.glassfish.hk2:hk2-utils:jar:2.4.0-b34:compile
[INFO] |  |  |  \- org.glassfish.hk2.external:aopalliance-repackaged:jar:2.4.0-b34:compile
[INFO] |  |  +- org.glassfish.hk2:hk2-locator:jar:2.4.0-b34:compile
[INFO] |  |  \- org.glassfish.hk2:osgi-resource-locator:jar:1.0.1:compile
[INFO] |  +- org.glassfish.jersey.core:jersey-server:jar:2.22.2:compile
[INFO] |  |  +- org.glassfish.jersey.core:jersey-client:jar:2.22.2:compile
[INFO] |  |  \- org.glassfish.jersey.media:jersey-media-jaxb:jar:2.22.2:compile
[INFO] |  \- javax.ws.rs:javax.ws.rs-api:jar:2.0.1:compile
[INFO] +- org.glassfish.jersey.media:jersey-media-multipart:jar:2.22.2:compile
[INFO] |  \- org.jvnet.mimepull:mimepull:jar:1.9.6:compile
[INFO] +- com.fasterxml.jackson.datatype:jackson-datatype-joda:jar:2.8.9:compile
[INFO] |  +- com.fasterxml.jackson.core:jackson-annotations:jar:2.8.0:compile
[INFO] |  +- com.fasterxml.jackson.core:jackson-core:jar:2.8.9:compile
[INFO] |  +- com.fasterxml.jackson.core:jackson-databind:jar:2.8.9:compile
[INFO] |  \- joda-time:joda-time:jar:2.7:compile
[INFO] +- com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:jar:2.8.9:compile
[INFO] |  +- com.fasterxml.jackson.jaxrs:jackson-jaxrs-base:jar:2.8.9:compile

[INFO] |  \- com.fasterxml.jackson.module:jackson-module-jaxb-annotations:jar:2.8.9:compile
[INFO] +- com.brsanthu:migbase64:jar:2.2:compile
[INFO] \- javax.validation:validation-api:jar:1.1.0.Final:compile

更改版本时的错误消息:javax-servlet版本3.1 Jetty 9.2.28.V20190418

org.eclipse.jetty.util.MultiException: Multiple exceptions
    at org.eclipse.jetty.annotations.AnnotationConfiguration.scanForAnnotations (AnnotationConfiguration.java:537)
    at org.eclipse.jetty.annotations.AnnotationConfiguration.configure (AnnotationConfiguration.java:448)
    at org.eclipse.jetty.webapp.WebAppContext.configure (WebAppContext.java:479)
    at org.eclipse.jetty.webapp.WebAppContext.startContext (WebAppContext.java:1337)
    at org.eclipse.jetty.server.handler.ContextHandler.doStart (ContextHandler.java:741)
    at org.eclipse.jetty.webapp.WebAppContext.doStart (WebAppContext.java:505)
    at org.eclipse.jetty.maven.plugin.JettyWebAppContext.doStart (JettyWebAppContext.java:366)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start (AbstractLifeCycle.java:68)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.start (ContainerLifeCycle.java:132)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart (ContainerLifeCycle.java:114)
    at org.eclipse.jetty.server.handler.AbstractHandler.doStart (AbstractHandler.java:61)
    at org.eclipse.jetty.server.handler.ContextHandlerCollection.doStart (ContextHandlerCollection.java:163)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start (AbstractLifeCycle.java:68)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.start (ContainerLifeCycle.java:132)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart (ContainerLifeCycle.java:114)
    at org.eclipse.jetty.server.handler.AbstractHandler.doStart (AbstractHandler.java:61)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start (AbstractLifeCycle.java:68)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.start (ContainerLifeCycle.java:132)
    at org.eclipse.jetty.server.Server.start (Server.java:387)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart (ContainerLifeCycle.java:114)
    at org.eclipse.jetty.server.handler.AbstractHandler.doStart (AbstractHandler.java:61)
    at org.eclipse.jetty.server.Server.doStart (Server.java:354)
    at org.eclipse.jetty.maven.plugin.JettyServer.doStart (JettyServer.java:73)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start (AbstractLifeCycle.java:68)
    at org.eclipse.jetty.maven.plugin.AbstractJettyMojo.startJetty (AbstractJettyMojo.java:535)
    at org.eclipse.jetty.maven.plugin.AbstractJettyMojo.execute (AbstractJettyMojo.java:358)
    at org.eclipse.jetty.maven.plugin.JettyRunMojo.execute (JettyRunMojo.java:167)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: java.lang.RuntimeException: Error scanning entry META-INF/versions/9/org/elasticsearch/core/internal/io/Streams.class from jar file:/home/administrator/.m2/repository/org/elasticsearch/elasticsearch-core/7.0.0/elasticsearch-core-7.0.0.jar
    at org.eclipse.jetty.annotations.AnnotationParser.parseJar (AnnotationParser.java:913)
    at org.eclipse.jetty.annotations.AnnotationParser.parse (AnnotationParser.java:831)
    at org.eclipse.jetty.annotations.AnnotationConfiguration$ParserTask.call (AnnotationConfiguration.java:164)
    at org.eclipse.jetty.annotations.AnnotationConfiguration$1.run (AnnotationConfiguration.java:549)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob (QueuedThreadPool.java:635)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run (QueuedThreadPool.java:555)
    at java.lang.Thread.run (Thread.java:748)
Caused by: java.lang.IllegalArgumentException
    at org.objectweb.asm.ClassReader.<init> (Unknown Source)
    at org.objectweb.asm.ClassReader.<init> (Unknown Source)
    at org.objectweb.asm.ClassReader.<init> (Unknown Source)
    at org.eclipse.jetty.annotations.AnnotationParser.scanClass (AnnotationParser.java:973)
    at org.eclipse.jetty.annotations.AnnotationParser.parseJarEntry (AnnotationParser.java:956)
    at org.eclipse.jetty.annotations.AnnotationParser.parseJar (AnnotationParser.java:909)
    at org.eclipse.jetty.annotations.AnnotationParser.parse (AnnotationParser.java:831)
    at org.eclipse.jetty.annotations.AnnotationConfiguration$ParserTask.call (AnnotationConfiguration.java:164)
    at org.eclipse.jetty.annotations.AnnotationConfiguration$1.run (AnnotationConfiguration.java:549)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob (QueuedThreadPool.java:635)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run (QueuedThreadPool.java:555)
    at java.lang.Thread.run (Thread.java:748)

共有1个答案

陶弘业
2023-03-14

原因...

Error scanning entry 
META-INF/versions/9/org/elasticsearch/core/internal/io/Streams.class
from jar file:/home/administrator/.m2/repository/org/elasticsearch/elasticsearch-core/7.0.0/elasticsearch-core-7.0.0.jar

...告诉您项目中存在一个JEP-238多版本JAR文件。

支持JEP-238多版本JAR文件的Jetty的第一个版本是Jetty 9.4.9。

  • 启动Jetty服务器时扫描条目“module-info.class”时出错
  • 无法启动上下文C.G.G.D.S.J.WebAppContextTwithreLoad
  • 在Meta-INF/Versions/9/*和带有Jetty 9.2的Elasticsearch 6.2.2+上出现字节码扫描错误
 类似资料:
  • 问题内容: 澄清: 这个问题是关于对基于JAX-WS的REST服务进行GZIP处理,但是我决定更改主题以使其更容易找到 我正在通过JAX-WS实现REST服务,并以标准方式发布它(原因是我想避免使用servlet容器或应用程序服务器)。 有办法让服务器gzip响应内容吗? 如何 实际提供的示例可以正常工作,它使您可以在没有servlet容器的嵌入式轻量级服务器上构建JAX-RS样式的服务器,但是需

  • 我在加载Swagger UI/启用UIendpoint时遇到了一个问题。Maven项目,Jersey版本-2.12,Swagger版本-1.5.1-m2 我有一个通过编程配置的jersey web应用程序。在我的ResourceConfig(扩展)中,我为Swagger设置了以下内容: 我已经将Swagger UI dist的内容复制到我的web应用程序文件夹中。 当我点击http://local

  • 泽西-客户端 泽西-普通 jersey-container-servlet jersey-container-servlet-core 泽西-服务器 如果我这样做,我总是得到以下异常: 经过一些研究,我发现我应该添加jersey-servlet-1.12.jar,而不是从上面发布的下载源添加jar。所以我做了。我将其添加到web.xml中

  • 如何配置swaggerui来为具有集合输入参数的JAX-RS资源显示正确的参数datatype? 下面是一个示例groovy JAX-RS资源。其输入类型为 在swagger UI中,我看到填充了空类型的列表,而不是。它对输出参数工作得很好。使用注释,我可以指定响应类型。

  • 我正在尝试使用 https://github.com/swagger-api/swagger-codegen 生成 nodejs 客户端 sdk 这是我使用的命令 但是对于我需要生成的实际sdk,swagger规范被拆分为两个不同的json文件,我想为两者创建一个sdk。我如何使用Swagger-codecen做到这一点,同时使用多个swagger json?

  • 问题内容: 我正在尝试在JBoss jboss-eap-6.1 AS上运行一个简单的“ Hallo World”应用程序Jersey 2.3.1 REST服务。在web.xml中,我禁用了restEasy库。部署期间出现错误: JBWEB000289:Servlet com.sun.jersey.samples.helloworld.resources.MyApplication抛出load()异