users@glassfish.java.net

Re: receive "Attempt to restart an already started EhCacheProvider." when usinging ejb3 with hibernate as persistence provider with glassfish b48

From: Art <ainfo_at_patteran.com>
Date: Thu, 01 Jun 2006 10:36:57 -0700

Temporarily resolved, here is the workaround pointed to by Petr Blaha:

http://www.netbeans.org/issues/show_bug.cgi?id=77232

Art wrote:
> I was just trying to use EJB3 with hibernate as persistence provider
> inside glassfish b48 and received the error shown below on server startup.
> Has anyone else seen this error? Since everything is supposed to happen
> automatically if the persistence.xml file is set correct I'm not sure
> what to do next. Any suggestions would be appreciated. I followed the
> suggestions on
>
> http://www.netbeans.org/kb/articles/hibernate-javaee.html
>
> using lib/ehcache-1.2.jar instead of lib/ehcache-1.1.jar, but this did
> not work either.
>
> Thanks.
>
> [#|2006-05-31T17:02:59.750-0700|WARNING|sun-appserver-pe9.0|javax.enterprise.system.core.classloading|_ThreadID=10;_Thre
> adName=main;_RequestID=a9ffbdc8-7be9-4c78-89c6-688382885770;|Attempt to
> restart an already started EhCacheProvider. Use sessionFactory.close()
> between repeated calls to buildSessionFactory. Consider using
> net.sf.ehcache.hibernate.Singleton EhCacheProvider. Error from ehcache
> was: Cannot parseConfiguration CacheManager. Attempt to create a new
> instance of Ca
> cheManager using the diskStorePath "C:\DOCUME~1\TEST\LOCALS~1\Temp\"
> which is already used by an existing CacheManage
> r. The source of the configuration was classpath.
> org.hibernate.cache.CacheException: Attempt to restart an already
> started EhCacheProvider. Use sessionFactory.close() b
> etween repeated calls to buildSessionFactory. Consider using
> net.sf.ehcache.hibernate.SingletonEhCacheProvider. Error fr
> om ehcache was: Cannot parseConfiguration CacheManager. Attempt to
> create a new instance of CacheManager using the disk
> StorePath "C:\DOCUME~1\TEST\LOCALS~1\Temp\" which is already used by an
> existing CacheManager. The source of the conf
> iguration was classpath.
> at
> org.hibernate.cache.EhCacheProvider.start(EhCacheProvider.java:133)
> at
> org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:180)
> at
> org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1213)
> at
> org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:631)
> at
> org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:760)
> at
> org.hibernate.ejb.Ejb3Configuration.createContainerEntityManagerFactory(Ejb3Configuration.java:350)
> at
> org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:119)
> at
> com.sun.enterprise.server.PersistenceUnitLoaderImpl.load(PersistenceUnitLoaderImpl.java:195)
> at
> com.sun.enterprise.server.PersistenceUnitLoaderImpl.load(PersistenceUnitLoaderImpl.java:106)
> at
> com.sun.enterprise.server.AbstractLoader.loadPersistenceUnits(AbstractLoader.java:849)
> at
> com.sun.enterprise.server.ApplicationLoader.load(ApplicationLoader.java:179)
> at
> com.sun.enterprise.server.TomcatApplicationLoader.load(TomcatApplicationLoader.java:113)
> at
> com.sun.enterprise.server.AbstractManager.load(AbstractManager.java:206)
> at
> com.sun.enterprise.server.ApplicationLifecycle.onStartup(ApplicationLifecycle.java:204)
> at
> com.sun.enterprise.server.ApplicationServer.onStartup(ApplicationServer.java:326)
> at
> com.sun.enterprise.server.ondemand.OnDemandServer.onStartup(OnDemandServer.java:112)
> at com.sun.enterprise.server.PEMain.run(PEMain.java:326)
> at com.sun.enterprise.server.PEMain.main(PEMain.java:260)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:585)
>
> at com.sun.enterprise.server.PELaunch.main(PELaunch.java:272)
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>