问:
Exception encountered during context initialization - cancelling refresh attempt .....Singleton instance not initialized yet - but workin in local VM
Starting our Server, we always get an exception starting with:

```<code>WARN  [localhost-startStop-5] [TenantIgnoreXmlWebApplicationContext] Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultDataToWsConverterList': Cannot resolve reference to bean 'cmsPageDataToWsConverter' while setting bean property 'sourceList' with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultPageDataToWsConverter' defined in class path resource [cmsoccaddon/web/spring/cmsoccaddon-web-spring.xml]: Cannot resolve reference to bean 'cmsDataMapper' while setting bean property 'mapper'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultCMSDataMapper' defined in class path resource [cmsoccaddon/web/spring/cmsoccaddon-web-spring.xml]: Initialization of bean failed; nested exception is java.lang.IllegalStateException: Singleton instance not initialized yet
</code>```

This only happens on our Testsystem, but everything is fine in the local VM. The beans mentioned are part of hybris (I checked them, but they seem fine and I didn't touch anything and like I said it's working local) and the AddOn should be installed properly

```<code>     <antcall target="addoninstall">
            <param name="addonnames" value="cmsoccaddon"/>
            <param name="addonStorefront.ycommercewebservices" value="ycommercewebservices"/>
        </antcall>
</code>```

Stacktrace:

```    INFO   | jvm 1    | main    | 2020/05/26 19:17:20.392 | INFO  [localhost-startStop-4] [PropertySourcedRequestMappingHandlerMapping] Mapped URL path [/api-docs] onto method [public org.springframework.http.ResponseEntity<springfox.documentation.spring.web.json.Json> springfox.documentation.swagger2.web.Swagger2Controller.getDocumentation(java.lang.String,javax.servlet.http.HttpServletRequest)]
    INFO   | jvm 1    | main    | 2020/05/26 19:17:20.392 | WARN  [localhost-startStop-5] [TenantIgnoreXmlWebApplicationContext] Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultDataToWsConverterList': Cannot resolve reference to bean 'cmsPageDataToWsConverter' while setting bean property 'sourceList' with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultPageDataToWsConverter' defined in class path resource [cmsoccaddon/web/spring/cmsoccaddon-web-spring.xml]: Cannot resolve reference to bean 'cmsDataMapper' while setting bean property 'mapper'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultCMSDataMapper' defined in class path resource [cmsoccaddon/web/spring/cmsoccaddon-web-spring.xml]: Initialization of bean failed; nested exception is java.lang.IllegalStateException: Singleton instance not initialized yet
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.392 | INFO  [localhost-startStop-5] [TenantAwareEhCacheManagerFactoryBean] Shutting down EhCache CacheManager 'wsCache_master'
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.492 | ERROR [localhost-startStop-5] [ContextLoader] Context initialization failed
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.492 | org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultDataToWsConverterList': Cannot resolve reference to bean 'cmsPageDataToWsConverter' while setting bean property 'sourceList' with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultPageDataToWsConverter' defined in class path resource [cmsoccaddon/web/spring/cmsoccaddon-web-spring.xml]: Cannot resolve reference to bean 'cmsDataMapper' while setting bean property 'mapper'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultCMSDataMapper' defined in class path resource [cmsoccaddon/web/spring/cmsoccaddon-web-spring.xml]: Initialization of bean failed; nested exception is java.lang.IllegalStateException: Singleton instance not initialized yet
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.492 |     at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:314) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.492 |     at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:110) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.492 |     at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveManagedList(BeanDefinitionValueResolver.java:399) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.493 |     at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:159) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.493 |     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1674) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.493 |     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1426) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.493 |     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:592) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.493 |     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.493 |     at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.493 |     at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.493 |     at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.493 |     at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.493 |     at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:828) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.493 |     at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:877) ~[spring-context-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.493 |     at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549) ~[spring-context-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.493 |     at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:401) ~[spring-web-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.493 |     at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:292) [spring-web-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.493 |     at de.hybris.platform.spring.HybrisContextLoaderListener.doInitWebApplicationContext(HybrisContextLoaderListener.java:226) [coreserver.jar:?]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.493 |     at de.hybris.platform.spring.HybrisContextLoaderListener.initWebApplicationContext(HybrisContextLoaderListener.java:199) [coreserver.jar:?]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.493 |     at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:103) [spring-web-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.493 |     at de.hybris.platform.spring.HybrisContextLoaderListener.contextInitialized(HybrisContextLoaderListener.java:95) [coreserver.jar:?]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.494 |     at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4699) [catalina.jar:8.5.51]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.494 |     at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5165) [catalina.jar:8.5.51]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.494 |     at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) [catalina.jar:8.5.51]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.494 |     at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1412) [catalina.jar:8.5.51]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.494 |     at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1402) [catalina.jar:8.5.51]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.494 |     at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.494 |     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.494 |     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.495 |     at java.lang.Thread.run(Thread.java:834) [?:?]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.495 | Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultPageDataToWsConverter' defined in class path resource [cmsoccaddon/web/spring/cmsoccaddon-web-spring.xml]: Cannot resolve reference to bean 'cmsDataMapper' while setting bean property 'mapper'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultCMSDataMapper' defined in class path resource [cmsoccaddon/web/spring/cmsoccaddon-web-spring.xml]: Initialization of bean failed; nested exception is java.lang.IllegalStateException: Singleton instance not initialized yet
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.495 |     at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:314) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.495 |     at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:110) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.495 |     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1674) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.495 |     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1426) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.495 |     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:592) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.495 |     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.495 |     at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.495 |     at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.495 |     at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.496 |     at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.496 |     at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:303) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.496 |     ... 29 more
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.496 | Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultCMSDataMapper' defined in class path resource [cmsoccaddon/web/spring/cmsoccaddon-web-spring.xml]: Initialization of bean failed; nested exception is java.lang.IllegalStateException: Singleton instance not initialized yet
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.496 |     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:601) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.496 |     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.496 |     at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.496 |     at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.496 |     at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.496 |     at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.496 |     at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:303) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.496 |     at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:110) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.496 |     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1674) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.496 |     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1426) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.496 |     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:592) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.496 |     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.496 |     at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.496 |     at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.497 |     at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.497 |     at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.497 |     at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:303) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.497 |     ... 29 more
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.497 | Caused by: java.lang.IllegalStateException: Singleton instance not initialized yet
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.497 |     at org.springframework.util.Assert.state(Assert.java:73) ~[spring-core-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.497 |     at org.springframework.beans.factory.config.AbstractFactoryBean.getSingletonInstance(AbstractFactoryBean.java:188) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.497 |     at org.springframework.beans.factory.config.AbstractFactoryBean.access$200(AbstractFactoryBean.java:63) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.497 |     at org.springframework.beans.factory.config.AbstractFactoryBean$EarlySingletonInvocationHandler.invoke(AbstractFactoryBean.java:275) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.497 |     at com.sun.proxy.$Proxy272.forEach(Unknown Source) ~[?:?]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.497 |     at de.hybris.platform.cmsoccaddon.mapping.DefaultCMSDataMapper.configure(DefaultCMSDataMapper.java:43) ~[cmsoccaddonserver.jar:?]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.497 |     at ma.glasnost.orika.impl.ConfigurableMapper.init(ConfigurableMapper.java:119) ~[orika-core-1.5.2.jar:?]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.497 |     at de.hybris.platform.webservicescommons.mapping.impl.DefaultDataMapper.setApplicationContext(DefaultDataMapper.java:74) ~[webservicescommonsserver.jar:?]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.497 |     at org.springframework.context.support.ApplicationContextAwareProcessor.invokeAwareInterfaces(ApplicationContextAwareProcessor.java:120) ~[spring-context-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.497 |     at org.springframework.context.support.ApplicationContextAwareProcessor.postProcessBeforeInitialization(ApplicationContextAwareProcessor.java:96) ~[spring-context-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.497 |     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:414) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.497 |     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1763) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.497 |     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:593) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.497 |     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.498 |     at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.498 |     at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.498 |     at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.498 |     at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.499 |     at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:303) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.499 |     at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:110) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.499 |     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1674) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.499 |     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1426) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.499 |     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:592) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.499 |     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.499 |     at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.499 |     at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.499 |     at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.499 |     at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.499 |     at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:303) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.499 |     ... 29 more
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.499 | Mai 26, 2020 7:17:20 NACHM. org.apache.catalina.core.StandardContext listenerStart
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.499 | SCHWERWIEGEND: Fehler beim Senden der 'Context Initialized' Benachrichtigung an den Listener aus der Klasse [de.hybris.platform.spring.HybrisContextLoaderListener]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.499 | org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultDataToWsConverterList': Cannot resolve reference to bean 'cmsPageDataToWsConverter' while setting bean property 'sourceList' with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultPageDataToWsConverter' defined in class path resource [cmsoccaddon/web/spring/cmsoccaddon-web-spring.xml]: Cannot resolve reference to bean 'cmsDataMapper' while setting bean property 'mapper'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultCMSDataMapper' defined in class path resource [cmsoccaddon/web/spring/cmsoccaddon-web-spring.xml]: Initialization of bean failed; nested exception is java.lang.IllegalStateException: Singleton instance not initialized yet
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.500 |     at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:314)
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.500 |     at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:110)
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.500 |     at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveManagedList(BeanDefinitionValueResolver.java:399)
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.500 |     at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:159)
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.500 |     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1674)
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.500 |     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1426)
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.500 |     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:592)
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.500 |     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515)
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.500 |     at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.500 |     at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
```

