You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@uima.apache.org by "Greg Holmberg (JIRA)" <ui...@incubator.apache.org> on 2010/03/22 04:54:28 UTC

[jira] Created: (UIMA-1747) TikaAnnotator: null pointer exception in MarkupHandler.populateCAS

TikaAnnotator: null pointer exception in MarkupHandler.populateCAS
------------------------------------------------------------------

                 Key: UIMA-1747
                 URL: https://issues.apache.org/jira/browse/UIMA-1747
             Project: UIMA
          Issue Type: Bug
          Components: Sandbox-TikaAnnotator
    Affects Versions: 2.3
            Reporter: Greg Holmberg
            Priority: Blocker


I get the following NPE.

java.lang.NullPointerException
	at org.apache.uima.cas.impl.CASImpl.createFS(CASImpl.java:474)
	at org.apache.uima.tika.MarkupHandler.populateCAS(MarkupHandler.java:168)
	at org.apache.uima.tika.TIKAWrapper.populateCASfromURL(TIKAWrapper.java:105)
	at org.apache.uima.tika.FileSystemCollectionReader.getNext(FileSystemCollectionReader.java:99)
	at org.apache.uima.collection.impl.cpm.engine.ArtifactProducer.readNext(ArtifactProducer.java:494)
	at org.apache.uima.collection.impl.cpm.engine.ArtifactProducer.run(ArtifactProducer.java:711)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (UIMA-1747) TikaAnnotator: null pointer exception in MarkupHandler.populateCAS

