使用ehcahe+Terracotta做项目缓存服务遇到tomcat启动报错,版本ehcahe-core2.6.11 Terracotta4.3.4报错内容如下:
Caused by: java.lang.RuntimeException: com.tc.config.schema.setup.ConfigurationSetupException:
*******************************************************************************
The configuration data in the base configuration from server at '127.0.0.1:9510' does not obey the Terracotta schema:
[0]: Line 8, column 9: Expected element 'server' instead of 'mirror-group' here in element servers
[1]: Line 27, column 9: Expected element 'server' instead of 'garbage-collection' here in element servers
[2]: Line 32, column 9: Expected element 'server' instead of 'restartable' here in element servers
[3]: Line 33, column 9: Expected element 'server' instead of 'client-reconnect-window' here in element servers
*******************************************************************************
at com.terracotta.express.StandaloneL1Boot.resolveConfig(StandaloneL1Boot.java:140)
at com.terracotta.express.StandaloneL1Boot.createConfigFile(StandaloneL1Boot.java:101)
at com.terracotta.express.StandaloneL1Boot.call(StandaloneL1Boot.java:221)
at com.terracotta.express.ClientImpl.<init>(ClientImpl.java:369)
... 138 more
Caused by: com.tc.config.schema.setup.ConfigurationSetupException:
*******************************************************************************
The configuration data in the base configuration from server at '127.0.0.1:9510' does not obey the Terracotta schema:
[0]: Line 8, column 9: Expected element 'server' instead of 'mirror-group' here in element servers
[1]: Line 27, column 9: Expected element 'server' instead of 'garbage-collection' here in element servers
[2]: Line 32, column 9: Expected element 'server' instead of 'restartable' here in element servers
[3]: Line 33, column 9: Expected element 'server' instead of 'client-reconnect-window' here in element servers
*******************************************************************************
at com.tc.config.schema.setup.StandardXMLFileConfigurationCreator.getConfigFromSourceStream(StandardXMLFileConfigurationCreator.java:510)
at com.tc.config.schema.setup.StandardXMLFileConfigurationCreator.loadConfigurationData(StandardXMLFileConfigurationCreator.java:427)
at com.tc.config.schema.setup.StandardXMLFileConfigurationCreator.loadConfigDataFromSources(StandardXMLFileConfigurationCreator.java:242)
at com.tc.config.schema.setup.StandardXMLFileConfigurationCreator.loadConfigAndSetIntoRepositories(StandardXMLFileConfigurationCreator.java:129)
at com.tc.config.schema.setup.StandardXMLFileConfigurationCreator.createConfigurationIntoRepositories(StandardXMLFileConfigurationCreator.java:111)
at com.terracotta.express.StandaloneL1Boot.resolveEmbedded(StandaloneL1Boot.java:193)
at com.terracotta.express.StandaloneL1Boot.resolveConfig(StandaloneL1Boot.java:138)
... 141 more
目测是tc-config.xml 配置错误。以下是我的tc-config.xml
<tc:tc-config xmlns:tc="http://www.terracotta.org/config" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<tc-properties>
<property name="l1.cachemanager.enabled" value="false"/>
<property name="l1.cachemanager.leastCount" value="4"/>
</tc-properties>
<servers>
<mirror-group group-name="group1">
<server host="127.0.0.1" name="server1" bind="127.0.0.1">
<data>c:/terracotta/server-data</data>
<logs>c:/terracotta/server-logs</logs>
<index>c:/terracotta/server-index</index>
<tsa-port bind="127.0.0.1">9510</tsa-port>
<jmx-port bind="127.0.0.1">9520</jmx-port>
<tsa-group-port bind="127.0.0.1">9530</tsa-group-port>
<management-port bind="127.0.0.1">9540</management-port>
<authentication/>
<http-authentication>
<user-realm-file>c:/terracotta/realm.properties</user-realm-file>
</http-authentication>
<offheap>
<enabled>false</enabled>
<maxDataSize>1g</maxDataSize>
</offheap>
</server>
</mirror-group>
<garbage-collection>
<enabled>true</enabled>
<verbose>false</verbose>
<interval>3600</interval>
</garbage-collection>
<restartable enabled="false"/>
<client-reconnect-window>120</client-reconnect-window>
</servers>
<clients>
<logs>logs-%i</logs>
</clients>
</tc:tc-config>
以上tc-config.xml配置,我的terracotta能正常启动。