Java缓存问题 Ehcache 报错,时间一长就报异常,读数据库是映射的数据库表 高手进 10C

系统时间一长,就会报Ehcache 异常
报错位置,query这个地方
List articles = this.articleService.query(
"select obj from Article obj order by obj.addTime desc", null,
0, 6);

第2级报错位置 query
public List query(String query, Map params, int begin, int max)
{
return this.articleDao.query(query, params, begin, max);
}
Eheache配置
<?xml version="1.0" encoding="UTF-8"?>


timeToIdleSeconds="1200" timeToLiveSeconds="1200"
overflowToDisk="true" clearOnFlush="true"
memoryStoreEvictionPolicy="LFU">

maxElementsOnDisk="10" eternal="false" overflowToDisk="true"
diskSpoolBufferSizeMB="20" timeToIdleSeconds="120"
timeToLiveSeconds="120" memoryStoreEvictionPolicy="LFU" />
<!-- 单独对某个entity的缓存策略设置-->
maxElementsInMemory="100" eternal="false" timeToIdleSeconds="1200"
timeToLiveSeconds="1200" overflowToDisk="true" clearOnFlush="true">


再描述下报错,就是查询访问数据库的时候,是用配置好的框架,直接映射访问数据库。
然后读好的数据加载到缓存里面应该是,时间一长Ehcache就报错了。
也就是说时间一长就不映射数据库了,或者读缓存没读出来,这个是什么原因呢。

高手麻烦看下啊,我可能描述没那么清晰
用的 JpaDaoSupport query.setHint("org.hibernate.cacheable", Boolean.valueOf(true));
具体相关程序请看下面报错图片啊,初步怀疑是映射表到缓存时间一到,缓存成null了,是不是Eheache缓存没有配置好

图片说明
图片说明
图片说明
图片说明

3个回答

个人没有遇到过此类问题,但是建议按照如下顺序解决。请注意,*我这里使用的Ehcache版本是2.10.4*.

  • 根据异常栈调用信息查看源码,这个很容易定位。
  • 这里看到的代码如下:
 public final Object get(Object key) throws CacheException {
        try {
                LOG.debug("key: {}", key);
            if (key == null) {
                return null;
            } else {
                Element element = cache.get(key);
                if (element == null) {

                        LOG.debug("Element for key {} is null", key);
                    return null;
                } else {
                    return element.getObjectValue();
                }
            }
        } catch (net.sf.ehcache.CacheException e) {
            throw new CacheException(e);
        }
    }
  • 分析源码,我们可以得出结论:
    1. 我们可以打开debug级别日志查看相关信息
    2. 异常栈的信息应该是这个方法本身的throw new CacheException(e);这句报错了,没有此构造方法
  • 根据以上结论,可以从日志的输出验证是什么情况下会出现此异常,使用相应方法规避。
  • 或者,查看CacheException这个类,确认下为什么没有构造方法,是不是有多个版本的jar包或者其他问题。

好歹你把各组件的版本信息贴一下噻,ehcach,spring都什么版本?

参考一下这个, https://stackoverflow.com/questions/28167845/spring-ehcache-no-such-method-error

这个应该还是和spring 或是ehcache 的版本相关

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
java项目中如何将map缓存改为ehcache缓存?

