-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Cache initialization problem
PostPosted: Mon Oct 10, 2005 11:21 am 
Regular
Regular

Joined: Fri Sep 17, 2004 10:51 am
Posts: 61
Location: Rimini, Italy
Hibernate version: 3.0.5

I'm sometimes experiencing this problem during Hibernate init phase:
Code:
org.hibernate.HibernateException: Could not instantiate cache implementation
        at org.hibernate.cache.CacheFactory.createCache(CacheFactory.java:64)
        at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:199)
        at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1005)
        at ejb.persistence.HibernateUtils.<clinit>(HibernateUtils.java:43)
        at ejb.auth.UserManagerEJB.getSession(UserManagerEJB.java:34)
        at ejb.auth.UserManagerEJB.findWEBUserByPrincipal(UserManagerEJB.java:132)
[snip]
Caused by: org.hibernate.cache.CacheException: net.sf.ehcache.ObjectExistsException: Cache ejb.catalog.Categoria al
ready exists
        at org.hibernate.cache.EhCacheProvider.buildCache(EhCacheProvider.java:105)
        at org.hibernate.cache.CacheFactory.createCache(CacheFactory.java:61)
        ... 17 more
Caused by: net.sf.ehcache.ObjectExistsException: Cache ejb.catalog.Categoria already exists
        at net.sf.ehcache.CacheManager.addCache(CacheManager.java:301)
        at org.hibernate.cache.EhCacheProvider.buildCache(EhCacheProvider.java:98)
        ... 18 more


I've checked both hibernate.cfg.xml and ehcache.xml, there're no duplicate class entry. Usually, restarting the application server solves the problem.

I've also noticed a duplicate log entry, right before the error:
Code:
05:01:49,240  WARN EhCacheProvider:97 - Could not find configuration [ejb.cart.OrderAddress]; using defaults.
05:01:49,344  WARN EhCacheProvider:97 - Could not find configuration [ejb.catalog.Categoria]; using defaults.
05:01:49,366  WARN EhCacheProvider:97 - Could not find configuration [ejb.catalog.Categoria]; using defaults.


Hibernate is initialized in a static block, then bound to JNDI using EJB session pattern.
I've noticed this occurs often when there are several request during startup. Is there a concurrency issue with ehcache ?

_________________
--
Marco


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.