After that the server keeps booting and the most things seem to work, but not everthing, like caching

答:
On got installed properly, the above exception comes when having the issue with addon installation.

Please Verify on the test server, your addon is installed properly on the given storefront.

to verify the addon please this property is injected in your addon or not.

```<code>XXXstorefront.additionalWebSpringConfigs.XXXsocialwebaddon=classpath\:/XXXsocialwebaddon/web/spring/XXXsocialwebaddon-web-spring.xml
</code>```

XXXstorefront.wro4jconfigscan.XXXsocialwebaddon=true

Later if you don't want to run ant target to install addon please add this property to local.properties or specific to storefront project.properties.

Body:
Starting our Server, we always get an exception starting with:

WARN  [localhost-startStop-5] [TenantIgnoreXmlWebApplicationContext] Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultDataToWsConverterList': Cannot resolve reference to bean 'cmsPageDataToWsConverter' while setting bean property 'sourceList' with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultPageDataToWsConverter' defined in class path resource [cmsoccaddon/web/spring/cmsoccaddon-web-spring.xml]: Cannot resolve reference to bean 'cmsDataMapper' while setting bean property 'mapper'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultCMSDataMapper' defined in class path resource [cmsoccaddon/web/spring/cmsoccaddon-web-spring.xml]: Initialization of bean failed; nested exception is java.lang.IllegalStateException: Singleton instance not initialized yet

This only happens on our Testsystem, but everything is fine in the local VM. The beans mentioned are part of hybris (I checked them, but they seem fine and I didn't touch anything and like I said it's working local) and the AddOn should be installed properly

     <antcall target="addoninstall">
            <param name="addonnames" value="cmsoccaddon"/>
            <param name="addonStorefront.ycommercewebservices" value="ycommercewebservices"/>
        </antcall>