java项目中如何将map缓存改为ehcache缓存?各位大神帮帮忙 代码如下 这些缓存以前是放在map中,现在想放入ehcache缓存中 package gov.csc.ems.util.cache; import gov.csc.ems.basedata.code.model.Codebasdistrict; import gov.csc.ems.basedata.code.model.Codebassexualdistinction; import gov.csc.ems.basedata.code.service.ICodebasdistrictService; import gov.csc.ems.basedata.code.service.ICodebassexualdistinctionService; import gov.csc.ems.util.dataaccess.model.Emslisttablebase; import gov.csc.ems.util.dataaccess.model.Emslisttableconfig; import gov.csc.ems.util.servicebase.UtilFactory; import gov.csc.ems.util.sys.priv.model.Emsorg; import gov.csc.ems.util.sys.priv.model.Emspriv; import gov.csc.ems.util.sys.priv.model.Emsroleprivrel; import gov.csc.ems.util.sys.priv.model.Emsuser; import gov.csc.ems.util.sys.priv.util.IConstants; import gov.csc.ems.util.sys.priv.util.PrivServiceFactory; import java.util.HashMap; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import com.thtf.ezone.security.util.BeanUtil; public final class BaseCodeUtil { private static Map<String, String> orgMap;// ok private static Map<String, String> orgReverseMap;// ok private static Map<String, String> orgIdMap;// 没动 private static Map<String, String> orgParentMap;// ok private static Map orgObjectMap;// ok private static Map<String, String> districtMap;// ok private static Map<String, String> fullNamedistrictMap;// ok private static Map<String, String> parentDistrictMap;// private static Map<String, String> allDistrictMap;// ok private static Map<String, String> shortNameDistrictMap;// ok private static Map<String, Codebasdistrict> districtObjectMap;// ok private static Map<String, String> personMap;// not ok private static Map<String, Emsuser> userMap;// not ok private static Map<String, String> dutyPersonNameMap;// ok private static Map<String, String> dutyPersonOrgMap;// ok private static Map<String, String> dutyPersonSexMap;// ok //用户组 private static Map<String,String> usergroupMap; // // 性别MAP表 private static Map<String, Codebassexualdistinction> basesexMap; // // 机构 private static final String ALL_ORG_MAP = "all_org_map"; private static final String ORGCODE_BYNAME_MAP = "orgcode_byname_map"; private static final String ORG_PARENT_MAP = "orgparentmap"; private static final String ALL_ORG_MAP_OBJ = "all_org_map_obj"; private static final String RE_INIT_ORG = "re_init_org"; /** * 列表基础信息MAP */ private static Map<String, Emslisttablebase> tablebaseMap; public static Map getOrgMap() { return BaseCodeUtil.getOrgMapByParam(ALL_ORG_MAP); } /** * 根据参数取得org相关map flag=,返回key:,value: flag=,返回key:,value: * * @param flag * @return * @author guorj * @date May 7, 2009 */ private static Map getOrgMapByParam(String flag) { if (orgMap == null || orgReverseMap == null || orgParentMap == null || orgObjectMap == null || RE_INIT_ORG.equals(flag)) { orgMap = new LinkedHashMap<String, String>(); orgReverseMap = new LinkedHashMap<String, String>(); orgParentMap = new LinkedHashMap<String, String>(); orgObjectMap = new LinkedHashMap(); List list = null; list = UtilFactory.getEmsorgService().findAllEmsorg(); if (list != null) { for (Iterator iterator = list.iterator(); iterator.hasNext();) { Emsorg element = (Emsorg) iterator.next(); orgMap.put(element.getOrgcode(), element.getOrgname()); orgReverseMap.put(element.getOrgname(), element .getOrgcode()); orgParentMap .put(element.getOrgname(), element.getOrgcode()); orgObjectMap.put(element.getOrgcode(), element); } } } if (ALL_ORG_MAP.equals(flag)) { return orgMap; } if (ORGCODE_BYNAME_MAP.equals(flag)) { return orgReverseMap; } if (ORG_PARENT_MAP.equals(flag)) { return orgParentMap; } if (ALL_ORG_MAP_OBJ.equals(flag)) { return orgObjectMap; } return null; } }

ssm+shiro+ehcache整合过程中ehcache报错求大神指路

没有C币。解决问题可以红包答谢。 先贴错误: [WARN][org.springframework.beans.factory.xml.XmlBeanDefinitionReader] - Ignored XML validation warning org.xml.sax.SAXParseException; lineNumber: 4; columnNumber: 22; schema_reference.4: 无法读取方案文档 'http://ehcache.org/ehcache.xsd', 原因为 1) 无法找到文档; 2) 无法读取文档; 3) 文档的根元素不是 <xsd:schema>。 at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203) at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.warning(ErrorHandlerWrapper.java:99) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:392) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:306) at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.reportSchemaErr(XSDHandler.java:4160) at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.reportSchemaWarning(XSDHandler.java:4151) at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.getSchemaDocument1(XSDHandler.java:2493) at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.getSchemaDocument(XSDHandler.java:2191) at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.parseSchema(XSDHandler.java:576) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadSchema(XMLSchemaLoader.java:613) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.findSchemaGrammar(XMLSchemaValidator.java:2446) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:1767) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:740) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:374) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDriver.scanRootElementHook(XMLNSDocumentScannerImpl.java:613) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:3132) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:852) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:602) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:112) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:505) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:841) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:770) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141) at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:243) at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:339) at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:76) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadDocument(XmlBeanDefinitionReader.java:429) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:391) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:336) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:304) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:181) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:217) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:188) at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:125) at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:94) at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:129) at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:609) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:510) at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:446) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:328) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107) at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:953) at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:558) at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:918) at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:370) at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1497) at org.eclipse.jetty.maven.plugin.JettyWebAppContext.startWebapp(JettyWebAppContext.java:360) at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1459) at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:848) at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:287) at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:545) at org.eclipse.jetty.maven.plugin.JettyWebAppContext.doStart(JettyWebAppContext.java:428) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:138) at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:117) at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113) at org.eclipse.jetty.server.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:167) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:138) at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:117) at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:138) at org.eclipse.jetty.server.Server.start(Server.java:419) at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:108) at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113) at org.eclipse.jetty.server.Server.doStart(Server.java:386) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) at org.eclipse.jetty.maven.plugin.AbstractJettyMojo.startJetty(AbstractJettyMojo.java:477) at org.eclipse.jetty.maven.plugin.AbstractJettyMojo.execute(AbstractJettyMojo.java:343) at org.eclipse.jetty.maven.plugin.JettyRunMojo.execute(JettyRunMojo.java:169) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:305) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105) at org.apache.maven.cli.MavenCli.execute(MavenCli.java:954) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288) at org.apache.maven.cli.MavenCli.main(MavenCli.java:192) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356) Caused by: java.net.ConnectException: Connection refused: connect at java.net.DualStackPlainSocketImpl.connect0(Native Method) at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) at java.net.Socket.connect(Socket.java:589) at java.net.Socket.connect(Socket.java:538) at sun.net.NetworkClient.doConnect(NetworkClient.java:180) at sun.net.www.http.HttpClient.openServer(HttpClient.java:463) at sun.net.www.http.HttpClient.openServer(HttpClient.java:558) at sun.net.www.http.HttpClient.<init>(HttpClient.java:242) at sun.net.www.http.HttpClient.New(HttpClient.java:339) at sun.net.www.http.HttpClient.New(HttpClient.java:357) at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1202) at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1138) at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1032) at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:966) at sun.net.www.protocol.http.HttpURLConnection.followRedirect0(HttpURLConnection.java:2701) at sun.net.www.protocol.http.HttpURLConnection.followRedirect(HttpURLConnection.java:2623) at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1806) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1474) at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:647) at com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVersion(XMLVersionDetector.java:148) at com.sun.org.apache.xerces.internal.impl.xs.opti.SchemaParsingConfig.parse(SchemaParsingConfig.java:582) at com.sun.org.apache.xerces.internal.impl.xs.opti.SchemaParsingConfig.parse(SchemaParsingConfig.java:685) at com.sun.org.apache.xerces.internal.impl.xs.opti.SchemaDOMParser.parse(SchemaDOMParser.java:530) at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.getSchemaDocument(XSDHandler.java:2179) ... 85 more [ERROR][org.springframework.web.context.ContextLoader] - Context initialization failed org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 4 in XML document from file [F:\workspace-sts\oa\target\classes\META-INF\applicationContent-shiro-ehcache.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 4; columnNumber: 22; cvc-elt.1: 找不到元素 'ehcache' 的声明。 at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:399) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:336) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:304) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:181) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:217) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:188) at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:125) at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:94) at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:129) at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:609) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:510) at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:446) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:328) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107) at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:953) at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:558) at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:918) at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:370) at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1497) at org.eclipse.jetty.maven.plugin.JettyWebAppContext.startWebapp(JettyWebAppContext.java:360) at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1459) at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:848) at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:287) at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:545) at org.eclipse.jetty.maven.plugin.JettyWebAppContext.doStart(JettyWebAppContext.java:428) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:138) at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:117) at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113) at org.eclipse.jetty.server.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:167) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:138) at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:117) at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:138) at org.eclipse.jetty.server.Server.start(Server.java:419) at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:108) at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113) at org.eclipse.jetty.server.Server.doStart(Server.java:386) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) at org.eclipse.jetty.maven.plugin.AbstractJettyMojo.startJetty(AbstractJettyMojo.java:477) at org.eclipse.jetty.maven.plugin.AbstractJettyMojo.execute(AbstractJettyMojo.java:343) at org.eclipse.jetty.maven.plugin.JettyRunMojo.execute(JettyRunMojo.java:169) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:305) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105) at org.apache.maven.cli.MavenCli.execute(MavenCli.java:954) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288) at org.apache.maven.cli.MavenCli.main(MavenCli.java:192) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356) Caused by: org.xml.sax.SAXParseException; lineNumber: 4; columnNumber: 22; cvc-elt.1: 找不到元素 'ehcache' 的声明。 at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203) at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:134) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:396) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:327) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:284) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:1900) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:740) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:374) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDriver.scanRootElementHook(XMLNSDocumentScannerImpl.java:613) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:3132) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:852) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:602) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:112) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:505) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:841) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:770) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141) at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:243) at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:339) at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:76) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadDocument(XmlBeanDefinitionReader.java:429) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:391) ... 65 more [WARNING] Failed startup of context o.e.j.m.p.JettyWebAppContext@2740e316{Archetype Created Web Application,/,file:///F:/workspace-sts/oa/src/main/webapp/,UNAVAILABLE}{file:///F:/workspace-sts/oa/src/main/webapp/} org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 4 in XML document from file [F:\workspace-sts\oa\target\classes\META-INF\applicationContent-shiro-ehcache.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 4; columnNumber: 22; cvc-elt.1: 找不到元素 'ehcache' 的声明。 at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions (XmlBeanDefinitionReader.java:399) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions (XmlBeanDefinitionReader.java:336) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions (XmlBeanDefinitionReader.java:304) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions (AbstractBeanDefinitionReader.java:181) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions (AbstractBeanDefinitionReader.java:217) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions (AbstractBeanDefinitionReader.java:188) at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions (XmlWebApplicationContext.java:125) at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions (XmlWebApplicationContext.java:94) at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory (AbstractRefreshableApplicationContext.java:129) at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory (AbstractApplicationContext.java:609) at org.springframework.context.support.AbstractApplicationContext.refresh (AbstractApplicationContext.java:510) at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext (ContextLoader.java:446) at org.springframework.web.context.ContextLoader.initWebApplicationContext (ContextLoader.java:328) at org.springframework.web.context.ContextLoaderListener.contextInitialized (ContextLoaderListener.java:107) at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized (ContextHandler.java:953) at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized (ServletContextHandler.java:558) at org.eclipse.jetty.server.handler.ContextHandler.startContext (ContextHandler.java:918) at org.eclipse.jetty.servlet.ServletContextHandler.startContext (ServletContextHandler.java:370) at org.eclipse.jetty.webapp.WebAppContext.startWebapp (WebAppContext.java:1497) at org.eclipse.jetty.maven.plugin.JettyWebAppContext.startWebapp (JettyWebAppContext.java:360) at org.eclipse.jetty.webapp.WebAppContext.startContext (WebAppContext.java:1459) at org.eclipse.jetty.server.handler.ContextHandler.doStart (ContextHandler.java:848) at org.eclipse.jetty.servlet.ServletContextHandler.doStart (ServletContextHandler.java:287) at org.eclipse.jetty.webapp.WebAppContext.doStart (WebAppContext.java:545) at org.eclipse.jetty.maven.plugin.JettyWebAppContext.doStart (JettyWebAppContext.java:428) at org.eclipse.jetty.util.component.AbstractLifeCycle.start (AbstractLifeCycle.java:68) at org.eclipse.jetty.util.component.ContainerLifeCycle.start (ContainerLifeCycle.java:138) at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart (ContainerLifeCycle.java:117) at org.eclipse.jetty.server.handler.AbstractHandler.doStart (AbstractHandler.java:113) at org.eclipse.jetty.server.handler.ContextHandlerCollection.doStart (ContextHandlerCollection.java:167) at org.eclipse.jetty.util.component.AbstractLifeCycle.start (AbstractLifeCycle.java:68) at org.eclipse.jetty.util.component.ContainerLifeCycle.start (ContainerLifeCycle.java:138) at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart (ContainerLifeCycle.java:117) at org.eclipse.jetty.server.handler.AbstractHandler.doStart (AbstractHandler.java:113) at org.eclipse.jetty.util.component.AbstractLifeCycle.start (AbstractLifeCycle.java:68) at org.eclipse.jetty.util.component.ContainerLifeCycle.start (ContainerLifeCycle.java:138) at org.eclipse.jetty.server.Server.start (Server.java:419) at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart (ContainerLifeCycle.java:108) at org.eclipse.jetty.server.handler.AbstractHandler.doStart (AbstractHandler.java:113) at org.eclipse.jetty.server.Server.doStart (Server.java:386) at org.eclipse.jetty.util.component.AbstractLifeCycle.start (AbstractLifeCycle.java:68) at org.eclipse.jetty.maven.plugin.AbstractJettyMojo.startJetty (AbstractJettyMojo.java:477) at org.eclipse.jetty.maven.plugin.AbstractJettyMojo.execute (AbstractJettyMojo.java:343) at org.eclipse.jetty.maven.plugin.JettyRunMojo.execute (JettyRunMojo.java:169) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192) at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105) at org.apache.maven.cli.MavenCli.execute (MavenCli.java:954) at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288) at org.apache.maven.cli.MavenCli.main (MavenCli.java:192) at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:498) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289) at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415) at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356) Caused by: org.xml.sax.SAXParseException: cvc-elt.1: 找不到元素 'ehcache' 的声明。 at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException (ErrorHandlerWrapper.java:203) at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error (ErrorHandlerWrapper.java:134) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError (XMLErrorReporter.java:396) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError (XMLErrorReporter.java:327) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError (XMLErrorReporter.java:284) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement (XMLSchemaValidator.java:1900) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement (XMLSchemaValidator.java:740) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement (XMLNSDocumentScannerImpl.java:374) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDriver.scanRootElementHook (XMLNSDocumentScannerImpl.java:613) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next (XMLDocumentFragmentScannerImpl.java:3132) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next (XMLDocumentScannerImpl.java:852) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next (XMLDocumentScannerImpl.java:602) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next (XMLNSDocumentScannerImpl.java:112) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument (XMLDocumentFragmentScannerImpl.java:505) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse (XML11Configuration.java:841) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse (XML11Configuration.java:770) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse (XMLParser.java:141) at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse (DOMParser.java:243) at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse (DocumentBuilderImpl.java:339) at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument (DefaultDocumentLoader.java:76) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadDocument (XmlBeanDefinitionReader.java:429) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions (XmlBeanDefinitionReader.java:391) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions (XmlBeanDefinitionReader.java:336) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions (XmlBeanDefinitionReader.java:304) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions (AbstractBeanDefinitionReader.java:181) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions (AbstractBeanDefinitionReader.java:217) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions (AbstractBeanDefinitionReader.java:188) at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions (XmlWebApplicationContext.java:125) at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions (XmlWebApplicationContext.java:94) at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory (AbstractRefreshableApplicationContext.java:129) at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory (AbstractApplicationContext.java:609) at org.springframework.context.support.AbstractApplicationContext.refresh (AbstractApplicationContext.java:510) at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext (ContextLoader.java:446) at org.springframework.web.context.ContextLoader.initWebApplicationContext (ContextLoader.java:328) at org.springframework.web.context.ContextLoaderListener.contextInitialized (ContextLoaderListener.java:107) at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized (ContextHandler.java:953) at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized (ServletContextHandler.java:558) at org.eclipse.jetty.server.handler.ContextHandler.startContext (ContextHandler.java:918) at org.eclipse.jetty.servlet.ServletContextHandler.startContext (ServletContextHandler.java:370) at org.eclipse.jetty.webapp.WebAppContext.startWebapp (WebAppContext.java:1497) at org.eclipse.jetty.maven.plugin.JettyWebAppContext.startWebapp (JettyWebAppContext.java:360) at org.eclipse.jetty.webapp.WebAppContext.startContext (WebAppContext.java:1459) at org.eclipse.jetty.server.handler.ContextHandler.doStart (ContextHandler.java:848) at org.eclipse.jetty.servlet.ServletContextHandler.doStart (ServletContextHandler.java:287) at org.eclipse.jetty.webapp.WebAppContext.doStart (WebAppContext.java:545) at org.eclipse.jetty.maven.plugin.JettyWebAppContext.doStart (JettyWebAppContext.java:428) at org.eclipse.jetty.util.component.AbstractLifeCycle.start (AbstractLifeCycle.java:68) at org.eclipse.jetty.util.component.ContainerLifeCycle.start (ContainerLifeCycle.java:138) at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart (ContainerLifeCycle.java:117) at org.eclipse.jetty.server.handler.AbstractHandler.doStart (AbstractHandler.java:113) at org.eclipse.jetty.server.handler.ContextHandlerCollection.doStart (ContextHandlerCollection.java:167) at org.eclipse.jetty.util.component.AbstractLifeCycle.start (AbstractLifeCycle.java:68) at org.eclipse.jetty.util.component.ContainerLifeCycle.start (ContainerLifeCycle.java:138) at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart (ContainerLifeCycle.java:117) at org.eclipse.jetty.server.handler.AbstractHandler.doStart (AbstractHandler.java:113) at org.eclipse.jetty.util.component.AbstractLifeCycle.start (AbstractLifeCycle.java:68) at org.eclipse.jetty.util.component.ContainerLifeCycle.start (ContainerLifeCycle.java:138) at org.eclipse.jetty.server.Server.start (Server.java:419) at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart (ContainerLifeCycle.java:108) at org.eclipse.jetty.server.handler.AbstractHandler.doStart (AbstractHandler.java:113) at org.eclipse.jetty.server.Server.doStart (Server.java:386) at org.eclipse.jetty.util.component.AbstractLifeCycle.start (AbstractLifeCycle.java:68) at org.eclipse.jetty.maven.plugin.AbstractJettyMojo.startJetty (AbstractJettyMojo.java:477) at org.eclipse.jetty.maven.plugin.AbstractJettyMojo.execute (AbstractJettyMojo.java:343) at org.eclipse.jetty.maven.plugin.JettyRunMojo.execute (JettyRunMojo.java:169) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192) at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105) at org.apache.maven.cli.MavenCli.execute (MavenCli.java:954) at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288) at org.apache.maven.cli.MavenCli.main (MavenCli.java:192) at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:498) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289) at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415) at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356) ``` ``` ehcache配置文件: ![图片说明](https://img-ask.csdn.net/upload/201810/25/1540477788_290176.jpg)

shiro整合ehcache总是报错

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'securityManager' defined in class path resource [spring/spring-shiro.xml]: Cannot resolve reference to bean 'sessionManager' while setting bean property 'sessionManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionManager' defined in class path resource [spring/spring-shiro.xml]: Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'net.sf.ehcache.CacheManager' to required type 'org.apache.shiro.cache.CacheManager' for property 'cacheManager'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [net.sf.ehcache.CacheManager] to required type [org.apache.shiro.cache.CacheManager] for property 'cacheManager': no matching editors or conversion strategy found Caused by: java.lang.IllegalStateException: Cannot convert value of type [net.sf.ehcache.CacheManager] to required type [org.apache.shiro.cache.CacheManager] for property 'cacheManager': no matching editors or conversion strategy found

ehcache 缓存失效时间配置基础问题?

本人需要配置系统中所有缓存失效时间为5分钟,配置如下: ``` <?xml version="1.0" encoding="GB2312"?> http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ehcache.xsd"> <diskStore path="java.io.tmpdir"/> <defaultCache maxElementsInMemory="500" eternal="false" timeToIdleSeconds="300" timeToLiveSeconds="300" overflowToDisk="true" /> </ehcache> ``` 请问,上面这种配置有什么错误吗?因为,我这样配置之后,5分钟之后仍然可以访问缓存。 我将缓存配置具体到每一个缓存,5分钟之后,缓存就过期。 ``` <?xml version="1.0" encoding="GB2312"?> <ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ehcache.xsd"> <diskStore path="java.io.tmpdir"/> <defaultCache maxElementsInMemory="500" eternal="false" timeToIdleSeconds="3600" timeToLiveSeconds="3600" overflowToDisk="true" /> <cache name="HomeGuideCache" maxElementsInMemory="10000" eternal="false" overflowToDisk="false" timeToIdleSeconds="3600" timeToLiveSeconds="3600" memoryStoreEvictionPolicy="LFU" /> <cache name="IHealthTypecache" maxElementsInMemory="10000" eternal="false" overflowToDisk="false" timeToIdleSeconds="3600" timeToLiveSeconds="3600" memoryStoreEvictionPolicy="LFU" /> </ehcache> ```

ehcache使用报错java.io.EOFException DiskStorageFactory.retrieve?

项目中使用ehcache报错如下: net.sf.ehcache.CacheException: java.io.EOFException at net.sf.ehcache.store.disk.DiskStorageFactory.retrieve(DiskStorageFactory.java:938) ~[ehcache-core-2.5.0.jar:na] at net.sf.ehcache.store.disk.Segment.decode(Segment.java:167) ~[ehcache-core-2.5.0.jar:na] at net.sf.ehcache.store.disk.Segment.put(Segment.java:444) ~[ehcache-core-2.5.0.jar:na] at net.sf.ehcache.store.disk.DiskStore.put(DiskStore.java:475) ~[ehcache-core-2.5.0.jar:na] at net.sf.ehcache.store.FrontEndCacheTier.put(FrontEndCacheTier.java:221) ~[ehcache-core-2.5.0.jar:na] at net.sf.ehcache.Cache.putInternal(Cache.java:1492) ~[ehcache-core-2.5.0.jar:na] at net.sf.ehcache.Cache.put(Cache.java:1417) ~[ehcache-core-2.5.0.jar:na] at net.sf.ehcache.Cache.put(Cache.java:1382) ~[ehcache-core-2.5.0.jar:na] at org.springframework.cache.ehcache.EhCacheCache.put(EhCacheCache.java:82) ~[spring-context-support-4.2.5.RELEASE.jar:4.2.5.RELEASE] at com.order.util.base.util.EhcacheUtil.put(EhcacheUtil.java:128) at com.order.service.impl.orderServerImpl.order(orderServerImpl.java:80) at sun.reflect.GeneratedMethodAccessor111.invoke(Unknown Source) ~[na:na] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_79] at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_79] at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221) [spring-web-4.2.5.RELEASE.jar:4.2.5.RELEASE] at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136) [spring-web-4.2.5.RELEASE.jar:4.2.5.RELEASE] at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110) [spring-webmvc-4.2.5.RELEASE.jar:4.2.5.RELEASE] at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:817) [spring-webmvc-4.2.5.RELEASE.jar:4.2.5.RELEASE] at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:731) [spring-webmvc-4.2.5.RELEASE.jar:4.2.5.RELEASE] at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85) [spring-webmvc-4.2.5.RELEASE.jar:4.2.5.RELEASE] at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959) [spring-webmvc-4.2.5.RELEASE.jar:4.2.5.RELEASE] at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893) [spring-webmvc-4.2.5.RELEASE.jar:4.2.5.RELEASE] at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:968) [spring-webmvc-4.2.5.RELEASE.jar:4.2.5.RELEASE] at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:870) [spring-webmvc-4.2.5.RELEASE.jar:4.2.5.RELEASE] at javax.servlet.http.HttpServlet.service(HttpServlet.java:661) [servlet-api.jar:na] at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:844) [spring-webmvc-4.2.5.RELEASE.jar:4.2.5.RELEASE] at javax.servlet.http.HttpServlet.service(HttpServlet.java:742) [servlet-api.jar:na] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) [catalina.jar:8.5.23] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [catalina.jar:8.5.23] at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) [tomcat-websocket.jar:8.5.23] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [catalina.jar:8.5.23] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [catalina.jar:8.5.23] at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:121) [spring-web-4.2.5.RELEASE.jar:4.2.5.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.2.5.RELEASE.jar:4.2.5.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [catalina.jar:8.5.23] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [catalina.jar:8.5.23] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199) [catalina.jar:8.5.23] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) [catalina.jar:8.5.23] at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:478) [catalina.jar:8.5.23] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) [catalina.jar:8.5.23] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81) [catalina.jar:8.5.23] at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650) [catalina.jar:8.5.23] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) [catalina.jar:8.5.23] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342) [catalina.jar:8.5.23] at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803) [tomcat-coyote.jar:8.5.23] at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) [tomcat-coyote.jar:8.5.23] at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868) [tomcat-coyote.jar:8.5.23] at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459) [tomcat-coyote.jar:8.5.23] at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-coyote.jar:8.5.23] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_79] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_79] at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-util.jar:8.5.23] at java.lang.Thread.run(Thread.java:745) [na:1.7.0_79] Caused by: java.io.EOFException: null at java.io.RandomAccessFile.readFully(RandomAccessFile.java:446) ~[na:1.7.0_79] at java.io.RandomAccessFile.readFully(RandomAccessFile.java:424) ~[na:1.7.0_79] at net.sf.ehcache.store.disk.DiskStorageFactory.read(DiskStorageFactory.java:372) ~[ehcache-core-2.5.0.jar:na] at net.sf.ehcache.store.disk.DiskStorageFactory.retrieve(DiskStorageFactory.java:936) ~[ehcache-core-2.5.0.jar:na] ... 55 common frames omitted

