ClassCastException using cache and continuous query

classic Classic list List threaded Threaded
2 messages Options
diego.gutierrez diego.gutierrez
Reply | Threaded
Open this post in threaded view
|

ClassCastException using cache and continuous query

Hello,

I'm trying to upgrade Ignite from 1.7.0 to 2.3.0 and I'm getting this
exception:

java.lang.ClassCastException:
com.company.datastore.ignite.model.IgniteFetchItem cannot be cast to
com.company.datastore.ignite.model.IgniteFetchItem.

No other changes were made, just the ignite dependency upgrade.

More context: An ignite cache is used as a work queue, so some items are
added to the cache and some logic should be executed when a new item is
added, for that a local listener is set:

Consumer<Iterable&lt;CacheEntryEvent&lt;? extends String, ? extends
IgniteFetchItem>>> localChangeHandler = (evts) -> {
      for (CacheEntryEvent<? extends String, ? extends IgniteFetchItem> e :
evts) {
             IgniteFetchItem fi = e.getValue();
             ...
      }
this.continousQuery.setLocalListener(new
CacheEntryListener<>(localChangeHandler));


The problem happens in the call to *IgniteFetchItem fi = e.getValue();*

Also, the class *IgniteFetchItem* contains only serializable fields.



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
Alexey Popov Alexey Popov
Reply | Threaded
Open this post in threaded view
|

Re: ClassCastException using cache and continuous query

Hi Diego,

It seems that your error is related to different class Loaders being used.

I don't have an idea why this happens but please try to clean your "work"
directory in Ignite home (IGNITE_HOME) after 1.8 -> 2.3 upgrade or set up a
new IGNITE_HOME.

Please share you node configs and IgniteFetchItem class if you still face
the issue.

Thank you,
Alexey



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/