Stacktrace:

    INFO   | jvm 1    | main    | 2020/05/26 19:17:20.392 | INFO  [localhost-startStop-4] [PropertySourcedRequestMappingHandlerMapping] Mapped URL path [/api-docs] onto method [public org.springframework.http.ResponseEntity<springfox.documentation.spring.web.json.Json> springfox.documentation.swagger2.web.Swagger2Controller.getDocumentation(java.lang.String,javax.servlet.http.HttpServletRequest)]
    INFO   | jvm 1    | main    | 2020/05/26 19:17:20.392 | WARN  [localhost-startStop-5] [TenantIgnoreXmlWebApplicationContext] Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultDataToWsConverterList': Cannot resolve reference to bean 'cmsPageDataToWsConverter' while setting bean property 'sourceList' with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultPageDataToWsConverter' defined in class path resource [cmsoccaddon/web/spring/cmsoccaddon-web-spring.xml]: Cannot resolve reference to bean 'cmsDataMapper' while setting bean property 'mapper'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultCMSDataMapper' defined in class path resource [cmsoccaddon/web/spring/cmsoccaddon-web-spring.xml]: Initialization of bean failed; nested exception is java.lang.IllegalStateException: Singleton instance not initialized yet
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.392 | INFO  [localhost-startStop-5] [TenantAwareEhCacheManagerFactoryBean] Shutting down EhCache CacheManager 'wsCache_master'
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.492 | ERROR [localhost-startStop-5] [ContextLoader] Context initialization failed
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.492 | org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultDataToWsConverterList': Cannot resolve reference to bean 'cmsPageDataToWsConverter' while setting bean property 'sourceList' with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultPageDataToWsConverter' defined in class path resource [cmsoccaddon/web/spring/cmsoccaddon-web-spring.xml]: Cannot resolve reference to bean 'cmsDataMapper' while setting bean property 'mapper'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultCMSDataMapper' defined in class path resource [cmsoccaddon/web/spring/cmsoccaddon-web-spring.xml]: Initialization of bean failed; nested exception is java.lang.IllegalStateException: Singleton instance not initialized yet
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.492 |     at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:314) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.492 |     at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:110) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.492 |     at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveManagedList(BeanDefinitionValueResolver.java:399) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.493 |     at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:159) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.493 |     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1674) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.493 |     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1426) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.493 |     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:592) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.493 |     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.493 |     at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.493 |     at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.493 |     at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.493 |     at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.493 |     at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:828) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.493 |     at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:877) ~[spring-context-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.493 |     at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549) ~[spring-context-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.493 |     at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:401) ~[spring-web-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.493 |     at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:292) [spring-web-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.493 |     at de.hybris.platform.spring.HybrisContextLoaderListener.doInitWebApplicationContext(HybrisContextLoaderListener.java:226) [coreserver.jar:?]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.493 |     at de.hybris.platform.spring.HybrisContextLoaderListener.initWebApplicationContext(HybrisContextLoaderListener.java:199) [coreserver.jar:?]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.493 |     at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:103) [spring-web-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.493 |     at de.hybris.platform.spring.HybrisContextLoaderListener.contextInitialized(HybrisContextLoaderListener.java:95) [coreserver.jar:?]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.494 |     at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4699) [catalina.jar:8.5.51]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.494 |     at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5165) [catalina.jar:8.5.51]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.494 |     at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) [catalina.jar:8.5.51]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.494 |     at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1412) [catalina.jar:8.5.51]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.494 |     at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1402) [catalina.jar:8.5.51]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.494 |     at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.494 |     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.494 |     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.495 |     at java.lang.Thread.run(Thread.java:834) [?:?]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.495 | Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultPageDataToWsConverter' defined in class path resource [cmsoccaddon/web/spring/cmsoccaddon-web-spring.xml]: Cannot resolve reference to bean 'cmsDataMapper' while setting bean property 'mapper'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultCMSDataMapper' defined in class path resource [cmsoccaddon/web/spring/cmsoccaddon-web-spring.xml]: Initialization of bean failed; nested exception is java.lang.IllegalStateException: Singleton instance not initialized yet
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.495 |     at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:314) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.495 |     at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:110) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.495 |     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1674) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.495 |     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1426) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.495 |     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:592) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.495 |     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.495 |     at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.495 |     at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.495 |     at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.496 |     at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.496 |     at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:303) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.496 |     ... 29 more
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.496 | Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultCMSDataMapper' defined in class path resource [cmsoccaddon/web/spring/cmsoccaddon-web-spring.xml]: Initialization of bean failed; nested exception is java.lang.IllegalStateException: Singleton instance not initialized yet
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.496 |     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:601) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.496 |     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.496 |     at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.496 |     at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.496 |     at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.496 |     at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.496 |     at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:303) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.496 |     at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:110) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.496 |     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1674) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.496 |     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1426) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.496 |     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:592) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.496 |     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.496 |     at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.496 |     at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.497 |     at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.497 |     at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.497 |     at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:303) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.497 |     ... 29 more
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.497 | Caused by: java.lang.IllegalStateException: Singleton instance not initialized yet
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.497 |     at org.springframework.util.Assert.state(Assert.java:73) ~[spring-core-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.497 |     at org.springframework.beans.factory.config.AbstractFactoryBean.getSingletonInstance(AbstractFactoryBean.java:188) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.497 |     at org.springframework.beans.factory.config.AbstractFactoryBean.access$200(AbstractFactoryBean.java:63) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.497 |     at org.springframework.beans.factory.config.AbstractFactoryBean$EarlySingletonInvocationHandler.invoke(AbstractFactoryBean.java:275) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.497 |     at com.sun.proxy.$Proxy272.forEach(Unknown Source) ~[?:?]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.497 |     at de.hybris.platform.cmsoccaddon.mapping.DefaultCMSDataMapper.configure(DefaultCMSDataMapper.java:43) ~[cmsoccaddonserver.jar:?]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.497 |     at ma.glasnost.orika.impl.ConfigurableMapper.init(ConfigurableMapper.java:119) ~[orika-core-1.5.2.jar:?]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.497 |     at de.hybris.platform.webservicescommons.mapping.impl.DefaultDataMapper.setApplicationContext(DefaultDataMapper.java:74) ~[webservicescommonsserver.jar:?]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.497 |     at org.springframework.context.support.ApplicationContextAwareProcessor.invokeAwareInterfaces(ApplicationContextAwareProcessor.java:120) ~[spring-context-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.497 |     at org.springframework.context.support.ApplicationContextAwareProcessor.postProcessBeforeInitialization(ApplicationContextAwareProcessor.java:96) ~[spring-context-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.497 |     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:414) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.497 |     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1763) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.497 |     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:593) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.497 |     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.498 |     at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.498 |     at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.498 |     at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.498 |     at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.499 |     at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:303) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.499 |     at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:110) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.499 |     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1674) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.499 |     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1426) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.499 |     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:592) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.499 |     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.499 |     at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.499 |     at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.499 |     at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.499 |     at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.499 |     at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:303) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.499 |     ... 29 more
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.499 | Mai 26, 2020 7:17:20 NACHM. org.apache.catalina.core.StandardContext listenerStart
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.499 | SCHWERWIEGEND: Fehler beim Senden der 'Context Initialized' Benachrichtigung an den Listener aus der Klasse [de.hybris.platform.spring.HybrisContextLoaderListener]
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.499 | org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultDataToWsConverterList': Cannot resolve reference to bean 'cmsPageDataToWsConverter' while setting bean property 'sourceList' with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultPageDataToWsConverter' defined in class path resource [cmsoccaddon/web/spring/cmsoccaddon-web-spring.xml]: Cannot resolve reference to bean 'cmsDataMapper' while setting bean property 'mapper'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultCMSDataMapper' defined in class path resource [cmsoccaddon/web/spring/cmsoccaddon-web-spring.xml]: Initialization of bean failed; nested exception is java.lang.IllegalStateException: Singleton instance not initialized yet
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.500 |     at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:314)
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.500 |     at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:110)
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.500 |     at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveManagedList(BeanDefinitionValueResolver.java:399)
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.500 |     at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:159)
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.500 |     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1674)
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.500 |     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1426)
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.500 |     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:592)
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.500 |     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515)
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.500 |     at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
        INFO   | jvm 1    | main    | 2020/05/26 19:17:20.500 |     at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)

After that the server keeps booting and the most things seem to work, but not everthing, like caching

Body:
On got installed properly, the above exception comes when having the issue with addon installation.

Please Verify on the test server, your addon is installed properly on the given storefront.

to verify the addon please this property is injected in your addon or not.

XXXstorefront.additionalWebSpringConfigs.XXXsocialwebaddon=classpath\:/XXXsocialwebaddon/web/spring/XXXsocialwebaddon-web-spring.xml

XXXstorefront.wro4jconfigscan.XXXsocialwebaddon=true

Later if you don't want to run ant target to install addon please add this property to local.properties or specific to storefront project.properties.


来源: stackexchange

问:
Is there a way to generate 100K unique 8-9 characters in excel
I am trying to use the below macro to generate 100K unique IDS/Strings in excel.

However, it's failing to generate more than 34,464 rows. I get "#NA"

I am not an expert so there's something definitely wrong.

Any and all help is greatly appreciated. Thank you

Sub Random_Number()

Const strCharacters As String = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"

```<code>Dim cllAlphaNums As Collection
Dim arrUnqAlphaNums(1 To 100000) As String
Dim varElement As Variant
Dim strAlphaNum As String
Dim AlphaNumIndex As Long
Dim lUbound As Long
Dim lNumChars As Long
Dim i As Long

Set cllAlphaNums = New Collection
lUbound = UBound(arrUnqAlphaNums)
lNumChars = Len(strCharacters)

On Error Resume Next
Do
    strAlphaNum = vbNullString
    For i = 1 To 9
        strAlphaNum = strAlphaNum & Mid(strCharacters, Int(Rnd() * lNumChars) + 1, 1)
    Next i
    cllAlphaNums.Add strAlphaNum, strAlphaNum
Loop While cllAlphaNums.Count < lUbound
On Error GoTo 0

For Each varElement In cllAlphaNums
    AlphaNumIndex = AlphaNumIndex + 1
    arrUnqAlphaNums(AlphaNumIndex) = varElement
Next varElement

Range("A1").Resize(lUbound).Value = Application.Transpose(arrUnqAlphaNums)

Set cllAlphaNums = Nothing
Erase arrUnqAlphaNums
</code>```

