簡體   English   中英

MappableContainerException 中包含的異常

[英]The exception contained within MappableContainerException

嗨,我的網絡服務代碼中出現異常情況,任何人都可以幫助解決這個問題

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);

要解決 - >您需要為對象分配適當的值並打印或做任何您想做的事情。 簡單的! :)

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