Comments (18)
Its generated via the Gradle build file.
Do you have any recommendations for how to test OSGi? I've never used it and I seem to screw up the manifest in every release. Is PaxExam the right approach for compatibility testing?
from caffeine.
I was partially successful and need your help to debug. I added a JUnit sanity test in the caffeine
and guava
modules, due to the TestNG integration eagerly initializing the container even if the test is skipped (broke tests). The caffeine
sanity test passes after your fix.
The guava
test fails with the exception below. The class should be exported and the manifest looks correct to me. Can you take a look at the osgi branch?
You can run using gradlew :guava:test
.
com.github.benmanes.caffeine.guava.OSGiTest > sanity FAILED
java.lang.ClassNotFoundException: com.github.benmanes.caffeine.guava.CaffeinatedGuava not found by PAXEXAM-PROBE-bee238e9-41a5-4071-8e3e-776f37fe25be [16]
at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1574)
at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:79)
at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:2018)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at com.github.benmanes.caffeine.guava.OSGiTest.sanity(OSGiTest.java:59)
from caffeine.
I'll take a look. I can see the problem in your build.gradle now, but I don't know much about unit-testing OSGi (I do all unit testing as plain-jane Java, and OSGi problems get rattled out in final integration tests). I'll check out your branch and take a look.
Great work, btw, big fan of the library 👍
from caffeine.
got it!
The error is due to using Guava 18.0 in test's mavenBundle
, while the build uses 19.0-rc2
. This caused the resolution to fail with a misleading error message. The reason why they differed is because I accidentally set the version
to the full artifact coordinate, which it said wasn't on maven central, so I hard coded it to an earlier version. Fixing the system property and it passes. I guess I'm tired :)
I'll try to finish the integration tests tomorrow and cut a patch release.
from caffeine.
Good find, I was stuck! I've got a workaround, so no rush on my account.
from caffeine.
Any chance you're familiar with OSGi + ServiceLoaders? I tried adding the instructions described here, but no luck so far. Probably because tests are consumers and I'm not declaring that right.
com.github.benmanes.caffeine.jcache.OSGiTest > sanity FAILED
java.util.ServiceConfigurationError: javax.cache.spi.CachingProvider: Provider com.github.benmanes.caffeine.jcache.spi.CaffeineCachingProvider not a subtype
at java.util.ServiceLoader.fail(ServiceLoader.java:239)
at java.util.ServiceLoader.access$300(ServiceLoader.java:185)
at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:376)
at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404)
at java.util.ServiceLoader$1.next(ServiceLoader.java:480)
at javax.cache.Caching$CachingProviderRegistry$1.run(Caching.java:438)
at javax.cache.Caching$CachingProviderRegistry$1.run(Caching.java:432)
at java.security.AccessController.doPrivileged(Native Method)
at javax.cache.Caching$CachingProviderRegistry.getCachingProviders(Caching.java:432)
at javax.cache.Caching$CachingProviderRegistry.getCachingProvider(Caching.java:370)
at javax.cache.Caching$CachingProviderRegistry.getCachingProvider(Caching.java:351)
at javax.cache.Caching.getCachingProvider(Caching.java:142)
at javax.cache.Caching.getCache(Caching.java:279)
at com.github.benmanes.caffeine.jcache.OSGiTest.sanity(OSGiTest.java:54)
from caffeine.
I can't find com.github.benmanes.caffeine.jcache.OSGiTest
. Maybe you need to push your latest to osgi
?
from caffeine.
Did you pull from upstream
? Its pushed
from caffeine.
Aha! My bad.
from caffeine.
This might also be due to JCache #326 or at least be a future blocker.
from caffeine.
Sorry, I've got no clue.
from caffeine.
Thanks for trying. It looks like Ehcache3's tests bypass the service loader so I'll try that tonight. I gave it a quick shot and it reported another not found error, so at least its a path to debug down.
from caffeine.
It turns out that the underling error message goes to standard error
, which is available as a separate tab in the html report. The problem is due jsr107 not exporting its packages, as noted in the bug report.
org.osgi.framework.BundleException: Unable to resolve com.github.ben-manes.caffeine.jcache [17](R 17.0): missing requirement [com.github.ben-manes.caffeine.jcache [17](R 17.0)] osgi.wiring.package; (osgi.wiring.package=javax.cache.configuration) Unresolved requirements: [[com.github.ben-manes.caffeine.jcache [17](R 17.0)] osgi.wiring.package; (osgi.wiring.package=javax.cache.configuration)]
at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4111)
at org.apache.felix.framework.Felix.startBundle(Felix.java:2117)
at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1371)
at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:308)
at java.lang.Thread.run(Thread.java:745)
from caffeine.
Can you try the snapshot jar and verify that it works for you? If so, I'll then release the update.
from caffeine.
Verified good.
from caffeine.
Awesome, thanks!
from caffeine.
Released. Might take a hour or two before all the mirrors get in sync. Thanks for the help on this one.
from caffeine.
Thanks for putting so much work into the tests! I use a lot of OSGi plugins, they all break the manifests all the time, you're the first person to actually add tests to fix it and keep it fixed. 👍
from caffeine.
Related Issues (20)
- Does `compute` renew the `expireAfterWrite` expiry? HOT 4
- Exceptions when "closing" a cache HOT 1
- Background refreshes not happening #2 HOT 5
- caffeine 2.9.2 deadlock HOT 5
- ClassCastException on expiry HOT 6
- Some `Expiry` implementations return `currentTime + desiredLength` instead of `desiredLength` HOT 7
- RemovalListener not always called in unit test. HOT 5
- Mark cache entries as non-evictable HOT 2
- refreshAll feature for CacheLoader HOT 3
- Is the version that supports JDK8 no longer updated? HOT 1
- notifyRejected: com.github.benmanes.caffeine.cache.BoundedLocalCache$BoundedLocalLoadingCache HOT 2
- Too many simple repetition of "multi put, multi get" results in immediate item eviction HOT 5
- Version 3.1.8 is not compatible with jdk21 HOT 2
- schedule() is not running exactly after expiry of each entry, it works only for first entry expiry HOT 4
- Race condition in computing write timestamp HOT 2
- Values currently being loaded shows up as `null` entries in `synchronous().asMap()` HOT 9
- Oldest Eviction option HOT 2
- When maximumValue and expireAfterAccessTime is used which is honored. HOT 1
- Compute BenchMark results comparison between Caffeine and ConcurrentHashMap HOT 3
- The GraalVM image building is successful, however, the execution fails HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from caffeine.