EHCache报出java.lang.IllegalMonitorStateException异常

我写的代码如下所示,其中EHCacheService.putIn是封装了EHCache的put函数,key=1,一直key++。 import java.util.concurrent.Callable; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.Future; public class EHCacheTestCallable implements Callable { @Override public Object call() throws Exception { //for (int i = 0; i < thresd; i++) { for (int i = 0; ; i++) { EHCacheService.putIn("aba"); } } public static void main(String[] args) { EHCacheTestCallable psc = new EHCacheTestCallable(); ExecutorService es = Executors.newFixedThreadPool(1); @SuppressWarnings({ "unchecked", "unused" }) Future recvHandler = es.submit(psc); } } 另外ehcache.xml中配置为: <cache name="sampleCache1" maxElementsInMemory="10000" eternal="false" timeToIdleSeconds="300" timeToLiveSeconds="600" overflowToDisk="true" /> 存储的内容为一个字符串“aba”,存到2138639个的时候出现异常。 异常结果显示为: Exception in thread "pool-1-thread-1" java.lang.IllegalMonitorStateException at java.util.concurrent.locks.ReentrantLock$Sync.tryRelease(Unknown Source) at java.util.concurrent.locks.AbstractQueuedSynchronizer.release(Unknown Source) at java.util.concurrent.locks.ReentrantLock.unlock(Unknown Source) at java.util.concurrent.LinkedBlockingQueue.take(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.getTask(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source)

ehcache.xml怎么清除缓存

ehcache怎么清除缓存呢,也就是说我想每5分钟清除一下缓存? <cache name="resCache" maxElementsInMemory="10000000" eternal="true" timeToIdleSeconds="36" timeToLiveSeconds="18" overflowToDisk="false" maxElementsOnDisk="200000"> 我应该在这里面怎么配置呢

ehcache上了以后就出现乱码

web系统,基于spring 2.5和hibernate 3.2 系统先是好的,可是加了ehcache后,访问就出现乱码了 web.xml文件片段如下: [code="xml"] <filter> <filter-name>indexCacheFilter</filter-name> <filter-class> net.sf.ehcache.constructs.web.filter.SimplePageCachingFilter </filter-class> </filter> <filter-mapping> <filter-name>indexCacheFilter</filter-name> <url-pattern>*.do</url-pattern> </filter-mapping> [/code] ehcache.xml文件如下: [code="xml"] <?xml version="1.0" encoding="UTF-8"?> <ehcache> <diskStore path="java.io.tmpdir" /> <defaultCache maxElementsInMemory="10000" eternal="false" overflowToDisk="true" timeToIdleSeconds="120" timeToLiveSeconds="120" diskPersistent="false" diskExpiryThreadIntervalSeconds="120" /> <cache name="SimplePageCachingFilter" maxElementsInMemory="10" maxElementsOnDisk="10" eternal="false" overflowToDisk="true" timeToIdleSeconds="120" timeToLiveSeconds="120" memoryStoreEvictionPolicy="LFU" /> </ehcache> [/code] 就只动了这两个地方,页面就全是方块形的乱码了,请高手搭救,谢谢 [b]问题补充:[/b] 回lijie250,试了的,不行 [b]问题补充:[/b] 对了,发现后台报错: 2008-09-05 19:27:06,562 WARN [net.sf.ehcache.constructs.web.filter.CachingFilter ] - PageInfo was not ok(200). Putting null into cache SimplePageCachingFilter wi th key /images/bl.pngnull 2008-09-05 19:27:06,578 WARN [net.sf.ehcache.constructs.web.filter.CachingFilter ] - PageInfo was not ok(200). Putting null into cache SimplePageCachingFilter wi th key /images/b.pngnull 2008-09-05 19:27:06,578 WARN [net.sf.ehcache.constructs.web.filter.CachingFilter ] - PageInfo was not ok(200). Putting null into cache SimplePageCachingFilter wi th key /images/br.pngnull 2008-09-05 19:27:06,593 WARN [net.sf.ehcache.constructs.web.filter.CachingFilter ] - PageInfo was not ok(200). Putting null into cache SimplePageCachingFilter wi th key /images/r.pngnull 2008-09-05 19:27:06,593 WARN [net.sf.ehcache.constructs.web.filter.CachingFilter ] - PageInfo was not ok(200). Putting null into cache SimplePageCachingFilter wi th key /images/tr.pngnull

ehcache缓存几万条图片信息的思路,有源码更棒!

请教大佬们一个问题, 我现在要从数据库一次性查几万条数据存到ehcache缓存中,是把这些数据放到list然后用一个key对应这个list,还是一条数据对应一个key存进去, 业务需求:数据库中有几十万条图片相关信息,现在需要把这些信息从数据库取出来放到ehcache缓存中,之后会从缓存中取出做一些其他操作,请大佬们讲讲思路,或者该怎么存,

shrio 配置ehcache 启动报错,一直报cacheManager匹配不对

ehcache.xml配置: <?xml version="1.0" encoding="UTF-8"?> <ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ehcache.xsd" updateCheck="false" monitoring="autodetect" dynamicConfig="true" name="shiroCache"> <diskStore path="java.io.tmpdir" /> <!-- <diskStore>==========当内存缓存中对象数量超过maxElementsInMemory时,将缓存对象写到磁盘缓存中(需对象实现序列化接口) * <diskStore path="">==用来配置磁盘缓存使用的物理路径,Ehcache磁盘缓存使用的文件后缀名是*.data和*.index * name=================缓存名称,cache的唯一标识(ehcache会把这个cache放到HashMap里) * maxElementsOnDisk====磁盘缓存中最多可以存放的元素数量,0表示无穷大 * maxElementsInMemory==内存缓存中最多可以存放的元素数量,若放入Cache中的元素超过这个数值,则有以下两种情况 * 1)若overflowToDisk=true,则会将Cache中多出的元素放入磁盘文件中 * 2)若overflowToDisk=false,则根据memoryStoreEvictionPolicy策略替换Cache中原有的元素 * eternal==============缓存中对象是否永久有效,即是否永驻内存,true时将忽略timeToIdleSeconds和timeToLiveSeconds * timeToIdleSeconds====缓存数据在失效前的允许闲置时间(单位:秒),仅当eternal=false时使用,默认值是0表示可闲置时间无穷大,此为可选属性 * 即访问这个cache中元素的最大间隔时间,若超过这个时间没有访问此Cache中的某个元素,那么此元素将被从Cache中清除 * timeToLiveSeconds====缓存数据在失效前的允许存活时间(单位:秒),仅当eternal=false时使用,默认值是0表示可存活时间无穷大 * 即Cache中的某元素从创建到清楚的生存时间,也就是说从创建开始计时,当超过这个时间时,此元素将从Cache中清除 * overflowToDisk=======内存不足时,是否启用磁盘缓存(即内存中对象数量达到maxElementsInMemory时,Ehcache会将对象写到磁盘中) * 会根据标签中path值查找对应的属性值,写入磁盘的文件会放在path文件夹下,文件的名称是cache的名称,后缀名是data * diskPersistent=======是否持久化磁盘缓存,当这个属性的值为true时,系统在初始化时会在磁盘中查找文件名为cache名称,后缀名为index的文件 * 这个文件中存放了已经持久化在磁盘中的cache的index,找到后会把cache加载到内存 * 要想把cache真正持久化到磁盘,写程序时注意执行net.sf.ehcache.Cache.put(Element element)后要调用flush()方法 * diskExpiryThreadIntervalSeconds==磁盘缓存的清理线程运行间隔,默认是120秒 * diskSpoolBufferSizeMB============设置DiskStore(磁盘缓存)的缓存区大小,默认是30MB * memoryStoreEvictionPolicy========内存存储与释放策略,即达到maxElementsInMemory限制时,Ehcache会根据指定策略清理内存 * 共有三种策略,分别为LRU(最近最少使用)、LFU(最常用的)、FIFO(先进先出) --> <!-- 注意,以下缓存是永久有效,是系统初始化数据到缓存中,如果不需要永久有效,请另写,或在 --> <!-- <defaultCache maxElementsInMemory="10000" eternal="false" timeToIdleSeconds="120" timeToLiveSeconds="120" overflowToDisk="true" maxElementsOnDisk="10000000" diskPersistent="false" diskExpiryThreadIntervalSeconds="120" memoryStoreEvictionPolicy="LRU" /> --> <defaultCache eternal="false" maxElementsInMemory="10000" overflowToDisk="false" diskPersistent="false" timeToIdleSeconds="0" timeToLiveSeconds="600" memoryStoreEvictionPolicy="LRU" /> <cache name="baseCache" eternal="false" maxElementsInMemory="1000" overflowToDisk="false" diskPersistent="false" timeToIdleSeconds="0" timeToLiveSeconds="300" memoryStoreEvictionPolicy="LRU" /> <!-- 登录记录缓存 锁定10分钟 --> <cache name="passwordRetryCache" maxEntriesLocalHeap="2000" eternal="false" timeToIdleSeconds="600" timeToLiveSeconds="0" overflowToDisk="false" statistics="true"> </cache> <cache name="authorizationCache" maxEntriesLocalHeap="2000" eternal="false" timeToIdleSeconds="1800" timeToLiveSeconds="0" overflowToDisk="false" statistics="true"> </cache> <cache name="authenticationCache" maxEntriesLocalHeap="2000" eternal="false" timeToIdleSeconds="1800" timeToLiveSeconds="0" overflowToDisk="false" statistics="true"> </cache> <cache name="shiro-activeSessionCache" maxEntriesLocalHeap="2000" eternal="false" timeToIdleSeconds="1800" timeToLiveSeconds="0" overflowToDisk="false" statistics="true"> </cache> </ehcache> spring-shiro.xml 配置 <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd" default-lazy-init="true" default-autowire="byName"> <description>Shiro Configuration</description> <!-- SHIRO CONFIG START --> <!-- 定义密码加密算法及迭代次数 --> <bean id="passwordHelper" class="com.leadbank.bcms.utils.PasswordHelper"> <property name="algorithmName" value="md5" /> <property name="hashIterations" value="2" /> </bean> <!-- 缓存管理器 使用Ehcache实现--> <bean id="cacheManager" class="org.apache.shiro.cache.ehcache.EhCacheManager"> <property name="cacheManager" ref="ehCacheManager"/> </bean> <bean id="ehCacheManager" class ="org.springframework.cache.ehcache.EhCacheManagerFactoryBean"> <property name="configLocation" value="classpath:spring/ehcache.xml" /> <property name="shared" value="true"></property> </bean> <!-- 凭证匹配器 --> <bean id="credentialsMatcher" class="com.leadbank.bcms.controller.shiro.credential.RetryLimitHashedCredentialsMatcher"> <constructor-arg ref="cacheManager" /> <property name="hashAlgorithmName" value="md5" /> <property name="hashIterations" value="2" /> <property name="storedCredentialsHexEncoded" value="true" /> </bean> <bean id="userService" class="com.leadbank.bcms.service.user.impl.UserServiceImpl" /> <!-- 項目自定义的Realm --> <bean id="myShiroRealm" class="com.leadbank.bcms.controller.shiro.MyshiroRealm" > <property name="userService" ref="userService" /> <property name="credentialsMatcher" ref="credentialsMatcher" /> <property name="cachingEnabled" value="true" /> <property name="authenticationCachingEnabled" value="true" /> <property name="authenticationCacheName" value="authenticationCache" /> <property name="authorizationCachingEnabled" value="true" /> <property name="authorizationCacheName" value="authorizationCache" /> </bean> <bean id="securityManager" class="org.apache.shiro.web.mgt.DefaultWebSecurityManager"> <property name="realms"> <list><ref bean="myShiroRealm"/></list> </property> <property name="sessionManager" ref="sessionManager"/> <property name="cacheManager" ref="cacheManager"/> <property name="rememberMeManager" ref="rememberMeManager"/> </bean> <bean id="shiroFilter" class="org.apache.shiro.spring.web.ShiroFilterFactoryBean"> <property name="securityManager" ref="securityManager" /> <property name="loginUrl" value="/login/loginIndex" /> <property name="successUrl" value="/backstage/index" /> <property name="unauthorizedUrl" value="/login/loginIndex" /> <property name="filterChainDefinitions"> <!-- anon:匿名拦截器,即不需要登录即可访问;一般用于静态资源过滤 authc:如果没有登录会跳到相应的登录页面登录 user:用户拦截器,用户已经身份验证/记住我登录的都可 --> <value> <!-- /static/js/system/login/** = anon /static/js/system/** = authc /static/** = anon /favicon.ico = anon /verifyCode/** = anon /system_login = anon /weixin/** = anon /upload/** = anon /** = authc /static/**/** = anon--> <!-- /test/toManagerIndex = roles[mg_001] --> /** = anon </value> </property> </bean> <!-- AOP式方法级权限检查 --> <bean class="org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator" depends-on="lifecycleBeanPostProcessor"> <property name="proxyTargetClass" value="true" /> </bean> <!-- 保证实现了Shiro内部lifecycle函数的bean执行 --> <bean id="lifecycleBeanPostProcessor" class="org.apache.shiro.spring.LifecycleBeanPostProcessor" /> </beans> 启动报错 如下: 2016/09/07-17:59:41.148 [localhost-startStop-1] ERROR o.s.web.context.ContextLoader - Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'shiroFilter' defined in URL [file:/E:/apache-tomcat-7.0.68/wtpwebapps/leadbank-bcms-manage/WEB-INF/classes/spring/spring-shiro.xml]: Cannot resolve reference to bean 'securityManager' while setting bean property 'securityManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'securityManager' defined in URL [file:/E:/apache-tomcat-7.0.68/wtpwebapps/leadbank-bcms-manage/WEB-INF/classes/spring/spring-shiro.xml]: Cannot resolve reference to bean 'myShiroRealm' while setting bean property 'realms' with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'myShiroRealm' defined in URL [file:/E:/apache-tomcat-7.0.68/wtpwebapps/leadbank-bcms-manage/WEB-INF/classes/spring/spring-shiro.xml]: Cannot resolve reference to bean 'credentialsMatcher' while setting bean property 'credentialsMatcher'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'credentialsMatcher' defined in URL [file:/E:/apache-tomcat-7.0.68/wtpwebapps/leadbank-bcms-manage/WEB-INF/classes/spring/spring-shiro.xml]: Unsatisfied dependency expressed through constructor argument with index 0 of type [org.apache.shiro.cache.Cache]: Could not convert constructor argument value of type [org.apache.shiro.cache.ehcache.EhCacheManager] to required type [org.apache.shiro.cache.Cache]: Failed to convert value of type 'org.apache.shiro.cache.ehcache.EhCacheManager' to required type 'org.apache.shiro.cache.Cache'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [org.apache.shiro.cache.ehcache.EhCacheManager] to required type [org.apache.shiro.cache.Cache]: no matching editors or conversion strategy found

redis跟ehcache搭配使用怎么解决脏数据的问题

ehcache 作一级缓存,redis作二级缓存,怎么解决脏数据问题 如果服务器A和服务器B都在本地ehcache缓存中缓存了同一个数据X,若服务器A对X修改为了Y,那么修改后的结果Y会缓存在服务器A的ehcache缓存和redis中心缓存中,但是此时服务器B取到的这个数据会是X还是Y呢?服务器A对X数据进行修改后,redis中心缓存不会主动将修改后的值Y推送到各个服务器吗?

Ehcache淘汰缓存时占用CPU资源过大,如何优化这一过程?

目前的项目中需要加入大value(平均8M)结构型的缓存,使用了Springboot集成ehache,使用LFU淘汰策略,部署在8v32G的CentOS上,设置了-Xmx22g。 由于项目启动后需要缓存预热,而预热的数据量大于22G,在到达峰值进行LFU淘汰时CPU占用率750%-800%,后面JVM报错JVM appears hung: Timed out waiting for signal from JVM导致服务重启。 请问如何能避免缓存淘汰时的CPU高占用?或者如何能在预热时实时获取到目前ehcache缓存使用量并及时停止预热?

spring MVC 3.1 ehcache 缓存无效

<bean id="cacheManagerFactory" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean"> <property name="configLocation" value="classpath:ehcache.xml" /> </bean> <bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheCacheManager"> <property name="cacheManager" ref="cacheManagerFactory" /> </bean> 我的spring 中配置的ehcache <ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ehcache.org/ehcache.xsd"> <diskStore path="java.io.tmpdir"/> <defaultCache maxElementsInMemory="1000" eternal="false" timeToIdleSeconds="120" timeToLiveSeconds="120" overflowToDisk="false"/> <cache name="theCache" maxElementsInMemory="2000" eternal="false" overflowToDisk="true" diskPersistent="true"/> <cache name="cacheTest" maxElementsInMemory="2000" eternal="false" overflowToDisk="true" diskPersistent="true"/> </ehcache> ehcache.xml 的配置 下面就是我的service 层 @Cacheable(value="theCache",key="'customer'") public Customer GetCustomerByCid(int cid){ System.out.print("----------------------------------------------------------"); return cd.GetCustomerByCid(cid); } 结果 测试点击两次查询tomcat打印: 第一次: DEBUG - Last-Modified value for [/jxc/customer/GetCustomerByCid] is: -1 ----------------------------------------------------------DEBUG - Creating a new SqlSession DEBUG - SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@63921a] was not registered for synchronization because synchronization is not active DEBUG - Fetching JDBC Connection from DataSource DEBUG - JDBC Connection [jdbc:mysql://192.168.1.6:3306/lyjxc?useUnicode=true&characterEncoding=utf-8, UserName=root@7-PC, MySQL-AB JDBC Driver] will not be managed by Spring DEBUG - ooo Using Connection [jdbc:mysql://192.168.1.6:3306/lyjxc?useUnicode=true&characterEncoding=utf-8, UserName=root@7-PC, MySQL-AB JDBC Driver] DEBUG - ==> Preparing: select * from Customer where cid=? DEBUG - ==> Parameters: 18(Integer) 第二次: DEBUG - Last-Modified value for [/jxc/customer/GetCustomerByCid] is: -1 ----------------------------------------------------------DEBUG - Creating a new SqlSession DEBUG - SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@19cdf24] was not registered for synchronization because synchronization is not active DEBUG - Fetching JDBC Connection from DataSource DEBUG - JDBC Connection [jdbc:mysql://192.168.1.6:3306/lyjxc?useUnicode=true&characterEncoding=utf-8, UserName=root@7-PC, MySQL-AB JDBC Driver] will not be managed by Spring DEBUG - ooo Using Connection [jdbc:mysql://192.168.1.6:3306/lyjxc?useUnicode=true&characterEncoding=utf-8, UserName=root@7-PC, MySQL-AB JDBC Driver] DEBUG - ==> Preparing: select * from Customer where cid=? DEBUG - ==> Parameters: 18(Integer) 很明显是访问了两次数据库,但是 我不知道为什么缓存无效,求大牛指教。。。

Ehcache 为啥缓存到磁盘中去

<?xml version="1.0" encoding="ISO-8859-1"?> <ehcache> <diskstore path="java.io.tmpdir"></diskstore> <defaultcache name="spring" maxElementsInMemory="10000" eternal="false" timeToIdleSeconds="120" timeToLiveSeconds="120" overflowToDisk="true" maxElementsOnDisk="10000000" diskPersistent="false" diskExpiryThreadIntervalSeconds="120" memoryStoreEvictionPolicy="LRU"> </defaultcache> <BootstrapCacheLoaderFactory class="net.sf.ehcache.store.DiskStoreBootstrapCacheLoaderFactory" properties="bootstrapAsynchronously=true" /> </ehcache> <!--ehcache 缓存--> <!--开启扫描--> <cache:annotation-driven cache-manager="cacheManager"></cache:annotation-driven> <bean id="temp" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean"> <property name="configLocation" value="classpath:ehcache.xml"></property> </bean> <bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheCacheManager"> <property name="cacheManager" ref="temp"></property> </bean>

java使用ehcache jgroups 无法数据同步问题

网上找不到答案,求帮忙。 我现在用ehcache jgroups在两台服务器上无法同步(同一台上也不行),tcp和udp都不行,但是单机是可以,而且用rmi是可以的。 **下面我贴上我的udp的配置文件,两台服务器配置相同** ------------------------------------------------------------ <ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ehcache.xsd"> <diskStore path="E:/database" /> <cacheManagerPeerProviderFactory class="net.sf.ehcache.distribution.jgroups.JGroupsCacheManagerPeerProviderFactory" properties="connect=UDP(mcast_addr=231.12.21.132;mcast_port=45566;ip_ttl=32; mcast_send_buf_size=150000;mcast_recv_buf_size=80000): PING(timeout=2000;num_initial_members=6): MERGE2(min_interval=5000;max_interval=10000): FD_SOCK:VERIFY_SUSPECT(timeout=1500): pbcast.NAKACK(gc_lag=10;retransmit_timeout=3000): UNICAST(timeout=5000): pbcast.STABLE(desired_avg_gossip=20000): FRAG: pbcast.GMS(join_timeout=5000;join_retry_timeout=2000; shun=false;print_local_addr=true)" propertySeparator="::" /> <cache name="UserCache" maxEntriesLocalHeap="1000" eternal="false" timeToIdleSeconds="1000" timeToLiveSeconds="1000" overflowToDisk="false"> <cacheEventListenerFactory class="net.sf.ehcache.distribution.jgroups.JGroupsCacheReplicatorFactory" properties="replicateAsynchronously=true, replicatePuts=true,replicateUpdates=true, replicateUpdatesViaCopy=true,replicateRemovals=true" /> <!-- <bootstrapCacheLoaderFactory class="net.sf.ehcache.distribution.jgroups.JGroupsBootstrapCacheLoaderFactory"/> --> </cache> </ehcache> ------------------------------------------------------------ **下面我贴上我的tcp的配置文件,两台服务器配置相同** ------------------------------------------------------------ <ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ehcache.xsd"> <diskStore path="java.io.tmpdir" /> <cacheManagerPeerProviderFactory class="net.sf.ehcache.distribution.jgroups.JGroupsCacheManagerPeerProviderFactory" properties="connect=TCP(start_port=7800): TCPPING(initial_hosts=192.2.2.57[7800],192.2.2.59[7800];port_range=10;timeout=3000; num_initial_members=3;up_thread=true;down_thread=true): VERIFY_SUSPECT(timeout=1500;down_thread=false;up_thread=false): pbcast.NAKACK(down_thread=true;up_thread=true;gc_lag=100;retransmit_timeout=3000): pbcast.GMS(join_timeout=5000;join_retry_timeout=2000;shun=false; print_local_addr=false;down_thread=true;up_thread=true)" propertySeparator="::" /> <defaultCache maxElementsInMemory="10000" eternal="true" overflowToDisk="true" timeToIdleSeconds="0" timeToLiveSeconds="0" diskPersistent="false" diskExpiryThreadIntervalSeconds="120"> <cacheEventListenerFactory class="net.sf.ehcache.distribution.jgroups.JGroupsCacheReplicatorFactory" properties="replicateAsynchronously=true, replicatePuts=true, replicateUpdates=true, replicateUpdatesViaCopy=false, replicateRemovals=true"/> </defaultCache> <cache name="UserCache" maxElementsInMemory="10000" eternal="true" overflowToDisk="true" timeToIdleSeconds="0" timeToLiveSeconds="0" diskPersistent="false" diskExpiryThreadIntervalSeconds="120"> <cacheEventListenerFactory class="net.sf.ehcache.distribution.jgroups.JGroupsCacheReplicatorFactory" properties="replicateAsynchronously=true, replicatePuts=true, replicateUpdates=true, replicateUpdatesViaCopy=false, replicateRemovals=true"/> </cache> </ehcache> ------------------------------------------------------------ 好心人帮忙解答下,谢谢! 单机都可以用,同步就不行。

spring整合ehcache缓存不了数据

大部分按照这个帖子上面说的做的http://www.cnblogs.com/lcuzhanglei/archive/2012/05/31/2528124.html, 但是数据就是缓存不了,每次测试都访问数据库。网上也没搜到答案 这个是我的ehcache.xml配置文件 [code="java"] <?xml version="1.0" encoding="UTF-8"?> <ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ehcache.xsd" updateCheck="true" monitoring="autodetect"> <diskStore path="d:\\temp\\cache"/> <defaultCache maxElementsInMemory="10000" eternal="false" timeToIdleSeconds="120" timeToLiveSeconds="120" overflowToDisk="true" maxElementsOnDisk="10000000" diskPersistent="false" diskExpiryThreadIntervalSeconds="120" memoryStoreEvictionPolicy="LRU" /> <cache name="demoCache" maxElementsInMemory="10000" maxElementsOnDisk="1000" eternal="false" overflowToDisk="true" diskSpoolBufferSizeMB="20" timeToIdleSeconds="300" timeToLiveSeconds="600" memoryStoreEvictionPolicy="LFU" /> </ehcache> [/code] spring配置文件 [code="java"] <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd" default-lazy-init="true"> <bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean"> <property name="configLocation"> <value>classpath:ehcache.xml</value> </property> </bean> <bean id="deptCache" class="org.springframework.cache.ehcache.EhCacheFactoryBean"> <property name="cacheManager" ref="cacheManager"/> <property name="beanName" value="democache"/> </bean> <bean id="cacheInterceptor" class="com.xiaolu.interceptor.MethodCacheInterceptor"> <property name="cache" ref="deptCache"/> </bean> <bean id="methodCachePointcutAdvisor" class="org.springframework.aop.support.RegexpMethodPointcutAdvisor"> <property name="advice" ref="cacheInterceptor"/> <property name="patterns"> <list> <value>.*getAllDept</value> </list> </property> </bean> <bean id="deptService" class="com.xiaolu.service.DeptService"/> <bean id="proxyFactoryBean" class="org.springframework.aop.framework.ProxyFactoryBean"> <property name="target" ref="deptService"/> <property name="interceptorNames"> <list> <value>methodCachePointcutAdvisor</value> </list> </property> </bean> </beans> [/code] 监听器 [code="java"] package com.xiaolu.interceptor; import java.io.Serializable; import net.sf.ehcache.Cache; import net.sf.ehcache.Element; import org.aopalliance.intercept.MethodInterceptor; import org.aopalliance.intercept.MethodInvocation; import org.springframework.beans.factory.InitializingBean; import org.springframework.util.Assert; public class MethodCacheInterceptor implements MethodInterceptor,InitializingBean { private Cache cache; @Override public Object invoke(MethodInvocation invocation) throws Throwable { String targetName = invocation.getThis().getClass().getName(); String methodName = invocation.getMethod().getName(); Object[] arguments = invocation.getArguments(); Object result = null; String cacheKey = getCacheKey(targetName, methodName, arguments); System.out.println("cacheKey:"+cacheKey); Element element = null; System.out.println("-----1-----"); synchronized(this){ element = cache.get(cacheKey); if(null == element){ result = invocation.proceed(); System.out.println("-----2----"); element = new Element(cacheKey, (Serializable)result); cache.put(element); } } return element.getValue(); } @Override public void afterPropertiesSet() throws Exception { Assert.notNull(cache, "A cache is required. Use setCache(Cache) to provide one."); } private String getCacheKey(String targetName,String methodName,Object[] arguments){ StringBuilder sb = new StringBuilder(); sb.append(targetName).append(".").append(methodName); if((arguments.length !=0)&&(arguments != null)){ for(int i=0;i<arguments.length;i++){ sb.append(".").append(arguments[i]); } } return sb.toString(); } public void setCache(Cache cache) { this.cache = cache; } } [/code] 访问数据库的类 [code="java"] package com.xiaolu.service; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.util.ArrayList; import java.util.List; import com.xiaolu.pojo.Dept; public class DeptService { Connection conn = null; PreparedStatement pstmt = null; ResultSet rs = null; public List<Dept> getAllDept(){ String sql = "select * from dept"; List<Dept> list = new ArrayList<Dept>(); try { Class.forName("oracle.jdbc.driver.OracleDriver"); conn = DriverManager.getConnection("jdbc:oracle:thin:@127.0.0.1:1521:orcl","scott","tiger"); pstmt = conn.prepareStatement(sql); rs = pstmt.executeQuery(); while(rs.next()){ Dept dept = new Dept(); dept.setDeptno(rs.getInt("deptno")); dept.setDname(rs.getString("dname")); dept.setLoc(rs.getString("loc")); list.add(dept); } } catch (Exception e) { e.printStackTrace(); } return list; } } [/code] 实体类 [code="java"] package com.xiaolu.pojo; import java.io.Serializable; public class Dept implements Serializable{ /** * */ private static final long serialVersionUID = 1L; private int deptno; private String dname; private String loc; public int getDeptno() { return deptno; } public void setDeptno(int deptno) { this.deptno = deptno; } public String getDname() { return dname; } public void setDname(String dname) { this.dname = dname; } public String getLoc() { return loc; } public void setLoc(String loc) { this.loc = loc; } } [/code] 测试代码 [code="java"] package test; import java.util.List; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; import com.xiaolu.pojo.Dept; import com.xiaolu.service.DeptService; import net.sf.ehcache.Cache; import net.sf.ehcache.CacheManager; import net.sf.ehcache.Element; public class Test { public static void main(String[] args) { ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml"); DeptService service = (DeptService) context.getBean("proxyFactoryBean"); List<Dept> list = service.getAllDept(); for(Dept dept:list){ System.out.println(dept.getDname()); } } } [/code]

怎样对从ehcache缓存中取出的对象修改而不改变缓存中的对象

使用缓存放入了对象,取出来修改属性后,发现缓存中的对象也修改了,也就是说缓存的是引用吗,如果想要对取出的对象操作而不改变缓存中的对象,要怎么做。 ``` List<Record> list = cache.get(cacheName, key); for(Record r:list){ if(r=="某条件"){ list.remove(r); } } System.out.println(list); ``` 第一次访问会修改list的内容,同样缓存内容被修改了。第二次访问,数据已经不正确了。

Spring整合Ehcache启动异常

Spring 整合 ehcache出现 Caused by: java.lang.NoClassDefFoundError: net/sf/ehca che/CacheManager 错误,百度了很多网页,都说是缺少jar包,但是每个网友说的jar包都不一致,所有的jar我都加进去试过,都还是同样的错误![图片说明](https://img-ask.csdn.net/upload/201610/12/1476262399_808659.png) spring.xml配置文件: ``` <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:cache="http://www.springframework.org/schema/cache" xmlns:p="http://www.springframework.org/schema/p" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd http://www.springframework.org/schema/cache http://www.springframework.org/schema/cache/spring-cache.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd"> <cache:annotation-driven /> <context:component-scan base-package="com.ztw" /> <!-- 缓存配置 --> <!-- 启用缓存注解功能(请将其配置在Spring主配置文件中) --> <cache:annotation-driven cache-manager="cacheManager" /> <bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheCacheManager" p:cache-manager-ref="ehcache" /> <bean id="ehcache" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean" p:config-location="classpath:ehcache.xml" /> </beans> ``` ehcache.xml配置文件: ``` <ehcache> <diskStore path="java.io.tmpdir"/> <defaultCache maxElementsInMemory="1000" eternal="false" timeToIdleSeconds="120" timeToLiveSeconds="120" overflowToDisk="false"/> <cache name="myCache" maxElementsOnDisk="20000" maxElementsInMemory="2000" eternal="true" overflowToDisk="true" diskPersistent="true"/> </ehcache> ``` 项目结构: ![图片说明](https://img-ask.csdn.net/upload/201610/12/1476262856_588831.png) tomcat启动报错截图: ![图片说明](https://img-ask.csdn.net/upload/201610/12/1476263254_119925.png)

软件测试入门、SQL、性能测试、测试管理工具

软件测试2小时入门,让您快速了解软件测试基本知识,有系统的了解; SQL一小时,让您快速理解和掌握SQL基本语法 jmeter性能测试 ,让您快速了解主流来源性能测试工具jmeter 测试管理工具-禅道,让您快速学会禅道的使用,学会测试项目、用例、缺陷的管理、

计算机组成原理实验教程

西北工业大学计算机组成原理实验课唐都仪器实验帮助,同实验指导书。分为运算器,存储器,控制器,模型计算机,输入输出系统5个章节

Java 最常见的 200+ 面试题:面试必备

这份面试清单是从我 2015 年做了 TeamLeader 之后开始收集的,一方面是给公司招聘用,另一方面是想用它来挖掘在 Java 技术栈中,还有那些知识点是我不知道的,我想找到这些技术盲点,然后修复它,以此来提高自己的技术水平。虽然我是从 2009 年就开始参加编程工作了,但我依旧觉得自己现在要学的东西很多,并且学习这些知识,让我很有成就感和满足感,那所以何乐而不为呢? 说回面试的事,这份面试...

winfrom中嵌套html,跟html的交互

winfrom中嵌套html,跟html的交互,源码就在里面一看就懂,很简单

玩转Python-Python3基础入门

总课时80+,提供源码和相关资料 本课程从Python零基础到纯Python项目实战。内容详细,案例丰富,覆盖了Python知识的方方面面,学完后不仅对Python知识有个系统化的了解,让你从Python小白变编程大牛! 课程包含: 1.python安装 2.变量、数据类型和运算符 3.选择结构 4.循环结构 5.函数和模块 6.文件读写 7.了解面向对象 8.异常处理

程序员的兼职技能课

获取讲师答疑方式: 在付费视频第一节(触摸命令_ALL)片头有二维码及加群流程介绍 限时福利 原价99元,今日仅需39元!购课添加小助手(微信号:itxy41)按提示还可领取价值800元的编程大礼包! 讲师介绍: 苏奕嘉&nbsp;前阿里UC项目工程师 脚本开发平台官方认证满级(六级)开发者。 我将如何教会你通过【定制脚本】赚到你人生的第一桶金? 零基础程序定制脚本开发课程,是完全针对零脚本开发经验的小白而设计,课程内容共分为3大阶段: ①前期将带你掌握Q开发语言和界面交互开发能力; ②中期通过实战来制作有具体需求的定制脚本; ③后期将解锁脚本的更高阶玩法,打通任督二脉; ④应用定制脚本合法赚取额外收入的完整经验分享,带你通过程序定制脚本开发这项副业,赚取到你的第一桶金!

HoloLens2开发入门教程

本课程为HoloLens2开发入门教程,讲解部署开发环境,安装VS2019,Unity版本,Windows SDK,创建Unity项目,讲解如何使用MRTK,编辑器模拟手势交互,打包VS工程并编译部署应用到HoloLens上等。

基于VHDL的16位ALU简易设计

基于VHDL的16位ALU简易设计,可完成基本的加减、带进位加减、或、与等运算。

MFC一站式终极全套课程包

该套餐共包含从C小白到C++到MFC的全部课程,整套学下来绝对成为一名C++大牛!!!

利用Verilog实现数字秒表(基本逻辑设计分频器练习)

设置复位开关。当按下复位开关时,秒表清零并做好计时准备。在任何情况下只要按下复位开关,秒表都要无条件地进行复位操作,即使是在计时过程中也要无条件地进行清零操作。 设置启/停开关。当按下启/停开关后,将

董付国老师Python全栈学习优惠套餐

购买套餐的朋友可以关注微信公众号“Python小屋”,上传付款截图,然后领取董老师任意图书1本。

Python可以这样学(第一季:Python内功修炼)

董付国系列教材《Python程序设计基础》、《Python程序设计(第2版)》、《Python可以这样学》配套视频,讲解Python 3.5.x和3.6.x语法、内置对象用法、选择与循环以及函数设计与使用、lambda表达式用法、字符串与正则表达式应用、面向对象编程、文本文件与二进制文件操作、目录操作与系统运维、异常处理结构。

计算机操作系统 第三版.pdf

计算机操作系统 第三版 本书全面介绍了计算机系统中的一个重要软件——操作系统(OS),本书是第三版,对2001年出版的修订版的各章内容均作了较多的修改,基本上能反映当前操作系统发展的现状,但章节名称基

技术大佬:我去,你写的 switch 语句也太老土了吧

昨天早上通过远程的方式 review 了两名新来同事的代码,大部分代码都写得很漂亮,严谨的同时注释也很到位,这令我非常满意。但当我看到他们当中有一个人写的 switch 语句时,还是忍不住破口大骂:“我擦,小王,你丫写的 switch 语句也太老土了吧!” 来看看小王写的代码吧,看完不要骂我装逼啊。 private static String createPlayer(PlayerTypes p...

Vue.js 2.0之全家桶系列视频课程

基于新的Vue.js 2.3版本, 目前新全的Vue.js教学视频,让你少走弯路,直达技术前沿! 1. 包含Vue.js全家桶(vue.js、vue-router、axios、vuex、vue-cli、webpack、ElementUI等) 2. 采用笔记+代码案例的形式讲解,通俗易懂

微信公众平台开发入门

本套课程的设计完全是为初学者量身打造,课程内容由浅入深,课程讲解通俗易懂,代码实现简洁清晰。通过本课程的学习,学员能够入门微信公众平台开发,能够胜任企业级的订阅号、服务号、企业号的应用开发工作。 通过本课程的学习,学员能够对微信公众平台有一个清晰的、系统性的认识。例如,公众号是什么,它有什么特点,它能做什么,怎么开发公众号。 其次,通过本课程的学习,学员能够掌握微信公众平台开发的方法、技术和应用实现。例如,开发者文档怎么看,开发环境怎么搭建,基本的消息交互如何实现,常用的方法技巧有哪些,真实应用怎么开发。

150讲轻松搞定Python网络爬虫

【为什么学爬虫?】 &nbsp; &nbsp; &nbsp; &nbsp;1、爬虫入手容易,但是深入较难,如何写出高效率的爬虫,如何写出灵活性高可扩展的爬虫都是一项技术活。另外在爬虫过程中,经常容易遇到被反爬虫,比如字体反爬、IP识别、验证码等,如何层层攻克难点拿到想要的数据,这门课程,你都能学到! &nbsp; &nbsp; &nbsp; &nbsp;2、如果是作为一个其他行业的开发者,比如app开发,web开发,学习爬虫能让你加强对技术的认知,能够开发出更加安全的软件和网站 【课程设计】 一个完整的爬虫程序,无论大小,总体来说可以分成三个步骤,分别是: 网络请求:模拟浏览器的行为从网上抓取数据。 数据解析:将请求下来的数据进行过滤,提取我们想要的数据。 数据存储:将提取到的数据存储到硬盘或者内存中。比如用mysql数据库或者redis等。 那么本课程也是按照这几个步骤循序渐进的进行讲解,带领学生完整的掌握每个步骤的技术。另外,因为爬虫的多样性,在爬取的过程中可能会发生被反爬、效率低下等。因此我们又增加了两个章节用来提高爬虫程序的灵活性,分别是: 爬虫进阶:包括IP代理,多线程爬虫,图形验证码识别、JS加密解密、动态网页爬虫、字体反爬识别等。 Scrapy和分布式爬虫:Scrapy框架、Scrapy-redis组件、分布式爬虫等。 通过爬虫进阶的知识点我们能应付大量的反爬网站,而Scrapy框架作为一个专业的爬虫框架,使用他可以快速提高我们编写爬虫程序的效率和速度。另外如果一台机器不能满足你的需求,我们可以用分布式爬虫让多台机器帮助你快速爬取数据。 &nbsp; 从基础爬虫到商业化应用爬虫,本套课程满足您的所有需求! 【课程服务】 专属付费社群+每周三讨论会+1v1答疑

SEIR课程设计源码与相关城市数据.rar

SEIR结合学报与之前博客结合所做的一些改进,选择其中三个城市进行拟合仿真SEIR结合学报与之前博客结合所做的一些改进,选择其中三个城市进行拟合仿真SEIR结合学报与之前博客结合所做的一些改进,选择其

Python数据挖掘简易入门

&nbsp; &nbsp; &nbsp; &nbsp; 本课程为Python数据挖掘方向的入门课程,课程主要以真实数据为基础,详细介绍数据挖掘入门的流程和使用Python实现pandas与numpy在数据挖掘方向的运用,并深入学习如何运用scikit-learn调用常用的数据挖掘算法解决数据挖掘问题,为进一步深入学习数据挖掘打下扎实的基础。

2019 AI开发者大会

2019 AI开发者大会(AI ProCon 2019)是由中国IT社区CSDN主办的AI技术与产业年度盛会。多年经验淬炼,如今蓄势待发:2019年9月6-7日,大会将有近百位中美顶尖AI专家、知名企业代表以及千余名AI开发者齐聚北京,进行技术解读和产业论证。我们不空谈口号,只谈技术,诚挚邀请AI业内人士一起共铸人工智能新篇章!

Java面试题大全(2020版)

发现网上很多Java面试题都没有答案,所以花了很长时间搜集整理出来了这套Java面试题大全,希望对大家有帮助哈~ 本套Java面试题大全,全的不能再全,哈哈~ 一、Java 基础 1. JDK 和 JRE 有什么区别? JDK:Java Development Kit 的简称,java 开发工具包,提供了 java 的开发环境和运行环境。 JRE:Java Runtime Environ...

定量遥感中文版 梁顺林著 范闻捷译

这是梁顺林的定量遥感的中文版,由范闻捷等翻译的,是电子版PDF,解决了大家看英文费时费事的问题,希望大家下载看看,一定会有帮助的

GIS程序设计教程 基于ArcGIS Engine的C#开发实例

张丰,杜震洪,刘仁义编著.GIS程序设计教程 基于ArcGIS Engine的C#开发实例.浙江大学出版社,2012.05

人工智能-计算机视觉实战之路(必备算法+深度学习+项目实战)

系列课程主要分为3大阶段:(1)首先掌握计算机视觉必备算法原理,结合Opencv进行学习与练手,通过实际视项目进行案例应用展示。(2)进军当下最火的深度学习进行视觉任务实战,掌握深度学习中必备算法原理与网络模型架构。(3)结合经典深度学习框架与实战项目进行实战,基于真实数据集展开业务分析与建模实战。整体风格通俗易懂,项目驱动学习与就业面试。 建议同学们按照下列顺序来进行学习:1.Python入门视频课程 2.Opencv计算机视觉实战(Python版) 3.深度学习框架-PyTorch实战/人工智能框架实战精讲:Keras项目 4.Python-深度学习-物体检测实战 5.后续实战课程按照自己喜好选择就可以

三个项目玩转深度学习(附1G源码)

从事大数据与人工智能开发与实践约十年,钱老师亲自见证了大数据行业的发展与人工智能的从冷到热。事实证明,计算机技术的发展,算力突破,海量数据,机器人技术等,开启了第四次工业革命的序章。深度学习图像分类一直是人工智能的经典任务,是智慧零售、安防、无人驾驶等机器视觉应用领域的核心技术之一,掌握图像分类技术是机器视觉学习的重中之重。针对现有线上学习的特点与实际需求,我们开发了人工智能案例实战系列课程。打造:以项目案例实践为驱动的课程学习方式,覆盖了智能零售,智慧交通等常见领域,通过基础学习、项目案例实践、社群答疑,三维立体的方式,打造最好的学习效果。

微信小程序开发实战之番茄时钟开发

微信小程序番茄时钟视频教程,本课程将带着各位学员开发一个小程序初级实战类项目,针对只看过官方文档而又无从下手的开发者来说,可以作为一个较好的练手项目,对于有小程序开发经验的开发者而言,可以更好加深对小程序各类组件和API 的理解,为更深层次高难度的项目做铺垫。

面试了一个 31 岁程序员,让我有所触动,30岁以上的程序员该何去何从?

最近面试了一个31岁8年经验的程序猿,让我有点感慨,大龄程序猿该何去何从。

去除异常值matlab程序

数据预处理中去除异常值的程序,matlab写成

用verilog HDL语言编写的秒表

在秒表设计中,分模块书写。用在七段数码管上显示。输入频率是1KHZ.可以显示百分秒,秒,分。如要显示小时,只需修改leds里的代码和主模块代码。改程序以通过硬件电路验证。完全正确。

[透视java——反编译、修补和逆向工程技术]源代码

源代码。

用QUARTUS设计模可变计数器器

用QUARTUS设计摸20|60的模可变计数器,文本设计

相关热词 c# 解析cad c#数字格式化万 c#int转byte c#格式化日期 c# wpf 表格 c# 实现ad域验证登录 c#心跳包机制 c#使用fmod.dll c#dll vb 调用 c# outlook
立即提问
相关内容推荐