简体   繁体   English

MappableContainerException 中包含的异常

[英]The exception contained within MappableContainerException

Hi I am getting below exception in my webservice code could any one help in this嗨,我的网络服务代码中出现异常情况,任何人都可以帮助解决这个问题

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)  

Looks like you are missing something on the classpath.看起来你在类路径上遗漏了一些东西。 The exception you need to fix is the NoClassDefFoundException from TenantConfigDB.getAllHotwords().您需要修复的异常是 TenantConfigDB.getAllHotwords() 中的 NoClassDefFoundException。 MappableContainerException is just a wrapper exception that Jersey uses if the underlying code threw something that is not mappable to a response (in this case it is the NoClassDefFoundException). MappableContainerException 只是 Jersey 使用的一个包装异常,如果底层代码抛出了一些不可映射到响应的东西(在本例中是 NoClassDefFoundException)。 Seems some dependency of DBManager class cannot be loaded as it is not on the classpath.似乎无法加载 DBManager 类的某些依赖项,因为它不在类路径上。

This happens when you initiate an object with new and try to print or do anything with it.当您使用new启动一个对象并尝试对其进行打印或执行任何操作时,就会发生这种情况。 Below is the example that throws the stack overflow error:下面是引发堆栈溢出错误的示例:

JSONObject outerMostObj = new JSONObject();
outerMostObj.put("authFailure", outerMostObj);
System.out.println("Rretrun vaklueeee" + outerMostObj);

To resolve -> You need to assign proper value for the object and print or do whatever you want.要解决 - >您需要为对象分配适当的值并打印或做任何您想做的事情。 Simple!简单的! :) :)

JSONObject outerMostObj = new JSONObject();
JSONObject outerMostObj = fetch.getJSONValue(); //added this one
outerMostObj.put("authFailure", outerMostObj);
System.out.println("Rretrun vaklueeee" + outerMostObj);

我正在做一个调用 mq 的休息服务,解决我的问题是在 WEB-INF/lib 文件夹中添加 .jar 文件

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM