TimeAndSpaceIO / SmoothieMap

A gulp of low latency Java
295 stars 30 forks source link

java.lang.ClassNotFoundException: net.openhft.smoothie.Segment60 #2

Closed qixiaobo closed 7 years ago

qixiaobo commented 8 years ago
  @Bean(name = "mapInMemory")
    public Map<CharSequence, CharSequence> mapInMemory() {
        return new SmoothieMap<>(1_0000_0000L);
    }

。。。。。。 mapInMemory.put(lines[0], lines[1]); 。。。。。。 CharSequence value = mapInMemory.get((CharSequence) key);

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'initAction': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mapInMemory' defined in class path resource [com/best/config/Config.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public java.util.Map com.best.config.Config.mapInMemory()] threw exception; nested exception is java.lang.RuntimeException: java.lang.ClassNotFoundException: net.openhft.smoothie.Segment60
    at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessPropertyValues(CommonAnnotationBeanPostProcessor.java:308)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1185)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:703)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:760)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:120)
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:683)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:313)
    at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:142)
    at org.springframework.boot.context.web.SpringBootServletInitializer.createRootApplicationContext(SpringBootServletInitializer.java:89)
    at org.springframework.boot.context.web.SpringBootServletInitializer.onStartup(SpringBootServletInitializer.java:51)
    at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:175)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5580)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
    at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1095)
    at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1957)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
leventov commented 8 years ago

Please try version 1.2.

qixiaobo commented 8 years ago

sorry ,error again

leventov commented 8 years ago

Could you please prepare a small self-contained reproducible example?

qixiaobo commented 8 years ago

Thanks for you. You can get my github project https://github.com/qixiaobo/BigMemory/blob/master/src/main/java/com/best/config/Config.java I just want a high performance collection。 2_000_000 ops(always get)===》key size 200byte value size 200byte

Since I know the heap collection (with big data) may cause fullgc,then I tried mapdb, Chronicle-Map and so on. But they can't be very fast solutions. Then I tried SmoothieMap,oops,some errors above appear.I found that just hashmap(JFC) has very high performance .

Thandks

leventov commented 8 years ago

Please check 1.3