terracotta + ehcache连接成功,但抛出异常java.lang.ArrayIndexOutOfBoundsException:28526

时间:2017-09-20 02:11:15

标签: ehcache terracotta

我安装了四个兵马俑服务器,ip是 192.168.24.2 192.168.24.3 192.168.24.4 192.168.24.5 tc-config.xml就是这个

<?xml version="1.0" encoding="UTF-8" ?>
<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">
<tc-properties>
    <property name="l2.nha.dirtydb.autoDelete" value="true"/>
    <property name="l1.cachemanager.enabled" value="true"/>
    <property name="l2.l1reconnect.timeout.millis" value="5000"/>
    <property name="logging.maxLogFileSize" value="1024"/>
</tc-properties>

<servers>
    <server host="192.168.24.2" name="node1" bind="192.168.24.2">
      <data>/opt/terracotta-3.7.0/server-data</data>
      <logs>/opt/terracotta-3.7.0/server-logs</logs>
      <index>/opt/terracotta-3.7.0/server-index</index>
      <statistics>/opt/terracotta-3.7.0/server-statistics</statistics>
      <dso-port bind="192.168.24.2">9510</dso-port>
      <jmx-port bind="192.168.24.2">9520</jmx-port>
      <l2-group-port bind="192.168.24.2">9530</l2-group-port>
      <dso>
        <client-reconnect-window>120</client-reconnect-window>
        <persistence>
          <mode>temporary-swap-only</mode>
        </persistence>
        <garbage-collection>
          <enabled>true</enabled>
          <verbose>false</verbose>
          <interval>3600</interval>
        </garbage-collection>
     </dso>
   </server>
    <server host="192.168.24.3" name="node2" bind="192.168.24.3">
      <data>/opt/terracotta-3.7.0/server-data</data>
      <logs>/opt/terracotta-3.7.0/server-logs</logs>
      <index>/opt/terracotta-3.7.0/server-index</index>
      <statistics>/opt/terracotta-3.7.0/server-statistics</statistics>
      <dso-port bind="192.168.24.3">9510</dso-port>
      <jmx-port bind="192.168.24.3">9520</jmx-port>
      <l2-group-port bind="192.168.24.3">9530</l2-group-port>
      <dso>
        <client-reconnect-window>120</client-reconnect-window>
        <persistence>
            <mode>temporary-swap-only</mode>
        </persistence>
        <garbage-collection>
            <enabled>true</enabled>
            <verbose>false</verbose>
            <interval>3600</interval>
        </garbage-collection>
     </dso>
  </server>
  <server host="192.168.24.4" name="node3" bind="192.168.24.4">
      <data>/opt/terracotta-3.7.0/server-data</data>
      <logs>/opt/terracotta-3.7.0/server-logs</logs>
      <index>/opt/terracotta-3.7.0/server-index</index>
      <statistics>/opt/terracotta-3.7.0/server-statistics</statistics>
      <dso-port bind="192.168.24.4">9510</dso-port>
      <jmx-port bind="192.168.24.4">9520</jmx-port>
      <l2-group-port bind="192.168.24.4">9530</l2-group-port>
      <dso>
          <client-reconnect-window>120</client-reconnect-window>
          <persistence>
              <mode>temporary-swap-only</mode>
          </persistence>
          <garbage-collection>
              <enabled>true</enabled>
              <verbose>false</verbose>
              <interval>3600</interval>
          </garbage-collection>
      </dso>
   </server>
  <server host="192.168.24.5" name="node4" bind="192.168.24.5">
      <data>/opt/terracotta-3.7.0/server-data</data>
      <logs>/opt/terracotta-3.7.0/server-logs</logs>
      <index>/opt/terracotta-3.7.0/server-index</index>
      <statistics>/opt/terracotta-3.7.0/server-statistics</statistics>
      <dso-port bind="192.168.24.5">9510</dso-port>
      <jmx-port bind="192.168.24.5">9520</jmx-port>
      <l2-group-port bind="192.168.24.5">9530</l2-group-port>
      <dso>
          <client-reconnect-window>120</client-reconnect-window>
          <persistence>
              <mode>temporary-swap-only</mode>
          </persistence>
          <garbage-collection>
              <enabled>true</enabled>
              <verbose>false</verbose>
              <interval>3600</interval>
          </garbage-collection>
     </dso>
   </server>
   <mirror-groups>
       <mirror-group group-name="ehcache-group">
       <members>
           <member>node1</member>
           <member>node2</member>
           <member>node3</member>
           <member>node4</member>
       </members>
      <ha>
          <mode>networked-active-passive</mode>
          <networked-active-passive>
              <election-time>5</election-time>
          </networked-active-passive>
      </ha>
   </mirror-group>
