Grails не может найти customCacheKeyGenerator

1

Когда я grails run-app я не получаю эту ошибку. Однако, когда я упаковываю его в качестве файла войны и загружаю его в Tomcat:

2014-07-09 10:54:24,386 [localhost-startStop-1] ERROR context.GrailsContextLoaderListener  - Error initializing the application: Error creat
ing bean with name 'org.springframework.cache.interceptor.CacheInterceptor#0': Cannot resolve reference to bean 'customCacheKeyGenerator' wh
ile setting bean property 'keyGenerator'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean w
ith name 'customCacheKeyGenerator': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException:
Could not instantiate bean class [grails.plugin.cache.CustomCacheKeyGenerator]: Constructor threw exception; nested exception is java.lang.R
untimeException: java.lang.ClassNotFoundException: org.springframework.cache.interceptor.SimpleKeyGenerator
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.cache.interceptor.CacheIntercept
or#0': Cannot resolve reference to bean 'customCacheKeyGenerator' while setting bean property 'keyGenerator'; nested exception is org.spring
framework.beans.factory.BeanCreationException: Error creating bean with name 'customCacheKeyGenerator': Instantiation of bean failed; nested
 exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [grails.plugin.cache.CustomCacheKeyGene
rator]: Constructor threw exception; nested exception is java.lang.RuntimeException: java.lang.ClassNotFoundException: org.springframework.c
ache.interceptor.SimpleKeyGenerator
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:745)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'customCacheKeyGenerator': Instantiation o
f bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [grails.plugin.cac
he.CustomCacheKeyGenerator]: Constructor threw exception; nested exception is java.lang.RuntimeException: java.lang.ClassNotFoundException:
org.springframework.cache.interceptor.SimpleKeyGenerator
        ... 5 more
Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [grails.plugin.cache.CustomCacheKeyGenerat
or]: Constructor threw exception; nested exception is java.lang.RuntimeException: java.lang.ClassNotFoundException: org.springframework.cach
e.interceptor.SimpleKeyGenerator
        ... 5 more
Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException: org.springframework.cache.interceptor.SimpleKeyGenerator
        at grails.plugin.cache.CustomCacheKeyGenerator.<init>(CustomCacheKeyGenerator.java:46)
        ... 5 more
Caused by: java.lang.ClassNotFoundException: org.springframework.cache.interceptor.SimpleKeyGenerator
        at java.lang.Class.forName(Class.java:190)
        at grails.plugin.cache.CustomCacheKeyGenerator.<init>(CustomCacheKeyGenerator.java:43)
        ... 5 more
2014-07-09 10:54:24,392 [localhost-startStop-1] ERROR context.GrailsContextLoaderListener  - Error initializing Grails: Error creating bean
with name 'org.springframework.cache.interceptor.CacheInterceptor#0': Cannot resolve reference to bean 'customCacheKeyGenerator' while setti
ng bean property 'keyGenerator'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name
'customCacheKeyGenerator': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not
 instantiate bean class [grails.plugin.cache.CustomCacheKeyGenerator]: Constructor threw exception; nested exception is java.lang.RuntimeExc
eption: java.lang.ClassNotFoundException: org.springframework.cache.interceptor.SimpleKeyGenerator
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.cache.interceptor.CacheIntercept
or#0': Cannot resolve reference to bean 'customCacheKeyGenerator' while setting bean property 'keyGenerator'; nested exception is org.spring
framework.beans.factory.BeanCreationException: Error creating bean with name 'customCacheKeyGenerator': Instantiation of bean failed; nested
 exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [grails.plugin.cache.CustomCacheKeyGene
rator]: Constructor threw exception; nested exception is java.lang.RuntimeException: java.lang.ClassNotFoundException: org.springframework.c
ache.interceptor.SimpleKeyGenerator
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:745)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'customCacheKeyGenerator': Instantiation o
f bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [grails.plugin.cac
he.CustomCacheKeyGenerator]: Constructor threw exception; nested exception is java.lang.RuntimeException: java.lang.ClassNotFoundException:
org.springframework.cache.interceptor.SimpleKeyGenerator
        ... 5 more
Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [grails.plugin.cache.CustomCacheKeyGenerat
or]: Constructor threw exception; nested exception is java.lang.RuntimeException: java.lang.ClassNotFoundException: org.springframework.cach
e.interceptor.SimpleKeyGenerator
        ... 5 more
Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException: org.springframework.cache.interceptor.SimpleKeyGenerator
        at grails.plugin.cache.CustomCacheKeyGenerator.<init>(CustomCacheKeyGenerator.java:46)
        ... 5 more
Caused by: java.lang.ClassNotFoundException: org.springframework.cache.interceptor.SimpleKeyGenerator
        at java.lang.Class.forName(Class.java:190)
        at grails.plugin.cache.CustomCacheKeyGenerator.<init>(CustomCacheKeyGenerator.java:43)
        ... 5 more

Я переключился на Hibernate 4 из 3. Я также добавил следующие зависимости, чтобы попытаться разрешить это безрезультатно:

compile 'org.hibernate:hibernate-ehcache:4.3.5.Final'
compile 'org.springframework:spring-context:4.0.5.RELEASE'
Теги:
groovy
hibernate
grails

1 ответ

0
Лучший ответ

Решение:

  1. Обновлен с весеннего плагина ядра 2.0.0.RC3 до RC4.
  2. grails refresh-dependencies Ran grails refresh-dependencies
  3. Сброс target и plugins.
  4. Ran grails war

Ещё вопросы

Сообщество Overcoder
Наверх
Меню