Skip to content
This repository was archived by the owner on Feb 9, 2019. It is now read-only.
This repository was archived by the owner on Feb 9, 2019. It is now read-only.

JedisPool injection giving exception for Play with java 2.4.x #156

@guptamitesh

Description

@guptamitesh

Hi,
I am using play for java 2.4.x. I followed all the steps to step the redis plugin and it worked out pretty well. However, while using the injected dependency for jedis pool:

import javax.inject.Inject;
import redis.clients.jedis.JedisPool;
@Inject JedisPool jedisPool;

I am getting the following error:

Unexpected exception

ProvisionException: Unable to provision, see the following errors:

  1. Could not find a suitable constructor in redis.clients.jedis.JedisPool. Classes must have either one (and only one) constructor annotated with @Inject or a zero-argument constructor that is not private.
    at redis.clients.jedis.JedisPool.class(JedisPool.java:10)
    while locating redis.clients.jedis.JedisPool
    for field at controllers.AdminLoginController.jedisPool(AdminLoginController.java:22)
    while locating controllers.AdminLoginController
    for parameter 13 at router.Routes.(Routes.scala:76)
    while locating router.Routes
    while locating play.api.inject.RoutesProvider
    while locating play.api.routing.Router

1 error
at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1025) ~[guice-4.0.jar:na]
at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1051) ~[guice-4.0.jar:na]
at play.api.inject.guice.GuiceInjector.instanceOf(GuiceInjectorBuilder.scala:321) ~[play_2.11-2.4.0.jar:2.4.0]
at play.api.inject.guice.GuiceInjector.instanceOf(GuiceInjectorBuilder.scala:316) ~[play_2.11-2.4.0.jar:2.4.0]
at play.api.Application$class.routes(Application.scala:111) ~[play_2.11-2.4.0.jar:2.4.0]
at play.api.DefaultApplication.routes(Application.scala:240) ~[play_2.11-2.4.0.jar:2.4.0]
at play.api.Play$.start(Play.scala:89) ~[play_2.11-2.4.0.jar:2.4.0]
at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1$$anonfun$apply$1$$anonfun$1.apply(DevServerStart.scala:156) ~[play-server_2.11-2.4.0.jar:2.4.0]
... 15 common frames omitted

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions