FOMUnsupportedTextTypeException - 删除type =" Text / Html"属性来自Atom feed

时间:2013-03-25 22:38:23

标签: xml-parsing websphere-portal atom-feed lotus-wcm

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

<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并在本地和dev中使用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属性吗?

1 个答案:

答案 0 :(得分:1)

作为the Atom spec shows,该Feed不正确:

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似乎生成了这个Feed;如果是这样,这是WCF中可能已修复的错误。如果这两个框正在生成不同的源,可能它们运行的​​版本不同。

修改:从您的other question我可以看到您的代码正在从azeez:10039/wps/mycontenthandler/获取Feed。您需要弄清楚为什么您的两个环境在此处生成不同的源,而不是尝试修补无效数据。