首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Maven编译-找不到符号

Maven编译-找不到符号
EN

Stack Overflow用户
提问于 2021-03-21 08:35:42
回答 1查看 119关注 0票数 0

我如何修复这个“找不到符号”的编译错误?

代码语言:javascript
复制
[ERROR] ../hapi-fhirstarters-simple-server/src/main/../SimpleRestfulServer.java:[30,43] cannot find symbol
[ERROR]   symbol:   class StaticCapabilityStatementInterceptor
[ERROR]   location: package ca.uhn.fhir.rest.server.interceptor

我导入了这个拦截器包(还有许多其他包):

代码语言:javascript
复制
// added to try to customize the capability statement
import ca.uhn.fhir.rest.server.interceptor.StaticCapabilityStatementInterceptor;
import ca.uhn.fhir.rest.server.interceptor.*;

下面是该包的文档:https://hapifhir.io/hapi-fhir//apidocs/hapi-fhir-server/ca/uhn/fhir/rest/server/interceptor/StaticCapabilityStatementInterceptor.html

我在这里做错了什么?

这是我的完整导入列表:

代码语言:javascript
复制
package ca.uhn.fhir.example;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;

import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.rest.server.RestfulServer;
import ca.uhn.fhir.rest.server.interceptor.ResponseHighlighterInterceptor;

import com.google.auth.oauth2.GoogleCredentials;
import com.google.cloud.firestore.Firestore;
import com.google.firebase.FirebaseApp;
import com.google.firebase.FirebaseOptions;
import com.google.firebase.cloud.FirestoreClient;
import com.google.cloud.firestore.QueryDocumentSnapshot;
import com.google.cloud.firestore.QuerySnapshot;
import com.google.cloud.firestore.WriteResult;
import com.google.common.collect.ImmutableMap;
import com.google.api.core.ApiFuture;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ExecutionException;
import java.io.*;
import java.util.Arrays;

// added to try to customize the capability statement
import ca.uhn.fhir.rest.server.exceptions.InternalErrorException;
import ca.uhn.fhir.rest.server.interceptor.StaticCapabilityStatementInterceptor;
import ca.uhn.fhir.rest.server.interceptor.*;
import ca.uhn.fhir.validation.ResultSeverityEnum;
//import org.hl7.fhir.common.hapi.validation.validator.FhirInstanceValidator;
import org.hl7.fhir.r4.model.CapabilityStatement;
import org.hl7.fhir.r4.model.Enumerations;
//import org.springframework.web.cors.CorsConfiguration;
EN

回答 1

Stack Overflow用户

发布于 2021-03-21 11:15:27

根据我上面的评论,我认为查看maven配置将有助于评估缺少的依赖项。

也就是说,我根据您提供的类查找了maven库,发现它位于这个依赖项中。根据需要插入您的项目版本:

代码语言:javascript
复制
<dependency>
    <groupId>ca.uhn.hapi.fhir</groupId>
    <artifactId>hapi-fhir-server</artifactId>
    <version>${project.version}</version>
</dependency>

确保您已经在Maven配置中添加了这一项。也许可以检查一下你是否也有这些:https://hapifhir.io/hapi-fhir/docs/getting_started/downloading_and_importing.html

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/66727814

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档