The 'pu run' and 'space run' CLI commands fail when Java 11 is used

Description

A NullPointerException is thrown:

WARNING [org.openspaces.pu.container.support.ResourceApplicationContext] - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'space' defined in class path resource [org/openspaces/core/config/annotation/EmbeddedSpaceBeansConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.openspaces.core.space.AbstractSpaceFactoryBean]: Factory method 'spaceFactoryBean' threw exception; nested exception is java.lang.NullPointerException
org.openspaces.pu.container.CannotCreateContainerException: Failed to start container; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'space' defined in class path resource [org/openspaces/core/config/annotation/EmbeddedSpaceBeansConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.openspaces.core.space.AbstractSpaceFactoryBean]: Factory method 'spaceFactoryBean' threw exception; nested exception is java.lang.NullPointerException
at org.openspaces.pu.container.standalone.StandaloneProcessingUnitContainerProvider.createContainer(StandaloneProcessingUnitContainerProvider.java:290)
at org.openspaces.pu.container.standalone.StandaloneProcessingUnitContainer.createContainer(StandaloneProcessingUnitContainer.java:168)
at org.openspaces.pu.container.standalone.StandaloneProcessingUnitContainer.main(StandaloneProcessingUnitContainer.java:121)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'space' defined in class path resource [org/openspaces/core/config/annotation/EmbeddedSpaceBeansConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.openspaces.core.space.AbstractSpaceFactoryBean]: Factory method 'spaceFactoryBean' threw exception; nested exception is java.lang.NullPointerException
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:627)
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:456)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1321)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1160)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:824)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:877)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549)
at org.openspaces.pu.container.standalone.StandaloneContainerRunnable.run(StandaloneContainerRunnable.java:115)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.openspaces.core.space.AbstractSpaceFactoryBean]: Factory method 'spaceFactoryBean' threw exception; nested exception is java.lang.NullPointerException
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185)
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:622)
... 14 more
Caused by: java.lang.NullPointerException
at org.openspaces.core.config.annotation.AbstractSpaceBeansConfig.getSpaceName(AbstractSpaceBeansConfig.java:87)
at org.openspaces.core.config.annotation.EmbeddedSpaceBeansConfig.configure(EmbeddedSpaceBeansConfig.java:58)
at org.openspaces.core.config.annotation.EmbeddedSpaceBeansConfig.createSpaceFactoryBean(EmbeddedSpaceBeansConfig.java:53)
at org.openspaces.core.config.annotation.AbstractSpaceBeansConfig.spaceFactoryBean(AbstractSpaceBeansConfig.java:55)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)
... 15 more
Shutdown completed successfully - 1 sub-processes were terminated (duration: 0ms)

Activity

Show:
Niv Ingberg
May 24, 2020, 9:51 AM

The problem is related to the @Resource annotation, which starting java 9 is excluded from java distro and available as another dependency. fix is to add it to classpath, similar to other places in code.

Fixed

Assignee

Niv Ingberg

Reporter

Niv Ingberg

Labels

None

Priority

Major

SalesForce Case ID

None

Fix versions

Commitment Version/s

None

Due date

None

Product

XAP

Edition

Open Source

Platform

All