[
https://issues.apache.org/jira/browse/ABDERA-258?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13482713#comment-13482713
]
Denilson Nastacio commented on ABDERA-258:
------------------------------------------
I still see a similar issue, I just downloaded Abdera 1.1.2 and tried to parse
the following atom XML document:
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"
xmlns:snx="http://www.ibm.com/xmlns/prod/sn"
xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/">
<generator uri="http://www.ibm.com/xmlns/prod/sn" version="3.0.1.0">IBM
Connections - Dogear</generator>
<title>Bookmarks - Public Bookmarks</title>
<link rel="self" type="application/atom+xml"
href="https://w3-connections.ibm.com/dogear/atom?page=690&ps=50&sortBy=created&sortOrder=desc&lang=en_US"
/>
<link rel="http://www.ibm.com/xmlns/prod/sn/tag-cloud"
type="application/atomcat+xml"
href="https://w3-connections.ibm.com/dogear/tags?page=690&ps=50&sortBy=created&sortOrder=desc&lang=en_US"
/>
<link rel="first"
href="https://w3-connections.ibm.com/dogear/atom?ps=50&sortBy=created&sortOrder=desc&lang=en_US"
type="application/atom+xml" />
<link rel="previous"
href="https://w3-connections.ibm.com/dogear/atom?page=689&ps=50&sortBy=created&sortOrder=desc&lang=en_US"
type="application/atom+xml" />
<link rel="next"
href="https://w3-connections.ibm.com/dogear/atom?page=691&ps=50&sortBy=created&sortOrder=desc&lang=en_US"
type="application/atom+xml" />
<link rel="last"
href="https://w3-connections.ibm.com/dogear/atom?page=22990&ps=50&sortBy=created&sortOrder=desc&lang=en_US"
type="application/atom+xml" />
<link rel="alternate" type="text/html"
href="https://w3-connections.ibm.com/dogear/html?page=690&ps=50&sortBy=created&sortOrder=desc&lang=en_US"
/>
<id>tag:dogear.ibm.com,2005:feed:/?page=690&ps=50&sortBy=created&sortOrder=desc&lang=en_US
</id>
<updated>2012-08-20T00:31:46+00:00</updated>
<entry>
<id>tag:dogear.ibm.com,2005:link:54f5f435-0efb-446f-b0bd-3d81fcf8ee9e</id>
<title>ITS Asset Overview Portal</title>
<category scheme="http://www.ibm.com/xmlns/prod/sn/type"
term="bookmark" />
<link href="http://its_gbsc.cn.ibm.com/" />
<content type="html"></content>
<published>2012-08-19T14:45:40+00:00</published>
<updated>2012-08-19T14:45:40+00:00</updated>
<category term="china" />
<category term="gbsc" />
<author>
<email>[email protected]</email>
<snx:userid>76dbfdc0-8f0a-1028-875c-db07163b51b2</snx:userid>
<snx:userState>active</snx:userState>
<name>SREERAM ANANTHASAYANAM</name>
<uri>https://w3-connections.ibm.com/dogear/html?email=asreeram%40in.ibm.com</uri>
</author>
<snx:clickcount>0</snx:clickcount>
<snx:linkcount>1</snx:linkcount>
<link rel="http://www.ibm.com/xmlns/prod/sn/same"
type="application/atom+xml"
href="https://w3-connections.ibm.com" />
</entry>
</feed>
and received the following exception:
org.apache.abdera.i18n.text.InvalidCharacterException: Invalid Character 0x5f(_)
at
org.apache.abdera.i18n.text.CodepointIterator$RestrictedCodepointIterator.next(CodepointIterator.java:476)
at org.apache.abdera.i18n.text.CharUtils.verifyNot(CharUtils.java:883)
at org.apache.abdera.i18n.iri.IDNA.toASCII(IDNA.java:108)
at org.apache.abdera.i18n.iri.IRI.init(IRI.java:127)
at org.apache.abdera.i18n.iri.IRI.<init>(IRI.java:65)
at
org.apache.abdera.parser.stax.FOMElement._getUriValue(FOMElement.java:293)
at org.apache.abdera.parser.stax.FOMLink.getHref(FOMLink.java:77)
at com.ibm.bluegenome.io.FeedScannerTest.testB(FeedScannerTest.java:176)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:600)
at
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:73)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:46)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:180)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:41)
at org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java:173)
at
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at org.junit.runners.ParentRunner.run(ParentRunner.java:220)
at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
The issue appeared when I called the last line in the following block:
Document<Feed> doc = abderaParser.parse(new FileInputStream(
"input/dogear/atom.xml"));
Feed feed = doc.getRoot();
List<Entry> feedEntries = feed.getEntries();
int feedEntriesSize = feedEntries.size();
for (int i = 0; i < feedEntriesSize; i++) {
Entry srcFeedEntry = feedEntries.get(i);
Link alink = srcFeedEntry.getAlternateLink();
if (alink != null) {
alink.getHref().toASCIIString();
}
}
----
which points to <link href="http://its_gbsc.cn.ibm.com/" />
When modify that URL removing the "_" character, the parsing succeeds.
> Abdera needs to support IPv6
> ----------------------------
>
> Key: ABDERA-258
> URL: https://issues.apache.org/jira/browse/ABDERA-258
> Project: Abdera
> Issue Type: Bug
> Affects Versions: 0.4.0, 1.0
> Reporter: Guo Wei
> Fix For: 1.1.2
>
>
> Abdera v0.4 and v1.0 have issue to support IPv6. According to
> http://www.ietf.org/rfc/rfc2732.txt, '[', ']' and ':' are valid characters in
> IPV6 URL. However, when we use such IPv6 URL
> (http://[2001:1890:110b:661f:65d4:c37c:1d82:f2e6]:8080) with Abdera, it
> throws exception.
> ----------
> Caused by: org.apache.abdera.parser.ParseException:
> org.apache.abdera.i18n.iri.IRISyntaxException:
> org.apache.abdera.i18n.text.InvalidCharacterException: Invalid Character
> 0x5b([)
> at org.apache.abdera.parser.stax.FOMParser.parse(FOMParser.java:210)
> at org.apache.abdera.parser.stax.FOMParser.parse(FOMParser.java:145)
> at
> org.apache.abdera.protocol.client.AbstractClientResponse.getDocument(AbstractClientResponse.java:119)
>
> ... 27 more
> Caused by: org.apache.abdera.i18n.iri.IRISyntaxException:
> org.apache.abdera.i18n.text.InvalidCharacterException: Invalid Character
> 0x5b([)
> at org.apache.abdera.i18n.iri.IRI.parseAuthority(IRI.java:616)
> at org.apache.abdera.i18n.iri.IRI.parse(IRI.java:632)
> at org.apache.abdera.i18n.iri.IRI.<init>(IRI.java:66)
> at org.apache.abdera.parser.stax.FOMParser.parse(FOMParser.java:207)
> ... 29 more
> Caused by: org.apache.abdera.i18n.text.InvalidCharacterException: Invalid
> Character 0x5b([)
> at
> org.apache.abdera.i18n.text.CodepointIterator$RestrictedCodepointIterator.next(CodepointIterator.java:480)
>
> at org.apache.abdera.i18n.text.CharUtils.verify(CharUtils.java:915)
> at org.apache.abdera.i18n.text.CharUtils.verify(CharUtils.java:931)
> at org.apache.abdera.i18n.iri.IRI.parseAuthority(IRI.java:614)
> ... 32 more
> ----------
> Abdera needs to fully support RFC 2732.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira