Java MappableContainerException中包含的异常

Java MappableContainerException中包含的异常,java,web-services,jersey,Java,Web Services,Jersey,嗨,我在我的Web服务代码中遇到以下异常,有人能帮我吗 Jun 28, 2012 8:49:46 PM com.sun.jersey.spi.container.ContainerResponse mapMappableContainerException SEVERE: The exception contained within MappableContainerException could not be mapped to a response, re-throwing to the

嗨,我在我的Web服务代码中遇到以下异常,有人能帮我吗

Jun 28, 2012 8:49:46 PM com.sun.jersey.spi.container.ContainerResponse mapMappableContainerException  
SEVERE: The exception contained within MappableContainerException could not be mapped to a response, re-throwing to the HTTP container  
java.lang.NoClassDefFoundError: Could not initialize class com.ibm.toro.utility.tenantconfig.DBManager  
    at com.ibm.toro.utility.tenantconfig.TenantConfigDB.getAllHotwords(TenantConfigDB.java:88)  
    at com.ibm.toro.utility.tenantconfig.TenantConfigDB.getAnalysisConf(TenantConfigDB.java:99)  
    at com.ibm.toro.utility.tenantconfig.GetTenantConfig.getTenantConfig(GetTenantConfig.java:58)  
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)  
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)  
    at java.lang.reflect.Method.invoke(Unknown Source)  
    at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)  
    at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$TypeOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:185)  
    at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)  
    at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:288)  
    at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)  
    at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)  
    at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)  
    at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)  
    at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1469)  
    at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1400)  
    at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1349)  
    at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1339)  

看起来类路径上缺少了一些内容。需要修复的异常是TenantConfigDB.getAllHotwords()中的NoClassDefFoundException。MappableContainerException只是一个包装异常,Jersey在底层代码抛出不可映射到响应的内容时使用它(在本例中,它是NoClassDefFoundException)。DBManager类的某些依赖项似乎无法加载,因为它不在类路径上。

当您使用
new
启动对象并尝试打印或使用它执行任何操作时,会发生这种情况。下面是引发堆栈溢出错误的示例:

JSONObject outerMostObj = new JSONObject();
outerMostObj.put("authFailure", outerMostObj);
System.out.println("Rretrun vaklueeee" + outerMostObj);
要解析->您需要为对象指定适当的值,并打印或执行任何您想要的操作。简单!:)


我也有同样的问题。我有一个项目(HibPro),它使用Hibernate与数据库交互。其他项目(RestService)具有服务。还有一个项目(clientTest)用于测试。HibPro有一些我想从RestService调用的方法。你能帮我看看这里缺什么吗。
JSONObject outerMostObj = new JSONObject();
JSONObject outerMostObj = fetch.getJSONValue(); //added this one
outerMostObj.put("authFailure", outerMostObj);
System.out.println("Rretrun vaklueeee" + outerMostObj);