You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by Martin <gh...@126.com> on 2017/07/22 04:55:16 UTC

About the xml configuration

Hi guys,


  I am a bit confuse on xml configuration. if i start a server node by using xml cache configuration( which set the cache name, queryEntities, indexedType, and cachestore related setting).
so my question are :
1, when i start a client node which is embed into my system, Do i need to set the same xml configuration with the server node? I test this without the same xml configuration (just using the default xml configuration), the client node can start normally, but show me some errors:
     1.1 Failed to find class with given class loader for unmarshalling (make sure same versions of all classes are available on all nodes or enable peer-class-loading)  , even if peerClassLoading is set as true
     1.2 and my system can not excute any sql, it shows  javax.cache.CacheException: Indexing is disabled for cache: Simpools. Use setIndexedTypes or setTypeMetadata methods on CacheConfiguration to enable. Actually, indexedTypes is set in server node xml configuration.
2, I see a suggestion that suggest me disable peer-class-loading on production. if do this, does this mean i need to deploy all dependent jar (especially cacheStore related Jar ) to all server nodes and client nodes ?
    you know client nodes won't store cache data  and i think it won't call the method  in cacheStore related Jar to synchronous data to database or something other. so do i really need to deploy these dependent jar to client node?


Thanks for your help


Attache the error details for your reference:
   1.1 org.apache.ignite.IgniteCheckedException: Failed to find class with given class loader for unmarshalling (make sure same versions of all classes are available on all nodes or enable peer-class-loading) [clsLdr=sun.misc.Launcher$AppClassLoader@18b4aac2, cls=com.cootf.cloudsim.cache.ignite.store.CacheStoreFactory]
at org.apache.ignite.marshaller.jdk.JdkMarshaller.unmarshal0(JdkMarshaller.java:123) ~[ignite-core-2.0.0.jar:2.0.0]
at org.apache.ignite.marshaller.AbstractNodeNameAwareMarshaller.unmarshal(AbstractNodeNameAwareMarshaller.java:94) ~[ignite-core-2.0.0.jar:2.0.0]
at org.apache.ignite.marshaller.jdk.JdkMarshaller.unmarshal0(JdkMarshaller.java:142) ~[ignite-core-2.0.0.jar:2.0.0]
at org.apache.ignite.marshaller.AbstractNodeNameAwareMarshaller.unmarshal(AbstractNodeNameAwareMarshaller.java:82) ~[ignite-core-2.0.0.jar:2.0.0]
at org.apache.ignite.spi.discovery.tcp.internal.DiscoveryDataPacket.unmarshalData(DiscoveryDataPacket.java:274) [ignite-core-2.0.0.jar:2.0.0]
at org.apache.ignite.spi.discovery.tcp.internal.DiscoveryDataPacket.unmarshalGridData(DiscoveryDataPacket.java:131) [ignite-core-2.0.0.jar:2.0.0]
at org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi.onExchange(TcpDiscoverySpi.java:1817) [ignite-core-2.0.0.jar:2.0.0]
at org.apache.ignite.spi.discovery.tcp.ClientImpl$MessageWorker.processNodeAddFinishedMessage(ClientImpl.java:1945) [ignite-core-2.0.0.jar:2.0.0]
at org.apache.ignite.spi.discovery.tcp.ClientImpl$MessageWorker.processDiscoveryMessage(ClientImpl.java:1828) [ignite-core-2.0.0.jar:2.0.0]
at org.apache.ignite.spi.discovery.tcp.ClientImpl$MessageWorker.body(ClientImpl.java:1725) [ignite-core-2.0.0.jar:2.0.0]
at org.apache.ignite.spi.IgniteSpiThread.run(IgniteSpiThread.java:62) [ignite-core-2.0.0.jar:2.0.0]
Caused by: java.lang.ClassNotFoundException: com.cootf.cloudsim.cache.ignite.store.CacheStoreFactory
at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[na:1.8.0_112]
at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_112]
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) ~[na:1.8.0_112]
at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_112]
at java.lang.Class.forName0(Native Method) ~[na:1.8.0_112]
at java.lang.Class.forName(Class.java:348) ~[na:1.8.0_112]
at org.apache.ignite.internal.util.IgniteUtils.forName(IgniteUtils.java:8478) ~[ignite-core-2.0.0.jar:2.0.0]
at org.apache.ignite.marshaller.jdk.JdkMarshallerObjectInputStream.resolveClass(JdkMarshallerObjectInputStream.java:54) ~[ignite-core-2.0.0.jar:2.0.0]
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1620) ~[na:1.8.0_112]
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1521) ~[na:1.8.0_112]
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1781) ~[na:1.8.0_112]
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1353) ~[na:1.8.0_112]
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2018) ~[na:1.8.0_112]
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1942) ~[na:1.8.0_112]
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1808) ~[na:1.8.0_112]
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1353) ~[na:1.8.0_112]
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2018) ~[na:1.8.0_112]
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1942) ~[na:1.8.0_112]
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1808) ~[na:1.8.0_112]
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1353) ~[na:1.8.0_112]
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:373) ~[na:1.8.0_112]
at java.util.ArrayList.readObject(ArrayList.java:791) ~[na:1.8.0_112]
at sun.reflect.GeneratedMethodAccessor17.invoke(Unknown Source) ~[na:na]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_112]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_112]
at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1058) ~[na:1.8.0_112]
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1909) ~[na:1.8.0_112]
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1808) ~[na:1.8.0_112]
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1353) ~[na:1.8.0_112]
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2018) ~[na:1.8.0_112]
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1942) ~[na:1.8.0_112]
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1808) ~[na:1.8.0_112]
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1353) ~[na:1.8.0_112]
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:373) ~[na:1.8.0_112]
at org.apache.ignite.marshaller.jdk.JdkMarshaller.unmarshal0(JdkMarshaller.java:120) ~[ignite-core-2.0.0.jar:2.0.0]
... 10 common frames omitted


