GridGain Community Edition

Expand all | Collapse all

CLASSPATH is misconfigured for "gridgain/community:8.7.20-21" images

  • 1.  CLASSPATH is misconfigured for "gridgain/community:8.7.20-21" images

    Posted 07-14-2020 03:41 PM

    Hi,


    I'm getting "java.lang.ClassNotFoundException: org.apache.ignite.spi.discovery.tcp.ipfinder.kubernetes.TcpDiscoveryKubernetesIpFinder" on GridGain boot within OpenShift.

    It works fine with 8.7.19.

    I follow https://www.gridgain.com/docs/latest/installation-guide/kubernetes/openshift-deployment

    Here is full stack trace:

    class org.apache.ignite.IgniteException: Failed to instantiate Spring XML application context (make sure all classes used in Spring configuration are present at CLASSPATH) [springUrl=file:/gridgain/config/node-configuration.xml]
    	at org.apache.ignite.internal.util.IgniteUtils.convertException(IgniteUtils.java:1088)
    	at org.apache.ignite.Ignition.start(Ignition.java:347)
    	at org.apache.ignite.startup.cmdline.CommandLineStartup.main(CommandLineStartup.java:299)
    Caused by: class org.apache.ignite.IgniteCheckedException: Failed to instantiate Spring XML application context (make sure all classes used in Spring configuration are present at CLASSPATH) [springUrl=file:/gridgain/config/node-configuration.xml]
    	at org.apache.ignite.internal.util.spring.IgniteSpringHelperImpl.applicationContext(IgniteSpringHelperImpl.java:386)
    	at org.apache.ignite.internal.util.spring.IgniteSpringHelperImpl.loadConfigurations(IgniteSpringHelperImpl.java:103)
    	at org.apache.ignite.internal.util.spring.IgniteSpringHelperImpl.loadConfigurations(IgniteSpringHelperImpl.java:97)
    	at org.apache.ignite.internal.IgnitionEx.loadConfigurations(IgnitionEx.java:750)
    	at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:951)
    	at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:860)
    	at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:730)
    	at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:699)
    	at org.apache.ignite.Ignition.start(Ignition.java:344)
    	... 1 more
    Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.apache.ignite.configuration.IgniteConfiguration#0' defined in URL [file:/gridgain/config/node-configuration.xml]: Cannot create inner bean 'org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi#5f375618' of type [org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi] while setting bean property 'discoverySpi'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi#5f375618' defined in URL [file:/gridgain/config/node-configuration.xml]: Cannot create inner bean 'org.apache.ignite.spi.discovery.tcp.ipfinder.kubernetes.TcpDiscoveryKubernetesIpFinder#50c87b21' of type [org.apache.ignite.spi.discovery.tcp.ipfinder.kubernetes.TcpDiscoveryKubernetesIpFinder] while setting bean property 'ipFinder'; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.apache.ignite.spi.discovery.tcp.ipfinder.kubernetes.TcpDiscoveryKubernetesIpFinder] for bean with name 'org.apache.ignite.spi.discovery.tcp.ipfinder.kubernetes.TcpDiscoveryKubernetesIpFinder#50c87b21' defined in URL [file:/gridgain/config/node-configuration.xml]; nested exception is java.lang.ClassNotFoundException: org.apache.ignite.spi.discovery.tcp.ipfinder.kubernetes.TcpDiscoveryKubernetesIpFinder
    	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:313)
    	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:122)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1533)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1280)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:551)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:481)
    	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:312)
    	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:308)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
    	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:756)
    	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867)
    	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:542)
    	at org.apache.ignite.internal.util.spring.IgniteSpringHelperImpl.applicationContext(IgniteSpringHelperImpl.java:380)
    	... 9 more
    Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi#5f375618' defined in URL [file:/gridgain/config/node-configuration.xml]: Cannot create inner bean 'org.apache.ignite.spi.discovery.tcp.ipfinder.kubernetes.TcpDiscoveryKubernetesIpFinder#50c87b21' of type [org.apache.ignite.spi.discovery.tcp.ipfinder.kubernetes.TcpDiscoveryKubernetesIpFinder] while setting bean property 'ipFinder'; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.apache.ignite.spi.discovery.tcp.ipfinder.kubernetes.TcpDiscoveryKubernetesIpFinder] for bean with name 'org.apache.ignite.spi.discovery.tcp.ipfinder.kubernetes.TcpDiscoveryKubernetesIpFinder#50c87b21' defined in URL [file:/gridgain/config/node-configuration.xml]; nested exception is java.lang.ClassNotFoundException: org.apache.ignite.spi.discovery.tcp.ipfinder.kubernetes.TcpDiscoveryKubernetesIpFinder
    	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:313)
    	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:122)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1533)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1280)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:551)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:481)
    	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:299)
    	... 22 more
    Caused by: org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.apache.ignite.spi.discovery.tcp.ipfinder.kubernetes.TcpDiscoveryKubernetesIpFinder] for bean with name 'org.apache.ignite.spi.discovery.tcp.ipfinder.kubernetes.TcpDiscoveryKubernetesIpFinder#50c87b21' defined in URL [file:/gridgain/config/node-configuration.xml]; nested exception is java.lang.ClassNotFoundException: org.apache.ignite.spi.discovery.tcp.ipfinder.kubernetes.TcpDiscoveryKubernetesIpFinder
    	at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1397)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:454)
    	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:299)
    	... 28 more
    Caused by: java.lang.ClassNotFoundException: org.apache.ignite.spi.discovery.tcp.ipfinder.kubernetes.TcpDiscoveryKubernetesIpFinder
    	at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
    	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
    	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    	at org.springframework.util.ClassUtils.forName(ClassUtils.java:251)
    	at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:408)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.doResolveBeanClass(AbstractBeanFactory.java:1444)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1389)
    	... 30 more
    Failed to start grid: Failed to instantiate Spring XML application context (make sure all classes used in Spring configuration are present at CLASSPATH) [springUrl=file:/gridgain/config/node-configuration.xml]
    Note! You may use 'USER_LIBS' environment variable to specify your classpath.


    Thanks,
    Maksym



    ------------------------------
    Maksym Gryevtsov
    Chief Architect
    Docupace Technologies
    ------------------------------


  • 2.  RE: CLASSPATH is misconfigured for "gridgain/community:8.7.20-21" images

    Posted 07-17-2020 01:56 AM
    Hello!

    I think the image did not change, rather, you have missed out OPTION_LIBS when deploying more recent version to enable kubernetes:

    docker run -e "OPTION_LIBS=ignite-kubernetes" gridgain/community:8.7.21

    Please see the relevant documentation: https://www.gridgain.com/docs/latest/installation-guide/installing-using-docker#enabling-modules

    Regards,


    ------------------------------
    Ilya Kasnacheev
    Community Support Specialist
    GridGain
    ------------------------------



  • 3.  RE: CLASSPATH is misconfigured for "gridgain/community:8.7.20-21" images

    Posted 07-17-2020 07:29 AM

    Ilya,

    Unfortunately that's not the case. I have the same K8S configuration (matches 1-to-1 to your doc) where I simply replace a GridGain image tag. With 8.7.19 it works as expected, but 8.7.20 or 8.7.21 causes the issue above. I run it under OpenShift v3.11. Here is extract from my config

    apiVersion: apps/v1
    kind: StatefulSet
    metadata:
      name: gridgain
    spec:
      template:
        spec:
          containers:
            - env:
                - name: OPTION_LIBS
                  value: 'ignite-kubernetes,ignite-rest-http,control-center-agent'
                - name: CONFIG_URI
                  value: 'file:///gridgain/config/node-configuration.xml'
                - name: JVM_OPTS
                  value: '-Xms1g -Xmx1g'
                - name: JAVA_TOOL_OPTIONS
                  value: >-
                    -DIGNITE_WAL_MMAP=false
                    -DIGNITE_WAIT_FOR_BACKUPS_ON_SHUTDOWN=true -DIGNITE_QUIET=false
                    -XX:+AlwaysPreTouch -XX:+UseG1GC -XX:+ScavengeBeforeFullGC
                    -XX:+DisableExplicitGC -Djava.net.preferIPv4Stack=true
                    -XX:MaxDirectMemorySize=256M
              image: 'gridgain/community:8.7.19'
              imagePullPolicy: IfNotPresent
              name: gridgain-node
              ports:
                - containerPort: 47100
                  protocol: TCP
                - containerPort: 47500
                  protocol: TCP
                - containerPort: 49112
                  protocol: TCP
                - containerPort: 10800
                  protocol: TCP
                - containerPort: 8080
                  protocol: TCP
              terminationMessagePath: /dev/termination-log
              terminationMessagePolicy: File
              volumeMounts:
                - mountPath: /gridgain/config
                  name: config-vol
                - mountPath: /gridgain/work
                  name: work-vol
                - mountPath: /gridgain/wal
                  name: wal-vol
                - mountPath: /gridgain/walarchive
                  name: walarchive-vol
          dnsPolicy: ClusterFirst
          restartPolicy: Always
          volumes:
            - configMap:
                defaultMode: 420
                name: gridgain-config-tcb9995dmc
              name: config-vol
      volumeClaimTemplates:
        - metadata:
            name: work-vol
          spec:
            accessModes:
              - ReadWriteOnce
            resources:
              requests:
                storage: 1Gi
          status:
            phase: Pending
        - metadata:
            name: wal-vol
          spec:
            accessModes:
              - ReadWriteOnce
            resources:
              requests:
                storage: 1Gi
          status:
            phase: Pending
        - metadata:
            name: walarchive-vol
          spec:
            accessModes:
              - ReadWriteOnce
            resources:
              requests:
                storage: 1Gi
          status:
            phase: Pending
    
    


    Thanks 



    ------------------------------
    Maksym Gryevtsov
    Chief Architect
    Docupace Technologies
    ------------------------------