Posted by "Greg Holmberg (JIRA)" <ui...@incubator.apache.org>.
    [ https://issues.apache.org/jira/browse/UIMA-1747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12848027#action_12848027 ] 

Greg Holmberg commented on UIMA-1747:
-------------------------------------

This is due to this line, 147 in MarkupHandler.java, returning null:

    Type attributeType = cas.getTypeSystem().getType("org.apache.uima.AttributeFS");

The problem is that the class name string is incorrect.  It should be "org.apache.tika.uima.AttributeFS".  Same for the line above, but that variable is never used, so it doesn't matter.


> TikaAnnotator: null pointer exception in MarkupHandler.populateCAS
> ------------------------------------------------------------------
>
>                 Key: UIMA-1747
>                 URL: https://issues.apache.org/jira/browse/UIMA-1747
>             Project: UIMA
>          Issue Type: Bug
>          Components: Sandbox-TikaAnnotator
>    Affects Versions: 2.3
>            Reporter: Greg Holmberg
>            Priority: Blocker
>
> I get the following NPE.
> java.lang.NullPointerException
> 	at org.apache.uima.cas.impl.CASImpl.createFS(CASImpl.java:474)
> 	at org.apache.uima.tika.MarkupHandler.populateCAS(MarkupHandler.java:168)
> 	at org.apache.uima.tika.TIKAWrapper.populateCASfromURL(TIKAWrapper.java:105)
> 	at org.apache.uima.tika.FileSystemCollectionReader.getNext(FileSystemCollectionReader.java:99)
> 	at org.apache.uima.collection.impl.cpm.engine.ArtifactProducer.readNext(ArtifactProducer.java:494)
> 	at org.apache.uima.collection.impl.cpm.engine.ArtifactProducer.run(ArtifactProducer.java:711)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (UIMA-1747) TikaAnnotator: null pointer exception in MarkupHandler.populateCAS

Posted by "Greg Holmberg (JIRA)" <ui...@incubator.apache.org>.
    [ https://issues.apache.org/jira/browse/UIMA-1747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12852496#action_12852496 ] 

Greg Holmberg commented on UIMA-1747:
-------------------------------------

Hi Tommaso.  Regarding what is the correct exception to throw, I looked at the callers code (TIKAWrapper.populateCASfromURL), and it throws CASException, so MarkupHandler.populateCAS could throw that also without any changes to MarkupHandler.

I'm not sure what the consequences of changing the signature of this method is.  Is it a real, documented public contract, or is it merely a method marked "public" and the only caller affected would be TIKAWrapper?  If the latter, then I wouldn't worry about keeping a stable signature.

If it would affect many callers other than TIKAWrapper, then throwing RuntimeException or something derived from it makes sense.

> TikaAnnotator: null pointer exception in MarkupHandler.populateCAS
> ------------------------------------------------------------------
>
>                 Key: UIMA-1747
>                 URL: https://issues.apache.org/jira/browse/UIMA-1747
>             Project: UIMA
>          Issue Type: Bug
>          Components: Sandbox-TikaAnnotator
>    Affects Versions: 2.3
>            Reporter: Greg Holmberg
>            Priority: Blocker
>         Attachments: UIMA-1747-patch.txt
>
>
> I get the following NPE.
> java.lang.NullPointerException
> 	at org.apache.uima.cas.impl.CASImpl.createFS(CASImpl.java:474)
> 	at org.apache.uima.tika.MarkupHandler.populateCAS(MarkupHandler.java:168)
> 	at org.apache.uima.tika.TIKAWrapper.populateCASfromURL(TIKAWrapper.java:105)
> 	at org.apache.uima.tika.FileSystemCollectionReader.getNext(FileSystemCollectionReader.java:99)
> 	at org.apache.uima.collection.impl.cpm.engine.ArtifactProducer.readNext(ArtifactProducer.java:494)
> 	at org.apache.uima.collection.impl.cpm.engine.ArtifactProducer.run(ArtifactProducer.java:711)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (UIMA-1747) TikaAnnotator: null pointer exception in MarkupHandler.populateCAS

Posted by "Tommaso Teofili (JIRA)" <ui...@incubator.apache.org>.
    [ https://issues.apache.org/jira/browse/UIMA-1747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12852309#action_12852309 ] 

Tommaso Teofili commented on UIMA-1747:
---------------------------------------

Hi Greg, it seems to me you're right in regards of the Type string so the patch should be fixing the issue.

I am wondering about the need of the line:
Type markupType = cas.getTypeSystem().getType("org.apache.uima.tika.MarkupAnnotation")
since it seems it is never used, so we may choose to remove it.

In regards of Exception now that the package name is fixed, it's something it should happen only when that FS is not defined inside the TypeSystem.
So for example we may choose to create an UnknownTypeException like the one inside the ConceptMapper
https://svn.apache.org/repos/asf/incubator/uima/sandbox/trunk/ConceptMapper/src/main/java/org/apache/uima/conceptMapper/support/tokens/UnknownTypeException.java
but extending RuntimeException so that we should not change method signature to declare throwing exception.
What do you think?

> TikaAnnotator: null pointer exception in MarkupHandler.populateCAS
> ------------------------------------------------------------------
>
>                 Key: UIMA-1747
>                 URL: https://issues.apache.org/jira/browse/UIMA-1747
>             Project: UIMA
>          Issue Type: Bug
>          Components: Sandbox-TikaAnnotator
>    Affects Versions: 2.3
>            Reporter: Greg Holmberg
>            Priority: Blocker
>         Attachments: UIMA-1747-patch.txt
>
>
> I get the following NPE.
> java.lang.NullPointerException
> 	at org.apache.uima.cas.impl.CASImpl.createFS(CASImpl.java:474)
> 	at org.apache.uima.tika.MarkupHandler.populateCAS(MarkupHandler.java:168)
> 	at org.apache.uima.tika.TIKAWrapper.populateCASfromURL(TIKAWrapper.java:105)
> 	at org.apache.uima.tika.FileSystemCollectionReader.getNext(FileSystemCollectionReader.java:99)
> 	at org.apache.uima.collection.impl.cpm.engine.ArtifactProducer.readNext(ArtifactProducer.java:494)
> 	at org.apache.uima.collection.impl.cpm.engine.ArtifactProducer.run(ArtifactProducer.java:711)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (UIMA-1747) TikaAnnotator: null pointer exception in MarkupHandler.populateCAS

Posted by "Greg Holmberg (JIRA)" <ui...@incubator.apache.org>.
     [ https://issues.apache.org/jira/browse/UIMA-1747?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Greg Holmberg updated UIMA-1747:
--------------------------------

    Attachment: UIMA-1747-patch.txt

Suggested fix.  I'm not sure about the type of exception thrown.  The method doesn't declare that it throws any exceptions, so RuntimeException was all I could come up with.

> TikaAnnotator: null pointer exception in MarkupHandler.populateCAS
> ------------------------------------------------------------------
>
>                 Key: UIMA-1747
>                 URL: https://issues.apache.org/jira/browse/UIMA-1747
>             Project: UIMA
>          Issue Type: Bug
>          Components: Sandbox-TikaAnnotator
>    Affects Versions: 2.3
>            Reporter: Greg Holmberg
>            Priority: Blocker
>         Attachments: UIMA-1747-patch.txt
>
>
> I get the following NPE.
> java.lang.NullPointerException
> 	at org.apache.uima.cas.impl.CASImpl.createFS(CASImpl.java:474)
> 	at org.apache.uima.tika.MarkupHandler.populateCAS(MarkupHandler.java:168)
> 	at org.apache.uima.tika.TIKAWrapper.populateCASfromURL(TIKAWrapper.java:105)
> 	at org.apache.uima.tika.FileSystemCollectionReader.getNext(FileSystemCollectionReader.java:99)
> 	at org.apache.uima.collection.impl.cpm.engine.ArtifactProducer.readNext(ArtifactProducer.java:494)
> 	at org.apache.uima.collection.impl.cpm.engine.ArtifactProducer.run(ArtifactProducer.java:711)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (UIMA-1747) TikaAnnotator: null pointer exception in MarkupHandler.populateCAS

Posted by "Greg Holmberg (JIRA)" <ui...@incubator.apache.org>.
    [ https://issues.apache.org/jira/browse/UIMA-1747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12848027#action_12848027 ] 

Greg Holmberg edited comment on UIMA-1747 at 4/1/10 6:21 PM:
-------------------------------------------------------------

This is due to this line, 147 in MarkupHandler.java, returning null:

    Type attributeType = cas.getTypeSystem().getType("org.apache.uima.AttributeFS");

The problem is that the class name string is incorrect.  It should be "org.apache.uima.tika.AttributeFS".  Same for the line above, but that variable is never used, so it doesn't matter.


      was (Author: holmberg):
    This is due to this line, 147 in MarkupHandler.java, returning null:

    Type attributeType = cas.getTypeSystem().getType("org.apache.uima.AttributeFS");

The problem is that the class name string is incorrect.  It should be "org.apache.tika.uima.AttributeFS".  Same for the line above, but that variable is never used, so it doesn't matter.

  
> TikaAnnotator: null pointer exception in MarkupHandler.populateCAS
> ------------------------------------------------------------------
>
>                 Key: UIMA-1747
>                 URL: https://issues.apache.org/jira/browse/UIMA-1747
>             Project: UIMA
>          Issue Type: Bug
>          Components: Sandbox-TikaAnnotator
>    Affects Versions: 2.3
>            Reporter: Greg Holmberg
>            Priority: Blocker
>         Attachments: UIMA-1747-patch.txt
>
>
> I get the following NPE.
> java.lang.NullPointerException
> 	at org.apache.uima.cas.impl.CASImpl.createFS(CASImpl.java:474)
> 	at org.apache.uima.tika.MarkupHandler.populateCAS(MarkupHandler.java:168)
> 	at org.apache.uima.tika.TIKAWrapper.populateCASfromURL(TIKAWrapper.java:105)
> 	at org.apache.uima.tika.FileSystemCollectionReader.getNext(FileSystemCollectionReader.java:99)
> 	at org.apache.uima.collection.impl.cpm.engine.ArtifactProducer.readNext(ArtifactProducer.java:494)
> 	at org.apache.uima.collection.impl.cpm.engine.ArtifactProducer.run(ArtifactProducer.java:711)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (UIMA-1747) TikaAnnotator: null pointer exception in MarkupHandler.populateCAS

Posted by "Greg Holmberg (JIRA)" <ui...@incubator.apache.org>.
    [ https://issues.apache.org/jira/browse/UIMA-1747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12852496#action_12852496 ] 

Greg Holmberg edited comment on UIMA-1747 at 4/1/10 6:35 PM:
-------------------------------------------------------------

Hi Tommaso.  Regarding what is the correct exception to throw, I looked at the callers code (TIKAWrapper.populateCASfromURL), and it throws CASException, so MarkupHandler.populateCAS could throw that also without any changes to MarkupHandler.

I'm not sure what the consequences of changing the signature of this method are.  Is it a real, documented public contract, or is it merely a method marked "public" and the only caller affected would be TIKAWrapper?  If the latter, then I wouldn't worry about keeping a stable signature.

If it would affect many callers other than TIKAWrapper, then throwing RuntimeException or something derived from it makes sense.

      was (Author: holmberg):
    Hi Tommaso.  Regarding what is the correct exception to throw, I looked at the callers code (TIKAWrapper.populateCASfromURL), and it throws CASException, so MarkupHandler.populateCAS could throw that also without any changes to MarkupHandler.

I'm not sure what the consequences of changing the signature of this method is.  Is it a real, documented public contract, or is it merely a method marked "public" and the only caller affected would be TIKAWrapper?  If the latter, then I wouldn't worry about keeping a stable signature.

If it would affect many callers other than TIKAWrapper, then throwing RuntimeException or something derived from it makes sense.
  
> TikaAnnotator: null pointer exception in MarkupHandler.populateCAS
> ------------------------------------------------------------------
>
>                 Key: UIMA-1747
>                 URL: https://issues.apache.org/jira/browse/UIMA-1747
>             Project: UIMA
>          Issue Type: Bug
>          Components: Sandbox-TikaAnnotator
>    Affects Versions: 2.3
>            Reporter: Greg Holmberg
>            Priority: Blocker
>         Attachments: UIMA-1747-patch.txt
>
>
> I get the following NPE.
> java.lang.NullPointerException
> 	at org.apache.uima.cas.impl.CASImpl.createFS(CASImpl.java:474)
> 	at org.apache.uima.tika.MarkupHandler.populateCAS(MarkupHandler.java:168)
> 	at org.apache.uima.tika.TIKAWrapper.populateCASfromURL(TIKAWrapper.java:105)
> 	at org.apache.uima.tika.FileSystemCollectionReader.getNext(FileSystemCollectionReader.java:99)
> 	at org.apache.uima.collection.impl.cpm.engine.ArtifactProducer.readNext(ArtifactProducer.java:494)
> 	at org.apache.uima.collection.impl.cpm.engine.ArtifactProducer.run(ArtifactProducer.java:711)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.