A little help

281 views
Skip to first unread message

rossputin

unread,
Jul 1, 2010, 9:58:25 AM7/1/10
to Ehcache Spring Annotations
Hi Guys.

Just checking that this line is right :

<bean id="ehCacheManager"
class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean"/>

As I am getting :

java.lang.ClassNotFoundException:
org.springframework.cache.ehcache.EhCacheManagerFactoryBean

Could be my pom.xml config.

Cheers,

-- Ross

Nicholas Blair

unread,
Jul 1, 2010, 10:05:43 AM7/1/10
to ehcache-sprin...@googlegroups.com
Can you provide a little more context about when you receive the
ClassNotFoundException?
Post your pom.xml and we'll try to help.

rossputin

unread,
Jul 1, 2010, 10:12:28 AM7/1/10
to Ehcache Spring Annotations
Hi.

Sure, when running my unit tests which use my live Spring config I get
this. Currently in my pom I have:

<dependency>
<groupId>com.googlecode.ehcache-spring-annotations</groupId>
<artifactId>ehcache-spring-annotations</artifactId>
<version>1.1.1</version>
<exclusions>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
</exclusion>
</exclusions>
</dependency>

I am excluding the dependencies in there as it caused a
misconfiguration, I am already pulling in Spring 3.0.3.RELEASE. Do I
also need another dependency for
org.springframework.cache.ehcache.EhCacheManagerFactoryBean ?

Thanks for your help,

-- Ross

Eric Dalquist

unread,
Jul 1, 2010, 10:23:59 AM7/1/10
to ehcache-sprin...@googlegroups.com
You need the spring-context-support library which contains EhCacheManagerFactoryBean

rossputin

unread,
Jul 1, 2010, 11:02:07 AM7/1/10
to Ehcache Spring Annotations
Thanks guys.

That gets me passed that one :-)

I used to do something like:

<ehcache:config configLocation="classpath:ehcache.xml" />

<ehcache:annotations>
<ehcache:caching id="someCacheModel" cacheName="someCache" />
</ehcache:annotations>

with spring-modules...

what is the new equivalent ?

Cheers,

-- Ross

Eric Dalquist

unread,
Jul 1, 2010, 11:20:28 AM7/1/10
to ehcache-sprin...@googlegroups.com

rossputin

unread,
Jul 1, 2010, 11:30:26 AM7/1/10
to Ehcache Spring Annotations
Apologies.

I tried that first, but it did not work, I assumed it was because I
needed to do something else, it turned out it was because my
ehcache.xml was not found on the class path.

Everything works fine.

Sorry for wasting your time.

-- Ross

On Jul 1, 4:20 pm, Eric Dalquist <eric.dalqu...@gmail.com> wrote:
> Take a look at:http://code.google.com/p/ehcache-spring-annotations/wiki/SwitchingFro...

Eric Dalquist

unread,
Jul 1, 2010, 11:41:11 AM7/1/10
to ehcache-sprin...@googlegroups.com
No problem, your question prompted me to put that wiki page together so hopefully others can find it useful too.

-Eric

KathyMc

unread,
Jul 30, 2015, 12:10:33 PM7/30/15
to Ehcache Spring Annotations, eric.d...@gmail.com
Hi,
I am getting the "Cannot find class [org.springframework.cache.ehcache.EhCacheCacheManagerFactoryBean]" error but I do have the spring-context-support dependency in my pom.  What else could cause this?
Thanks

Reply all
Reply to author
Forward
0 new messages