You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Jawad Bokhari <ja...@gmail.com> on 2010/04/29 17:26:19 UTC

HTML Text Extraction fails even with Jackrabbit 2.1

Hi All,

Jackrabbit fails to extract text from HTML files. I see HTML as supported
format at http://jackrabbit.apache.org/jackrabbit-text-extractors.html.
But still it's not working. Is there anything I can do to fix this?
Actually I experienced this for any XML documents that I tried to add to
repository.

29.04.2010 20:21:51 *WARN * LazyTextExtractorField: Failed to extract text
from a binary property (LazyTextExtractorField.java, line 180)
org.apache.tika.exception.TikaException: Unexpected RuntimeException from
org.apache.tika.parser.html.HtmlParser@c81672
        at
org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:122)
        at
org.apache.tika.parser.AutoDetectParser.parse(AutoDetectParser.java:101)
        at
org.apache.jackrabbit.core.query.lucene.JackrabbitParser.parse(JackrabbitParser.java:189)
        at
org.apache.jackrabbit.core.query.lucene.LazyTextExtractorField$ParsingTask.run(LazyTextExtractorField.java:174)
        at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
        at
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
        at java.util.concurrent.FutureTask.run(FutureTask.java:138)
        at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98)
        at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:207)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:619)
Caused by: java.nio.charset.IllegalCharsetNameException:
        at java.nio.charset.Charset.checkName(Charset.java:273)
        at java.nio.charset.Charset.lookup2(Charset.java:458)
        at java.nio.charset.Charset.lookup(Charset.java:437)
        at java.nio.charset.Charset.forName(Charset.java:502)
        at
org.apache.tika.parser.txt.CharsetDetector.setCanonicalDeclaredEncoding(CharsetDetector.java:352)
        at
org.apache.tika.parser.txt.CharsetDetector.setDeclaredEncoding(CharsetDetector.java:75)
        at
org.apache.tika.parser.html.HtmlParser.getEncoding(HtmlParser.java:110)
        at org.apache.tika.parser.html.HtmlParser.parse(HtmlParser.java:166)
        at
org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:120)
        ... 11 more


Thanks,
Bokhari

Re: HTML Text Extraction fails even with Jackrabbit 2.1

Posted by Jawad Bokhari <ja...@gmail.com>.
Thanks Jukka,

It seems as if there was something wrong with my code, which I actually
couldn't identify even now.
Anyways, I just loaded Jackrabbit 2.1 jar files and imported the code of
populate.jsp in my own class for importing a file and it worked perfectly.
I tried many different HTML files, and didn't notice any exception and
searching is also working fine.

There must be something wrong with my code. Next time, for any issues, I'll
copy the relevant lines of code also for reference.

Thanks for your help anyway,

Bokhari

On Fri, Apr 30, 2010 at 2:20 PM, Jukka Zitting <ju...@gmail.com>wrote:

> Hi,
>
> On Thu, Apr 29, 2010 at 5:26 PM, Jawad Bokhari <ja...@gmail.com>
> wrote:
> > Caused by: java.nio.charset.IllegalCharsetNameException:
>
> It looks like the HTML documents you have use some character encoding
> that's not supported by the underlying Java platform.
>
> Can you file a bug about this in
> https://issues.apache.org/jira/browse/TIKA for the Tika project that
> Jackrabbit nowadays uses for full text extraction? It would be great
> if you could also attach a troublesome HTML file to the bug report.
>
> BR,
>
> Jukka Zitting
>

Re: HTML Text Extraction fails even with Jackrabbit 2.1

Posted by Jukka Zitting <ju...@gmail.com>.
Hi,

On Thu, Apr 29, 2010 at 5:26 PM, Jawad Bokhari <ja...@gmail.com> wrote:
> Caused by: java.nio.charset.IllegalCharsetNameException:

It looks like the HTML documents you have use some character encoding
that's not supported by the underlying Java platform.

Can you file a bug about this in
https://issues.apache.org/jira/browse/TIKA for the Tika project that
Jackrabbit nowadays uses for full text extraction? It would be great
if you could also attach a troublesome HTML file to the bug report.

BR,

Jukka Zitting