1

I am following basic tutorial at Spring Data Cassandra reference http://docs.spring.io/spring-data/cassandra/docs/1.1.0.RC1/reference/html/ and I am running into following exception

java.lang.IllegalArgumentException: Environment must not be null!
    at org.springframework.util.Assert.notNull(Assert.java:112)
    at org.springframework.data.repository.config.RepositoryConfigurationSourceSupport.<init>(RepositoryConfigurationSourceSupport.java:50)
    at org.springframework.data.repository.config.AnnotationRepositoryConfigurationSource.<init>(AnnotationRepositoryConfigurationSource.java:74)
    at org.springframework.data.repository.config.RepositoryBeanDefinitionRegistrarSupport.registerBeanDefinitions(RepositoryBeanDefinitionRegistrarSupport.java:74)
    at org.springframework.context.annotation.ConfigurationClassParser.processImport(ConfigurationClassParser.java:394)
    at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:204)
    at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:163)
    at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:138)
    at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:284)
    at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:225)
    at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:630)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:461)
    at org.springframework.context.annotation.AnnotationConfigApplicationContext.<init>(AnnotationConfigApplicationContext.java:73)
    at com.strides.platform.domain.UserRepositoryDaoTest.<init>(UserRepositoryDaoTest.java:28)

I have completed steps mentioned in document,

1) Use Cassandra Properties

2) Create Java configuration

3) Create domain and repository classes

I have autowired Environment variable in Test classes. I checked couple of sample projects and not sure what needs to be done more.

Kromster
  • 7,181
  • 7
  • 63
  • 111

1 Answers1

1

I've encountered this error message and found the problem only occuring when I used Spring Framework version 3.2.8.RELEASE.

My solution was to upgrade to version 3.2.9.RELEASE.

See also java.lang.IllegalArgumentException: Environment must not be null

Community
  • 1
  • 1
awgn
  • 11
  • 1