You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by 王 刚 <wa...@live.cn> on 2018/03/17 13:24:59 UTC

答复: Ignite cluster always throw java.lang.NoClassDefFoundError

Hi , ann body know how to fix java.lang.NoClassDefFoundError ?  It happened random in ignite cluster.

I have dependency and config in spring boot application.

@Bean
    public Ignite igniteServerMode() throws IgniteCheckedException {
        // Apache Ignite node configuration.
        IgniteConfiguration igniteConfiguration = new IgniteConfiguration();

        // Ignite persistence configuration.
        DataStorageConfiguration dataStorageConfiguration = new DataStorageConfiguration();

        //set dataStorageConfiguration
        {
            // Enabling the writes throttling.
            dataStorageConfiguration.setWriteThrottlingEnabled(true);

            //prsist data region
            DataRegionConfiguration dataRegionConfiguration = dataStorageConfiguration.getDefaultDataRegionConfiguration();
            // Enabling the persistence.
            dataRegionConfiguration.setPersistenceEnabled(true);
            //set persist region name
            dataRegionConfiguration.setName(igniteProperties.getPersistRegionName());
            // Increasing the buffer size to 1 GB.
            dataRegionConfiguration.setCheckpointPageBufferSize(1024 * 1024 * 1024);

            // Creating a new cache region.
            DataRegionConfiguration cacheRegionConfiguration = new DataRegionConfiguration();
            // Region name.
            cacheRegionConfiguration.setName(igniteProperties.getCacheRegionName());
            // Setting initial RAM size 100M
            cacheRegionConfiguration.setInitialSize(100 * 1024 * 1024);
            // Setting maximum RAM size 1G
            cacheRegionConfiguration.setMaxSize(1024 * 1024 * 1024);
            // Setting the data region configuration.
            dataStorageConfiguration.setDataRegionConfigurations(cacheRegionConfiguration);

            if (!igniteProperties.getDataPath().equalsIgnoreCase("local")) {
                //set work path
                igniteConfiguration.setWorkDirectory(igniteProperties.getDataPath() + workPath);
                //set store path
                dataStorageConfiguration.setStoragePath(igniteProperties.getDataPath() + storePath);
                dataStorageConfiguration.setWalPath(igniteProperties.getDataPath() + walPath);
                dataStorageConfiguration.setWalArchivePath(igniteProperties.getDataPath() + walArchivePath);
            }

            // Applying settings.
            igniteConfiguration.setDataStorageConfiguration(dataStorageConfiguration);
        }

        //set cluster config
        {
            //add cluster config
            TcpDiscoverySpi tcpDiscoverSpi = new TcpDiscoverySpi();
            TcpDiscoveryJdbcIpFinder ipFinder = new TcpDiscoveryJdbcIpFinder();
            // Configure your DataSource.
            ipFinder.setDataSource(igniteSpiDatasource);
            tcpDiscoverSpi.setIpFinder(ipFinder);
            tcpDiscoverSpi.setNetworkTimeout(igniteProperties.getNetworkTimeout());
            igniteConfiguration.setDiscoverySpi(tcpDiscoverSpi);
        }

        //set sql client port
        {
            //add sql connection configuration
            ClientConnectorConfiguration clientConnectorConfiguration = new ClientConnectorConfiguration();
            clientConnectorConfiguration.setPort(igniteProperties.getSqlPort());
            igniteConfiguration.setClientConnectorConfiguration(clientConnectorConfiguration);
        }

        //start ignite
        Ignite ignite = IgniteSpring.start(igniteConfiguration, context);
        ignite.active(true);
        return ignite;
}

  <dependency>
            <groupId>org.apache.ignite</groupId>
            <artifactId>ignite-core</artifactId>
            <version>${ignite.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.ignite</groupId>
            <artifactId>ignite-spring</artifactId>
            <version>${ignite.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.ignite</groupId>
            <artifactId>ignite-indexing</artifactId>
            <version>${ignite.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.ignite</groupId>
            <artifactId>ignite-slf4j</artifactId>
            <version>${ignite.version}</version>
        </dependency>
          <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
        </dependency>

发送自 Windows 10 版邮件<https://go.microsoft.com/fwlink/?LinkId=550986>应用

________________________________
发件人: 王 刚 <wa...@live.cn>
发送时间: Thursday, March 15, 2018 4:29:44 PM
收件人: user@ignite.apache.org
主题: Ignite cluster always throw java.lang.NoClassDefFoundError


Hi, guys. I meat an issue in ignite cluster. I am using ignite in spring-boot 1.5.8 by add ignite-core dependency 2.30. And the cluster use JDBC DiscoverySpi as cluster ipFinder.

If i kill spring-boot-ignite by chance, and try to restart, ignite alaws throws an NoClassDefFoundError: java.lang.NoClassDefFoundError: ch/qos/logback/classic/spi/ThrowableProxy or other class like org/springframework/http/ResponseEntity.  But I’am sure the class is in jar file. And after i remove all the files in /store/node, ignite can successfully start.

These are my pom file, configuration file and log file.




发送自 Windows 10 版邮件<https://go.microsoft.com/fwlink/?LinkId=550986>应用


Re: 答复: Ignite cluster always throw java.lang.NoClassDefFoundError

Posted by "ilya.kasnacheev" <il...@gmail.com>.
Hello!

Here is the error that you are seeing:

ignite 13:25:25.163 [main] WARN 
o.s.b.c.e.AnnotationConfigEmbeddedWebApplicationContext - Exception
encountered during context initialization - cancelling refresh attempt:
org.springframework.beans.factory.UnsatisfiedDependencyException: Error
creating bean with name 'fileController': Unsatisfied dependency expressed
through field 'alarmRecordFileService'; nested exception is
org.springframework.beans.factory.UnsatisfiedDependencyException: Error
creating bean with name 'alarmRecordFileService': Unsatisfied dependency
expressed through field 'alarmService'; nested exception is
org.springframework.beans.factory.UnsatisfiedDependencyException: Error
creating bean with name 'alarmService': Unsatisfied dependency expressed
through field 'template'; nested exception is
org.springframework.beans.factory.UnsatisfiedDependencyException: Error
creating bean with name 'igniteJdbcTemplate': Unsatisfied dependency
expressed through field 'sqlEntityQueue'; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'sqlEntityQueue' defined in URL
[jar:file:/root/ignite/ignite-0.3.0-SNAPSHOT.jar!/BOOT-INF/classes!/com/samples/vehicles/ignite/sql/SqlEntityQueue.class]:
Initialization of bean failed; nested exception is
java.lang.NoClassDefFoundError: org/springframework/scheduling/Trigger

As you can see, it is unrelated to Ignite. Your SqlEntityQueue class could
not be created because it has missing Trigger dependency, which is not on
classpath.

Unfortunately, you did not provide parent POM, so it's hard to say why this
dependency is unsatisfied.
It should be handled with
       <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter</artifactId>
        </dependency>

Regards,



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