[ 
https://issues.apache.org/jira/browse/ANY23-248?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14301846#comment-14301846
 ] 

Lewis John McGibbney commented on ANY23-248:
--------------------------------------------

I think that you cannot pass in *null* as a document URI. A value needs to be 
present.
{code}
StringDocumentSource documentSource = new StringDocumentSource(html, some_uri);
{code}
if you look at the code in 
https://github.com/apache/any23/blob/master/core/src/main/java/org/apache/any23/extractor/SingleDocumentExtraction.java#L421
it it is calling
{code}
documentURI.stringValue()).getPath()
{code}
This may be null, additionally
{code}
localDocumentSource.getContentType()
{code}
Also apears to be null based on the above debug output. You need to debug this 
more thoroughly and ensure that no null values exist.

> NTriplesWriter on hadoop : issue with MIME type
> -----------------------------------------------
>
>                 Key: ANY23-248
>                 URL: https://issues.apache.org/jira/browse/ANY23-248
>             Project: Apache Any23
>          Issue Type: Bug
>    Affects Versions: 1.1
>         Environment: hadoop,linux
>            Reporter: Souri
>            Priority: Minor
>             Fix For: 1.2
>
>
> I am trying to create n-triples from an html string. I am using the following 
> code to do it:
> StringDocumentSource documentSource = new StringDocumentSource(html, null);
>             ByteArrayOutputStream out = new ByteArrayOutputStream();
>             final NTriplesWriter tripleHandler = new NTriplesWriter(out);
>             Any23 runner = new Any23();
>            
>             runner.extract(documentSource,tripleHandler);
>             tripleHandler.close();
>             String result = out.toString("us-ascii");
>             return result;
> This is giving me the error :
> java.lang.NullPointerException
>       at 
> org.apache.any23.extractor.SingleDocumentExtraction.filterExtractorsByMIMEType(SingleDocumentExtraction.java:421)
>       at 
> org.apache.any23.extractor.SingleDocumentExtraction.run(SingleDocumentExtraction.java:223)
>       at org.apache.any23.Any23.extract(Any23.java:298)
>       at org.apache.any23.Any23.extract(Any23.java:433)
> I am running this in hadoop. When I run locally with a single file it works, 
> but doesn't work when run on hadoop.
> Can someone please tell me how to go about this issue?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to