How to use CDI Injected JDG Cache when JDG is installed via modules in EAP

Solution Verified - Updated -

Issue

  • How to use CDI Injected JDG JCache when JDG libraries are installed via modules in EAP
  • My JDG application with CDI injection for JCache is not working if I use the modules for EAP, if I have the infinispan jar files in my application it will work correctly, what is wrong?
  • There are warn messages in the logfile if a JDG JCache application is started, how can I avoid it?
 WARN  [org.jboss.as.weld] (MSC service thread 1-1) JBAS016017: Using deployment classloader to load proxy classes for module org.infinispan.cdi.embedded:jdg-7.1. Package-private access will not work. To fix this the module should declare dependencies on [org.jboss.weld.core, org.javassist]
  • An application using JDG JCache API and CDI annotations to inject the references fail with NullPointerExceptions in infinispan classes
ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/infinispan-cdi].[FacesServlet]] (http-127.0.0.1:8080-1) JBWEB000236: Servlet.service() for servlet FacesServlet threw exception: java.lang.NullPointerException
    at org.infinispan.cdi.common.util.ContextualReference.create(ContextualReference.java:40) [infinispan-cdi-common.jar:8.4.0.Final-redhat-2]
    at org.infinispan.cdi.embedded.InfinispanExtensionEmbedded$1.create(InfinispanExtensionEmbedded.java:97) [infinispan-cdi-embedded.ja

Environment

  • Red Hat JBoss Data Grid (JDG)
    • 6.x
    • 7.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.