小编rtn*_*nyc的帖子

com.fasterxml.jackson.module.jaxb.JaxbAnnotationIntrospector 未找到 --- 使用 Swagger 时

我在 SO 上的第一篇文章并期待好东西的回报:-)

我开发了一个小型 java 宁静服务应用程序并与 Swagger 集成。我有 @Controller -> @Service -> @Repository 架构。我已经部署在 Glassfish (4.1.1) 上,当我使用 Chrome 的“高级休息客户端”时,我能够完美地发送和接收休息调用(GET/POST 等),但是当我使用 Swagger 时,它会抛出以下异常“在控制器返回正确的响应后'。

我一直在通过更改 maven 入口版本、更改 moxy jar、按照某些论坛中的建议删除 felix 等来解决这个问题,但似乎没有任何帮助。

这里有更多细节...

例外:

  StandardWrapperValve[com.xxx.config.ApplicationConfig]: Servlet.service() for servlet com.xxx.config.ApplicationConfig threw exception
java.lang.ClassNotFoundException: com.fasterxml.jackson.module.jaxb.JaxbAnnotationIntrospector not found by com.fasterxml.jackson.jaxrs.jackson-jaxrs-json-provider [130]
    at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1532)
    at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75)
    at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1955)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
Run Code Online (Sandbox Code Playgroud)

代码:

@Controller
@Path("/document")
@Api(value = "/document", description = "Document Controller ")
public class DocumentController {

    @Inject
    DocumentService documentService;

    @GET
    @Path("/{id}")
    @Produces(MediaType.APPLICATION_JSON)
    @ApiOperation(value = "Get Document.", notes = …
Run Code Online (Sandbox Code Playgroud)

java maven swagger glassfish-4.1

6
推荐指数
2
解决办法
2万
查看次数

在 Docker 上运行的 Springboot 无法从资源中读取文件

我有一个默认结构的 springboot 项目。我在资源/数据下有一个 excel 文件。我的程序需要加载 excel 文件并将数据从每张表中转储到不同的表中。

当我从 Eclipse 运行时,程序正确加载了 excel 文件,一切看起来都很好。但是,当我在 Docker 上部署同一个应用程序时,它无法从资源中读取文件。

有没有人遇到过这个问题?你是怎么解决的?

apache-poi java-8 docker spring-boot

2
推荐指数
1
解决办法
4205
查看次数

标签 统计

apache-poi ×1

docker ×1

glassfish-4.1 ×1

java ×1

java-8 ×1

maven ×1

spring-boot ×1

swagger ×1