You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by austin solomon <au...@gmail.com> on 2017/07/03 14:55:03 UTC
Class not found exception for ScanQuery
Hi Igniters,
My Ignite version is 2.0.0
I am trying to Query the Ignite cache through Apache Camel-Ignite component
using ScanQuery option inside the OSGI plugin project.
TcpDiscoveryMulticastIpFinder ipFinder = new
TcpDiscoveryMulticastIpFinder();
ipFinder.setAddresses(Collections.singletonList(HOST));
TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
discoSpi.setIpFinder(ipFinder);
IgniteConfiguration cfg1 = new IgniteConfiguration();
cfg1.setDiscoverySpi(discoSpi);
cfg1.setPeerClassLoadingEnabled(true);
cfg1.setClientMode(true);
CacheConfiguration <Integer, TempSensor> cacheCfg = new
CacheConfiguration<>(CACHE_NAME);
cacheCfg.setName("tempSensor");
cacheCfg.setCacheMode(CacheMode.PARTITIONED);
cfg1.setCacheConfiguration(cacheCfg);
ScanQuery<Integer, TempSensor> query = new ScanQuery<>(new
IgniteBiPredicate<Integer, TempSensor>() {
private static final long serialVersionUID = 1L;
@Override
public boolean apply(Integer key, TempSensor tempSensor) {
return tempSensor.getId() < 50;
}
});
SimpleRegistry reg = new SimpleRegistry();
reg.put("query", query);
builder.registryFactory(createOsgiRegistry(ctx, reg));
When I run this code in OSGI container I got Class TempSensor not found
error
09:04:35,542 [Component Resolve Thread (Bundle 12)] INFO
GatewayRouterJava:256 - =====**********route builder********==
09:04:36,161 [Component Resolve Thread (Bundle 12)] INFO
IgniteCacheContinuousQueryConsumer:62 - Started Ignite Cache Continuous
Query consumer for cache tempSensor with query: ScanQuery
[filter=org.eclipse.kura.example.camel.quickstart.GatewayRouterJava$2@891ab61,
part=null].
09:04:36,161 [Component Resolve Thread (Bundle 12)] INFO
IgniteCacheContinuousQueryConsumer:69 - Skipping existing cache results for
cache name = tempSensor.
09:04:36,161 [Component Resolve Thread (Bundle 12)] INFO
OsgiDefaultCamelContext:3570 - Route: route2 started and consuming from:
Endpoint[ignite://cache:tempSensor?query=%23query]
Exception in thread "sys-#37%null%" class
org.apache.ignite.binary.BinaryInvalidTypeException:
org.eclipse.kura.example.camel.quickstart.TempSensor cannot be found by
org.apache.ignite.ignite-core_2.0.0
at
org.apache.ignite.internal.binary.BinaryContext.descriptorForTypeId(BinaryContext.java:701)
at
org.apache.ignite.internal.binary.BinaryReaderExImpl.deserialize0(BinaryReaderExImpl.java:1745)
at
org.apache.ignite.internal.binary.BinaryReaderExImpl.deserialize(BinaryReaderExImpl.java:1704)
at
org.apache.ignite.internal.binary.BinaryObjectImpl.deserializeValue(BinaryObjectImpl.java:794)
at
org.apache.ignite.internal.binary.BinaryObjectImpl.value(BinaryObjectImpl.java:142)
at
org.apache.ignite.internal.processors.cache.CacheObjectContext.unwrapBinary(CacheObjectContext.java:273)
at
org.apache.ignite.internal.processors.cache.CacheObjectContext.unwrapBinaryIfNeeded(CacheObjectContext.java:161)
at
org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryEvent.getValue(CacheContinuousQueryEvent.java:73)
at
org.apache.camel.component.ignite.cache.IgniteCacheContinuousQueryConsumer.fireSingleExchange(IgniteCacheContinuousQueryConsumer.java:133)
at
org.apache.camel.component.ignite.cache.IgniteCacheContinuousQueryConsumer.access$300(IgniteCacheContinuousQueryConsumer.java:40)
at
org.apache.camel.component.ignite.cache.IgniteCacheContinuousQueryConsumer$2.onUpdated(IgniteCacheContinuousQueryConsumer.java:111)
at
org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryHandler.notifyCallback0(CacheContinuousQueryHandler.java:708)
at
org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryHandler.notifyCallback(CacheContinuousQueryHandler.java:653)
at
org.apache.ignite.internal.processors.continuous.GridContinuousProcessor.processNotification(GridContinuousProcessor.java:1140)
at
org.apache.ignite.internal.processors.continuous.GridContinuousProcessor.access$2000(GridContinuousProcessor.java:102)
at
org.apache.ignite.internal.processors.continuous.GridContinuousProcessor$8.onMessage(GridContinuousProcessor.java:792)
at
org.apache.ignite.internal.managers.communication.GridIoManager.invokeListener(GridIoManager.java:1257)
at
org.apache.ignite.internal.managers.communication.GridIoManager.access$2000(GridIoManager.java:114)
at
org.apache.ignite.internal.managers.communication.GridIoManager$GridCommunicationMessageSet.unwind(GridIoManager.java:2461)
at
org.apache.ignite.internal.managers.communication.GridIoManager.unwindMessageSet(GridIoManager.java:1217)
at
org.apache.ignite.internal.managers.communication.GridIoManager.access$2300(GridIoManager.java:114)
at
org.apache.ignite.internal.managers.communication.GridIoManager$8.run(GridIoManager.java:1186)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Can any one point me what is wrong in this?
Best Regards
--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Class-not-found-exception-for-ScanQuery-tp14273.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.
Re: Class not found exception for ScanQuery
Posted by Николай Ижиков <ni...@gmail.com>.
Hello, Austin.
This stack trace looks very similar to bug -
https://issues.apache.org/jira/browse/IGNITE-2190
Please see my comments in Jira ticket.
I currently working on fixing this bug.
2017-07-03 17:55 GMT+03:00 austin solomon <au...@gmail.com>:
> Hi Igniters,
>
> My Ignite version is 2.0.0
>
> I am trying to Query the Ignite cache through Apache Camel-Ignite component
> using ScanQuery option inside the OSGI plugin project.
>
> TcpDiscoveryMulticastIpFinder ipFinder = new
> TcpDiscoveryMulticastIpFinder();
> ipFinder.setAddresses(Collections.singletonList(HOST));
> TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
> discoSpi.setIpFinder(ipFinder);
>
> IgniteConfiguration cfg1 = new IgniteConfiguration();
> cfg1.setDiscoverySpi(discoSpi);
> cfg1.setPeerClassLoadingEnabled(true);
> cfg1.setClientMode(true);
>
> CacheConfiguration <Integer, TempSensor> cacheCfg = new
> CacheConfiguration<>(CACHE_NAME);
> cacheCfg.setName("tempSensor");
> cacheCfg.setCacheMode(CacheMode.PARTITIONED);
> cfg1.setCacheConfiguration(cacheCfg);
>
> ScanQuery<Integer, TempSensor> query = new ScanQuery<>(new
> IgniteBiPredicate<Integer, TempSensor>() {
> private static final long serialVersionUID = 1L;
>
> @Override
> public boolean apply(Integer key, TempSensor tempSensor) {
> return tempSensor.getId() < 50;
> }
> });
> SimpleRegistry reg = new SimpleRegistry();
> reg.put("query", query);
>
> builder.registryFactory(createOsgiRegistry(ctx, reg));
>
> When I run this code in OSGI container I got Class TempSensor not found
> error
>
> 09:04:35,542 [Component Resolve Thread (Bundle 12)] INFO
> GatewayRouterJava:256 - =====**********route builder********==
> 09:04:36,161 [Component Resolve Thread (Bundle 12)] INFO
> IgniteCacheContinuousQueryConsumer:62 - Started Ignite Cache Continuous
> Query consumer for cache tempSensor with query: ScanQuery
> [filter=org.eclipse.kura.example.camel.quickstart.
> GatewayRouterJava$2@891ab61,
> part=null].
> 09:04:36,161 [Component Resolve Thread (Bundle 12)] INFO
> IgniteCacheContinuousQueryConsumer:69 - Skipping existing cache results
> for
> cache name = tempSensor.
> 09:04:36,161 [Component Resolve Thread (Bundle 12)] INFO
> OsgiDefaultCamelContext:3570 - Route: route2 started and consuming from:
> Endpoint[ignite://cache:tempSensor?query=%23query]
> Exception in thread "sys-#37%null%" class
> org.apache.ignite.binary.BinaryInvalidTypeException:
> org.eclipse.kura.example.camel.quickstart.TempSensor cannot be found by
> org.apache.ignite.ignite-core_2.0.0
> at
> org.apache.ignite.internal.binary.BinaryContext.descriptorForTypeId(
> BinaryContext.java:701)
> at
> org.apache.ignite.internal.binary.BinaryReaderExImpl.deserialize0(
> BinaryReaderExImpl.java:1745)
> at
> org.apache.ignite.internal.binary.BinaryReaderExImpl.deserialize(
> BinaryReaderExImpl.java:1704)
> at
> org.apache.ignite.internal.binary.BinaryObjectImpl.deserializeValue(
> BinaryObjectImpl.java:794)
> at
> org.apache.ignite.internal.binary.BinaryObjectImpl.value(
> BinaryObjectImpl.java:142)
> at
> org.apache.ignite.internal.processors.cache.CacheObjectContext.
> unwrapBinary(CacheObjectContext.java:273)
> at
> org.apache.ignite.internal.processors.cache.CacheObjectContext.
> unwrapBinaryIfNeeded(CacheObjectContext.java:161)
> at
> org.apache.ignite.internal.processors.cache.query.continuous.
> CacheContinuousQueryEvent.getValue(CacheContinuousQueryEvent.java:73)
> at
> org.apache.camel.component.ignite.cache.IgniteCacheContinuousQueryCons
> umer.fireSingleExchange(IgniteCacheContinuousQueryConsumer.java:133)
> at
> org.apache.camel.component.ignite.cache.IgniteCacheContinuousQueryCons
> umer.access$300(IgniteCacheContinuousQueryConsumer.java:40)
> at
> org.apache.camel.component.ignite.cache.IgniteCacheContinuousQueryCons
> umer$2.onUpdated(IgniteCacheContinuousQueryConsumer.java:111)
> at
> org.apache.ignite.internal.processors.cache.query.continuous.
> CacheContinuousQueryHandler.notifyCallback0(CacheContinuousQueryHandler.
> java:708)
> at
> org.apache.ignite.internal.processors.cache.query.continuous.
> CacheContinuousQueryHandler.notifyCallback(CacheContinuousQueryHandler.
> java:653)
> at
> org.apache.ignite.internal.processors.continuous.GridContinuousProcessor.
> processNotification(GridContinuousProcessor.java:1140)
> at
> org.apache.ignite.internal.processors.continuous.GridContinuousProcessor.
> access$2000(GridContinuousProcessor.java:102)
> at
> org.apache.ignite.internal.processors.continuous.
> GridContinuousProcessor$8.onMessage(GridContinuousProcessor.java:792)
> at
> org.apache.ignite.internal.managers.communication.
> GridIoManager.invokeListener(GridIoManager.java:1257)
> at
> org.apache.ignite.internal.managers.communication.
> GridIoManager.access$2000(GridIoManager.java:114)
> at
> org.apache.ignite.internal.managers.communication.GridIoManager$
> GridCommunicationMessageSet.unwind(GridIoManager.java:2461)
> at
> org.apache.ignite.internal.managers.communication.GridIoManager.
> unwindMessageSet(GridIoManager.java:1217)
> at
> org.apache.ignite.internal.managers.communication.
> GridIoManager.access$2300(GridIoManager.java:114)
> at
> org.apache.ignite.internal.managers.communication.GridIoManager$8.run(
> GridIoManager.java:1186)
> at
> java.util.concurrent.ThreadPoolExecutor.runWorker(
> ThreadPoolExecutor.java:1142)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(
> ThreadPoolExecutor.java:617)
> at java.lang.Thread.run(Thread.java:745)
>
> Can any one point me what is wrong in this?
>
> Best Regards
>
>
>
> --
> View this message in context: http://apache-ignite-users.
> 70518.x6.nabble.com/Class-not-found-exception-for-ScanQuery-tp14273.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>
--
Nikolay Izhikov
NIzhikov.dev@gmail.com