jamie jacob
jamie jacob

Reputation: 19

Not able to start redis server on Mac M1

I am using a Macbook Pro M1 and I am trying to start my server through Intellij

-- Added from the comments below --

COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME 
redis-ser 3387 josephantony 6u IPv4 0x9c37a0d6c1c8e2c9 0t0 TCP localhost:6379 (LISTEN) redis-ser 3387 josephantony 7u IPv6 0x9c37a0d6ba1e9219 0t0 TCP localhost:6379 (LISTEN)

-- End of comment --

And getting this error:

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'redisServer' defined in class path resource [com/sensei/gls/config/EmbeddedRedisConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [redis.embedded.RedisServer]: Factory method 'redisServer' threw exception; nested exception is java.lang.RuntimeException: Can't start redis server. Check logs for details. at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:655) at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:483) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1336) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1176) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:556) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516) at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:226) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1307) at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1227) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:640) ... 132 common frames omitted Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [redis.embedded.RedisServer]: Factory method 'redisServer' threw exception; nested exception is java.lang.RuntimeException: Can't start redis server. Check logs for details. at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185) at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:650) ... 145 common frames omitted Caused by: java.lang.RuntimeException: Can't start redis server. Check logs for details. at redis.embedded.AbstractRedisInstance.awaitRedisServerReady(AbstractRedisInstance.java:62) at redis.embedded.AbstractRedisInstance.start(AbstractRedisInstance.java:39) at redis.embedded.RedisServer.start(RedisServer.java:9) at com.sensei.gls.config.EmbeddedRedisConfiguration.redisServer(EmbeddedRedisConfiguration.java:34) at com.sensei.gls.config.EmbeddedRedisConfiguration$$EnhancerBySpringCGLIB$$de8352da.CGLIB$redisServer$0() at com.sensei.gls.config.EmbeddedRedisConfiguration$$EnhancerBySpringCGLIB$$de8352da$$FastClassBySpringCGLIB$$ccaa38a4.invoke() at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244) at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:331) at com.sensei.gls.config.EmbeddedRedisConfiguration$$EnhancerBySpringCGLIB$$de8352da.redisServer() 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) ... 146 common frames omitted

Upvotes: 1

Views: 5508

Answers (1)

Saravanakrishnan Pk
Saravanakrishnan Pk

Reputation: 461

I'm not sure how you set up redis server in your system. But I followed the instructions from spring guides (also installed it with rosetta2 enabled terminal), and it's working fine.

redis-server-in-m1-mac-using-brew

Upvotes: 1

Related Questions