Skip to content

Auto-configure repositories for Redis #5448

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
snicoll opened this issue Mar 19, 2016 · 14 comments
Closed

Auto-configure repositories for Redis #5448

snicoll opened this issue Mar 19, 2016 · 14 comments
Labels
status: invalid An issue that we don't feel is valid

Comments

@snicoll
Copy link
Member

snicoll commented Mar 19, 2016

Hopper RC1 brings support for Redis repositories. We should improve our auto-configuration to support that as well.

See gh-5150

@snicoll snicoll added the type: enhancement A general enhancement label Mar 19, 2016
@snicoll snicoll self-assigned this Mar 19, 2016
@snicoll snicoll added this to the 1.4.0.M2 milestone Mar 19, 2016
eddumelendez added a commit to eddumelendez/spring-boot that referenced this issue Mar 20, 2016
@eddumelendez
Copy link
Contributor

@snicoll I have been working on this in 4fa5cb5 but hard to test it. Can you give a hint? Thanks in advance.

@snicoll
Copy link
Member Author

snicoll commented Mar 20, 2016

There is a RedisTestServer that runs if redis is available. I would use that. Are you going to submit a PR for this?

@eddumelendez
Copy link
Contributor

Thanks @snicoll PR is under way.

eddumelendez added a commit to eddumelendez/spring-boot that referenced this issue Mar 21, 2016
eddumelendez added a commit to eddumelendez/spring-boot that referenced this issue Mar 21, 2016
@snicoll
Copy link
Member Author

snicoll commented Mar 21, 2016

Closing in favour of the PR #5455

@snicoll snicoll closed this as completed Mar 21, 2016
@snicoll snicoll removed the type: enhancement A general enhancement label Mar 21, 2016
@dsyer dsyer added the type: enhancement A general enhancement label Mar 21, 2016
@snicoll snicoll removed this from the 1.4.0.M2 milestone Mar 21, 2016
@snicoll snicoll removed their assignment Mar 21, 2016
@snicoll snicoll added status: duplicate A duplicate of another issue and removed type: enhancement A general enhancement labels Mar 21, 2016
snicoll pushed a commit that referenced this issue Mar 21, 2016
snicoll added a commit that referenced this issue Mar 21, 2016
* pr/5455:
  Polish contribution
  Auto-configure Redis repositories
@philwebb philwebb reopened this Mar 22, 2016
@philwebb
Copy link
Member

Seems to break the latest Buildpack.

