Quantcast
Channel: KNIME RSS
Viewing all articles
Browse latest Browse all 4157

Error casting DocumentBufferedFileStoreCell

$
0
0

Hi knime team and community.

When I try to read document cells, the getClass() method returns the type DocumentBufferedFileStoreCell. Then I tried the following to get the document to be read:

RowIterator it = inData[0].iterator();
        while (it.hasNext()) {
        	DataRow r = it.next();
        	
        	DataCell c = r.getCell(colIndex);
        	logger.info("Cell class: " + c.getClass());
        	logger.info("Cell type: " + c.getType());
        	logger.info("String da célula: " + c.toString());

        	/* c.getClass() returns DocumentBufferedFileStoreCell */

        	DocumentBufferedFileStoreCell dc = (DocumentBufferedFileStoreCell) c;
        	Document d = dc.getDocument();

 

 

For some reason, when I execute the node, it gives an error saying I can't cast a type to the very same type!

2017-07-01 15:43:38,734 : DEBUG : KNIME-Worker-0 : BrTagger : BrTagger : 0:8 : Execute failed: org.knime.ext.textprocessing.data.filestore.DocumentBufferedFileStoreCell cannot be cast to org.knime.ext.textprocessing.data.filestore.DocumentBufferedFileStoreCell

java.lang.ClassCastException: org.knime.ext.textprocessing.data.filestore.DocumentBufferedFileStoreCell cannot be cast to org.knime.ext.textprocessing.data.filestore.DocumentBufferedFileStoreCell at org.knime.brtagger.BrTaggerNodeModel.execute(BrTaggerNodeModel.java:147)

Line 147 at the error is line 13 at code snippet above.

Can someone tell me what I'm missing? I already tried to cast the DataCell to DocumentBufferedFileStoreCell and to DocumentCell and both causes the cast error.

Thank you a lot!!!


Viewing all articles
Browse latest Browse all 4157

Trending Articles