</mirror-groups>     
<ha>
  <mode>networked-active-passive</mode>
      <networked-active-passive>
          <election-time>5</election-time>
      </networked-active-passive>
</ha>
</servers>
<clients>
    <logs>/opt/terracotta-3.7.0/clients-logs/logs-%i</logs>
</clients>

ehcache-terracotta.xml就是这个

<?xml version="1.0" encoding="UTF-8"?>
<ehcache updateCheck="false" name="defaultCache">

    <diskStore path="java.io.tmpdir" />
    <cacheManagerEventListenerFactory class="" properties=""/>  
    <terracottaConfig url="192.168.24.2:9510,192.168.24.3:9510,192.168.24.4:9510,192.168.24.5:9510"/>   
    <!-- <terracottaConfig url="192.168.24.2:9510"/>    -->

    <defaultCache maxEntriesLocalHeap="1000" eternal="false" timeToIdleSeconds="300" timeToLiveSeconds="600"
    overflowToDisk="false" maxElementsOnDisk="1000000" statistics="true">
    <terracotta clustered="true" localCacheEnabled="false"/>
</defaultCache>

    <cache name="sysCache" maxEntriesLocalHeap="1000" eternal="false" timeToIdleSeconds="300" timeToLiveSeconds="600" overflowToDisk="false" maxElementsOnDisk="1000000" statistics="true">
    <terracotta clustered="true" localCacheEnabled="false"/>
</cache>

    <cache name="userCache" maxEntriesLocalHeap="1000" eternal="false" timeToIdleSeconds="300" timeToLiveSeconds="600" overflowToDisk="false" maxElementsOnDisk="1000000" statistics="true">
    <terracotta clustered="true" localCacheEnabled="false"/>
</cache>

    <cache name="corpCache" maxEntriesLocalHeap="1000" eternal="false" timeToIdleSeconds="300" timeToLiveSeconds="600" overflowToDisk="false" maxElementsOnDisk="1000000" statistics="true">
    <terracotta clustered="true" localCacheEnabled="false"/>
</cache>

    <cache name="cmsCache" maxEntriesLocalHeap="1000" eternal="false" timeToIdleSeconds="300" timeToLiveSeconds="600" overflowToDisk="false" maxElementsOnDisk="1000000" statistics="true">
    <terracotta clustered="true" localCacheEnabled="false"/>
</cache>

    <cache name="actCache" maxEntriesLocalHeap="100" eternal="false" timeToIdleSeconds="300" timeToLiveSeconds="600" overflowToDisk="false" maxElementsOnDisk="1000000" statistics="true">
    <terracotta clustered="true" localCacheEnabled="false"/>
</cache>

    <cache name="pageCachingFilter" maxEntriesLocalHeap="1000" eternal="false" timeToIdleSeconds="300" timeToLiveSeconds="600" overflowToDisk="false" maxElementsOnDisk="1000000" memoryStoreEvictionPolicy="LFU" statistics="true">
    <terracotta clustered="true" localCacheEnabled="false"/>
