如何使用oscache配置grails1.2?

发布于 2024-09-02 11:36:52 字数 1350 浏览 3 评论 0原文

我这样做:

DataSource.groovy:
hibernate {
    cache.use_second_level_cache=true
    cache.use_query_cache=true
    cache.provider_class='com.opensymphony.oscache.hibernate.OSCacheProvider'
}

 BuildConfig.groovy:
 inherits( "global" ) {
        // uncomment to disable ehcache
        excludes 'ehcache'
    }

runtime ("opensymphony:oscache:2.4.1") { 
 excludes 'jms', 'commons-logging', 'servlet-api' 
   } 

我只得到这个错误:

commons.DefaultGrailsApplication The class [com.ai.scenter.service.reschange.ResourceChangeAdapter] was not found when attempting to load Grails application. Skipping.
commons.DefaultGrailsApplication The class [com.ai.scenter.service.reschange.ResourceChangeService] was not found when attempting to load Grails application. Skipping.
hibernate.ConfigurableLocalSessionFactoryBean There was an error configuring the Hibernate second level cache: could not instantiate CacheProvider [com.opensymphony.oscache.hibernate.OSCacheProvide]
hibernate.ConfigurableLocalSessionFactoryBean This is normally due to one of two reasons. Either you have incorrectly specified the cache provider class name in [DataSource.groovy] or you do not have the cache provider on your classpath (eg. runtime ("net.sf.ehcache:ehcache:1.6.1"))

我该怎么做?

I do this :

DataSource.groovy:
hibernate {
    cache.use_second_level_cache=true
    cache.use_query_cache=true
    cache.provider_class='com.opensymphony.oscache.hibernate.OSCacheProvider'
}

and in

 BuildConfig.groovy:
 inherits( "global" ) {
        // uncomment to disable ehcache
        excludes 'ehcache'
    }

runtime ("opensymphony:oscache:2.4.1") { 
 excludes 'jms', 'commons-logging', 'servlet-api' 
   } 

but i only get this error :

commons.DefaultGrailsApplication The class [com.ai.scenter.service.reschange.ResourceChangeAdapter] was not found when attempting to load Grails application. Skipping.
commons.DefaultGrailsApplication The class [com.ai.scenter.service.reschange.ResourceChangeService] was not found when attempting to load Grails application. Skipping.
hibernate.ConfigurableLocalSessionFactoryBean There was an error configuring the Hibernate second level cache: could not instantiate CacheProvider [com.opensymphony.oscache.hibernate.OSCacheProvide]
hibernate.ConfigurableLocalSessionFactoryBean This is normally due to one of two reasons. Either you have incorrectly specified the cache provider class name in [DataSource.groovy] or you do not have the cache provider on your classpath (eg. runtime ("net.sf.ehcache:ehcache:1.6.1"))

how can i do it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

哽咽笑 2024-09-09 11:36:52

根据您的日志,您拼写错误了提供商,您错过了最后一个“r”字母。

om.opensymphony.oscache.hibernate.OSCacheProvide[r]

According to your logs, you misspelled the provider, you're missing the final 'r' letter.

om.opensymphony.oscache.hibernate.OSCacheProvide[r]
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文