[ERROR]-[Thread: JFinal-Scanner]-[net.sf.ehcache.store.disk.DiskStorageFactory$DiskWriteTask.call()]: Disk Write of findFloors failed: java.io.NotSerializableException: com.jfinal.plugin.activerecord.DaoContainerFactory$DaoMap at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1183) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1547) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1508) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1431) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1177) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1547) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1508) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1431) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1177) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:347) at java.util.ArrayList.writeObject(ArrayList.java:742) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:988) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1495) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1431) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1177) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1547) at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:440) at net.sf.ehcache.Element.writeObject(Element.java:875) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:988) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1495) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1431) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1177) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:347) at net.sf.ehcache.util.MemoryEfficientByteArrayOutputStream.serialize(MemoryEfficientByteArrayOutputStream.java:97) at net.sf.ehcache.store.disk.DiskStorageFactory.serializeElement(DiskStorageFactory.java:403) at net.sf.ehcache.store.disk.DiskStorageFactory.write(DiskStorageFactory.java:385) at net.sf.ehcache.store.disk.DiskStorageFactory$DiskWriteTask.call(DiskStorageFactory.java:477) at net.sf.ehcache.store.disk.DiskStorageFactory$PersistentDiskWriteTask.call(DiskStorageFactory.java:1071) at net.sf.ehcache.store.disk.DiskStorageFactory$IndexWriteTask.call(DiskStorageFactory.java:1108) at net.sf.ehcache.store.disk.DiskStorageFactory.unbind(DiskStorageFactory.java:921) at net.sf.ehcache.store.disk.DiskStore.dispose(DiskStore.java:664) at net.sf.ehcache.store.CacheStore.dispose(CacheStore.java:342) at net.sf.ehcache.Cache.dispose(Cache.java:2588) at net.sf.ehcache.CacheManager.shutdown(CacheManager.java:1548) at com.jfinal.plugin.ehcache.EhCachePlugin.stop(EhCachePlugin.java:95) at com.jfinal.core.JFinal.stopPlugins(JFinal.java:115) at com.jfinal.core.JFinalFilter.destroy(JFinalFilter.java:91) at org.eclipse.jetty.servlet.FilterHolder.destroyInstance(FilterHolder.java:153) at org.eclipse.jetty.servlet.FilterHolder.doStop(FilterHolder.java:131) at org.eclipse.jetty.util.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:89) at org.eclipse.jetty.servlet.ServletHandler.doStop(ServletHandler.java:204) at org.eclipse.jetty.util.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:89) at org.eclipse.jetty.server.handler.HandlerWrapper.doStop(HandlerWrapper.java:107) at org.eclipse.jetty.security.SecurityHandler.doStop(SecurityHandler.java:395) at org.eclipse.jetty.security.ConstraintSecurityHandler.doStop(ConstraintSecurityHandler.java:463) at org.eclipse.jetty.util.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:89) at org.eclipse.jetty.server.handler.HandlerWrapper.doStop(HandlerWrapper.java:107) at org.eclipse.jetty.server.session.SessionHandler.doStop(SessionHandler.java:136) at org.eclipse.jetty.util.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:89) at org.eclipse.jetty.server.handler.HandlerWrapper.doStop(HandlerWrapper.java:107) at org.eclipse.jetty.server.handler.ContextHandler.doStop(ContextHandler.java:805) at org.eclipse.jetty.servlet.ServletContextHandler.doStop(ServletContextHandler.java:160) at org.eclipse.jetty.webapp.WebAppContext.doStop(WebAppContext.java:516) at org.eclipse.jetty.util.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:89) at com.jfinal.server.JettyServer$1.onChange(JettyServer.java:116) at com.jfinal.server.Scanner.compare(Scanner.java:94) at com.jfinal.server.Scanner.working(Scanner.java:57) at com.jfinal.server.Scanner.access$000(Scanner.java:31) at com.jfinal.server.Scanner$1.run(Scanner.java:101) at java.util.TimerThread.mainLoop(Timer.java:555) at java.util.TimerThread.run(Timer.java:505)
翻了下源码,确实是没有实现Serializable接口
不过并没有影响项目运行,@JFinal 大佬,这个需要处理吗,求解释?
项目:JFinal
对于 Config 来说,缓存一个 String 足够了,通过 string 得到 Config 的代码:
Config config = Db.use(string);