</cache>

    <cache name="activeSessionsCache" maxEntriesLocalHeap="10000" eternal="false" timeToIdleSeconds="300" timeToLiveSeconds="600" overflowToDisk="false" maxElementsOnDisk="1000000" 
       diskPersistent="false" diskExpiryThreadIntervalSeconds="600" statistics="true">
    <terracotta clustered="true" localCacheEnabled="false"/>
</cache>

如果设置terracottaConfig url属性只是一个服务器&amp;设置兵马俑标签的群集属性为false它运行正常,当我设置multile兵马俑服务器&amp;设置兵马俑标签属性'clustered'为真。然后我开始它显示的项目:

 2017 5:50:08 下午 net.sf.ehcache.terracotta.TerracottaClient info
 Thread [localhost-startStop-1] [cacheManager: 'defaultCache']: Creating new ClusteredInstanceFactory
 2017-09-19 17:50:08,838 INFO - Terracotta 3.7.0, as of 20120718-055216 (Revision 18930-20453 by cruise@su10mo128 from 3.7.0)
 2017-09-19 17:50:09,304 INFO - Successfully loaded base configuration from server at '192.168.24.2:9510'.
 2017-09-19 17:50:09,363 INFO - Successfully loaded base configuration from file at 'C:\Users\Admin\AppData\Local\Temp\tc-config3458563347390637739.xml'.
 2017-09-19 17:50:09,397 INFO - Log file: 'D:\opt\terracotta-3.7.0\clients-logs\logs-192.168.30.83\terracotta-client.log'.
 2017-09-19 17:50:10,711 INFO - Connection successfully established to server at 192.168.24.2:9510
java.lang.ArrayIndexOutOfBoundsException: 28526
at com.tc.asm.ClassReader.readClass(ClassReader.java:2015)

at com.tc.asm.ClassReader.accept(ClassReader.java:469)
at com.tc.asm.ClassReader.accept(ClassReader.java:425)
at com.tc.aspectwerkz.reflect.impl.asm.AsmClassInfo.<init>(AsmClassInfo.java:189)
at com.tc.aspectwerkz.reflect.impl.asm.AsmClassInfo.constructAsmClassInfo(AsmClassInfo.java:269)
at com.tc.aspectwerkz.reflect.impl.asm.AsmClassInfo.getClassInfo(AsmClassInfo.java:298)
at com.tc.aspectwerkz.reflect.impl.asm.AsmClassInfo.createClassInfoFromStream(AsmClassInfo.java:692)
at com.tc.aspectwerkz.reflect.impl.asm.AsmClassInfo.getClassInfo(AsmClassInfo.java:245)
at com.tc.aspectwerkz.reflect.impl.asm.AsmFieldInfo.getType(AsmFieldInfo.java:63)
at com.tc.aspectwerkz.expression.ExpressionVisitor.visit(ExpressionVisitor.java:488)
at com.tc.aspectwerkz.expression.ast.ASTFieldPattern.jjtAccept(ASTFieldPattern.java:28)
at com.tc.aspectwerkz.expression.ExpressionVisitor.visitAnnotatedNode(ExpressionVisitor.java:1016)
at com.tc.aspectwerkz.expression.ExpressionVisitor.visit(ExpressionVisitor.java:171)

at com.tc.aspectwerkz.expression.ast.ASTGet.jjtAccept(ASTGet.java:22)
at com.tc.aspectwerkz.expression.ExpressionVisitor.visit(ExpressionVisitor.java:100)