End Sub

答:
Just go 2-dimensional from the start and don't use TRANSPOSE():

```<code>Sub Random_Number()

    Const strCharacters As String = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"

    Dim cllAlphaNums As Collection
    Dim arrUnqAlphaNums(1 To 100000, 1 To 1) As String '  column-compatible
    Dim varElement As Variant
    Dim strAlphaNum As String
    Dim AlphaNumIndex As Long
    Dim lUbound As Long
    Dim lNumChars As Long
    Dim i As Long

    Set cllAlphaNums = New Collection
    lUbound = UBound(arrUnqAlphaNums, 1)
    lNumChars = Len(strCharacters)

    On Error Resume Next
    Do
        strAlphaNum = vbNullString
        For i = 1 To 9
            strAlphaNum = strAlphaNum & Mid(strCharacters, Int(Rnd() * lNumChars) + 1, 1)
        Next i
        cllAlphaNums.Add strAlphaNum, strAlphaNum
    Loop While cllAlphaNums.Count < lUbound
    On Error GoTo 0

    For Each varElement In cllAlphaNums
        AlphaNumIndex = AlphaNumIndex + 1
        arrUnqAlphaNums(AlphaNumIndex, 1) = varElement
    Next varElement

    Range("A1").Resize(lUbound).Value = arrUnqAlphaNums

    Set cllAlphaNums = Nothing
    Erase arrUnqAlphaNums
End Sub
</code>```

NOTE:

arrUnqAlphaNums has been Dim'ed to be column-compatible from the beginning.

ContentLicense: CC BY-SA 4.0

Body:
I am trying to use the below macro to generate 100K unique IDS/Strings in excel.

However, it's failing to generate more than 34,464 rows. I get "#NA"

I am not an expert so there's something definitely wrong.

Any and all help is greatly appreciated. Thank you

Sub Random_Number()

Const strCharacters As String = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"

Dim cllAlphaNums As Collection
Dim arrUnqAlphaNums(1 To 100000) As String
Dim varElement As Variant
Dim strAlphaNum As String
Dim AlphaNumIndex As Long
Dim lUbound As Long
Dim lNumChars As Long
Dim i As Long

Set cllAlphaNums = New Collection
lUbound = UBound(arrUnqAlphaNums)
lNumChars = Len(strCharacters)

On Error Resume Next
Do
    strAlphaNum = vbNullString
    For i = 1 To 9
        strAlphaNum = strAlphaNum & Mid(strCharacters, Int(Rnd() * lNumChars) + 1, 1)
    Next i
    cllAlphaNums.Add strAlphaNum, strAlphaNum
Loop While cllAlphaNums.Count < lUbound
On Error GoTo 0

For Each varElement In cllAlphaNums
    AlphaNumIndex = AlphaNumIndex + 1
    arrUnqAlphaNums(AlphaNumIndex) = varElement
Next varElement

Range("A1").Resize(lUbound).Value = Application.Transpose(arrUnqAlphaNums)

Set cllAlphaNums = Nothing
Erase arrUnqAlphaNums

End Sub

Body:
Just go 2-dimensional from the start and don't use TRANSPOSE():

Sub Random_Number()

    Const strCharacters As String = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"

    Dim cllAlphaNums As Collection
    Dim arrUnqAlphaNums(1 To 100000, 1 To 1) As String '  column-compatible
    Dim varElement As Variant
    Dim strAlphaNum As String
    Dim AlphaNumIndex As Long
    Dim lUbound As Long
    Dim lNumChars As Long
    Dim i As Long

    Set cllAlphaNums = New Collection
    lUbound = UBound(arrUnqAlphaNums, 1)
    lNumChars = Len(strCharacters)

    On Error Resume Next
    Do
        strAlphaNum = vbNullString
        For i = 1 To 9
            strAlphaNum = strAlphaNum & Mid(strCharacters, Int(Rnd() * lNumChars) + 1, 1)
        Next i
        cllAlphaNums.Add strAlphaNum, strAlphaNum
    Loop While cllAlphaNums.Count < lUbound
    On Error GoTo 0

    For Each varElement In cllAlphaNums
        AlphaNumIndex = AlphaNumIndex + 1
        arrUnqAlphaNums(AlphaNumIndex, 1) = varElement
    Next varElement

    Range("A1").Resize(lUbound).Value = arrUnqAlphaNums

    Set cllAlphaNums = Nothing
    Erase arrUnqAlphaNums
End Sub

NOTE:

arrUnqAlphaNums has been Dim'ed to be column-compatible from the beginning.


问:
Add elements of a list together python
I have this list

```<code>r1 = 2
r2 = 4
r3 = 5
r4 = 9
lst = [r1, r2, r3, r4]
</code>```

I want to create a new list which looks like this:

```<code>new_lst = [r1, r1+r2, r1+r2+r3, r1+r2+r3+r4]
</code>```

Except in the new_lst r1 is named "x1", r1+r2 named "x2 etc.

I'm currently doing this using:

```<code>new_lst = []
new_lst.append(sum(lst[0:1]))
new_lst.append(sum(lst[0:2]))
new_lst.append(sum(lst[0:3]))
new_lst.append(sum(lst[0:4]))
</code>```

And then refer to this list by saying if "n" is between 0 and x1, x1 and x1+x2 etc; print y. i.e.

```<code> if n >=0 and n <= new_lst[0]:
      print(y)
 elif n >=new_lst[0] and n <= new_lst[1]:
      print(z)
</code>```

答:
This might seem a bit unpractical, but it does include defining the x1, x2, x3 and x4 you mentioned in your post:

```<code>r1 = 2
r2 = 4
r3 = 5
r4 = 9
lst = [r1, r2, r3, r4]
new_lst = []
s = ''
for n in range(1,len(lst)+1):
    s += f'+r{n}'
    exec(f'x{n}='+s)
    new_lst.append(eval(f'x{n}'))

print(new_lst)
</code>```

This is not recommended though, because it uses exec, which is considered a bad practice because it's generally abused to do a task where it isn't needed, leading to potential security issues and generally bad programming.
If possible, just define the variables manually, or, there's also a way to let python write them all into a separate file so you can copy and paste it into your main script.

Title: Add elements of a list together python

Body:
I have this list

r1 = 2
r2 = 4
r3 = 5
r4 = 9
lst = [r1, r2, r3, r4]

I want to create a new list which looks like this:

new_lst = [r1, r1+r2, r1+r2+r3, r1+r2+r3+r4]

Except in the new_lst r1 is named "x1", r1+r2 named "x2 etc.

I'm currently doing this using:

