0

以下是我的带有依赖项的 build.gradle 文件

plugins {
    id 'java'
}
dependencyManagement {
    imports {
        mavenBom 'com.oracle.oci.sdk:oci-java-sdk-bom:2.6.0'
    }
}

dependencies {
    implementation 'com.oracle.oci.sdk:oci-java-sdk-objectstorage'
    testImplementation 'org.springframework.boot:spring-boot-starter-test'
}

当我运行测试用例时,我看到以下问题。我在这里缺少什么依赖项

java.lang.TypeNotPresentException: Type org.glassfish.jersey.spi.ComponentProvider not present
    at java.base/sun.reflect.generics.factory.CoreReflectionFactory.makeNamedType(CoreReflectionFactory.java:117)
    at java.base/sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:125)
    at java.base/sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:49)
    at java.base/sun.reflect.generics.visitor.Reifier.reifyTypeArguments(Reifier.java:68)
    at java.base/sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:138)
    at java.base/sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:49)
    at java.base/sun.reflect.generics.visitor.Reifier.reifyTypeArguments(Reifier.java:68)
    at java.base/sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:138)
    at java.base/sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:49)
    at java.base/sun.reflect.generics.visitor.Reifier.reifyTypeArguments(Reifier.java:68)
    at java.base/sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:138)
    at java.base/sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:49)
    at java.base/sun.reflect.generics.repository.ClassRepository.computeSuperclass(ClassRepository.java:104)
    at java.base/sun.reflect.generics.repository.ClassRepository.getSuperclass(ClassRepository.java:86)
    at java.base/java.lang.Class.getGenericSuperclass(Class.java:949)
    at javax.ws.rs.core.GenericType.getTypeArgument(GenericType.java:211)
    at javax.ws.rs.core.GenericType.<init>(GenericType.java:117)
    at org.glassfish.jersey.client.ClientBootstrapBag$1.<init>(ClientBootstrapBag.java:55)
    at org.glassfish.jersey.client.ClientBootstrapBag.getComponentProviders(ClientBootstrapBag.java:55)
4

1 回答 1

1

org.glassfish.jersey.spi.ComponentProvider 类在 jersey-server 中找到:

compile group: 'org.glassfish.jersey.core', name: 'jersey-server', version: '2.26'
于 2021-10-04T07:23:15.650 回答