at com.tc.aspectwerkz.expression.ast.ASTExpression.jjtAccept(ASTExpression.java:22)
at com.tc.aspectwerkz.expression.ExpressionVisitor.visit(ExpressionVisitor.java:88)
at com.tc.aspectwerkz.expression.ExpressionVisitor.match(ExpressionVisitor.java:74)
at com.tc.object.config.Root.matches(Root.java:94)
at com.tc.object.config.StandardDSOClientConfigHelperImpl.findMatchingRootDefinition(StandardDSOClientConfigHelperImpl.java:1015)
at com.tc.object.config.StandardDSOClientConfigHelperImpl.classContainsAnyRoots(StandardDSOClientConfigHelperImpl.java:1023)
at com.tc.object.config.StandardDSOClientConfigHelperImpl.shouldBeAdapted(StandardDSOClientConfigHelperImpl.java:1254)
at com.tc.object.bytecode.hook.impl.DefaultWeavingStrategy.transformInternal(DefaultWeavingStrategy.java:177)
at com.tc.object.bytecode.hook.impl.DefaultWeavingStrategy.transform(DefaultWeavingStrategy.java:127)
at com.tc.object.bytecode.hook.impl.DSOContextImpl.preProcess(DSOContextImpl.java:305)
at com.tc.object.bytecode.hook.impl.DSOContextImpl.transform(DSOContextImpl.java:409)
at com.terracotta.express.ClusteredStateLoader.transform(ClusteredStateLoader.java:160)
at com.terracotta.express.ClusteredStateLoader.loadClass(ClusteredStateLoader.java:119)
at org.terracotta.modules.ehcache.store.TerracottaClusteredInstanceFactory.registerLocalResourceCacheManager(TerracottaClusteredInstanceFactory.java:279)
at org.terracotta.modules.ehcache.store.TerracottaClusteredInstanceFactory.getOrCreateStoreInternal(TerracottaClusteredInstanceFactory.java:235)
at org.terracotta.modules.ehcache.store.TerracottaClusteredInstanceFactory.getOrCreateStore(TerracottaClusteredInstanceFactory.java:228)
at org.terracotta.modules.ehcache.store.TerracottaClusteredInstanceFactory.createStore(TerracottaClusteredInstanceFactory.java:123)
at net.sf.ehcache.terracotta.StandaloneTerracottaClusteredInstanceFactory.createStore(StandaloneTerracottaClusteredInstanceFactory.java:67)
at net.sf.ehcache.terracotta.ClusteredInstanceFactoryWrapper.createStore(ClusteredInstanceFactoryWrapper.java:93)
at net.sf.ehcache.CacheManager.createTerracottaStore(CacheManager.java:570)
at net.sf.ehcache.Cache.initialise(Cache.java:1052)

at net.sf.ehcache.CacheManager.initializeEhcache(CacheManager.java:1298)
at net.sf.ehcache.CacheManager.addCacheNoCheck(CacheManager.java:1329)
at net.sf.ehcache.CacheManager.addConfiguredCaches(CacheManager.java:750)
at net.sf.ehcache.CacheManager.doInit(CacheManager.java:451)
at net.sf.ehcache.CacheManager.init(CacheManager.java:374)

at net.sf.ehcache.CacheManager.<init>(CacheManager.java:259)
at org.springframework.cache.ehcache.EhCacheManagerFactoryBean.afterPropertiesSet(EhCacheManagerFactoryBean.java:157)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1631)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1568)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:351)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1475)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1220)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:351)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1475)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1220)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:351)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1475)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1220)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
at org.springframework.context.support.PostProcessorRegistrationDelegate.registerBeanPostProcessors(PostProcessorRegistrationDelegate.java:232)
at org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:619)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:465)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:434)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
at com.thinkgem.jeesite.modules.sys.listener.WebContextListener.initWebApplicationContext(WebContextListener.java:16)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5099)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5615)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1260)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:2002)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

1 个答案:

答案 0 :(得分:0)

您遇到的问题是,Terootta 3.x根源的技术DSO仅为compliant with Java 7 as of version 3.7.3。因此,您很可能需要更新许多依赖项。

但是,如果您可以使用更新路径,我强烈建议您转到Ehcache 2.10.4 / Terracotta 4.3.4,它甚至可以在Java 8上运行,因为您似乎没有在设置中使用DSO。