Hibernate: org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.spi.CacheImplementor]

与世无争的帅哥 提交于 2019-12-13 20:51:47

问题


I am attempting to deploy an application on a glassfish 4 server on my local machine. When I copy the .war file into the autodeploy directory, the glassfish log returns exceptions and the application does not appear in the list of applications, on the server's admin console. I've consulted with a local colleague on this and based on comparisons to working instances, we believe the traces from the Glassfish server, shown below, may have something to do with the cause:

Server Trace:

Caused by: org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.spi.CacheImplementor]
at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:186)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:150)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:131)
at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:264)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1760)
at org.hibernate.ejb.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:96)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:913)
... 60 more
Caused by: org.hibernate.cache.CacheException: net.sf.ehcache.CacheException: Error configuring from null. Initial cause was null
    at org.hibernate.cache.ehcache.EhCacheRegionFactory.start(EhCacheRegionFactory.java:110)
    at org.hibernate.internal.CacheImpl.<init>(CacheImpl.java:70)
    at org.hibernate.engine.spi.CacheInitiator.initiateService(CacheInitiator.java:40)
    at org.hibernate.engine.spi.CacheInitiator.initiateService(CacheInitiator.java:35)
    at org.hibernate.service.internal.SessionFactoryServiceRegistryImpl.initiateService(SessionFactoryServiceRegistryImpl.java:91)
    at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:176)
    ... 66 more
Caused by: net.sf.ehcache.CacheException: Error configuring from null. Initial cause was null
    at net.sf.ehcache.config.ConfigurationFactory.parseConfiguration(ConfigurationFactory.java:105)
    at org.hibernate.cache.ehcache.internal.util.HibernateUtil.loadAndCorrectConfiguration(HibernateUtil.java:63)
    at org.hibernate.cache.ehcache.EhCacheRegionFactory.start(EhCacheRegionFactory.java:93)
    ... 71 more
Caused by: java.lang.NullPointerException
    at net.sf.ehcache.config.ConfigurationFactory.parseConfiguration(ConfigurationFactory.java:102)
    ... 73 more

If a full stack trace is needed or any further info or edits are needed, let me know. Otherwise, I will await response.


回答1:


Problem solved:

I mispelled the ehcache property, in the Glassfish server.

Lesson Learned. :)



来源:https://stackoverflow.com/questions/18149339/hibernate-org-hibernate-service-spi-serviceexception-unable-to-create-requeste

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!