VERY strange runtime errors with com.google.common.cache.CacheBuilder
See original GitHub issueSo it would seem that most of the Cassandra java drivers out there are using guava CacheBuilder. I have tried Astayanx and at runtime I get:
Caused by: java.lang.NoSuchMethodError: com.google.common.cache.CacheBuilder.build()Lcom/google/common/cache/Cache;
at com.netflix.astyanax.thrift.ThriftKeyspaceImpl.<init>(ThriftKeyspaceImpl.java:116)
at com.netflix.astyanax.thrift.ThriftFamilyFactory.createKeyspace(ThriftFamilyFactory.java:41)
at com.netflix.astyanax.AstyanaxContext$Builder.buildKeyspace(AstyanaxContext.java:146)
at com.disney.tss.auth.backend.persistence.CassandraClient.<init>(CassandraClient.java:28)
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 org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:147)
... 25 more
I have tried the datastax driver and get a similar error in the same class CacheBuilder:
Caused by: java.lang.NoSuchMethodError: com.google.common.cache.CacheBuilder.maximumWeight(J)Lcom/google/common/cache/CacheBuilder;
at com.datastax.driver.core.CodecRegistry.defaultCacheBuilder(CodecRegistry.java:305)
at com.datastax.driver.core.CodecRegistry.<init>(CodecRegistry.java:297)
at com.datastax.driver.core.CodecRegistry.<clinit>(CodecRegistry.java:172)
at com.datastax.driver.core.Configuration$Builder.build(Configuration.java:276)
at com.datastax.driver.core.Cluster$Builder.getConfiguration(Cluster.java:1221)
at com.datastax.driver.core.Cluster.<init>(Cluster.java:116)
at com.datastax.driver.core.Cluster.buildFrom(Cluster.java:181)
at com.datastax.driver.core.Cluster$Builder.build(Cluster.java:1238)
at com.disney.tss.auth.backend.persistence.CassandraClient.<init>(CassandraClient.java:31)
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 org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:147)
... 25 more
When I check my maven includes and look for the “missing” methods, they are there. But evidently google is doing something weird with class loaders or something. More than one product that depends on this class fails inexplicably.
Issue Analytics
- State:
- Created 8 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Ask Question - Stack Overflow
A strange run time error when working with JPMML library (with guava). I used the jpmml related dependencies in my pom.xml like below...
Read more >CacheBuilder (Guava: Google Core Libraries for Java 19.0 API)
A builder of LoadingCache and Cache instances having any combination of the following features: automatic loading of entries into the cache ...
Read more >Bug? When setting expireAfterWrite, all my keys get evicted ...
I'm using Scala and com.google.guava version 18.0. I'm storing a Future Option, hope it is not the cause of this, and every time...
Read more >Can't cache this! - LinkedIn
Here is a fragment of code showing how the cache was configured: var cache = CacheBuilder.newBuilder() .refreshAfterWrite(Constants.
Read more >spotify/scio - Gitter
OK, so I've manged to read nested Json String as TableRow with Google Jackson ... /time/Duration;)Lcom/google/common/cache/CacheBuilder; [error] java.lang.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Do you suppose that the maven tomcat7 plugin under which this is executing might be the culprit? Given everything I have observed while digging in to this your suspicion seems very well founded indeed.
Yes, that did the trick. Thanks!