在Glassfish 4上部署Grails应用程序错误

时间:2017-07-31 10:52:24

标签: grails glassfish

我试图在Glassfish 4上部署Grails应用程序,但它失败了并得到了以下错误:

Exception Occurred :Error occurred during deployment: Exception while loading the app : java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManagerPostProcessor': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Invocation of init method failed; nested exception is org.hibernate.cache.NoCacheRegionFactoryAvailableException: Second-level cache is used in the application, but property hibernate.cache.region.factory_class is not given; please either disable second level cache or set correct region factory using the hibernate.cache.region.factory_class setting and make sure the second level cache provider (hibernate-infinispan, e.g.) is available on the classpath.. Please see server.log for more details.]]

我无法弄清楚导致此错误的原因,我在google上试过但没什么用处

2 个答案:

答案 0 :(得分:1)

在整个文件中的DataSource.groovy评论driverClassNamedialectproduction部分评论URL并使用URL } jndiName并成功部署在GlassFish上,没有上一个错误。希望这种解决方法可以帮助其他人

答案 1 :(得分:0)

错误的根本原因与休眠缓存配置有关:

Invocation of init method failed; nested exception is org.hibernate.cache.NoCacheRegionFactoryAvailableException:
Second-level cache is used in the application, but property hibernate.cache.region.factory_class is not given;
please either disable second level cache or set correct region factory using the hibernate.cache.region.factory_class setting and make sure the second level cache provider (hibernate-infinispan, e.g.) is available on the classpath..

我建议查看/比较缓存设置并检查缓存提供程序。