iswarezwp commented on issue #11392:
URL: https://github.com/apache/ignite/issues/11392#issuecomment-2167944164
@ptupitsyn Thank you very much, I modify the `DeviceStreamReceiver`:
```java
public static class DeviceStreamReceiver implements StreamReceiver<String,
MyDouble> {
private IgniteCache<String, Instrument> instCache;
public DeviceStreamReceiver(IgniteCache<String, Instrument> cache) {
instCache = cache;
}
@Override
public void receive(IgniteCache<String, MyDouble> cache,
Collection<Map.Entry<String, MyDouble>> entries) {
//CommunicationTrackKafkaProducer producer =
CommunicationTrackKafkaProducer.getInstance();
for (Map.Entry<String, MyDouble> entry : entries) {
String symbol = entry.getKey();
MyDouble tick = getValue(entry);
Instrument inst = instCache.get(symbol);
if (inst == null)
inst = new Instrument(symbol);
// Don't populate market cache, as we don't use it for
querying.
// Update cached instrument based on the latest market tick.
inst.update(tick.getValue());
instCache.put(symbol, inst);
}
}
private static MyDouble getValue(Map.Entry<String, MyDouble> entry) {
return (MyDouble)entry.getValue();
}
}
```
and, still got the same error:
```
Caused by: class org.apache.ignite.binary.BinaryInvalidTypeException:
com.nimblex.StreamVisitorExample$MyDouble
at
org.apache.ignite.internal.binary.BinaryContext.descriptorForTypeId(BinaryContext.java:741)
at
org.apache.ignite.internal.binary.BinaryReaderExImpl.deserialize0(BinaryReaderExImpl.java:1772)
at
org.apache.ignite.internal.binary.BinaryReaderExImpl.deserialize(BinaryReaderExImpl.java:1731)
at
org.apache.ignite.internal.binary.BinaryObjectImpl.deserializeValue(BinaryObjectImpl.java:866)
at
org.apache.ignite.internal.binary.BinaryObjectImpl.value(BinaryObjectImpl.java:198)
at
org.apache.ignite.internal.processors.cache.CacheObjectUtils.unwrapBinary(CacheObjectUtils.java:199)
at
org.apache.ignite.internal.processors.cache.CacheObjectUtils.unwrapBinaryIfNeeded(CacheObjectUtils.java:78)
at
org.apache.ignite.internal.processors.cache.CacheObjectContext.unwrapBinaryIfNeeded(CacheObjectContext.java:138)
at
org.apache.ignite.internal.processors.datastreamer.DataStreamerEntry$1.getValue(DataStreamerEntry.java:96)
at
com.nimblex.StreamVisitorExample$DeviceStreamReceiver.getValue(StreamVisitorExample.java:159)
at
com.nimblex.StreamVisitorExample$DeviceStreamReceiver.receive(StreamVisitorExample.java:143)
at
org.apache.ignite.internal.processors.datastreamer.DataStreamerUpdateJob.call(DataStreamerUpdateJob.java:141)
at
org.apache.ignite.internal.processors.datastreamer.DataStreamProcessor.localUpdate(DataStreamProcessor.java:394)
at
org.apache.ignite.internal.processors.datastreamer.DataStreamProcessor.processRequest(DataStreamProcessor.java:299)
at
org.apache.ignite.internal.processors.datastreamer.DataStreamProcessor.access$000(DataStreamProcessor.java:60)
at
org.apache.ignite.internal.processors.datastreamer.DataStreamProcessor$1.onMessage(DataStreamProcessor.java:90)
... 8 more
Caused by: java.lang.ClassNotFoundException:
com.nimblex.StreamVisitorExample$MyDouble
at java.net.URLClassLoader.findClass(URLClassLoader.java:407)
at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at
org.apache.ignite.internal.util.IgniteUtils.forName(IgniteUtils.java:9373)
at
org.apache.ignite.internal.util.IgniteUtils.forName(IgniteUtils.java:9311)
at
org.apache.ignite.internal.MarshallerContextImpl.getClass(MarshallerContextImpl.java:384)
at
org.apache.ignite.internal.binary.BinaryContext.descriptorForTypeId(BinaryContext.java:717)
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]