Table Reader: Cannot be cast to class

Hi,

I am facing an error with the table reader that occurred the first time and nothing had changed to the data being processed or the workflow in question.

ERROR Table Reader 3:1126:0:1018:0:1007 Execute failed: class org.knime.core.data.columnar.table.ColumnarContainerTableLoader$SavedColumnarContainerTable cannot be cast to class org.knime.core.data.container.BufferedContainerTable (org.knime.core.data.columnar.table.ColumnarContainerTableLoader$SavedColumnarContainerTable is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @71bebddf; org.knime.core.data.container.BufferedContainerTable is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @3661b732)

I am trying to understand the error to eventually trace back the cause since it seems to be clearly rooted in the data. I am trying to trace it down. If in the meantime anyone got an idea, I’d greatly appreciate your two cents.

Best
Mike

Hi @ArjenEX,

out of curiosity, why was the post, which is a bug, moved to another category?

Best
Mike

Thanks. I gave this some second though and tinkering around a bit I managed to close in on the culprit. I stored collections of the type XML in the table. Converting all to string mitigated the issue.

The data is not confidential as it’s related to the Knime forum but the workflow I’d rather like to keep private for “USP” reasons. It also leverages Selenium nodes extensively so I am not quite certain if you can run it, can’t you?

I agree this seems like a bug. I’ll move the thread back to Feedback & Ideas .

In the meantime, are you able to provide data and/or a workflow? Or is the data confidential?

Thanks Scott. Giving this some second though and tinkering around a bit I managed to close in on the culprit. I stored collections of the type XML in the table. Converting all to string mitigated the issue.

The data is not confidential as it is related to the Knime forum but I’d rather opt to keep the workflow private for “USP” reasons. Though, it uses Selenium nodes for scraping and I am uncertain if you could execute it, can’t you?

Ah, so the issue then is that when you write XML data, it can’t later be read again using the appropriate nodes? Odd. @thor_landstrom can you investigate and see if you can recreate?

What I can do, once the current crawl commenced, is to provide the Knime table before and upon the issue is triggered. That might help you understand the cause.

Hello @mwiegand,

When you are grabbing XML, what nodes are you using to fetch this information? I want to try my best to recreate what you are doing.

My initial proprosal if it looks similar to what you are doing

  1. Grab info using ‘Webpage Retriever’
  2. Write this to a KNIME table (specifically store it as a collection of xml)
  3. Read this in using a Table Reader (and theoretically this should get me to that issue you are encountering)

Correct me if I am along the same process you follow,
TL

1 Like

Here is the data exhibiting the issue. Based on the table file “before issue” you might be able to identify which data is pulled.

80327 data before issue.table.txt (6.0 KB)
80327 data after issue.table.txt (20.5 KB)

PS. If you ask why I am pulling that data:

  1. Out of curiosity
  2. Creating leader boards cleaned from Knime team members
  3. Analyzing feature requests and reported bugs

If you like we can schedule a remote session so you can check the workflow in case you cannot reproduce it due to complexity of the data I scrape.

1 Like

Thanks for the sample data; Are you having a problem with reading that second file you sent me (data after issue.table.txt)? I converted both to a .table and the Table Reader node runs on both of them.

Perhaps the data got corrupted leading to that cast error?

Also, I did make a sample workflow that saved a list of XML and I wrote it to the disk and the Table Reader worked on it fine, so maybe the issues lies somewhere else.

TL

Jepp, reading the second file throws the error. I used a freshly placed table reader to double confirm the issue.

Hey @mwiegand,

So I also tried running it on windows using a VM, and that second file seemed to be read in fine. Does the issue persist even after exiting KAP or restarting?

TL

Yes, it is persistent even after restarting Knime. I also placed a new Table reader outside of any Component to eliminate additional factors.

Update 1
I further closed in on the issue. The column “Posts” (collection of XML) is at fault. It is triggered when scraping this post:

Even attempting an unpivot of this fails:

ERROR Ungroup 3:1126:0:1018:0:1115 Execute failed: class org.knime.core.data.columnar.table.ColumnarContainerTableLoader$SavedColumnarContainerTable cannot be cast to class org.knime.core.data.container.BufferedContainerTable (org.knime.core.data.columnar.table.ColumnarContainerTableLoader$SavedColumnarContainerTable is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @4d001a14; org.knime.core.data.container.BufferedContainerTable is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @4ae5ddc0)

80327 data upon issue only Posts.table.txt (14.6 KB)

Intriguingly, converting the collection to string, then back to XML and into a list does not cause any issue

I am inspecting the data row by now to identify the cause. Something about the data is converted poorly I believe.

Update 2
I narrowed it down to html attributes. Though there is nothing odd at first glance in the html code. It is reproducible when converting to string and back to XML. Using the String Cleaner did not resolve it.

While removing each html attribute to sort good from bad I also faced another but similar error:

ERROR InplaceSaveRunnable             Could not save workflow - this exception will be re-thrown as an InterruptedException.
ERROR WorkflowEditor                  Could not save workflow: Could not save workflow: Error while writing to buffer: class org.knime.core.data.columnar.table.ColumnarContainerTableLoader$SavedColumnarContainerTable cannot be cast to class org.knime.core.data.container.BufferedContainerTable (org.knime.core.data.columnar.table.ColumnarContainerTableLoader$SavedColumnarContainerTable is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @4d001a14; org.knime.core.data.container.BufferedContainerTable is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @4ae5ddc0)

@thor_landstrom in order to pin down the cause I:

  1. Replaced all html attributes proving it originates from them
  2. Replaced attribute names i.e. by aaa, bbb, ccc etc. which didn’t resolve it
  3. Replaced attribute values i.e. by aaa, bbb, ccc etc. which resolved it
  4. Selectively removed attributes one by one, creating a bucket of attributes when removed, resolving the issue

Though, I feel the issue is rooted in the Table Reader node as it fails when reading XML too. Reading as String works just fine.


The XML seems valid (double confirmed using a 3rd party validator)

One thing which caught my eyes. The error reads org.knime.core.data.columnar.table but the workflow backend type is row based. Is by any chance this the cause?

1 Like

It could be the issue, though in the last image you sent with the error log, it looks like it is complaining about the schema.

Does that bottom error still come up after changing to 'Use new schema" in the Table Reader?

I would try to address the top most error first as it can cause a cascading effect of errors.

TL

Changing to columnar backend resolved the issue. After switching back to row based it was not reproducible any longer.

Edit: Upon re-execution the table Reader Node now pukes with the collection types again, not recognizing them et all. In the first iteration all is fine, though:

1st Iteration

2nd Iteration

@thor_landstrom just FYI , the issue persists on 5.3 too. The collection of the type string is not recognized. Trying to reset the any transformation, where none was made in the first place, did not resolve it.