我想在春天使用赤土陶器(兵马俑4.3.3 + ehcache 2.6.8)来实现缓存一些数据。当我试着跑步时,我收到了这个错误:
<div id="page-content-wrapper">
<div class="container-fluid">
<div class="row">
<div class="col-sm-12">
<div class="row row-bottom-margin">
<div class="col-sm-6">
<div class="work_image">
<a href="#" class="darken imgwrap">
<img src="images/mockimage_1.jpeg" alt="image-1">
<h1 class="imgdescription">Lorem Ipsum</h1>
</a>
</div>
</div>
<div class="col-sm-6">
<div class="work_image">
<a href="#" class="darken imgwrap">
<img src="images/mockimage_2.jpeg" alt="image-2">
<h1 class="imgdescription">Lorem Ipsum</h1>
</a>
</div>
</div>
</div>
<div class="row row-bottom-margin">
<div class="col-sm-6 row-bottom-margin">
<div class="work_image">
<a href="#" class="darken imgwrap">
<img src="images/mockimage_3.jpeg" alt="image-3">
<h1 class="imgdescription">Lorem Ipsum</h1>
</a>
</div>
</div>
<div class="col-sm-6 row-bottom-margin">
<div class="work_image">
<a href="#" class="darken imgwrap">
<img src="images/mockimage_4.jpeg" alt="image-4">
<h1 class="imgdescription">Lorem Ipsum</h1>
</a>
</div>
</div>
</div>
<div class="row row-bottom-margin">
<div class="col-sm-6 row-bottom-margin">
<div class="work_image">
<a href="#" class="darken imgwrap">
<img src="images/mockimage_1.jpeg" alt="image-1">
<h1 class="imgdescription">Lorem Ipsum</h1>
</a>
</div>
</div>
<div class="col-sm-6">
<div class="work_image">
<a href="#" class="darken imgwrap">
<img src="images/mockimage_2.jpeg" alt="image-2">
<h1 class="imgdescription">Lorem Ipsum</h1>
</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
&#13;
当我运行我的兵马俑服务器时,我没有收到任何错误:
03:10:10,320 ERROR [ContextLoader] Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.cache.interceptor.CacheInterceptor#0': Cannot resolve reference to bean 'cacheManager' while setting bean property 'cacheManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cacheManager' defined in class path resource [foundationCommonContext-service.xml]: Cannot resolve reference to bean 'ehcache' while setting bean property 'cacheManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ehcache' defined in class path resource [foundationCommonContext-service.xml]: Invocation of init method failed; nested exception is net.sf.ehcache.CacheException: Unable to load class net.sf.ehcache.terracotta.StandaloneTerracottaClusteredInstanceFactory. Initial cause was 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 31, column 9: Expected element 'server' instead of 'garbage-collection' here in element servers
[2]: Line 36, column 9: Expected element 'server' instead of 'restartable' here in element servers
[3]: Line 37, column 9: Expected element 'server' instead of 'client-reconnect-window' here in element servers
*******************************************************************************
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:336) ~[spring-beans-4.0.6.RELEASE.jar:4.0.6.RELEASE]
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108) ~[spring-beans-4.0.6.RELEASE.jar:4.0.6.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1456) ~[spring-beans-4.0.6.RELEASE.jar:4.0.6.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1197) ~[spring-beans-4.0.6.RELEASE.jar:4.0.6.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537) ~[spring-beans-4.0.6.RELEASE.jar:4.0.6.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475) ~[spring-beans-4.0.6.RELEASE.jar:4.0.6.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302) ~[spring-beans-4.0.6.RELEASE.jar:4.0.6.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) ~[spring-beans-4.0.6.RELEASE.jar:4.0.6.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298) ~[spring-beans-4.0.6.RELEASE.jar:4.0.6.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) ~[spring-beans-4.0.6.RELEASE.jar:4.0.6.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:703) ~[spring-beans-4.0.6.RELEASE.jar:4.0.6.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:760) ~[spring-context-4.0.6.RELEASE.jar:4.0.6.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482) ~[spring-context-4.0.6.RELEASE.jar:4.0.6.RELEASE]
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403) ~[spring-web-4.0.6.RELEASE.jar:4.0.6.RELEASE]
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306) [spring-web-4.0.6.RELEASE.jar:4.0.6.RELEASE]
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106) [spring-web-4.0.6.RELEASE.jar:4.0.6.RELEASE]
at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:798) [jetty-server-9.2.3.v20140905.jar:9.2.3.v20140905]
at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:444) [jetty-servlet-9.2.3.v20140905.jar:9.2.3.v20140905]
at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:789) [jetty-server-9.2.3.v20140905.jar:9.2.3.v20140905]
at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:294) [jetty-servlet-9.2.3.v20140905.jar:9.2.3.v20140905]
at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1341) [jetty-webapp-9.2.3.v20140905.jar:9.2.3.v20140905]
at org.eclipse.jetty.maven.plugin.JettyWebAppContext.startWebapp(JettyWebAppContext.java:296) [jetty-maven-plugin-9.2.3.v20140905.jar:9.2.3.v20140905]
at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1334) [jetty-webapp-9.2.3.v20140905.jar:9.2.3.v20140905]
at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:741) [jetty-server-9.2.3.v20140905.jar:9.2.3.v20140905]
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:497) [jetty-webapp-9.2.3.v20140905.jar:9.2.3.v20140905]
at org.eclipse.jetty.maven.plugin.JettyWebAppContext.doStart(JettyWebAppContext.java:365) [jetty-maven-plugin-9.2.3.v20140905.jar:9.2.3.v20140905]
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) [jetty-util-9.2.3.v20140905.jar:9.2.3.v20140905]
at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132) [jetty-util-9.2.3.v20140905.jar:9.2.3.v20140905]
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114) [jetty-util-9.2.3.v20140905.jar:9.2.3.v20140905]
at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61) [jetty-server-9.2.3.v20140905.jar:9.2.3.v20140905]
at org.eclipse.jetty.server.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:163) [jetty-server-9.2.3.v20140905.jar:9.2.3.v20140905]
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) [jetty-util-9.2.3.v20140905.jar:9.2.3.v20140905]
at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132) [jetty-util-9.2.3.v20140905.jar:9.2.3.v20140905]
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114) [jetty-util-9.2.3.v20140905.jar:9.2.3.v20140905]
at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61) [jetty-server-9.2.3.v20140905.jar:9.2.3.v20140905]
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) [jetty-util-9.2.3.v20140905.jar:9.2.3.v20140905]
at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132) [jetty-util-9.2.3.v20140905.jar:9.2.3.v20140905]
at org.eclipse.jetty.server.Server.start(Server.java:387) [jetty-server-9.2.3.v20140905.jar:9.2.3.v20140905]
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114) [jetty-util-9.2.3.v20140905.jar:9.2.3.v20140905]
at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61) [jetty-server-9.2.3.v20140905.jar:9.2.3.v20140905]
at org.eclipse.jetty.server.Server.doStart(Server.java:354) [jetty-server-9.2.3.v20140905.jar:9.2.3.v20140905]
at org.eclipse.jetty.maven.plugin.JettyServer.doStart(JettyServer.java:73) [jetty-maven-plugin-9.2.3.v20140905.jar:9.2.3.v20140905]
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) [jetty-util-9.2.3.v20140905.jar:9.2.3.v20140905]
at org.eclipse.jetty.maven.plugin.AbstractJettyMojo.startJetty(AbstractJettyMojo.java:534) [jetty-maven-plugin-9.2.3.v20140905.jar:9.2.3.v20140905]
at org.eclipse.jetty.maven.plugin.AbstractJettyMojo.execute(AbstractJettyMojo.java:357) [jetty-maven-plugin-9.2.3.v20140905.jar:9.2.3.v20140905]
at org.eclipse.jetty.maven.plugin.JettyRunMojo.execute(JettyRunMojo.java:167) [jetty-maven-plugin-9.2.3.v20140905.jar:9.2.3.v20140905]
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132) [maven-core-3.2.3.jar:3.2.3]
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208) [maven-core-3.2.3.jar:3.2.3]
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) [maven-core-3.2.3.jar:3.2.3]
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) [maven-core-3.2.3.jar:3.2.3]
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116) [maven-core-3.2.3.jar:3.2.3]
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80) [maven-core-3.2.3.jar:3.2.3]
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51) [maven-core-3.2.3.jar:3.2.3]
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120) [maven-core-3.2.3.jar:3.2.3]
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:347) [maven-core-3.2.3.jar:3.2.3]
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:154) [maven-core-3.2.3.jar:3.2.3]
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:582) [maven-embedder-3.2.3.jar:3.2.3]
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214) [maven-embedder-3.2.3.jar:3.2.3]
at org.apache.maven.cli.MavenCli.main(MavenCli.java:158) [maven-embedder-3.2.3.jar:3.2.3]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_101]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_101]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_101]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_101]
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289) [plexus-classworlds-2.5.1.jar:?]
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229) [plexus-classworlds-2.5.1.jar:?]
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415) [plexus-classworlds-2.5.1.jar:?]
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356) [plexus-classworlds-2.5.1.jar:?]
&#13;
我的tc-config.xml没有错误提及的任何元素:
./start-tc-server.sh -f ../config/tc-config.xml
2016-12-10 03:09:01,931 INFO - Terracotta 4.3.3, as of 20161014-074934 (Revision 27037 from 4.3.3)
2016-12-10 03:09:02,241 WARN -
********************************* WARNING **********************************
* DataStorage offheap size not specified. Using a default of 2g
****************************************************************************
2016-12-10 03:09:02,255 INFO - Successfully loaded base configuration from file at '/home/asyst/Software/terracotta-4.3.3/server/bin/../config/tc-config.xml'.
2016-12-10 03:09:02,378 INFO - Log file: '/home/asyst/terracotta/server-logs/terracotta-server.log'.
2016-12-10 03:09:02,399 INFO - Available Max Runtime Memory: 1963MB
2016-12-10 03:09:08,231 INFO - Becoming State[ ACTIVE-COORDINATOR ]
2016-12-10 03:09:08,274 INFO - Terracotta Server instance has started up as ACTIVE node on 127.0.0.1:9510 successfully, and is now ready for work.
2016-12-10 03:09:09,922 INFO - Management server started on 0.0.0.0:9540
&#13;
这里是我的ehcache.xml:
<?xml version="1.0" encoding="UTF-8" ?>
<tc:tc-config xmlns:tc="http://www.terracotta.org/config">
<servers>
<server host="127.0.0.1" name="My Server Name" bind="0.0.0.0">
<data>/home/asyst/terracotta/server-data</data>
<logs>/home/asyst/terracotta/server-logs</logs>
<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>
</server>
</servers>
<clients>
<logs>logs-%i</logs>
</clients>
<tc-properties>
<property name="l2.nha.dirtydb.autoDelete" value="true"/>
<property name="l1.cachemanager.enabled" value="true"/>
<property name="logging.maxLogFileSize" value="1024"/>
</tc-properties>
</tc:tc-config>
&#13;
任何人都可以帮我解决这个问题吗?提前谢谢
答案 0 :(得分:0)
Terracotta 4.3.3需要Ehcache 2.10.3。
问题来自于您正在尝试使用Ehcache 2.6.8。
从Terracotta 4.3 OSS服务器开始,点发布可能会有所不同,但major.minor
必须匹配,4.3.x
与2.10.x
相匹配,而不是说差异应限于滚动升级的持续时间,而不是一般的运行时配置。