2013-03-25 42 views
-1

我無法從解析的Atom Feed獲取條目。我從Web服務獲取這些提要。事情是代碼工作絕對好,在我的本地服務器,但是當我部署它在我的開發盒我得到FOMUnsupportedTextTypeException例外。 當我檢查生成的Atom feed中的差異時,發現feed xml中的變化很小。下面 是我local飼料FOMUnsupportedTextTypeException - 從Atom feed刪除type =「Text/Html」屬性

<atom:entry> 
<atom:id>e0f7f5e7-a5f3-4a2e-a87d-d8def2b6bc2c</atom:id> 
<atom:title">Locations</atom:title> 
<atom:author> 
<atom:uri>uid=wpsadmin,o=defaultWIMFileBasedRealm</atom:uri> 
<atom:name>wpsadmin</atom:name> 
</atom:author> 

,在這裏我dev框中生成XML。

<atom:entry> 
<atom:id>e0f7f5e7-a5f3-4a2e-a87d-d8def2b6bc2c</atom:id> 
<atom:title type="text/html">Locations</atom:title> 
<atom:author> 
<atom:uri>uid=wpsadmin,o=defaultWIMFileBasedRealm</atom:uri> 
<atom:name>wpsadmin</atom:name> 
</atom:author> 

唯一的區別是在type="text/html"atom:title

我使用阿布德拉解析器來解析原子和在本地和DEV使用IBM門戶8。

我在這個代碼得到錯誤

Document<Feed> doc = response.getDocument(); 
Feed feed = (Feed) doc.getRoot(); 
for (Entry entry : feed.getEntries()) { //exception at this line 

例外是FOMUnsupportedTextTypeException

以下是完整的異常詳細信息

[3/28/13 8:15:22:630 CDT] 0000041f servlet  E com.ibm.ws.webcontainer.servlet.ServletWrapper service SRVE0068E: An exception was thrown by one of the service methods of the servlet [/jsp/html/searchWCM.jsp] in application [APA_SearchWCM]. Exception created : [org.apache.abdera.parser.stax.FOMUnsupportedTextTypeException: Unsupported Text Type: text/html 
    at org.apache.abdera.parser.stax.FOMBuilder.getTextType(FOMBuilder.java:66) 
    at org.apache.abdera.parser.stax.FOMFactory.createElement(FOMFactory.java:558) 
    at org.apache.abdera.parser.stax.FOMBuilder.constructNode(FOMBuilder.java:108) 
    at org.apache.axiom.om.impl.builder.StAXOMBuilder.createOMElement(StAXOMBuilder.java:430) 
    at org.apache.axiom.om.impl.builder.StAXOMBuilder.createNextOMElement(StAXOMBuilder.java:298) 
    at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:223) 
    at org.apache.abdera.parser.stax.FOMBuilder.next(FOMBuilder.java:93) 
    at org.apache.axiom.om.impl.llom.OMContainerHelper.buildNext(OMContainerHelper.java:164) 
    at org.apache.axiom.om.impl.llom.OMNodeHelper.getNextOMSibling(OMNodeHelper.java:40) 
    at org.apache.axiom.om.impl.llom.OMNodeImpl.getNextOMSibling(OMNodeImpl.java:106) 
    at org.apache.axiom.om.impl.traverse.OMChildrenIterator.getNextNode(OMChildrenIterator.java:36) 
    at org.apache.axiom.om.impl.traverse.OMAbstractIterator.hasNext(OMAbstractIterator.java:69) 
    at org.apache.axiom.om.impl.traverse.OMFilterIterator.hasNext(OMFilterIterator.java:54) 
    at org.apache.abdera.parser.stax.util.FOMElementIteratorWrapper.hasNext(FOMElementIteratorWrapper.java:37) 
    at org.apache.abdera.parser.stax.util.FOMList.buffer(FOMList.java:62) 
    at org.apache.abdera.parser.stax.util.FOMList.get(FOMList.java:71) 
    at org.apache.abdera.parser.stax.util.FOMList$BufferIterator.next(FOMList.java:197) 
    at org.apache.abdera.parser.stax.FOMFeed.getEntry(FOMFeed.java:208) 
    at com.ibm.searchwcm.SearchAndFilter.getSearchResultFromServer(SearchAndFilter.java:279) 
    at com.ibm.searchwcm.SearchAndFilter.getSearchResult(SearchAndFilter.java:115) 
    at com.ibm._jsp._searchWCM._jspService(_searchWCM.java:204) 
    at com.ibm.ws.jsp.runtime.HttpJspBase.service(HttpJspBase.java:99) 
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:668) 
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1224) 
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:774) 
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:456) 
    at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178) 
    at com.ibm.wsspi.webcontainer.servlet.GenericServletWrapper.handleRequest(GenericServletWrapper.java:122) 
    at com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionServletWrapper.handleRequest(AbstractJSPExtensionServletWrapper.java:205) 
    at com.ibm.ws.webcontainer.filter.WebAppFilterChain.invokeTarget(WebAppFilterChain.java:136) 
    at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:79) 
    at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:928) 
    at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1025) 

可有人告訴我如何從atom:title刪除type="text/html"屬性?

+0

在您的問題中,網上唯一對'FOMUnsupportedTextHtmlType'的引用。你能包括完整的例外名稱嗎? – Joe 2013-03-28 11:57:05

+0

嘿喬,我已經更新了我的問題。它的'FOMUnsupportedTextTypeException' – 2013-03-28 13:19:54

回答

1

由於the Atom spec shows,飼料是不正確:

Text constructs MAY have a "type" attribute. When present, the value 
MUST be one of "text", "html", or "xhtml". If the "type" attribute 
is not provided, Atom Processors MUST behave as though it were 
present with a value of "text". 

阿布德拉是正確的拒絕。從您的問題來看,Lotus Web Content Manager正在生成該訂閱源;如果是這樣,這是WCF中的一個可能已經修復的錯誤。如果這兩個盒子生產不同的飼料,可能它們運行的​​版本不同。

編輯:從你的other question我可以看到你的代碼是從azeez:10039/wps/mycontenthandler/獲取飼料。您需要弄清楚爲什麼您的兩個環境在這裏生成不同的Feed,而不是試圖修補無效的數據。

+0

謝謝喬,如果無論如何我可以通過代碼刪除該屬性。 – 2013-03-28 14:50:49