new_lst = []
new_lst.append(sum(lst[0:1]))
new_lst.append(sum(lst[0:2]))
new_lst.append(sum(lst[0:3]))
new_lst.append(sum(lst[0:4]))

And then refer to this list by saying if "n" is between 0 and x1, x1 and x1+x2 etc; print y. i.e.

 if n >=0 and n <= new_lst[0]:
      print(y)
 elif n >=new_lst[0] and n <= new_lst[1]:
      print(z)

Body:
This might seem a bit unpractical, but it does include defining the x1, x2, x3 and x4 you mentioned in your post:

r1 = 2
r2 = 4
r3 = 5
r4 = 9
lst = [r1, r2, r3, r4]
new_lst = []
s = ''
for n in range(1,len(lst)+1):
    s += f'+r{n}'
    exec(f'x{n}='+s)
    new_lst.append(eval(f'x{n}'))

print(new_lst)

This is not recommended though, because it uses exec, which is considered a bad practice because it's generally abused to do a task where it isn't needed, leading to potential security issues and generally bad programming.
If possible, just define the variables manually, or, there's also a way to let python write them all into a separate file so you can copy and paste it into your main script.


问:
importing data from firestore into bigQuery
I have upgraded my account to blaze which is one of the prerequisite. I have tried to followed the FAQ  Link BigQuery to Firebase. still not able to see any of the data from firestore or firebase-realtimeDatabase into bigQuery.

I see option in bigQuery to create Dataset. however after creating dataset it allows me to upload data from [file], [cloud storage], [bigQuery],[google Drive] . but not  firestore database.

Plesae help.

答:
You should use the BigQuery export extension built-in in Firebase

See details: https://firebase.google.com/products/extensions/firestore-bigquery-export

Now, this extension will be importing to your BigQuery table new created/updated/deleted documents inside a collection, your current old data before the new one is added will not be placed inside this table.

To import all the previous data you will need first to install the extension because all the writes while doing the export first without installing the extension will be lost.

After you install the extension, just use gcloud to export all the current dataset

https://github.com/firebase/extensions/blob/master/firestore-bigquery-export/guides/IMPORT_EXISTING_DOCUMENTS.md

ContentLicense: CC BY-SA 3.0


问:
Finding an empty cell in a column using google sheet script

I am trying to find an empty cell in a specific column in google sheets. I am familiar with getLastRow(), but it returns the last row in whole sheet. I want to get the first empty cell in a specific column. So, I used a for loop and if. But I don't know why it is not working. The problem is that for loop does not return anything.
I am getting 10 rows of the column H (position 8) in the sheet test (line2). first 5 rows already have content. Data will be added to this cell later using another code. so, I want to be able to find the first empty cell in this column to be able to put the new data.

```<code>var sheettest = SpreadsheetApp.getActive().getSheetByName("test");
var columntest = sheettest.getRange(4, 8, 10).getValues();
    for(var i=0; columntest[i]=="" ; i++){
      if (columntest[i] ==""){
        var notationofemptycell = sheettest.getRange(i,8).getA1Notation();
        return notationofemptycell
      }

  }
</code>```

As I said, I want to find the first empty cell in that column. I defined the for loop to go on as long as the cell is not empty. then if the cell is empty, it should return the A1 notation of that cell.

It seems the for loop does go on until it find the empty cell, because I get no definition for the var "notationofemptycell" in debugging.

答:
This may be faster:</p>

```<code>function getFirstEmptyCellIn_A_Column() {
  var rng,sh,values,x;

  /*  Ive tested the code for speed using many different ways to do this and using array.some
    is the fastest way - when array.some finds the first true statement it stops iterating -

  */

  sh = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('test');
  rng = sh.getRange('A:A');//This is the fastest - Its faster than getting the last row and
  //getting a specific range that goes only to the last row

  values = rng.getValues(); // get all the data in the column - This is a 2D array

  x = 0;

  values.some(function(ca,i){
    //Logger.log(i)
    //Logger.log(ca[0])

    x = i;//Set the value every time - its faster than first testing for a reason to set the value
    return ca[0] == "";//The first time that this is true it stops looping
  });

  Logger.log('x: ' + x)//x is the index of the value in the array - which is one less than
  //the row number

  return x + 1;
}
</code>```

Body:
I am trying to find an empty cell in a specific column in google sheets. I am familiar with getLastRow(), but it returns the last row in whole sheet. I want to get the first empty cell in a specific column. So, I used a for loop and if. But I don't know why it is not working. The problem is that for loop does not return anything.
I am getting 10 rows of the column H (position 8) in the sheet test (line2). first 5 rows already have content. Data will be added to this cell later using another code. so, I want to be able to find the first empty cell in this column to be able to put the new data.

var sheettest = SpreadsheetApp.getActive().getSheetByName("test");
var columntest = sheettest.getRange(4, 8, 10).getValues();
    for(var i=0; columntest[i]=="" ; i++){
      if (columntest[i] ==""){
        var notationofemptycell = sheettest.getRange(i,8).getA1Notation();
        return notationofemptycell
      }

  }

As I said, I want to find the first empty cell in that column. I defined the for loop to go on as long as the cell is not empty. then if the cell is empty, it should return the A1 notation of that cell.

It seems the for loop does go on until it find the empty cell, because I get no definition for the var "notationofemptycell" in debugging.

Body:
This may be faster:

function getFirstEmptyCellIn_A_Column() {
  var rng,sh,values,x;

  /*  Ive tested the code for speed using many different ways to do this and using array.some
    is the fastest way - when array.some finds the first true statement it stops iterating -

  */

  sh = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('test');
  rng = sh.getRange('A:A');//This is the fastest - Its faster than getting the last row and
  //getting a specific range that goes only to the last row

  values = rng.getValues(); // get all the data in the column - This is a 2D array

  x = 0;

  values.some(function(ca,i){
    //Logger.log(i)
    //Logger.log(ca[0])

    x = i;//Set the value every time - its faster than first testing for a reason to set the value
    return ca[0] == "";//The first time that this is true it stops looping
  });

  Logger.log('x: ' + x)//x is the index of the value in the array - which is one less than
  //the row number

  return x + 1;
}


问:
C++: Rotating a vector around a certain point
I am trying to rotate a vector around a certain point on the vector(in C++):

```<code>1 2 3
4 5 6
7 8 9
</code>```

rotated around the point (1,1) (which is the "5")  90 degrees would result in:

```<code>7 4 1
8 5 2
9 6 3
</code>```

Right now I am using:

```<code>x = (x * cos(90)) - (y * sin(90))
y = (y * cos(90)) + (x * sin(90))
</code>```

But I don't want it rotated around (0,0)

答:
Assuming you're using a standard vector implementation where (0,0) would be the top left corner and you're rotating around the point (x_origin, y_origin), this should do it:

```<code>x = ((x - x_origin) * cos(angle)) - ((y_origin - y) * sin(angle))
y = ((y_origin - y) * cos(angle)) - ((x - x_origin) * sin(angle))
</code>```

Note that the y's are y_origin - y because the y value increases as you go down.

OwnerDisplayName: Erik Ahlswede

Body:
I am trying to rotate a vector around a certain point on the vector(in C++):

1 2 3
4 5 6
7 8 9

