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
java.lang.NoClassDefFoundError: com/github/benmanes/caffeine/cache/tracing/Tracer when used in OSGI container #29
Comments
Sorry that I haven't used OSGi so it's not tested, but I thought the bundle instructions were correct. The tracing jar is built with, bundle {
instruction 'Export-Package', 'com.github.benmanes.caffeine.cache.tracing.*'
} |
ah ok i did not realise that there are transitive dependencies - i'll give it a try |
i added the tracing-api bundle but as it seems this does not help much, since the com.github.ben-manes.caffeine is not importing the tracing bundle. So adding that import would probably fix the issue and document this runtime dependency all at once |
That makes sense that I missed the The tracing package will probably be removed in v2 since we collected enough data to simulate policies and choose an optimal one to replace LRU. |
I probably need an import statement for the guava jar too... |
Not sure why this fails on travis but runs locally. I'll have to retry piecemeal... This reverts commit 98a7282.
Not sure why this fails on travis but runs locally. I'll have to retry piecemeal... This reverts commit 98a7282.
Not sure why this fails on travis but runs locally. I'll have to retry piecemeal... This reverts commit 98a7282.
Release v2.0 which fixes the OSGi manifests. It also removes the tracing packages, which are no longer needed due to choosing a new eviction policy. Sorry this took so long to release. |
having this same issue with spring container, any suggestions? |
I guess you're referring to this StackOverflow issue? I think you are supposed to use Spring's |
Thank you for your reply, resolved the issue
…On Tue, Sep 17, 2019, 12:23 AM Ben Manes ***@***.***> wrote:
I guess you're referring to this StackOverflow issue
<https://stackoverflow.com/questions/57962520/caffeine-cache-cannot-be-cast-to-org-springframework-cache-cache>?
I think you are supposed to use Spring's CaffeineCacheManager, but I am
not very familiar with Spring these days.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#29?email_source=notifications&email_token=ABSXCWEB4T43KIGDZJEOA3TQJ7IYZA5CNFSM4BQDV2G2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD62EWMQ#issuecomment-531909426>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABSXCWAEWSO632CYJMVJD23QJ7IYZANCNFSM4BQDV2GQ>
.
|
the cache.tracing package is not exported and in this way not visible when creating e.g. a LocalCache:
java.lang.NoClassDefFoundError: com/github/benmanes/caffeine/cache/tracing/Tracer
at com.github.benmanes.caffeine.cache.LocalCache.tracer(LocalCache.java:64)
at com.github.benmanes.caffeine.cache.BoundedLocalCache.(BoundedLocalCache.java:139)
at com.github.benmanes.caffeine.cache.LocalCacheFactory$SS.(LocalCacheFactory.java:12966)
at com.github.benmanes.caffeine.cache.LocalCacheFactory$SSMS.(LocalCacheFactory.java:23034)
at com.github.benmanes.caffeine.cache.LocalCacheFactory$SSMSA.(LocalCacheFactory.java:23079)
at com.github.benmanes.caffeine.cache.LocalCacheFactory.newBoundedLocalCache(LocalCacheFactory.java:795)
at com.github.benmanes.caffeine.cache.BoundedLocalCache$BoundedLocalManualCache.(BoundedLocalCache.java:1779)
at com.github.benmanes.caffeine.cache.BoundedLocalCache$BoundedLocalManualCache.(BoundedLocalCache.java:1775)
at com.github.benmanes.caffeine.cache.Caffeine.build(Caffeine.java:814)
The text was updated successfully, but these errors were encountered: