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

Dependency issues with jedis and cache-redis plugin #41

Closed
raffian opened this issue Sep 21, 2014 · 1 comment
Closed

Dependency issues with jedis and cache-redis plugin #41

raffian opened this issue Sep 21, 2014 · 1 comment

Comments

@raffian
Copy link

raffian commented Sep 21, 2014

We've been using cache-redis plugin with spring cache annotations on Grails 2.3.7, but want to upgrade to this plugin, but can't due to dependency issues, wanted to reach out before we dumped our legacy code and started fresh. Due to code dependencies, we can't remove cache-redis without breaking a LOT of code, so we want to leverage redis plugin incrementally until later when we can drop cache-redis entirely.

Current BuildConfig:

   dependencies {
      runtime 'net.sf.ehcache:ehcache-core:2.4.6'
   }
   plugins {
      compile ":cache-redis:1.0.0"
   }

BuildConfig with redis:1.5.5,

   dependencies {
      runtime 'net.sf.ehcache:ehcache-core:2.4.6'
   }
   plugins {
      compile ":cache-redis:1.0.0"
      runtime ":redis:1.5.5"
   }

But this causes error when refreshing/compiling dependencies,

| Environment set to development.....
| Error Fatal error during compilation org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
C:\PROJECTS\WorkspaceSTS2\kennis-cache-plugin-AUG2014\target\work\plugins\redis-1.5.5\.\RedisGrailsPlugin.groovy: 20: unable to resolve class redis.clients.jedis.JedisSentinelPool
 @ line 20, column 1.
   import redis.clients.jedis.JedisSentinelPool

Since redis plugin uses a newer version of jedis, 2.4.2, we excluding jedis from cache-redis,

   dependencies {
      runtime 'net.sf.ehcache:ehcache-core:2.4.6'
   }
   plugins {
      compile (":cache-redis:1.0.0"){
           excludes "jedis"
      }
      runtime ":redis:1.5.5"
   }

We managed to eliminate the compilation error, but on startup, we're getting the following error:

Caused by NoSuchMethodError: redis.clients.jedis.JedisPool.<init>(Lorg/apache/commons/pool/impl/GenericObjectPool$Config;Ljava/lang/String;IILjava/lang/String;)V
->> 303 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
|   138 | run      in java.util.concurrent.FutureTask
|   895 | runTask  in java.util.concurrent.ThreadPoolExecutor$Worker
|   918 | run      in     ''
^   662 | run . .  in java.lang.Thread

No surprise, really, since we configure connections in cache-redis, so we're stuck.

Is it possible to make cache-redis:1.0.0 and redis:1.5.5 play nice together on 2.3.7, or are we wasting our time?

@raffian
Copy link
Author

raffian commented Sep 22, 2014

We dumped cache-redis:1.0.0 in favor of redis:1.5.5, working well.

@raffian raffian closed this as completed Sep 22, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant