-1

我无法从已解析的 Atom Feed 中获取条目。我正在从 Web 服务获取这些提要。事情是代码在我的本地服务器上工作得非常好,但是当我将它部署在我的开发盒上时,我得到了FOMUnsupportedTextTypeException异常。当我检查生成的 Atom 提要的差异时,我发现提要 xml 几乎没有变化。下面是我的local饲料

<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

我正在使用 abdera 解析器来解析 atom 并在本地和开发中使用 IBM Portal 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)

谁能告诉我如何从中删除type="text/html"属性atom:title

4

1 回答 1

1

正如Atom 规范所示,该提要不正确:

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".

Abdera 拒绝它是正确的。根据您的问题,Lotus Web Content Manager 似乎正在生成该提要;如果是这样,那是 WCF 中可能已修复的错误。如果这两个盒子产生不同的提要,也许它们运行不同的版本。

编辑:从您的另一个问题中,我可以看到您的代码正在从azeez:10039/wps/mycontenthandler/. 您需要弄清楚为什么您的两个环境在这里产生不同的提要,而不是试图修补无效数据。

于 2013-03-28T13:39:29.503 回答