rotated around the point (1,1) (which is the "5")  90 degrees would result in:

7 4 1
8 5 2
9 6 3

Right now I am using:

x = (x * cos(90)) - (y * sin(90))
y = (y * cos(90)) + (x * sin(90))

But I don't want it rotated around (0,0)

Body:
Assuming you're using a standard vector implementation where (0,0) would be the top left corner and you're rotating around the point (x_origin, y_origin), this should do it:

x = ((x - x_origin) * cos(angle)) - ((y_origin - y) * sin(angle))
y = ((y_origin - y) * cos(angle)) - ((x - x_origin) * sin(angle))

Note that the y's are y_origin - y because the y value increases as you go down.

OwnerDisplayName: Pesto

ContentLicense: CC BY-SA 2.5


问:
Efficient way to check all points around a given point
Hey, I recently wrote this fairly simple game of life in JavaScript.

Within this script I check all cells around a given cell, I currently do this via eight if statements.

It works but just feels wrong and hard coded. Would there happen to be a faster, more efficient way of doing this? Or are masses of if statements the only way?

答: you can create a lookup table that gets updated after some steps, so you speedup calculations</p>


问:
Storing arrays in ES6 Set and accessing them by value
Is there a simple way to verify that an ES6 Set contains a value that is a particular array? I'd like a solution that doesn't require me to use a reference:

```<code>var set = new Set();

var array = [1, 2];
set.add(array);
set.has(array); // true

set.add([3, 4]);
set.has([3, 4]); // false
</code>```

So far my solution is to store everything as a string, but this is annoying:

```<code>set.add([3, 4].toString());
set.has([3, 4].toString()); // true
</code>```

答:
It's not using a Set, but may solve your problem.

If you want to make sure that an array can only exist in a collection once, and you want instant lookups you can use a hash by abusing its keys. They do not necessarily need a value. You can set them to undefined, to true, or something else if it makes you sleep better at night .

Inspired by: javascript search array of arrays

It is halfway tempting to make a wrapper, but it is also simple enough to handle a small job.

const hash = {};

hash[[1, 2, 3]] = undefined;
hash[[3, 4]] = undefined;
hash[[3, 4]] = undefined;

console.log({hash});
console.log("hash has [3, 4]?", hash.hasOwnProperty([3, 4]));```
</div>
</div>
</p>

<p>For me, this will work fine, because I am checking if a coordinate exists in a collection. Unfortunately from this <code>stackoverflow</code> it seems that <code>Set</code> cannot be the answer to this problem.</p>

<p>Coincidentally it seems to implicitly solve your problem of not calling <code>toString</code> on the array which this seems to do under the hood. Personally I don't care for <code>hash.hasOwnProperty</code>.</p>

<h2>A More Elegant Option</h2>

<p>You could even write a wrapper to your code like:</p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>class ArraySet extends Set {
  add(arr) {
    super.add(arr.toString());
  }
  has(arr) {
    return super.has(arr.toString());
  }
}

const arraySet = new ArraySet();

arraySet.add([1, 2]);
arraySet.add([3, 4]);
arraySet.add([3, 4]);

console.log("ArraySet has [3, 4]?", arraySet.has([3, 4]));</code>```

Body:
Is there a simple way to verify that an ES6 Set contains a value that is a particular array? I'd like a solution that doesn't require me to use a reference:

var set = new Set();

var array = [1, 2];
set.add(array);
set.has(array); // true

set.add([3, 4]);
set.has([3, 4]); // false

So far my solution is to store everything as a string, but this is annoying:

set.add([3, 4].toString());
set.has([3, 4].toString()); // true

Body:
It's not using a Set, but may solve your problem.

If you want to make sure that an array can only exist in a collection once, and you want instant lookups you can use a hash by abusing its keys. They do not necessarily need a value. You can set them to undefined, to true, or something else if it makes you sleep better at night .

Inspired by: javascript search array of arrays

It is halfway tempting to make a wrapper, but it is also simple enough to handle a small job.

const hash = {};

hash[[1, 2, 3]] = undefined;
hash[[3, 4]] = undefined;
hash[[3, 4]] = undefined;

console.log({hash});
console.log("hash has [3, 4]?", hash.hasOwnProperty([3, 4]));

For me, this will work fine, because I am checking if a coordinate exists in a collection. Unfortunately from this stackoverflow it seems that Set cannot be the answer to this problem.

Coincidentally it seems to implicitly solve your problem of not calling toString on the array which this seems to do under the hood. Personally I don't care for hash.hasOwnProperty.

A More Elegant Option

You could even write a wrapper to your code like:

class ArraySet extends Set {
  add(arr) {
    super.add(arr.toString());
  }
  has(arr) {
    return super.has(arr.toString());
  }
}

const arraySet = new ArraySet();

arraySet.add([1, 2]);
arraySet.add([3, 4]);
arraySet.add([3, 4]);

console.log("ArraySet has [3, 4]?", arraySet.has([3, 4]));


问:
Unable to locate element when using python selenium webdriver chrome on Linux Ubuntu
Using python, I am trying to get the number in front of the "Advances -" text on the url:
https://www.nseindia.com/market-data/pre-open-market-cm-and-emerge-market

I am using the below xpath:

//*[@id="livepreOpenAdv"]

but getting the below error:

no such element: Unable to locate element: {"method":"xpath","selector":"//*[@id="livepreOpenAdv"]"}
(Session info: headless chrome=83.0.4103.61)

I am using chromedriver in Linux (ubuntu 20.04)

Below is the python code:

```<code>from selenium import webdriver
from selenium.webdriver.chrome.options import Options

strURL="https://www.nseindia.com/market-data/pre-open-market-cm-and-emerge-market"

options = Options()

options.add_argument('--headless')
options.add_argument('--no-sandbox')
options.add_argument('--disable-gpu')

driver = webdriver.Chrome("/usr/lib/chromium-browser/chromedriver",options=options)

driver.implicitly_wait(60)
driver.get(strURL)

print("Finding element.")

try:
    # advances = driver.find_element_by_id("livepreOpenAdv")
    advances = driver.find_element_by_xpath('''//*[@id="livepreOpenAdv"]''').text
    print(advances)
except Exception as ex:
    print(ex)

driver.close()

print("closed driver")
</code>```

This code works fine in windows. Not able to make out what is the issue here.

答:
Add the following imports :

```<code>from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
</code>```

and replace the line starting with advances = driver... with :

```<code>advances = WebDriverWait(driver, 20).until(EC.visibility_of_element_located((By.XPATH, "//span[@id='livepreOpenAdv']"))).getText()
</code>```

Body:
Using python, I am trying to get the number in front of the "Advances -" text on the url:
https://www.nseindia.com/market-data/pre-open-market-cm-and-emerge-market

I am using the below xpath:

//*[@id="livepreOpenAdv"]

but getting the below error:

no such element: Unable to locate element: {"method":"xpath","selector":"//*[@id="livepreOpenAdv"]"}
(Session info: headless chrome=83.0.4103.61)

I am using chromedriver in Linux (ubuntu 20.04)

Below is the python code:

from selenium import webdriver
from selenium.webdriver.chrome.options import Options

