You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by Ankit Singhai <an...@gmail.com> on 2017/11/09 11:46:08 UTC

Cache Mode = LOCAL throwing exception while initialisation

Hi,
I am trying to create an Ignite cache with cacheMode="LOCAL" and on
initialisation it is throwing NPE.

localCache XML
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="
        http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans.xsd">


    <bean name="sampleCacheLocalIgnite"
class="org.apache.ignite.configuration.CacheConfiguration"
          scope="singleton">
        <property name="name" value="sampleCacheLocalIgnite" />

        
        <property name="cacheMode" value="LOCAL" />

        
        <property name="statisticsEnabled" value="true" />

        <property name="expiryPolicyFactory"
ref="sampleLocalExpiryPolicyFactory" />

    </bean>

    <bean id="sampleLocalExpiryPolicyFactory"
class="javax.cache.configuration.FactoryBuilder"
          factory-method="factoryOf">
        <constructor-arg ref="sampleLocalAccessedExpiryPolicy" />
    </bean>

    <bean id="sampleLocalAccessedExpiryPolicy"
class="javax.cache.expiry.CreatedExpiryPolicy">
        <constructor-arg ref="sampleLocalDuration" />
    </bean>

    <bean id="sampleLocalDuration" class="javax.cache.expiry.Duration">
        <constructor-arg type="java.util.concurrent.TimeUnit"
                         value="MINUTES" />
        <constructor-arg type="long" value="10" />
    </bean>
</beans>

Ignite Config XML

<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="
        http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans.xsd">

    <import resource="localCache.xml"/>

    <bean id="ignite.cfg"
class="org.apache.ignite.configuration.IgniteConfiguration">
        <property name="clientMode" value="true"/>
        <property name="igniteInstanceName" value="SampleServices"/>
        <property name="peerClassLoadingEnabled" value="false"/>
        <property name="metricsUpdateFrequency" value="2000" />

        
        

        
        

        <property name="discoverySpi">
            <bean
class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
                <property name="ipFinder">
                    
                    <bean
class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">
                        <property name="addresses">
                            <list>                                
                                <value>127.0.0.1:47500..47509</value>
                            </list>
                        </property>
                    </bean>
                </property>

                
                <property name="reconnectCount" value="100"/>

                
                <property name="networkTimeout" value="10000"/>

                
                <property name="socketTimeout" value="10000"/>

                
                <property name="ackTimeout" value="10000"/>

                
                <property name="statisticsPrintFrequency" value="60000"/>
            </bean>
        </property>

        <property name="communicationSpi">
            <bean
class="org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi">

                <property name="slowClientQueueLimit" value="1800"/>

                <property name="messageQueueLimit" value="2000"/>

                
                <property name="localPort" value="7070"/>

                
                <property name="connectTimeout" value="5000"/>

                
                <property name="idleConnectionTimeout" value="75000"/>

                
                <property name="sharedMemoryPort" value="-1"/>
            </bean>
        </property>
        
    </bean>
</beans>


For server instance memory configuration is un-commented & for client it is
commented.

Failed to process custom exchange task:
ClientCacheChangeDummyDiscoveryMessage
[reqId=d470058b-dd64-4f27-b0c8-bade7fdec9be, cachesToClose=null,
startCaches=[sampleCacheLocalIgnite]]
java.lang.NullPointerException
	at
org.apache.ignite.internal.processors.cache.CacheGroupContext.<init>(CacheGroupContext.java:190)
	at
org.apache.ignite.internal.processors.cache.GridCacheProcessor.startCacheGroup(GridCacheProcessor.java:1918)
	at
org.apache.ignite.internal.processors.cache.GridCacheProcessor.prepareCacheStart(GridCacheProcessor.java:1860)
	at
org.apache.ignite.internal.processors.cache.CacheAffinitySharedManager.processClientCacheStartRequests(CacheAffinitySharedManager.java:431)
	at
org.apache.ignite.internal.processors.cache.CacheAffinitySharedManager.processClientCachesChanges(CacheAffinitySharedManager.java:603)
	at
org.apache.ignite.internal.processors.cache.GridCacheProcessor.processCustomExchangeTask(GridCacheProcessor.java:410)
	at
org.apache.ignite.internal.processors.cache.GridCachePartitionExchangeManager$ExchangeWorker.processCustomTask(GridCachePartitionExchangeManager.java:1789)
	at
org.apache.ignite.internal.processors.cache.GridCachePartitionExchangeManager$ExchangeWorker.body(GridCachePartitionExchangeManager.java:1878)
	at
org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:110)
	at java.lang.Thread.run(Thread.java:745)

Any I/Ps what I am missing here?

Regards,
Ankit Singhai




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

Re: Cache Mode = LOCAL throwing exception while initialisation

Posted by Andrey Mashenkov <an...@gmail.com>.
Hi Ankit,

It is a known bug. Here is a ticket for it IGNITE-6794 [1].
A s a workaround you can set empty MemoryConfiguration on client.

[1] https://issues.apache.org/jira/browse/IGNITE-6794

On Thu, Nov 9, 2017 at 2:46 PM, Ankit Singhai <an...@gmail.com> wrote:

