Hi
I am trying to integrate Infinispan specific JCache in Glassfish 3.1.1.
When I was trying to deploy an Infinispan cdi example on glassfish, I am
getting the error on Injecting the Javax.cache class as well as
DefaultCacheManager. The error is like...
SEVERE: Exception while loading the app : WELD-001408 Unsatisfied
dependencies for type [DefaultCacheManager] with qualifiers [@Default] at
injection point [[field] @Inject private
com.xxxx.xxxxx.xxx.CustomerFacade.defaultCacheManager]
And also when I am trying to use CacheResultInterceptor on a method, the
method result never gets cached onto the greeting-cache.The code is like
this,
public void cacheTest() { Thread.currentThread().setContextClassLoader(
this.getClass().getClassLoader()); EmbeddedCacheManager manager =
createCacheConfig(); Set<String> cacheList = manager.getCacheNames(); // new
// DefaultCacheManager().getCacheNames(); for (String cache : cacheList) {
System.out.println("Cache name " + cache); } defaultCache =
manager.getCache("test-cache"); defaultCache.put("aa", "AA"); String user =
"User"; greet(user); Set<String> keys = defaultCache.keySet(); for (String
key : keys) { System.out.println("Key is -" + key + "Value is -" +
defaultCache.get(key)); } } @CacheResult(cacheName = "test-cache") public
String greet(@CacheKeyParam String user) { user += "Hello"; return user; }
public EmbeddedCacheManager createCacheConfig() { EmbeddedCacheManager
manager = new DefaultCacheManager(); Configuration conf = new
Configuration();
conf.fluent().eviction().strategy(EvictionStrategy.FIFO).maxEntries(10)
.expiration().maxIdle(1200000L).build(); conf.fluent().clustering().sync();
manager.start(); manager.defineConfiguration("test-cache", conf); return
manager; }
I have defined the CacheResultInterceptor in beans.xml and copied into
web-inf folder. In th server.log I see the error message like
Valid java EE environment is not available.
I have tried to integrate this CDI into a EJB project also, still the same
problem.beans.xml is created in meta-inf folder in with the Interceptors
defined in it.
I think the problem is with the Weld, which is bundled with glassfish 3.1.1.
I tried even using the latest weld-osgi bundle 1.1.2 jar file by replacing
the existing glassfish jar file in the modules folder. Still the problem
exists. I have no clue how to clear those errors in glassfish 3.1.1
I would appreciate if someone can help me integrating Infinispan CDI in
Glassfish 3.1.1
--
[Message sent by forum member 'rajj_s']
View Post: http://forums.java.net/node/860016