strURL="https://www.nseindia.com/market-data/pre-open-market-cm-and-emerge-market"

options = Options()

options.add_argument('--headless')
options.add_argument('--no-sandbox')
options.add_argument('--disable-gpu')

driver = webdriver.Chrome("/usr/lib/chromium-browser/chromedriver",options=options)

driver.implicitly_wait(60)
driver.get(strURL)

print("Finding element.")

try:
    # advances = driver.find_element_by_id("livepreOpenAdv")
    advances = driver.find_element_by_xpath('''//*[@id="livepreOpenAdv"]''').text
    print(advances)
except Exception as ex:
    print(ex)

driver.close()

print("closed driver")

This code works fine in windows. Not able to make out what is the issue here.

Body:
Add the following imports :

from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC

and replace the line starting with advances = driver... with :

advances = WebDriverWait(driver, 20).until(EC.visibility_of_element_located((By.XPATH, "//span[@id='livepreOpenAdv']"))).getText()


问:
Extracting and isolating a Python function, given an instance of a class
Suppose I am given an instance of a Python class. This class has a function, which I would like to extract and isolate from the class. The final function needs to have access to the values of the attributes from the original class, but otherwise it should not invoke the class at all.

My motivation is that I want to compile the function using jit from numba, but I do not want to compile the entire class using jitclass

As a concrete example, consider the following class. Ideally, I do not want to modify this code:

```<code>class Adder:
    """
    A minimal callable class with keyword arg
    """
    def __init__(self, num=4):
        self.num = num
    def add(self, val1, val2):
        return val1 + val2
    def add_default(self, val1, val2):
        return self.num + val1 + val2
</code>```

I now instantiate these objects, and then try to compile their methods using numba. This works when the instance method does not use any of the object's attributes

```<code>from numba import jit

a = Adder(num=1)
print(a.add(7, 8)) # 15
add_fast = jit(a.add)
print(add_fast(7, 8)) # 15
</code>```

However, this breaks when I try to use the method that requires a class attribute

```<code>from numba import jit

a = Adder(num=1)
print(a.add_default(7, 8)) # 16
add_default_fast = jit(a.add_default)
print(add_default_fast(7, 8)) # NotDefinedError: Variable 'self' is not defined.
</code>```

I tried using a lambda function, but that still internally references the class and breaks jit. Ideally, I want to extract the instance method, as well as the values of all instance attributes, and build a new function that replaces all self. variables with their values from the instance attributes.

Is there a simple way to do this? I am hoping for a solution that does not involve refactoring the class.

答:
Try this:

def add_default(a,*args):
    return Adder.__dict__['add_default'](a,*args)

add_default_fast = jit(add_default,forceobj=True)
print(add_default_fast(a,7, 8)) # 16
```

Instead of 'a' you can pass  to the function any python object having a 'num' attribute

(see also : Python: Hack to call a method on an object that isn't of its class for that dict trick which allows to explicitly specify the 'self' argument of the method)

Body:
Suppose I am given an instance of a Python class. This class has a function, which I would like to extract and isolate from the class. The final function needs to have access to the values of the attributes from the original class, but otherwise it should not invoke the class at all.

My motivation is that I want to compile the function using jit from numba, but I do not want to compile the entire class using jitclass

As a concrete example, consider the following class. Ideally, I do not want to modify this code:

class Adder:
    """
    A minimal callable class with keyword arg
    """
    def __init__(self, num=4):
        self.num = num
    def add(self, val1, val2):
        return val1 + val2
    def add_default(self, val1, val2):
        return self.num + val1 + val2

I now instantiate these objects, and then try to compile their methods using numba. This works when the instance method does not use any of the object's attributes

from numba import jit

a = Adder(num=1)
print(a.add(7, 8)) # 15
add_fast = jit(a.add)
print(add_fast(7, 8)) # 15

However, this breaks when I try to use the method that requires a class attribute

from numba import jit

a = Adder(num=1)
print(a.add_default(7, 8)) # 16
add_default_fast = jit(a.add_default)
print(add_default_fast(7, 8)) # NotDefinedError: Variable 'self' is not defined.

I tried using a lambda function, but that still internally references the class and breaks jit. Ideally, I want to extract the instance method, as well as the values of all instance attributes, and build a new function that replaces all self. variables with their values from the instance attributes.

Is there a simple way to do this? I am hoping for a solution that does not involve refactoring the class.

Body:
Try this:

def add_default(a,*args):
    return Adder.__dict__['add_default'](a,*args)

add_default_fast = jit(add_default,forceobj=True)
print(add_default_fast(a,7, 8)) # 16

Instead of 'a' you can pass  to the function any python object having a 'num' attribute

(see also : Python: Hack to call a method on an object that isn't of its class for that dict trick which allows to explicitly specify the 'self' argument of the method)


问:
neo4jClient create node with dynamic label using paramters
I am building an app that give users the ability to construct there own graphs. I have been using parameters for all queries and creates. But when I want to give users the ability to create a node where they can also Label it anything they want(respecting neo4j restrictions on empty string labels). How would I parameterize this type of transaction?

I tried this:

```<code>.CREATE("(a:{dynamicLabel})").WithParams(new {dynamicLabel = dlabel})...
</code>```

But this yields a syntax error with neo. I am tempted to concatenate, but am worried that this may expose an injection risk to my application.

I am tempted to build up my-own class that reads the intended string and rejects any type of neo syntax, but this would limit my users a bit and I would rather not.

答:
I searched like hell and finally found it out.
you can do it like that:

```<code>// create or update nodes with dynamic label from import data
WITH "file:///query.json" AS url
call apoc.load.json(url) YIELD value as u
UNWIND u.cis as ci
CALL apoc.merge.node([ ci.label ], {Id:ci.Id}, {}, {}) YIELD node
RETURN node;
</code>```

The JSON looks like that:

```<code>{
   "cis": [
     {
       "label": "Computer",
       "Id": "1"
     },
     {
       "label": "Service",
       "Id": "2"
     },
     {
       "label": "Person",
       "Id": "3"
     }
   ],
   "relations": [
     {
       "end1Id": "1",
       "Id": "4",
       "end2Id": "2",
       "label": "USES"
     },
     {
       "end1Id": "3",
       "Id": "5",
       "end2Id": "1",
       "label": "MANAGED_BY"
     }
   ]
 }
