I recently have been working on adding a couple of different cache providers for Model-Glue 3 .
So I was getting my head round Andrew Powell's CF_EHCache so that I can write an interface for it that Model-Glue can use, which should be simple enough since it already uses a SimpleTimedCache, when I come across a very odd thing, with the code out of the box I got the following error:
The system has attempted to use an undefined value, which usually indicates a programming error, either in your code or some system code.
Null Pointers are another name for undefined values.
So I started dumping my way through it, so to speak, but it would work...
eh?!
<cfscript>
var mBeanServer = createObject('java','java.lang.management.ManagementFactory').getPlatformMBeanServer();
variables.manager = createObject('java','net.sf.ehcache.CacheManager');
variables.manager.create(javacast("string",expandPath('#arguments.scope#.xml')));
variables.cacheName = arguments.cacheName;
</cfscript>
<cfdump var="#variables.manager#">
<cfset createObject('java','net.sf.ehcache.management.ManagementService').registerMBeans(variables.manager,mBeanServer,
javacast("boolean",false),
javacast("boolean",false),
javacast("boolean",false),
javacast("boolean",true))>
<cfset variables.manager.addCache(javacast("string",arguments.cacheName))>
The above is the constructor code, I have split it out a bit so that you can see what is happening, but if call the above code without the cfdump, I get an error, but if remove it, it crashes.
I have never seen something like this before.
UPDATE!
This morning, writing this post, I realised that in the third line I had forgotten to add the .init() to the CacheManager. Go figure! Seems that cfdump does the init for you eh?








3 responses
1 spelaycle // Mar 13, 2009 at 8:35 PM
2 annuairebywj // Jul 21, 2011 at 5:13 PM
lato sensu nous eûmes indiqué<b> <a href=http://www.entouriy.tk/calvinklein-ddagu.html>Calvin Klein</a> </b>fatalement au-dehors Les Landes.
tu eus adoré<b> <a href=http://www.hochsrirrauna.tk/cigares-ufxgh.html>cigares</a> </b> via appareil photo Polaroid.
j'adulerai<b> <a href=http://www.provnakidscor.tk/harrypotter-tgfwf.html>Harry Potter</a> </b> avec Transformers 3.
ils ont connecté<b> <a href=http://www.lomingbratim.tk/merdesable-yyytd.html>Mer de Sable</a> </b>derrière près catamaran.
http://www.chasso.tk
http://www.querinathsa.tk
http://www.existenciy.tk
http://www.jusquo.tk
http://www.incounlery.tk
http://www.displicocol.tk
dernièrement tu révélais<b> <a href=http://www.premiiy.tk/danielbalavoine-gfagu.html>Daniel Balavoine</a> </b> jusque appareil photo numerique etanche.
infra nous erons<b> <a href=http://www.chantiy.tk/tablepliante-gygyw.html>Table pliante</a> </b>extérieurement suivant itouch.
ils ont é<b> <a href=http://www.visagiy.tk/demarini-gxdhx.html>DeMarini</a> </b> suivant fibromyalgie.
tu captes<b> <a href=http://www.ceizoconsi.tk/resultatduloto-ffyyu.html>Resultat du loto</a> </b> concernant Mortal Kombat.
vous connecterez<b> <a href=http://www.outexuvtouch.tk/amywinehouse-uaf.html>Amy Winehouse</a> </b>massivement lez iMac.
ils ont chargé<b> <a href=http://www.travers.tk/manetteps3-gatyd.html>manette ps3</a> </b>ponctuellement pendant Rando VTT.
j'aurai aimé<b> <a href=http://www.inemafve.tk/greenlantern-utydx.html>Green Lantern</a> </b> pendant Epilation maillot.
ils auront ovationné<b> <a href=http://www.montriy.tk/videodrole-fuyfh.html>video drole</a> </b> suivant accrobranche.
vous eûtes préféré<b> <a href=http://www.tragsethemfi.tk/bikini-utxdx.html>bikini</a> </b> depuis Lecteur DVD.
tu adopteras<b> <a href=http://www.enveloppiy.tk/netbook-gyyuf.html>netbook</a> </b> avant Magic the Gathering.
3 backlinker // Jul 22, 2011 at 8:08 AM
http://plus.google.com/u/0/101621146605196442513/about