java - EHCache issue with localCacheEnabled and Cache replicated between apps -
i'm getting exception when trying access app making me crazy. tried many variants none of them worked. exception is:
[2014-06-27t09:57:07.058+0200] [glassfish 4.0] [info] [] [] [tid: _threadid=44 _threadname=thread-3] [timemillis: 1403855827058] [levelvalue: 800] [[ error 27/06/2014 09:57:07.055 [jk-connector(2)] find failed: net.sf.ehcache.cacheexception: uncaught exception in setpinned() - pinning not supported when local cache disabled]] [2014-06-27t09:57:07.081+0200] [glassfish 4.0] [severe] [] [] [tid: _threadid=44 _threadname=thread-4] [timemillis: 1403855827081] [levelvalue: 1000] [[ org.hibernate.cache.cacheexception: net.sf.ehcache.cacheexception: uncaught exception in setpinned() - pinning not supported when local cache disabled @ net.sf.ehcache.hibernate.regions.ehcachetransactionaldataregion.put(ehcachetransactionaldataregion.java:151) @ net.sf.ehcache.hibernate.regions.ehcachetransactionaldataregion.put(ehcachetransactionaldataregion.java:126) @ net.sf.ehcache.hibernate.strategy.abstractreadwriteehcacheaccessstrategy.putfromload(abstractreadwriteehcacheaccessstrategy.java:93) @ net.sf.ehcache.hibernate.nonstop.nonstopawareentityregionaccessstrategy.putfromload(nonstopawareentityregionaccessstrategy.java:180) @ org.hibernate.engine.twophaseload.initializeentity(twophaseload.java:179) @ org.hibernate.loader.loader.initializeentitiesandcollections(loader.java:877) @ org.hibernate.loader.loader.doquery(loader.java:752) @ org.hibernate.loader.loader.doqueryandinitializenonlazycollections(loader.java:259) @ org.hibernate.loader.loader.dolist(loader.java:2232) @ org.hibernate.loader.loader.listusingquerycache(loader.java:2161) @ org.hibernate.loader.loader.list(loader.java:2121) @ org.hibernate.loader.criteria.criterialoader.list(criterialoader.java:118) @ org.hibernate.impl.sessionimpl.list(sessionimpl.java:1597) @ org.hibernate.impl.criteriaimpl.list(criteriaimpl.java:306) @ org.hibernate.impl.criteriaimpl.uniqueresult(criteriaimpl.java:328) (...) @ com.opensymphony.xwork2.defaultactioninvocation.invoke(defaultactioninvocation.java:246) @ com.opensymphony.xwork2.interceptor.aliasinterceptor.intercept(aliasinterceptor.java:193) @ com.opensymphony.xwork2.defaultactioninvocation.invoke(defaultactioninvocation.java:246) @ com.opensymphony.xwork2.interceptor.exceptionmappinginterceptor.intercept(exceptionmappinginterceptor.java:189) @ com.opensymphony.xwork2.defaultactioninvocation.invoke(defaultactioninvocation.java:246) @ org.apache.struts2.impl.strutsactionproxy.execute(strutsactionproxy.java:54) @ org.apache.struts2.dispatcher.dispatcher.serviceaction(dispatcher.java:562) @ org.apache.struts2.dispatcher.ng.executeoperations.executeaction(executeoperations.java:77) @ org.apache.struts2.dispatcher.ng.filter.strutsprepareandexecutefilter.dofilter(strutsprepareandexecutefilter.java:99) @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:256) @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:214) @ org.apache.catalina.core.applicationdispatcher.doinvoke(applicationdispatcher.java:873) @ org.apache.catalina.core.applicationdispatcher.invoke(applicationdispatcher.java:739) @ org.apache.catalina.core.applicationdispatcher.processrequest(applicationdispatcher.java:575) @ org.apache.catalina.core.applicationdispatcher.dodispatch(applicationdispatcher.java:546) @ org.apache.catalina.core.applicationdispatcher.dispatch(applicationdispatcher.java:428) @ org.apache.catalina.core.applicationdispatcher.forward(applicationdispatcher.java:378) @ org.tuckey.web.filters.urlrewrite.normalrewrittenurl.dorewrite(normalrewrittenurl.java:213) @ org.tuckey.web.filters.urlrewrite.rulechain.handlerewrite(rulechain.java:171) @ org.tuckey.web.filters.urlrewrite.rulechain.dorules(rulechain.java:145) @ org.tuckey.web.filters.urlrewrite.urlrewriter.processrequest(urlrewriter.java:92) @ org.tuckey.web.filters.urlrewrite.urlrewritefilter.dofilter(urlrewritefilter.java:381) @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:256) @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:214) @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:256) @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:214) @ org.apache.catalina.core.standardwrappervalve.invoke(standardwrappervalve.java:316) @ org.apache.catalina.core.standardcontextvalve.invoke(standardcontextvalve.java:160) @ org.apache.catalina.core.standardpipeline.doinvoke(standardpipeline.java:734) @ org.apache.catalina.core.standardpipeline.invoke(standardpipeline.java:673) @ com.sun.enterprise.web.webpipeline.invoke(webpipeline.java:99) @ org.apache.catalina.core.standardhostvalve.invoke(standardhostvalve.java:174) @ org.apache.catalina.connector.coyoteadapter.doservice(coyoteadapter.java:357) @ org.apache.catalina.connector.coyoteadapter.service(coyoteadapter.java:260) @ com.sun.enterprise.v3.services.impl.containermapper.service(containermapper.java:188) @ org.glassfish.grizzly.http.server.httphandler.runservice(httphandler.java:191) @ org.glassfish.grizzly.http.server.httphandler.dohandle(httphandler.java:168) @ org.glassfish.grizzly.http.server.httpserverfilter.handleread(httpserverfilter.java:189) @ org.glassfish.grizzly.filterchain.executorresolver$9.execute(executorresolver.java:119) @ org.glassfish.grizzly.filterchain.defaultfilterchain.executefilter(defaultfilterchain.java:288) @ org.glassfish.grizzly.filterchain.defaultfilterchain.executechainpart(defaultfilterchain.java:206) @ org.glassfish.grizzly.filterchain.defaultfilterchain.execute(defaultfilterchain.java:136) @ org.glassfish.grizzly.filterchain.defaultfilterchain.process(defaultfilterchain.java:114) @ org.glassfish.grizzly.processorexecutor.execute(processorexecutor.java:77) @ org.glassfish.grizzly.nio.transport.tcpniotransport.fireioevent(tcpniotransport.java:838) @ org.glassfish.grizzly.strategies.abstractiostrategy.fireioevent(abstractiostrategy.java:113) @ org.glassfish.grizzly.strategies.workerthreadiostrategy.run0(workerthreadiostrategy.java:115) @ org.glassfish.grizzly.strategies.workerthreadiostrategy.access$100(workerthreadiostrategy.java:55) @ org.glassfish.grizzly.strategies.workerthreadiostrategy$workerthreadrunnable.run(workerthreadiostrategy.java:135) @ org.glassfish.grizzly.threadpool.abstractthreadpool$worker.dowork(abstractthreadpool.java:564) @ org.glassfish.grizzly.threadpool.abstractthreadpool$worker.run(abstractthreadpool.java:544) @ java.lang.thread.run(thread.java:744) caused by: net.sf.ehcache.cacheexception: uncaught exception in setpinned() - pinning not supported when local cache disabled @ org.terracotta.modules.ehcache.store.clusteredsafestore.setpinned(clusteredsafestore.java:212) @ net.sf.ehcache.cache.setpinned(cache.java:4231) @ net.sf.ehcache.hibernate.regions.ehcachetransactionaldataregion.put(ehcachetransactionaldataregion.java:141) ... 70 more
the application deployed on glassfish 4 server on host "front" , terracotta server on host "back".
the ehcache.xml file on application is:
<?xml version="1.0" encoding="utf-8"?> <ehcache xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:nonamespaceschemalocation="ehcache-2.6.6.xsd" updatecheck="false" monitoring="autodetect" dynamicconfig="true" name="hibernate-cache"> <!-- replicated caches between applications / ehcache servers --> <cachemanagerpeerproviderfactory class="net.sf.ehcache.distribution.rmicachemanagerpeerproviderfactory" properties="peerdiscovery=manual, rmiurls=//127.0.0.1:40001/common_objects_region|//127.0.0.1:40001/org.hibernate.cache.updatetimestampscache|//127.0.0.1:40001/org.hibernate.cache.standardquerycache"/> <cachemanagerpeerlistenerfactory class="net.sf.ehcache.distribution.rmicachemanagerpeerlistenerfactory" properties="hostname=127.0.0.1, port=40001, sockettimeoutmillis=2000"/> <terracottaconfig url="back:9510" /> <defaultcache maxelementsinmemory="100" maxelementsondisk="1000" statistics="true" eternal="false" timetoidleseconds="43200" timetoliveseconds="86400" memorystoreevictionpolicy="lfu"> <cacheeventlistenerfactory class="net.sf.ehcache.distribution.rmicachereplicatorfactory" listenfor="all" /> <terracotta clustered="true" consistency="eventual" localcacheenabled="true" /> <persistence strategy="distributed" /> </defaultcache> <cache name="org.hibernate.cache.standardquerycache" statistics="true" maxelementsinmemory="5000" maxelementsondisk="10000" eternal="false" timetoidleseconds="43200" timetoliveseconds="86400" memorystoreevictionpolicy="lfu"> <cacheeventlistenerfactory class="net.sf.ehcache.distribution.rmicachereplicatorfactory" listenfor="all"/> <terracotta clustered="true" consistency="eventual" localcacheenabled="true" /> <persistence strategy="distributed" /> </cache> <cache name="org.hibernate.cache.updatetimestampscache" statistics="true" maxelementsinmemory="5000" maxelementsondisk="10000" eternal="false" timetoidleseconds="43200" timetoliveseconds="86400" memorystoreevictionpolicy="lfu"> <cacheeventlistenerfactory class="net.sf.ehcache.distribution.rmicachereplicatorfactory" listenfor="all"/> <terracotta clustered="true" consistency="eventual" localcacheenabled="true" /> <persistence strategy="distributed" /> </cache> <cache name="common_objects_region" statistics="true" maxelementsinmemory="100000" maxelementsondisk="250000" eternal="false" timetoidleseconds="43200" timetoliveseconds="86400" memorystoreevictionpolicy="lfu"> <cacheeventlistenerfactory class="net.sf.ehcache.distribution.rmicachereplicatorfactory" listenfor="all" /> <!-- <bootstrapcacheloaderfactory class="net.sf.ehcache.distribution.rmibootstrapcacheloaderfactory" properties="bootstrapasynchronously=true, maximumchunksizebytes=5000000"/>--> <terracotta clustered="true" consistency="eventual" localcacheenabled="true" /> <persistence strategy="distributed" /> </cache> </ehcache>
and tc-config.xml file on "back" is:
<?xml version="1.0" encoding="utf-8"?> <!-- content copyright terracotta, inc., unless otherwise indicated. rights reserved. --> <tc:tc-config xmlns:tc="http://www.terracotta.org/config" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://www.terracotta.org/schema/terracotta-6.xsd"> <!-- configuracion de high-availability --> <tc-properties> <property name="l1.healthcheck.l2.ping.enabled" value="true" /> <property name="l1.healthcheck.l2.ping.idletime" value="10000" /> <property name="l1.healthcheck.l2.ping.interval" value="2000" /> <property name="l1.healthcheck.l2.ping.probes" value="5" /> <property name="l1.healthcheck.l2.socketconnect" value="true" /> <property name="l1.healthcheck.l2.socketconnecttimeout" value="20" /> <property name="l1.healthcheck.l2.socketconnectcount" value="10" /> <!-- client reconnection properties --> <property name="l2.l1reconnect.enabled" value="true" /> <property name="l2.l1reconnect.timeout.millis" value="2000" /> <property name="l2.healthcheck.l1.ping.enabled" value="true" /> <property name="l2.healthcheck.l1.ping.idletime" value="10000" /> <property name="l2.healthcheck.l1.ping.interval" value="2000" /> <property name="l2.healthcheck.l1.ping.probes" value="5" /> <property name="l2.healthcheck.l1.socketconnect" value="true" /> <property name="l2.healthcheck.l1.socketconnecttimeout" value="20" /> <property name="l2.healthcheck.l1.socketconnectcount" value="10" /> </tc-properties> <!-- tell dso terracotta server can found; see - terracotta configuration guide , reference - terracotta configuration files additional information. --> <servers> <server host="back" name="cache"> <dso-port>9510</dso-port> <jmx-port>9520</jmx-port> <data>/opt/terracotta/server-data</data> <logs>/var/log/terracotta/server-logs</logs> <statistics>/opt/terracotta/server-statistics</statistics> <dso> <client-reconnect-window>15</client-reconnect-window> <persistence> <mode>permanent-store</mode> </persistence> <garbage-collection> <enabled>true</enabled> <verbose>false</verbose> <interval>7200</interval> <!-- está en segundos --> </garbage-collection> </dso> <l2-group-port bind="0.0.0.0">9530</l2-group-port> <data-backup>/opt/terracotta/data-backup</data-backup> <index>/opt/terracotta/server-data/index</index> </server> </servers> </tc:tc-config>
these files working on localhost have both glassfish , terracotta server on same machine. in addition, configuration works nice on host both glassfish , terracotta server on same machine too. tried change hostname on config files ip of host exception remains.
so many questions: wrong in these config files? need have terracotta server on same machine glassfish installed? missing configuration options configuration?
thanks.
edit: tried using developer glassfish server "back" terracotta server , got same exception.
update: if disable second level cache application works fine , retrieves info terracota server i've got no local cache , it's slow.
Comments
Post a Comment