1.2 javax.cache.CacheException: Indexing is disabled for cache: Simpools. Use setIndexedTypes or setTypeMetadata methods on CacheConfiguration to enable.
at org.apache.ignite.internal.processors.cache.IgniteCacheProxy.validate(IgniteCacheProxy.java:909)
at org.apache.ignite.internal.processors.cache.IgniteCacheProxy.query(IgniteCacheProxy.java:766)
at com.cootf.cloudsim.oms.ignite.api.cache.impl.IgniteCacheImpl.executeDMLSql(IgniteCacheImpl.java:104)
at com.cootf.cloudsim.oms.ignite.api.cache.impl.SimPoolIgniteImpl.updateSimpoolIsEnabledField(SimPoolIgniteImpl.java:114)
at com.cootf.cloudsim.oms.ignite.api.cache.impl.SimPoolIgniteImpl.enableSimpool(SimPoolIgniteImpl.java:78)
at com.cootf.cloudsim.oms.ignite.api.impl.SimPoolServiceImpl.enabledTheSimpool(SimPoolServiceImpl.java:124)
at com.cootf.cloudsim.oms.ignite.api.impl.SimPoolServiceImpl$$FastClassBySpringCGLIB$$bdbdbb17.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:738)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:85)
at com.cootf.cloudsim.oms.ignite.api.impl.ServiceExceptionHandlerAspect.aroundMethod(ServiceExceptionHandlerAspect.java:38)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:629)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:618)
at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:62)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:85)
at com.cootf.cloudsim.oms.ignite.api.impl.ServiceExceptionHandlerAspect.aroundMethod(ServiceExceptionHandlerAspect.java:38)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:629)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:618)
at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:62)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:673)
at com.cootf.cloudsim.oms.ignite.api.impl.SimPoolServiceImpl$$EnhancerBySpringCGLIB$$8481f95f.enabledTheSimpool(<generated>)
at com.cootf.cloudsim.oms.ignite.test.SimPoolApiTest.enableOrDisableSimPool(SimPoolApiTest.java:175)
at com.cootf.cloudsim.oms.ignite.test.SimPoolApiTest.Should_Be_Able_To_Enable_The_Simpool(SimPoolApiTest.java:145)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:75)
at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:86)
at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:84)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:252)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:94)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:191)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)


Thanks,
Martin

Re:Re: About the xml configuration

Posted by Martin <gh...@126.com>.
Thanks for your support, thanks very much




At 2017-07-25 07:32:10, "vkulichenko" <va...@gmail.com> wrote:
>Hi Martin,
>
>1. Generally yes, I would recommend to use the same configuration. Even if
>you do otherwise, you need to make sure that discovery configuration is
>correct everywhere.
>1.1. Classes that are part of configuration like cache store implementation,
>must be explicitly deployed on all nodes including clients. Peer class
>loading works only with Compute Grid to deploy closures and remote jobs.
>1.2. This is probably caused by misconfiguration. Make the configuration
>consistent on all nodes first, and the check if issue persists or not.
>2. See 1.1. Cache store can be invoked on client for transactional caches.
>For atomic caches this is not the case, but validity checks are the same, so
>you still have to deploy classes.
>
>-Val
>
>
>
>--
>View this message in context: http://apache-ignite-users.70518.x6.nabble.com/About-the-xml-configuration-tp15269p15524.html
>Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: About the xml configuration

Posted by vkulichenko <va...@gmail.com>.
Hi Martin,

1. Generally yes, I would recommend to use the same configuration. Even if
you do otherwise, you need to make sure that discovery configuration is
correct everywhere.
1.1. Classes that are part of configuration like cache store implementation,
must be explicitly deployed on all nodes including clients. Peer class
loading works only with Compute Grid to deploy closures and remote jobs.
1.2. This is probably caused by misconfiguration. Make the configuration
consistent on all nodes first, and the check if issue persists or not.
2. See 1.1. Cache store can be invoked on client for transactional caches.
For atomic caches this is not the case, but validity checks are the same, so
you still have to deploy classes.

-Val



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/About-the-xml-configuration-tp15269p15524.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.