In my usual style I keep having problems (*nothing* is ever easy for me, maybe I'm just plain stupid...)
I am trying to figure out if it's my ehcache settings that need to be tweaked to get some more juice out of the batching so I have added the following ehcache.xml to my classpath. The cache name is the same as the name of the domain object I want to cache and have in my List to iterate over.
Code:
<cache name="com.lehman.mis.model.TradeFinal"
maxElementsInMemory="50000"
eternal="false"
timeToIdleSeconds="900"
timeToLiveSeconds="3600"
overflowToDisk="false"
/>
And when starting I get the following exception when my HibernateUtil class tries to configure the cache:
java.lang.NoSuchMethodError
at net.sf.ehcache.CacheException.<init>(CacheException.java:97)
at net.sf.ehcache.CacheManager.configure(CacheManager.java:156)
at net.sf.ehcache.CacheManager.<init>(CacheManager.java:127)
at net.sf.ehcache.CacheManager.create(CacheManager.java:179)
at net.sf.ehcache.CacheManager.getInstance(CacheManager.java:195)
at net.sf.ehcache.hibernate.Plugin.<init>(Plugin.java:92)
at net.sf.ehcache.hibernate.Provider.buildCache(Provider.java:89)
at net.sf.hibernate.cfg.Configuration.configureCaches(Configuration.java:1067)
at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:738)
at com.lehman.mis.utils.HibernateUtil.<clinit>(HibernateUtil.java:28)
at com.lehman.mis.servlet.DataHandler.UpdateCommissionOnZeroTrades(DataHandler.java:1116)
at com.lehman.mis.servlet.DataHandler.createReport(DataHandler.java:694)
at com.lehman.mis.servlet.MISServlet.running(MISServlet.java:412)
at com.lehman.mis.servlet.FeedReader.run(FeedReader.java:73)
at com.lehman.mis.servlet.MISServlet.init(MISServlet.java:69)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:935)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:823)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3422)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3623)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:754)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:363)
at org.apache.catalina.core.StandardService.start(StandardService.java:497)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:2190)
at org.apache.catalina.startup.Catalina.start(Catalina.java:512)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
at org.apache.catalina.startup.Catalina.process(Catalina.java:180)
at java.lang.reflect.Method.invoke(Native Method)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)
My util class for Hibernate follows the ThreadLocal pattern suggested on the site.
Could this be a thread related problem or have I totally missed something in ehcache.xml? Is it me or is it strange that I get an Exception in the ehcache exception class?