Welcome to the new Gigaspaces XAP forum. To recover your account, please follow these instructions.

Ask Your Question
0

Exception after "space" bean initialization

I'm trying to store data to Posgresql with XAP. Application was implemented using SpringBoot 1.2.5 and the last XAP. I have tried to init GigaSpace using a bean in xml file, in a java code and with a simple class:

/***********************************/

in xml (see jpg):

C:\fakepath\xml_conf.jpg

/*******************************************/

in Java:

@Bean
public EmbeddedSpaceFactoryBean createSpaceFactory() throws Exception {

    EmbeddedSpaceFactoryBean sf = new EmbeddedSpaceFactoryBean();
    sf.setSpaceName("spaceTest");
    sf.setSchema("persistent");
    // sf.setSpaceDataSource(hibernateSpaceDataSource.getObject());
    // sf.setSpaceSynchronizationEndpoint(hibernateSpaceSynchronizationEndpoint.getObject());
    Properties properties = new Properties();
    properties.setProperty("cluster-config.cache-loader.external-data-source", "true");
    properties.setProperty("cluster-config.cache-loader.central-data-source", "true");
    sf.setProperties(properties);
    return sf;
}

/******************************************/

as a simple class:

SpaceFactoryBean.java

public class SpaceFactoryBean extends EmbeddedSpaceFactoryBean {

@Override
public IJSpace doCreateSpace() throws DataAccessException {
    return super.doCreateSpace();
}

}

InteractionServiceGSImpl.java

public GigaSpace createGigaSpace() throws Exception {
    SpaceFactoryBean sf = new SpaceFactoryBean();
    sf.setSpaceName("spaceTest");
    sf.setSchema("persistent");
    sf.setSpaceDataSource(hibernateSpaceDataSource.getObject());
    sf.setSpaceSynchronizationEndpoint(hibernateSpaceSynchronizationEndpoint.getObject());
    Properties properties = new Properties();
    properties.setProperty("cluster-config.cache-loader.external-data-source", "true");
    properties.setProperty("cluster-config.cache-loader.central-data-source", "true");
    sf.setProperties(properties);
    GigaSpace gigaSpace = new GigaSpaceConfigurer(sf.doCreateSpace()).create();
    return gigaSpace;

/*************************************/

The result in all cases the same:

[WARN] org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext - Exception encountered during context initialization - cancelling refresh attempt org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'space': Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: com/gigaspaces/internal/gnu/trove/TObjectIntHashMap at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE] at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:736) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE] at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757) ~[spring-context-4.1.7.RELEASE.jar:4.1.7.RELEASE] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480) ~[spring-context-4.1.7.RELEASE.jar:4.1.7.RELEASE] at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118) [spring-boot-1.2.5.RELEASE.jar:1.2.5.RELEASE] at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:686) [spring-boot-1.2.5.RELEASE.jar:1.2.5.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:320) [spring-boot-1.2.5.RELEASE.jar:1.2.5.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:957) [spring-boot-1.2.5.RELEASE.jar:1.2.5.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:946) [spring-boot-1.2.5.RELEASE.jar:1.2.5.RELEASE] at org.lightadmin.boot.LightAdminBootApplication.main(LightAdminBootApplication.java:108) [classes/:na] Caused by: java.lang.NoClassDefFoundError: com/gigaspaces/internal/gnu/trove/TObjectIntHashMap at com.gigaspaces.internal.collections.trove.TroveObjectIntegerMap.<init>(TroveObjectIntegerMap.java:28) ~[xap-datagrid.jar:na] at com.gigaspaces.internal.collections.trove.TroveCollectionsFactory.createObjectIntegerMap(TroveCollectionsFactory.java:145) ~[xap-datagrid.jar:na] at com.gigaspaces.internal.io.IOUtils.<clinit>(IOUtils.java:79) ~[xap-datagrid.jar:na] at com.j_spaces.core.JSpaceContainerImpl.loadRMIRegistry(JSpaceContainerImpl.java:2118) ~[xap-datagrid.jar:na] at com.j_spaces.core.JSpaceContainerImpl.initContainer(JSpaceContainerImpl.java:435) ~[xap-datagrid.jar:na] at com.j_spaces.core.JSpaceContainerImpl.<init>(JSpaceContainerImpl.java:371) ~[xap-datagrid.jar:na] at com.j_spaces.core.client.SpaceFinder.createEmbeddedSpace(SpaceFinder.java:556) ~[xap-datagrid.jar:na] at com.j_spaces.core.client.SpaceFinder.findEmbeddedSpace(SpaceFinder.java:588) ~[xap-datagrid.jar:na] at com.j_spaces.core.client.SpaceFinder.findService(SpaceFinder.java:469) ~[xap-datagrid.jar:na] at com.j_spaces.core.client.SpaceFinder.findService(SpaceFinder.java:431) ~[xap-datagrid.jar:na] at com.j_spaces.core.client.SpaceFinder.find(SpaceFinder.java:336) ~[xap-datagrid.jar:na] at com.gigaspaces.client.SpaceProxyFactory.createSpaceProxy(SpaceProxyFactory.java:94) ~[xap-datagrid.jar:na] at org.openspaces.core.space.InternalSpaceFactory.create(InternalSpaceFactory.java:108) ~[xap-openspaces.jar:12.1.1] at org.openspaces.core.space.UrlSpaceFactoryBean.doCreateSpace(UrlSpaceFactoryBean.java:101) ~[xap-openspaces.jar:12.1.1] at org.openspaces.core.space.AbstractSpaceFactoryBean.afterPropertiesSet(AbstractSpaceFactoryBean.java:189) ~[xap-openspaces.jar:12.1.1] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1633) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1570) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE] ... 15 common frames omitted Caused by: java.lang.ClassNotFoundException: com.gigaspaces.internal.gnu.trove.TObjectIntHashMap at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[na:1.8.0_40] at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_40] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) ~[na:1.8.0_40] at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_40] ... 32 common frames omitted 2017-08-31 12:29:34,229 INFO [org.apache.catalina.core.StandardService] - Stopping service Tomcat [WARN] org.springframework.beans.factory.support.DefaultListableBeanFactory - Bean creation exception on FactoryBean type check: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration': Initialization of bean failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'org.springframework.context.annotation.ConfigurationClassPostProcessor.importRegistry' is defined [WARN] org.springframework.beans.factory.support.DefaultListableBeanFactory - Bean creation exception on FactoryBean type check: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration': Initialization of bean failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'org.springframework.context.annotation.ConfigurationClassPostProcessor.importRegistry' is defined [ERROR] org.springframework.boot.SpringApplication - Application startup failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'space': Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: com/gigaspaces/internal/gnu/trove/TObjectIntHashMap at org.springframework.beans.factory ... (more)

asked 2017-08-31 05:14:29 -0600

alexmera gravatar image
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

Hi,

You are getting class not found exception for some trove related classes. Can you please check ${XAP Home}/required/xap-trove.jar is in the classpath?

Thanks, Dixson

answered 2017-09-01 09:00:10 -0600

Dixson Huie gravatar image

updated 2017-09-05 08:12:07 -0600

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2017-08-31 05:14:29 -0600

Seen: 467 times

Last updated: Sep 05