本文介绍了com.sun.jersey.spi.container.ContainerResponse mapMappableContainerException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Web服务REST中遇到了异常.我了解MappableContainerException只是Jersey所使用的包装异常,如果基础代码抛出了无法映射到响应的内容(在我的情况下是NoClassDefFoundError).但是我不知道如何解决它.

Hi I am getting below exception in my web service REST.I understand that MappableContainerException is just a wrapper exception that Jersey uses if the underlying code threw something that is not mappable to a response (in my case it is the NoClassDefFoundError). But I don't khow how to fix it.

com.sun.jersey.spi.container.ContainerResponse mapMappableContainerException
GRAVE: The exception contained within MappableContainerException could not be mapped to a response, re-throwing to the HTTP container
java.lang.NoClassDefFoundError: com/rest/util/Model

Model类存在于另一个maven项目"REST-Util"中,我像这样将其集成到我的pom.xml中:

The Model class exist in an other maven project "REST-Util" and I integrated it my pom.xml tlike this :

    <dependency>
        <groupId>com.rest.util</groupId>
        <artifactId>REST-Util</artifactId>
        <version>0.0.1-SNAPSHOT</version>
        <scope>provided</scope>
    </dependency>

如果您能帮助我解决此问题,我将不胜感激.预先感谢

I would greatly appreciate it if you can help me solve this problem. Thanks in advance

推荐答案

将所需的JAR放入WebContent\WEB-INF\lib文件夹.

Put your required JAR inside WebContent\WEB-INF\lib folder.

这篇关于com.sun.jersey.spi.container.ContainerResponse mapMappableContainerException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-15 22:56