gpt4 book ai didi

java - Swagger 生成的 JAX-RS 服务器与 ElasticSearch 依赖关系中断

转载 作者:行者123 更新时间:2023-12-02 05:02:01 26 4
gpt4 key购买 nike

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

mvn clean package jetty:run

现在,服务器的目的之一是在 ElasticSearch 中索引 POST 请求。但是,添加 elastic search high level rest client pom 中的内容使服务器在启动时中断。请参阅底部的错误消息。

我想补充一点,我实际上是将另一个项目作为 Maven 依赖项导入到服务器中,这就是我第一次遇到错误的地方,因为另一个项目将 elasticsearch 作为依赖项。我缩小了范围,结果发现在没有 Elasticsearch 依赖的情况下一切正常。直接在服务器 pom 中添加 elasticsearch 依赖关系会产生相同的错误,因此这就是问题所在。

我尝试过多个版本的elasticsearch,没有区别。

我还将在底部附加 POM 文件的内容。

底部附有 Maven 依赖关系树。

按照 Joakim Erdfelt 的建议,我尝试将 javax-servlet 更改为版本 3.1 和 Jetty 9.2.28.v20190418。问题仍然存在,但有新的错误消息,见底部。

原始错误消息:

Failed startup of context o.e.j.m.p.JettyWebAppContext@29c53c4f{/,file:/home/administrator/Documents/company/projects/gefion/repos/gefmail-db/jaxrs-server/src/main/webapp/,STARTING}{file:/home/administrator/Documents/company/projects/gefion/repos/gefmail-db/jaxrs-server/src/main/webapp/}

org.eclipse.jetty.util.MultiException: Multiple exceptions at org.eclipse.jetty.annotations.AnnotationConfiguration.scanForAnnotations (AnnotationConfiguration.java:536)

at org.eclipse.jetty.annotations.AnnotationConfiguration.configure (AnnotationConfiguration.java:447)

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:365)

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:534)

at org.eclipse.jetty.maven.plugin.AbstractJettyMojo.execute (AbstractJettyMojo.java:357)

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)

原始pom文件:

<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.1Jetty 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)

最佳答案

原因...

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 Multi-Release JAR 文件。

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

查看过去的问题(以及有关此主题的答案):

关于java - Swagger 生成的 JAX-RS 服务器与 ElasticSearch 依赖关系中断,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56381566/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com