Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8086783
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T18:33:24+00:00 2026-06-05T18:33:24+00:00

I am trying to use the following jcache-ehcache library to as a wrapper so

  • 0

I am trying to use the following jcache-ehcache library to as a wrapper so that I can use Ecache as my JCache implementation.

These are my maven dependancies:

    <dependency>
        <groupId>net.sf.ehcache</groupId>
        <artifactId>ehcache</artifactId>
        <version>2.1.0</version>
        <type>pom</type>
    </dependency>

    <dependency>
        <groupId>net.sf.ehcache</groupId>
        <artifactId>ehcache-jcache</artifactId>
        <version>1.4.0-beta1</version>
    </dependency>

In my Spring configuration file, I have the following beans:

<bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean">
    <property name="shared" value="true"/>
</bean>


<bean id="userCache" class="org.springframework.cache.ehcache.EhCacheFactoryBean">
    <property name="cacheName" value="userCache"/>
    <property name="cacheManager" ref="cacheManager"/>
    <property name="diskPersistent" value="false"/>
</bean>

<bean id="jcacheUserCache" class="net.sf.ehcache.jcache.JCache">
    <constructor-arg index="0" ref="userCache"/>
</bean>

And my Ehcache.xml (on classpath root) file contains the userCache region definition:

  <cache name="userCache" maxElementsInMemory="10000"
  maxElementsOnDisk="0" eternal="false" overflowToDisk="false"
  diskSpoolBufferSizeMB="20" timeToIdleSeconds="0"
  timeToLiveSeconds="0" memoryStoreEvictionPolicy="LFU"
  statistics = "true">
  </cache>

On initialization, I get the following error:

Exception in thread "main" org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'jcacheUserCache' defined in class path resource [application-context.xml]: Unsatisfied dependency expressed through constructor argument with index 1 of type [net.sf.ehcache.jcache.JCacheManager]: Ambiguous constructor argument types - did you specify the correct bean references as constructor arguments?

Can anyone provide any assistance with how to correctly initialise this jCacheUserCache bean?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T18:33:25+00:00Added an answer on June 5, 2026 at 6:33 pm

    The constructor of net.sf.ehcache.jcache.JCache has three arguments, but you only provided the first one when creating the jcacheUserCache bean. The error you get is about the missing second parameter (of type net.sf.ehcache.jcache.JCacheManager).

    The constructor of JCache looks like this:

    public JCache(Ehcache ehcache, JCacheManager cacheManager, ClassLoader classLoader) {
        // ...
    }
    

    So you also need to provide a JCacheManager and a ClassLoader as constructor arguments.

    (see JCache.java here)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to use this following script to load a page so that I can
I'm trying to use following implementation of the ObservableDictionary: ObservableDictionary (C#) . When I'm
I'm trying to use the following library in my Android app: http://www.jjoe64.com/p/graphview-library.html I donwloaded
I am trying to use the following archetype. https://github.com/akquinet/android-archetypes/wiki/Android-release-archetype I can follow the instructions
I'm trying to use the following as a URL that executes javascript: javascript:var field
Trying to use the following demo example, using the 80px x 80px snap to
I am trying to use the following code, to display $formcode, which is the
I'm trying to use the following code # LOAD XML FILE $XML = new
I'm trying to use the following code to make an image fadeOut and, only
I'm trying to use the following code and it still strips out all the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.