gpt4 book ai didi

java - 无法将类型id 'http'解析为[简单类型,类io.dropwizard.jetty.ConnectorFactory]的子类型

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

我在我的应用程序中使用dropwizard,并且尝试运行JAR文件,它显示了以下错误:

Could not resolve type id 'http' as a subtype of [simple type, class io.dropwizard.jetty.ConnectorFactory]

我的config.yml文件
server:
type: default
applicationConnectors:
- type: http
port: 9000
adminConnectors:
- type: http
port: 9001

另外,我已经在build.gradle中处理了影子插件,但仍然显示错误。
buildscript {
repositories {
jcenter()
}
dependencies {
classpath "com.github.jengelman.gradle.plugins:shadow:2.0.1"
}
}


apply plugin: 'maven'
apply plugin: 'java'
apply plugin: 'application'
apply plugin: 'com.github.johnrengelman.shadow'

apply plugin: 'com.jfrog.artifactory'
apply plugin: 'maven-publish'

sourceCompatibility = 1.8

mainClassName = "com.freightos.flux.LocationsApplication"

repositories {
jcenter()
mavenCentral()
}

task wrapper(type: Wrapper) {
gradleVersion = "4.5"
}

// Configure the shadow jar task
shadowJar {
mergeServiceFiles()
exclude 'META-INF/*.DSA'
exclude 'META-INF/*.RSA'
}
jar {
manifest {
attributes 'Main-Class': mainClassName
}
}

我该如何解决这个问题?

最佳答案

您的YAML缩进看起来很破损。 linter为此返回它:

server: 
adminConnectors:
-
port: 9001
type: http
applicationConnectors:
-
port: 9000
type: http
type: default

尝试以下方法:
server:
type: default
applicationConnectors:
- type: http
port: 8080
adminConnectors:
- type: http
port: 8081
- type: https

关于java - 无法将类型id 'http'解析为[简单类型,类io.dropwizard.jetty.ConnectorFactory]的子类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48487411/

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