</code>```

Body:
I am building an app that give users the ability to construct there own graphs. I have been using parameters for all queries and creates. But when I want to give users the ability to create a node where they can also Label it anything they want(respecting neo4j restrictions on empty string labels). How would I parameterize this type of transaction?

I tried this:

.CREATE("(a:{dynamicLabel})").WithParams(new {dynamicLabel = dlabel})...

But this yields a syntax error with neo. I am tempted to concatenate, but am worried that this may expose an injection risk to my application.

I am tempted to build up my-own class that reads the intended string and rejects any type of neo syntax, but this would limit my users a bit and I would rather not.

Body:
I searched like hell and finally found it out.
you can do it like that:

// create or update nodes with dynamic label from import data
WITH "file:///query.json" AS url
call apoc.load.json(url) YIELD value as u
UNWIND u.cis as ci
CALL apoc.merge.node([ ci.label ], {Id:ci.Id}, {}, {}) YIELD node
RETURN node;

The JSON looks like that:

{
   "cis": [
     {
       "label": "Computer",
       "Id": "1"
     },
     {
       "label": "Service",
       "Id": "2"
     },
     {
       "label": "Person",
       "Id": "3"
     }
   ],
   "relations": [
     {
       "end1Id": "1",
       "Id": "4",
       "end2Id": "2",
       "label": "USES"
     },
     {
       "end1Id": "3",
       "Id": "5",
       "end2Id": "1",
       "label": "MANAGED_BY"
     }
   ]
 }


问:
MutableLiveData is null in JUnitTest
I want to write a unit test. Therefore I need MutableLiveData. I started with a very basic test for setup but I cannot instantiate a MutableLiveData object. I is always null when I run the test. Do I have to mock anything? Any suggestions?

```<code>@RunWith(MockitoJUnitRunner.class)
public class DefaultLiveDataTest {

    private static final int EXPECTED = 5;

    private final MutableLiveData<Integer> underTest = new MutableLiveData<>();

    @Test
    public void exampleTest() {

    underTest.setValue(EXPECTED); //underTest is Null
    assertEquals(underTest.getValue().intValue(), EXPECTED);

    }
}

java.lang.NullPointerException
at android.arch.core.executor.DefaultTaskExecutor.isMainThread(DefaultTaskExecutor.java:58)
at android.arch.core.executor.ArchTaskExecutor.isMainThread(ArchTaskExecutor.java:116)
at android.arch.lifecycle.LiveData.assertMainThread(LiveData.java:434)
at android.arch.lifecycle.LiveData.setValue(LiveData.java:279)
at android.arch.lifecycle.MutableLiveData.setValue(MutableLiveData.java:33)
at com.mypackage.DefaultLiveDataTest.test_that_live_data_has_default_value(DefaultLiveDataTest.java:22)
</code>```

build.gradle

```<code>apply plugin: 'com.android.application'

android {
compileSdkVersion 27
defaultConfig {
    applicationId 'com.mypackage.title'
    minSdkVersion 16
    targetSdkVersion 27
    versionCode 1
    versionName '1.0'
    testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner'
}

testOptions {
    unitTests.returnDefaultValues = true
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:support-vector-drawable:27.1.1'
implementation 'android.arch.lifecycle:extensions:1.1.1'
implementation 'android.arch.lifecycle:viewmodel:1.1.1'
implementation 'android.arch.lifecycle:livedata:1.1.1'

annotationProcessor 'android.arch.lifecycle:compiler:1.1.1'
testImplementation 'junit:junit:4.12'
testImplementation 'org.mockito:mockito-core:1.10.19'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
annotationProcessor 'org.androidannotations:androidannotations:4.4.0'
implementation 'org.androidannotations:androidannotations-api:4.4.0'
compileOnly 'org.projectlombok:lombok:1.16.20'
annotationProcessor 'org.projectlombok:lombok:1.16.20'
}
</code>```

答:
Add an executor InstantTaskExecutorRule() as a member of the Test class

A JUnit Test Rule that swaps the background executor used by the
Architecture Components with a different one which executes each task
synchronously. You can use this rule for your host side tests that use
Architecture Components.

```<code>//@RunWith(JUnit4::class)   // For JUnit4
@ExtendWith(InstantExecutorExtension::class)   // For JUnit5
class FilterViewModelTest {

    @Rule @JvmField
    val instantTaskExecutorRule = InstantTaskExecutorRule()

    @Test
    fun test() {
        //Here you don't ask if isMainThread
    }
}
</code>```

build.gradle(:mobile)

```<code>android {
    //...
    dependencies {
        //...
        testImplementation 'androidx.arch.core:core-testing:2.1.0'
        androidTestImplementation 'androidx.arch.core:core-testing:2.1.0'
    }
}
</code>```

GL

InstantTaskExecutorRule

Title: MutableLiveData is null in JUnitTest

Body:
I want to write a unit test. Therefore I need MutableLiveData. I started with a very basic test for setup but I cannot instantiate a MutableLiveData object. I is always null when I run the test. Do I have to mock anything? Any suggestions?

@RunWith(MockitoJUnitRunner.class)
public class DefaultLiveDataTest {

    private static final int EXPECTED = 5;

    private final MutableLiveData<Integer> underTest = new MutableLiveData<>();

    @Test
    public void exampleTest() {

    underTest.setValue(EXPECTED); //underTest is Null
    assertEquals(underTest.getValue().intValue(), EXPECTED);

    }
}

java.lang.NullPointerException
at android.arch.core.executor.DefaultTaskExecutor.isMainThread(DefaultTaskExecutor.java:58)
at android.arch.core.executor.ArchTaskExecutor.isMainThread(ArchTaskExecutor.java:116)
at android.arch.lifecycle.LiveData.assertMainThread(LiveData.java:434)
at android.arch.lifecycle.LiveData.setValue(LiveData.java:279)
at android.arch.lifecycle.MutableLiveData.setValue(MutableLiveData.java:33)
at com.mypackage.DefaultLiveDataTest.test_that_live_data_has_default_value(DefaultLiveDataTest.java:22)

build.gradle

apply plugin: 'com.android.application'

android {
compileSdkVersion 27
defaultConfig {
    applicationId 'com.mypackage.title'
    minSdkVersion 16
    targetSdkVersion 27
    versionCode 1
    versionName '1.0'
    testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner'
}

testOptions {
    unitTests.returnDefaultValues = true
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:support-vector-drawable:27.1.1'
implementation 'android.arch.lifecycle:extensions:1.1.1'
implementation 'android.arch.lifecycle:viewmodel:1.1.1'
implementation 'android.arch.lifecycle:livedata:1.1.1'

annotationProcessor 'android.arch.lifecycle:compiler:1.1.1'
testImplementation 'junit:junit:4.12'
testImplementation 'org.mockito:mockito-core:1.10.19'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
annotationProcessor 'org.androidannotations:androidannotations:4.4.0'
implementation 'org.androidannotations:androidannotations-api:4.4.0'
compileOnly 'org.projectlombok:lombok:1.16.20'
annotationProcessor 'org.projectlombok:lombok:1.16.20'
}

Body:
Add an executor InstantTaskExecutorRule() as a member of the Test class

A JUnit Test Rule that swaps the background executor used by the
Architecture Components with a different one which executes each task
synchronously. You can use this rule for your host side tests that use
Architecture Components.

//@RunWith(JUnit4::class)   // For JUnit4
@ExtendWith(InstantExecutorExtension::class)   // For JUnit5
class FilterViewModelTest {

    @Rule @JvmField
    val instantTaskExecutorRule = InstantTaskExecutorRule()

    @Test
    fun test() {
        //Here you don't ask if isMainThread
    }
}

build.gradle(:mobile)

android {
    //...
    dependencies {
        //...
        testImplementation 'androidx.arch.core:core-testing:2.1.0'
        androidTestImplementation 'androidx.arch.core:core-testing:2.1.0'
    }
}

GL

InstantTaskExecutorRule