2016-03-22T15:46:08.80-0700 [APP/0]      OUT 2016-03-22 22:46:08.804  WARN 14 --- [           main] ationConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'redisKeyValueAdapter': Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.data.redis.core.RedisKeyValueAdapter]: Constructor threw exception; nested exception is java.lang.NullPointerException
2016-03-22T15:46:08.80-0700 [APP/0]      OUT 2016-03-22 22:46:08.806  INFO 14 --- [           main] o.s.j.e.a.AnnotationMBeanExporter        : Unregistering JMX-exposed beans on shutdown
2016-03-22T15:46:08.80-0700 [APP/0]      OUT 2016-03-22 22:46:08.808  INFO 14 --- [           main] o.s.j.d.e.EmbeddedDatabaseFactory        : Shutting down embedded database: url='jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=false'
2016-03-22T15:46:08.81-0700 [APP/0]      OUT 2016-03-22 22:46:08.815  INFO 14 --- [           main] o.apache.catalina.core.StandardService   : Stopping service Tomcat
2016-03-22T15:46:08.85-0700 [APP/0]      OUT 2016-03-22 22:46:08.850  INFO 14 --- [           main] utoConfigurationReportLoggingInitializer : 
2016-03-22T15:46:08.85-0700 [APP/0]      OUT Error starting ApplicationContext. To display the auto-configuration report enable debug logging (start with --debug)
2016-03-22T15:46:08.88-0700 [APP/0]      OUT 2016-03-22 22:46:08.880 ERROR 14 --- [           main] o.s.boot.SpringApplication               : Application startup failed
2016-03-22T15:46:08.88-0700 [APP/0]      OUT org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'redisKeyValueAdapter': Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.data.redis.core.RedisKeyValueAdapter]: Constructor threw exception; nested exception is java.lang.NullPointerException
2016-03-22T15:46:08.88-0700 [APP/0]      OUT    at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:279) ~[spring-beans-4.3.0.BUILD-SNAPSHOT.jar!/:4.3.0.BUILD-SNAPSHOT]
2016-03-22T15:46:08.88-0700 [APP/0]      OUT    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1143) ~[spring-beans-4.3.0.BUILD-SNAPSHOT.jar!/:4.3.0.BUILD-SNAPSHOT]
2016-03-22T15:46:08.88-0700 [APP/0]      OUT    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1046) ~[spring-beans-4.3.0.BUILD-SNAPSHOT.jar!/:4.3.0.BUILD-SNAPSHOT]
2016-03-22T15:46:08.88-0700 [APP/0]      OUT    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:510) ~[spring-beans-4.3.0.BUILD-SNAPSHOT.jar!/:4.3.0.BUILD-SNAPSHOT]
2016-03-22T15:46:08.88-0700 [APP/0]      OUT    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482) ~[spring-beans-4.3.0.BUILD-SNAPSHOT.jar!/:4.3.0.BUILD-SNAPSHOT]
2016-03-22T15:46:08.88-0700 [APP/0]      OUT    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) ~[spring-beans-4.3.0.BUILD-SNAPSHOT.jar!/:4.3.0.BUILD-SNAPSHOT]
2016-03-22T15:46:08.88-0700 [APP/0]      OUT    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.3.0.BUILD-SNAPSHOT.jar!/:4.3.0.BUILD-SNAPSHOT]
2016-03-22T15:46:08.88-0700 [APP/0]      OUT    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) ~[spring-beans-4.3.0.BUILD-SNAPSHOT.jar!/:4.3.0.BUILD-SNAPSHOT]
2016-03-22T15:46:08.88-0700 [APP/0]      OUT    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) ~[spring-beans-4.3.0.BUILD-SNAPSHOT.jar!/:4.3.0.BUILD-SNAPSHOT]
2016-03-22T15:46:08.88-0700 [APP/0]      OUT    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:775) ~[spring-beans-4.3.0.BUILD-SNAPSHOT.jar!/:4.3.0.BUILD-SNAPSHOT]
2016-03-22T15:46:08.88-0700 [APP/0]      OUT    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:841) ~[spring-context-4.3.0.BUILD-SNAPSHOT.jar!/:4.3.0.BUILD-SNAPSHOT]
2016-03-22T15:46:08.88-0700 [APP/0]      OUT    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:540) ~[spring-context-4.3.0.BUILD-SNAPSHOT.jar!/:4.3.0.BUILD-SNAPSHOT]
2016-03-22T15:46:08.88-0700 [APP/0]      OUT    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118) ~[spring-boot-1.4.0.BUILD-SNAPSHOT.jar!/:1.4.0.BUILD-SNAPSHOT]
2016-03-22T15:46:08.88-0700 [APP/0]      OUT    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:773) [spring-boot-1.4.0.BUILD-SNAPSHOT.jar!/:1.4.0.BUILD-SNAPSHOT]
2016-03-22T15:46:08.88-0700 [APP/0]      OUT    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:368) [spring-boot-1.4.0.BUILD-SNAPSHOT.jar!/:1.4.0.BUILD-SNAPSHOT]
2016-03-22T15:46:08.88-0700 [APP/0]      OUT    at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) [spring-boot-1.4.0.BUILD-SNAPSHOT.jar!/:1.4.0.BUILD-SNAPSHOT]
2016-03-22T15:46:08.88-0700 [APP/0]      OUT    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1190) [spring-boot-1.4.0.BUILD-SNAPSHOT.jar!/:1.4.0.BUILD-SNAPSHOT]
2016-03-22T15:46:08.88-0700 [APP/0]      OUT    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1179) [spring-boot-1.4.0.BUILD-SNAPSHOT.jar!/:1.4.0.BUILD-SNAPSHOT]
2016-03-22T15:46:08.88-0700 [APP/0]      OUT    at com.gopivotal.cloudfoundry.test.ApplicationConfiguration.main(ApplicationConfiguration.java:41) [classes/:na]
2016-03-22T15:46:08.88-0700 [APP/0]      OUT    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_73-]
2016-03-22T15:46:08.88-0700 [APP/0]      OUT    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_73-]
2016-03-22T15:46:08.88-0700 [APP/0]      OUT    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_73-]
2016-03-22T15:46:08.88-0700 [APP/0]      OUT    at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_73-]
2016-03-22T15:46:08.88-0700 [APP/0]      OUT    at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:54) [app/:na]
2016-03-22T15:46:08.88-0700 [APP/0]      OUT    at org.springframework.boot.loader.Launcher.launch(Launcher.java:100) [app/:na]
2016-03-22T15:46:08.88-0700 [APP/0]      OUT    at org.springframework.boot.loader.Launcher.launch(Launcher.java:58) [app/:na]
2016-03-22T15:46:08.88-0700 [APP/0]      OUT    at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:58) [app/:na]
2016-03-22T15:46:08.88-0700 [APP/0]      OUT Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.data.redis.core.RedisKeyValueAdapter]: Constructor threw exception; nested exception is java.lang.NullPointerException
2016-03-22T15:46:08.88-0700 [APP/0]      OUT    at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:163) ~[spring-beans-4.3.0.BUILD-SNAPSHOT.jar!/:4.3.0.BUILD-SNAPSHOT]
2016-03-22T15:46:08.88-0700 [APP/0]      OUT    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:122) ~[spring-beans-4.3.0.BUILD-SNAPSHOT.jar!/:4.3.0.BUILD-SNAPSHOT]
2016-03-22T15:46:08.88-0700 [APP/0]      OUT    at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:271) ~[spring-beans-4.3.0.BUILD-SNAPSHOT.jar!/:4.3.0.BUILD-SNAPSHOT]
2016-03-22T15:46:08.88-0700 [APP/0]      OUT    ... 26 common frames omitted
2016-03-22T15:46:08.88-0700 [APP/0]      OUT Caused by: java.lang.NullPointerException: null
2016-03-22T15:46:08.88-0700 [APP/0]      OUT    at org.springframework.data.redis.listener.KeyspaceEventMessageListener.init(KeyspaceEventMessageListener.java:78) ~[spring-data-redis-1.7.0.RC1.jar!/:na]
2016-03-22T15:46:08.88-0700 [APP/0]      OUT    at org.springframework.data.redis.core.RedisKeyValueAdapter.initKeyExpirationListener(RedisKeyValueAdapter.java:509) ~[spring-data-redis-1.7.0.RC1.jar!/:na]
2016-03-22T15:46:08.88-0700 [APP/0]      OUT    at org.springframework.data.redis.core.RedisKeyValueAdapter.<init>(RedisKeyValueAdapter.java:160) ~[spring-data-redis-1.7.0.RC1.jar!/:na]
2016-03-22T15:46:08.88-0700 [APP/0]      OUT    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.8.0_73-]
2016-03-22T15:46:08.88-0700 [APP/0]      OUT    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:1.8.0_73-]
2016-03-22T15:46:08.88-0700 [APP/0]      OUT    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.8.0_73-]
2016-03-22T15:46:08.88-0700 [APP/0]      OUT    at java.lang.reflect.Constructor.newInstance(Constructor.java:422) ~[na:1.8.0_73-]
2016-03-22T15:46:08.88-0700 [APP/0]      OUT    at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:147) ~[spring-beans-4.3.0.BUILD-SNAPSHOT.jar!/:4.3.0.BUILD-SNAPSHOT]
2016-03-22T15:46:08.88-0700 [APP/0]      OUT    ... 28 common frames omitted
2016-03-22T15:46:08.91-0700 [APP/0]      OUT Exit status 1

