-
Bug
-
Resolution: Done
-
Major
-
1.1.3.Final, 2.0.3.Final
-
None
Using Infinispan Cache via CDI cause ClassCastException
Setup
@Produces @ApplicationScoped public EmbeddedCacheManager create() { return new DefaultCacheManager(...); } @Produces @ApplicationScoped public Cache<String, Attachment> create(EmbeddedCacheManager manager) { return manager.getCache(); }
@Inject private Cache<String, Attachment> cache; public Attachment store(Attachment entity) { cache.getAdvancedCache().put(entity.getId(), entity); return entity; }
cache.getAdvancedCache() cause ClassCastException
Caused by: java.lang.ClassCastException: org.jboss.weld.proxies.BasicCache$Cache$ConcurrentMap$Lifecycle$Listenable$Map$449205494$Proxy$_$$_WeldClientProxy cannot be cast to org.infinispan.AdvancedCache
at org.jboss.weld.proxies.BasicCache$Cache$ConcurrentMap$Lifecycle$Listenable$Map$449205494$Proxy$_$$_WeldClientProxy.getAdvancedCache(BasicCache$Cache$ConcurrentMap$Lifecycle$Listenable$Map$449205494$Proxy$_$$_WeldClientProxy.java) [weld-core-1.1.13.Final-redhat-1.jar:]
at org.cedj.geekseek.domain.attachment.AttachmentRepository.store(AttachmentRepository.java:32) [df4da6a4-e82c-403c-9815-03a170096317.jar:]
- relates to
-
WELD-2245 ClassCastException when unwrapping proxied EntityManager
- Resolved