Java 无法解析类型id';http';作为[简单类型,类io.dropwizard.jetty.ConnectorFactory]的子类型
我正在我的应用程序中使用dropwizard,我尝试运行JAR文件,它显示以下错误:Java 无法解析类型id';http';作为[简单类型,类io.dropwizard.jetty.ConnectorFactory]的子类型,java,maven,gradle,dropwizard,Java,Maven,Gradle,Dropwizard,我正在我的应用程序中使用dropwizard,我尝试运行JAR文件,它显示以下错误: Could not resolve type id 'http' as a subtype of [simple type, class io.dropwizard.jetty.ConnectorFactory] My config.yml文件 server: type: default applicationConnectors: - type: http port: 9000 ad
Could not resolve type id 'http' as a subtype of [simple type, class io.dropwizard.jetty.ConnectorFactory]
My 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的缩进看起来已损坏。A为其返回此值:
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
你的YAML的缩进看起来破了。A为其返回此值:
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
同上无法将类型id“http”解析为[simple type,class io.dropwizard.jetty.ConnectorFactory]的子类型同上无法将类型id“http”解析为[simple type,class io.dropwizard.jetty.ConnectorFactory]的子类型您最终是如何解决的?最终是如何解决的?