Java 休眠:org.hibernate.service.spi.ServiceException:无法创建请求的服务 [org.hibernate.engine.spi.CacheImplementor]

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/18149339/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-11 22:48:06  来源:igfitidea点击:

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

javahibernateglassfish-4

提问by user2668237

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:

我正在尝试在本地机器上的 glassfish 4 服务器上部署应用程序。当我将 .war 文件复制到 autodeploy 目录中时,glassfish 日志返回异常并且该应用程序没有出现在服务器管理控制台的应用程序列表中。我已经就此咨询了一位当地同事,根据与工作实例的比较,我们认为来自 Glassfish 服务器的痕迹(如下所示)可能与原因有关:

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.

如果需要完整的堆栈跟踪或需要任何进一步的信息或编辑,请告诉我。否则,我将等待回应。

回答by user2668237

Problem solved:

问题解决了:

I mispelled the ehcache property, in the Glassfish server.

我拼错了 Glassfish 服务器中的 ehcache 属性。

Lesson Learned. :)

学过的知识。:)