Skip to content
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

nullpointer exception #102

Closed
shenroong opened this issue Nov 10, 2015 · 0 comments
Closed

nullpointer exception #102

shenroong opened this issue Nov 10, 2015 · 0 comments
Labels

Comments

@shenroong
Copy link

I used the exactly same example code from java redis example. I use maven to compile and package.

    final RedisClient client = RedisClient.create(vertx,
        new RedisOptions().setHost("127.0.0.1"));
java.lang.NullPointerException
at io.vertx.redis.impl.AbstractRedisClient.<init>(AbstractRedisClient.java:44)
at io.vertx.redis.impl.RedisClientImpl.<init>(RedisClientImpl.java:39)
at io.vertx.redis.RedisClient.create(RedisClient.java:49)
at ccproject.q2.<init>(q2.java:54)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at java.lang.Class.newInstance(Class.java:442)
at io.vertx.core.impl.JavaVerticleFactory.createVerticle(JavaVerticleFactory.java:44)
at io.vertx.core.impl.DeploymentManager.createVerticles(DeploymentManager.java:186)
at io.vertx.core.impl.DeploymentManager.lambda$doDeployVerticle$153(DeploymentManager.java:159)
at io.vertx.core.impl.FutureImpl.checkCallHandler(FutureImpl.java:135)
at io.vertx.core.impl.FutureImpl.setHandler(FutureImpl.java:100)
at io.vertx.core.impl.DeploymentManager.doDeployVerticle(DeploymentManager.java:132)
at io.vertx.core.impl.DeploymentManager.doDeployVerticle(DeploymentManager.java:104)
at io.vertx.core.impl.DeploymentManager.deployVerticle(DeploymentManager.java:92)
at io.vertx.core.impl.VertxImpl.deployVerticle(VertxImpl.java:557)
at io.vertx.core.Starter.runVerticle(Starter.java:333)
at io.vertx.core.Starter.run(Starter.java:130)
at io.vertx.core.Starter.main(Starter.java:101)

I solved it. Redis.create should be inside start()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants