I have found these dependencies in http://mvnrepository.com but could not find them valid. I need to implement spring based dependency in Gradle. Please guide me with valid dependency in Gradle, so that I can access aerospike in Spring framework.
I can access mongodb like :
import org.springframework.data.mongodb.
but could not able to get :
import org.springframework.data.aerospike. (as mentioned in your docs and Git).
NOTE: I have used the above dependencies in my gradle project also and my gradle could not compile. It seems these are not valid maven repositories.
Spring Data for Aerospike is a Spring Community project controlled by Pivotal (Spring) and sponsored by Aerospike.
Currently there is an issue with the automated build of Spring Data for Aerospike preventing the JAR to be published in Maven Central, and Aerospike has raised these with Pivotal.
In the mean time, I recommend that you clone the GitHub repo and build it.
This build command will build, test and install it in your local Maven repo.
@Autowired
public AerospikeTemplate aerospikeTemplate;
And it is giving me this Exceptions:
5372 ERROR [main] --- SpringApplication: Application startup failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'prePushAnalysisService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: public org.springframework.data.aerospike.core.AerospikeTemplate com.matchinguu.analytics.core.service.PrePushAnalysisService.aerospikeTemplate; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'aerospikeTemplate' defined in class path resource [com/matchinguu/analytics/ConfigurationHandler.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.data.aerospike.core.AerospikeTemplate]: Factory method 'aerospikeTemplate' threw exception; nested exception is java.lang.NullPointerException
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1214)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:543)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:772)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:839)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:538)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:766)
at org.springframework.boot.SpringApplication.createAndRefreshContext(SpringApplication.java:361)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:307)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1191)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1180)
Please guide me, what I am doing wrong. I use the same format for MongoDB and it is running fine.
java.lang.NullPointerException
at java.util.TreeMap.compare(TreeMap.java:1290)
at java.util.TreeMap.put(TreeMap.java:538)
at com.aerospike.helper.query.QueryEngine.refreshIndexes(QueryEngine.java:497)
at com.aerospike.helper.query.QueryEngine.refreshCluster(QueryEngine.java:420)
at com.aerospike.helper.query.QueryEngine.<init>(QueryEngine.java:108)
at org.springframework.data.aerospike.core.AerospikeTemplate.<init>(AerospikeTemplate.java:135)