> Hi,
> I am trying to create an Ignite cache with cacheMode="LOCAL" and on
> initialisation it is throwing NPE.
>
> localCache XML
> <beans xmlns="http://www.springframework.org/schema/beans"
>        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>        xsi:schemaLocation="
>         http://www.springframework.org/schema/beans
>         http://www.springframework.org/schema/beans/spring-beans.xsd">
>
>
>     <bean name="sampleCacheLocalIgnite"
> class="org.apache.ignite.configuration.CacheConfiguration"
>           scope="singleton">
>         <property name="name" value="sampleCacheLocalIgnite" />
>
>
>         <property name="cacheMode" value="LOCAL" />
>
>
>         <property name="statisticsEnabled" value="true" />
>
>         <property name="expiryPolicyFactory"
> ref="sampleLocalExpiryPolicyFactory" />
>
>     </bean>
>
>     <bean id="sampleLocalExpiryPolicyFactory"
> class="javax.cache.configuration.FactoryBuilder"
>           factory-method="factoryOf">
>         <constructor-arg ref="sampleLocalAccessedExpiryPolicy" />
>     </bean>
>
>     <bean id="sampleLocalAccessedExpiryPolicy"
> class="javax.cache.expiry.CreatedExpiryPolicy">
>         <constructor-arg ref="sampleLocalDuration" />
>     </bean>
>
>     <bean id="sampleLocalDuration" class="javax.cache.expiry.Duration">
>         <constructor-arg type="java.util.concurrent.TimeUnit"
>                          value="MINUTES" />
>         <constructor-arg type="long" value="10" />
>     </bean>
> </beans>
>
> Ignite Config XML
>
> <beans xmlns="http://www.springframework.org/schema/beans"
>        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>        xsi:schemaLocation="
>         http://www.springframework.org/schema/beans
>         http://www.springframework.org/schema/beans/spring-beans.xsd">
>
>     <import resource="localCache.xml"/>
>
>     <bean id="ignite.cfg"
> class="org.apache.ignite.configuration.IgniteConfiguration">
>         <property name="clientMode" value="true"/>
>         <property name="igniteInstanceName" value="SampleServices"/>
>         <property name="peerClassLoadingEnabled" value="false"/>
>         <property name="metricsUpdateFrequency" value="2000" />
>
>
>
>
>
>
>
>         <property name="discoverySpi">
>             <bean
> class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
>                 <property name="ipFinder">
>
>                     <bean
> class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.
> TcpDiscoveryVmIpFinder">
>                         <property name="addresses">
>                             <list>
>                                 <value>127.0.0.1:47500..47509</value>
>                             </list>
>                         </property>
>                     </bean>
>                 </property>
>
>
>                 <property name="reconnectCount" value="100"/>
>
>
>                 <property name="networkTimeout" value="10000"/>
>
>
>                 <property name="socketTimeout" value="10000"/>
>
>
>                 <property name="ackTimeout" value="10000"/>
>
>
>                 <property name="statisticsPrintFrequency" value="60000"/>
>             </bean>
>         </property>
>
>         <property name="communicationSpi">
>             <bean
> class="org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi">
>
>                 <property name="slowClientQueueLimit" value="1800"/>
>
>                 <property name="messageQueueLimit" value="2000"/>
>
>
>                 <property name="localPort" value="7070"/>
>
>
>                 <property name="connectTimeout" value="5000"/>
>
>
>                 <property name="idleConnectionTimeout" value="75000"/>
>
>
>                 <property name="sharedMemoryPort" value="-1"/>
>             </bean>
>         </property>
>
>     </bean>
> </beans>
>
>
> For server instance memory configuration is un-commented & for client it is
> commented.
>
> Failed to process custom exchange task:
> ClientCacheChangeDummyDiscoveryMessage
> [reqId=d470058b-dd64-4f27-b0c8-bade7fdec9be, cachesToClose=null,
> startCaches=[sampleCacheLocalIgnite]]
> java.lang.NullPointerException
>         at
> org.apache.ignite.internal.processors.cache.CacheGroupContext.<init>(
> CacheGroupContext.java:190)
>         at
> org.apache.ignite.internal.processors.cache.GridCacheProcessor.
> startCacheGroup(GridCacheProcessor.java:1918)
>         at
> org.apache.ignite.internal.processors.cache.GridCacheProcessor.
> prepareCacheStart(GridCacheProcessor.java:1860)
>         at
> org.apache.ignite.internal.processors.cache.CacheAffinitySharedManager.
> processClientCacheStartRequests(CacheAffinitySharedManager.java:431)
>         at
> org.apache.ignite.internal.processors.cache.CacheAffinitySharedManager.
> processClientCachesChanges(CacheAffinitySharedManager.java:603)
>         at
> org.apache.ignite.internal.processors.cache.GridCacheProcessor.
> processCustomExchangeTask(GridCacheProcessor.java:410)
>         at
> org.apache.ignite.internal.processors.cache.GridCachePartitionExchangeMana
> ger$ExchangeWorker.processCustomTask(GridCachePartitionExchangeMana
> ger.java:1789)
>         at
> org.apache.ignite.internal.processors.cache.GridCachePartitionExchangeMana
> ger$ExchangeWorker.body(GridCachePartitionExchangeManager.java:1878)
>         at
> org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:110)
>         at java.lang.Thread.run(Thread.java:745)
>
> Any I/Ps what I am missing here?
>
> Regards,
> Ankit Singhai
>
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>



-- 
Best regards,
Andrey V. Mashenkov