@philwebb philwebb added type: blocker An issue that is blocking us from releasing and removed status: duplicate A duplicate of another issue labels Mar 22, 2016
@philwebb philwebb added this to the 1.4.0.M2 milestone Mar 22, 2016
christophstrobl added a commit to christophstrobl/spring-boot that referenced this issue Mar 23, 2016
@christophstrobl
Copy link
Member

@philwebb I altered SampleRedisApplication and the RedisKeyValueAdapter, Listener... and repository support seem to be fine so far.
master...christophstrobl:issue/5448_verify

@philwebb
Copy link
Member

@nebhale Did you have a way to replicate this issue?

@nebhale
Copy link
Contributor

nebhale commented Mar 28, 2016

@philwebb Our system tests would reproduce it. Can I update to the latest -SNAPSHOT for testing the fix?

@philwebb
Copy link
Member

@nebhale We've not made any changes to fix it as yet. I just wanted a way to reproduce locally if possible.

@snicoll
Copy link
Member Author

snicoll commented Apr 5, 2016

@nebhale how can I test this? Does it work with 1.4.0.M1?

@snicoll
Copy link
Member Author

snicoll commented Apr 8, 2016

@nebhale can you help? It's a blocker for M2 and we're about to release it. I am still not sure what the problem is.

@nebhale
Copy link
Contributor

nebhale commented Apr 8, 2016

@snicoll This works with M1 in our system tests, but if I release that to the snapshot it starts failing again. I can check a snapshot if an update has been made.

@snicoll
Copy link
Member Author

snicoll commented Apr 8, 2016

You said that already. I don't know what those system tests are and nothing indicates that this failure is related to this commit. It's failing quite low so that's why I am asking for a way to reproduce myself...

@philwebb
Copy link
Member

philwebb commented Apr 8, 2016

Problem seems to be because FakeRedisConnectionFactory returns null and KeyspaceEventMessageListener doesn't expect that.

@philwebb philwebb removed this from the 1.4.0.M2 milestone Apr 8, 2016
@philwebb philwebb added status: invalid An issue that we don't feel is valid and removed type: blocker An issue that is blocking us from releasing labels Apr 8, 2016
@philwebb philwebb closed this as completed Apr 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: invalid An issue that we don't feel is valid
Projects
None yet
Development

No branches or pull requests

6 participants