Showing posts with label context. Show all posts
Showing posts with label context. Show all posts

May 4, 2014

How to expose spring ehcache 2.8.2 to jmx

In this version ehcache statistics is enabled by default.

I am using ehcache as spring cache.

it's easy

find the place where you define your config
like 'net.sf.ehcache.config.Configuration config = new net.sf.ehcache.config.Configuration()'

in my case i use annotations therefore i got this line in the code, in your case, maybe defined as bean inside the xml .

add the following :
      'config.setMonitoring(net.sf.ehcache.config.Configuration.Monitoring.ON.name());'

Yeah i wondered too why it's not possible to give the enum only .. maybe in the next version... '

Worked for me .
Dor

Nov 23, 2010

Initializing LdapContextSource localy instead of using spring xml

If you decide to work with internal coded LdapContextSource initialize instead of using spring injection (external application context xml file). There is one important thing you shouldn't forget:
Call "afterPropertiesSet()" method to finish up initialization.
Failing to do so would probably led you to this failure / exception as i had:
"org.springframework.ldap.core.support.AbstractContextSource.getAuthenticatedEnv(AbstractContextSource.java:449) etc.."
Hopefully that this helps...
Dor