NutzCN Logo
问答 NutzBook中ehcache的问题
发布于 2418天前 作者 chniccs 1179 次浏览 复制 上一个帖子 下一个帖子
标签:

以下是配置

依赖版本:

<dependency>
            <groupId>org.nutz</groupId>
            <artifactId>nutz-plugins-daocache</artifactId>
            <version>1.r.62</version>
        </dependency>
        <dependency>
            <groupId>net.sf.ehcache</groupId>
            <artifactId>ehcache</artifactId>
            <version>2.10.4</version>
        </dependency>

ehcache.xml

<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="ehcache.xsd" updateCheck="false"
         monitoring="autodetect" dynamicConfig="true" name="nutzdemo">
    <!-- <diskStore path="java.io.tmpdir/shiro-ehcache"/> -->
    <defaultCache
            maxElementsInMemory="10000"
            eternal="false"
            timeToIdleSeconds="120"
            timeToLiveSeconds="120"
            overflowToDisk="false"
            diskPersistent="false"
            diskExpiryThreadIntervalSeconds="120"
    />
    <cache name="shiro-activeSessionCache"
           maxElementsInMemory="10000"
           overflowToDisk="true"
           eternal="true"
           timeToLiveSeconds="0"
           timeToIdleSeconds="0"
           diskPersistent="true"
           diskExpiryThreadIntervalSeconds="600"/>
</ehcache>

ehcache.js

var ioc = {
    "cacheManager" : {
        "type" : "net.sf.ehcache.CacheManager",
        "factory" : "net.sf.ehcache.CacheManager#getCacheManager",
        "args" : ["nutzdemo"] // 对应shiro.ini中指定的ehcache.xml中定义的name
    }
    /*
     // 如果不需要shiro初始化的Ehcache, 使用下面的方式配置
     "cacheManager" : {
     "type" : "net.sf.ehcache.CacheManager",
     "factory" : "net.sf.ehcache.CacheManager#create"
     }
     */
};

dao.js

var ioc = {
    conf : {
        type : "org.nutz.ioc.impl.PropertiesProxy",
        fields : {
            paths : ["custom/"]
        }
    },
    dataSource : {
        factory : "$conf#make",
        args : ["com.alibaba.druid.pool.DruidDataSource", "db."],
        type : "com.alibaba.druid.pool.DruidDataSource",
        events : {
            create : "init",
            depose : 'close'
        }
    },
    dao : {
        type : "org.nutz.dao.impl.NutDao",
        args : [{refer:"dataSource"}],
        fields : {
            interceptors : [{refer:"cacheExecutor"}, "log"]
        }
    },
    cacheExecutor : {
        type : "org.nutz.plugins.cache.dao.DaoCacheInterceptor",
        fields : {
            cacheProvider : {refer:"cacheProvider"},
            // 需要缓存的表名
            cachedTableNames : ["t_user_profile",
                //"t_user", "t_role", "t_permission", "t_role_permission"
            ]
        }
    },
    // 基于Ehcache的DaoCacheProvider
    cacheProvider : {
        type : "org.nutz.plugins.cache.dao.impl.provider.EhcacheDaoCacheProvider",
        fields : {
            cacheManager : {refer:"cacheManager"} // 引用ehcache.js中定义的CacheManager
        },
        events : {
            create : "init"
        }
    }
};

UserProfile类

@Table("t_user_profile")
public class UserProfile extends BasePojo {
    /**关联的用户id*/
    @Id(auto=false)
    @Column("uid")
    protected int userId;
    /**用户昵称*/
    @Column
    protected String nickname;
    /**用户邮箱*/
    @Column
    protected String email;
    /**邮箱是否已经验证过*/
    @Column("email_checked")
    protected boolean emailChecked;
    /**头像的byte数据*/
    @Column
    @JsonField(ignore=true)
    protected byte[] avatar;
    /**性别*/
    @Column
    protected String gender;
    /**自我介绍*/
    @Column("dt")
    protected String description;
    @Column("loc")
    protected String location;
get/set省略
}

ehcache配置后启动tomcat是没问题的,也没报错,但是在访问user/profile页面时报下面这个错

2017-11-01 14:23:59,669 org.nutz.mvc.impl.UrlMappingImpl.get(UrlMappingImpl.java:101) DEBUG - Found mapping for [GET] path=/user/profile : UserProfileModule.index(UserProfileModule.java:49)
2017-11-01 14:23:59,669 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:151) DEBUG - Get 'userProfileModule'<class com.chniccs.nutzdemo.module.UserProfileModule>
2017-11-01 14:23:59,670 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:177) DEBUG - 	 >> Load definition name=userProfileModule
2017-11-01 14:23:59,670 org.nutz.ioc.loader.combo.ComboIocLoader.load(ComboIocLoader.java:161) DEBUG - Found IocObject(userProfileModule) in AnnotationIocLoader(packages=[com.chniccs.nutzdemo])
2017-11-01 14:23:59,670 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:209) DEBUG - 	 >> Make...'userProfileModule'<class com.chniccs.nutzdemo.module.UserProfileModule>
2017-11-01 14:23:59,670 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:151) DEBUG - Get 'txREAD_COMMITTED'<interface org.nutz.aop.MethodInterceptor>
2017-11-01 14:23:59,671 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:177) DEBUG - 	 >> Load definition name=txREAD_COMMITTED
2017-11-01 14:23:59,671 org.nutz.ioc.loader.map.MapLoader.load(MapLoader.java:67) DEBUG - Loading define for name=txREAD_COMMITTED
2017-11-01 14:23:59,676 org.nutz.ioc.loader.combo.ComboIocLoader.load(ComboIocLoader.java:161) DEBUG - Found IocObject(txREAD_COMMITTED) in TransIocLoader@1043678058
2017-11-01 14:23:59,676 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:209) DEBUG - 	 >> Make...'txREAD_COMMITTED'<interface org.nutz.aop.MethodInterceptor>
2017-11-01 14:23:59,676 org.nutz.ioc.impl.ScopeContext.save(ScopeContext.java:64) DEBUG - Save object 'txREAD_COMMITTED' to [app] 
2017-11-01 14:23:59,683 org.nutz.aop.asm.AsmClassAgent.<clinit>(AsmClassAgent.java:29) DEBUG - AsmClassAgent will define class in Version 50
2017-11-01 14:23:59,689 org.nutz.ioc.impl.ScopeContext.save(ScopeContext.java:64) DEBUG - Save object 'userProfileModule' to [app] 
2017-11-01 14:23:59,695 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:151) DEBUG - Get 'dao'<interface org.nutz.dao.Dao>
2017-11-01 14:23:59,695 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:151) DEBUG - Get 'emailService'<interface com.chniccs.nutzdemo.service.EmailService>
2017-11-01 14:23:59,696 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:151) DEBUG - Get 'userService'<class com.chniccs.nutzdemo.service.UserService>
2017-11-01 14:23:59,696 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:151) DEBUG - Get 'cacheManager'<class net.sf.ehcache.CacheManager>
2017-11-01 14:23:59,707 net.sf.ehcache.store.MemoryStore.<init>(MemoryStore.java:180) DEBUG - Initialized net.sf.ehcache.store.MemoryStore for t_user_profile
2017-11-01 14:23:59,707 net.sf.ehcache.statistics.extended.ExtendedStatisticsImpl.findStandardPassThruStatistics(ExtendedStatisticsImpl.java:224) DEBUG - Mocking Pass-Through Statistic: LOCAL_OFFHEAP_SIZE
2017-11-01 14:23:59,708 net.sf.ehcache.statistics.extended.ExtendedStatisticsImpl.findStandardPassThruStatistics(ExtendedStatisticsImpl.java:224) DEBUG - Mocking Pass-Through Statistic: LOCAL_OFFHEAP_SIZE_BYTES
2017-11-01 14:23:59,708 net.sf.ehcache.statistics.extended.ExtendedStatisticsImpl.findStandardPassThruStatistics(ExtendedStatisticsImpl.java:224) DEBUG - Mocking Pass-Through Statistic: LOCAL_DISK_SIZE
2017-11-01 14:23:59,708 net.sf.ehcache.statistics.extended.ExtendedStatisticsImpl.findStandardPassThruStatistics(ExtendedStatisticsImpl.java:224) DEBUG - Mocking Pass-Through Statistic: LOCAL_DISK_SIZE_BYTES
2017-11-01 14:23:59,708 net.sf.ehcache.statistics.extended.ExtendedStatisticsImpl.findStandardPassThruStatistics(ExtendedStatisticsImpl.java:224) DEBUG - Mocking Pass-Through Statistic: WRITER_QUEUE_LENGTH
2017-11-01 14:23:59,708 net.sf.ehcache.statistics.extended.ExtendedStatisticsImpl.findStandardPassThruStatistics(ExtendedStatisticsImpl.java:224) DEBUG - Mocking Pass-Through Statistic: REMOTE_SIZE
2017-11-01 14:23:59,709 net.sf.ehcache.statistics.extended.ExtendedStatisticsImpl.findStandardPassThruStatistics(ExtendedStatisticsImpl.java:224) DEBUG - Mocking Pass-Through Statistic: LAST_REJOIN_TIMESTAMP
2017-11-01 14:23:59,709 net.sf.ehcache.statistics.extended.ExtendedStatisticsImpl.findStandardOperationStatistics(ExtendedStatisticsImpl.java:206) DEBUG - Mocking Operation Statistic: OFFHEAP_GET
2017-11-01 14:23:59,709 net.sf.ehcache.statistics.extended.ExtendedStatisticsImpl.findStandardOperationStatistics(ExtendedStatisticsImpl.java:206) DEBUG - Mocking Operation Statistic: OFFHEAP_PUT
2017-11-01 14:23:59,709 net.sf.ehcache.statistics.extended.ExtendedStatisticsImpl.findStandardOperationStatistics(ExtendedStatisticsImpl.java:206) DEBUG - Mocking Operation Statistic: OFFHEAP_REMOVE
2017-11-01 14:23:59,709 net.sf.ehcache.statistics.extended.ExtendedStatisticsImpl.findStandardOperationStatistics(ExtendedStatisticsImpl.java:206) DEBUG - Mocking Operation Statistic: DISK_GET
2017-11-01 14:23:59,710 net.sf.ehcache.statistics.extended.ExtendedStatisticsImpl.findStandardOperationStatistics(ExtendedStatisticsImpl.java:206) DEBUG - Mocking Operation Statistic: DISK_PUT
2017-11-01 14:23:59,710 net.sf.ehcache.statistics.extended.ExtendedStatisticsImpl.findStandardOperationStatistics(ExtendedStatisticsImpl.java:206) DEBUG - Mocking Operation Statistic: DISK_REMOVE
2017-11-01 14:23:59,710 net.sf.ehcache.statistics.extended.ExtendedStatisticsImpl.findStandardOperationStatistics(ExtendedStatisticsImpl.java:206) DEBUG - Mocking Operation Statistic: XA_COMMIT
2017-11-01 14:23:59,710 net.sf.ehcache.statistics.extended.ExtendedStatisticsImpl.findStandardOperationStatistics(ExtendedStatisticsImpl.java:206) DEBUG - Mocking Operation Statistic: XA_ROLLBACK
2017-11-01 14:23:59,710 net.sf.ehcache.statistics.extended.ExtendedStatisticsImpl.findStandardOperationStatistics(ExtendedStatisticsImpl.java:206) DEBUG - Mocking Operation Statistic: XA_RECOVERY
2017-11-01 14:23:59,710 net.sf.ehcache.statistics.extended.ExtendedStatisticsImpl.findStandardOperationStatistics(ExtendedStatisticsImpl.java:206) DEBUG - Mocking Operation Statistic: CLUSTER_EVENT
2017-11-01 14:23:59,711 net.sf.ehcache.statistics.extended.ExtendedStatisticsImpl.findStandardOperationStatistics(ExtendedStatisticsImpl.java:206) DEBUG - Mocking Operation Statistic: NONSTOP
2017-11-01 14:23:59,712 net.sf.ehcache.Cache.initialise(Cache.java:1262) DEBUG - Initialised cache: t_user_profile
2017-11-01 14:23:59,712 net.sf.ehcache.config.ConfigurationHelper.createDefaultCacheDecorators(ConfigurationHelper.java:364) DEBUG - CacheDecoratorFactory not configured for defaultCache. Skipping for 't_user_profile'.
2017-11-01 14:23:59,713 org.nutz.dao.impl.sql.run.NutDaoExecutor.printSQL(NutDaoExecutor.java:388) DEBUG - SELECT uid,nickname,email,email_checked,gender,dt,loc,ct,ut FROM t_user_profile  WHERE uid=?
    | 1 |
    |---|
    | 1 |
  For example:> "SELECT uid,nickname,email,email_checked,gender,dt,loc,ct,ut FROM t_user_profile  WHERE uid=1"
2017-11-01 14:23:59,731 org.nutz.plugins.cache.dao.impl.convert.JavaCacheSerializer.from(JavaCacheSerializer.java:31) INFO  - Object to bytes fail
java.io.NotSerializableException: com.chniccs.nutzdemo.bean.UserProfile
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1184)
	at java.io.ObjectOutputStream.writeUnshared(ObjectOutputStream.java:415)
	at org.nutz.plugins.cache.dao.impl.convert.JavaCacheSerializer.from(JavaCacheSerializer.java:27)
	at org.nutz.plugins.cache.dao.impl.provider.EhcacheDaoCacheProvider.put(EhcacheDaoCacheProvider.java:28)
	at org.nutz.plugins.cache.dao.CachedNutDaoExecutor.exec(CachedNutDaoExecutor.java:172)
	at org.nutz.plugins.cache.dao.DaoCacheInterceptor.filter(DaoCacheInterceptor.java:18)
	at org.nutz.dao.DaoInterceptorChain.doChain(DaoInterceptorChain.java:64)
	at org.nutz.dao.DaoInterceptorChain.invoke(DaoInterceptorChain.java:139)
	at org.nutz.dao.impl.sql.run.NutDaoRunner.runCallback(NutDaoRunner.java:158)
	at org.nutz.dao.impl.sql.run.NutDaoRunner._runWithoutTransaction(NutDaoRunner.java:125)
	at org.nutz.dao.impl.sql.run.NutDaoRunner._run(NutDaoRunner.java:92)
	at org.nutz.dao.impl.sql.run.NutDaoRunner.run(NutDaoRunner.java:81)
	at org.nutz.dao.impl.DaoSupport.run(DaoSupport.java:240)
	at org.nutz.dao.impl.DaoSupport._exec(DaoSupport.java:252)
	at org.nutz.dao.impl.NutDao.fetch(NutDao.java:556)
	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.nutz.dao.util.ExtDaoInvocationHandler$1.run(Daos.java:1051)
	at org.nutz.dao.FieldFilter.run(FieldFilter.java:286)
	at org.nutz.dao.FieldFilter.run(FieldFilter.java:297)
	at org.nutz.dao.util.ExtDaoInvocationHandler.invoke(Daos.java:1067)
	at com.sun.proxy.$Proxy38.fetch(Unknown Source)
	at com.chniccs.nutzdemo.module.UserProfileModule.get(UserProfileModule.java:55)
	at com.chniccs.nutzdemo.module.UserProfileModule.index(UserProfileModule.java:49)
	at com.chniccs.nutzdemo.module.UserProfileModule$FM$index$72458cbb5818f0310c57f0e0713e6e66.invoke(UserProfileModule.java)
	at org.nutz.mvc.impl.processor.MethodInvokeProcessor.process(MethodInvokeProcessor.java:31)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.AdaptorProcessor.process(AdaptorProcessor.java:33)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.ActionFiltersProcessor.process(ActionFiltersProcessor.java:58)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.integration.shiro.NutShiroProcessor.process(NutShiroProcessor.java:126)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.ModuleProcessor.process(ModuleProcessor.java:123)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.EncodingProcessor.process(EncodingProcessor.java:27)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.UpdateRequestAttributesProcessor.process(UpdateRequestAttributesProcessor.java:15)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at com.chniccs.nutzdemo.mvc.LogTimeProcessor.process(LogTimeProcessor.java:22)
	at org.nutz.mvc.impl.NutActionChain.doChain(NutActionChain.java:44)
	at org.nutz.mvc.impl.ActionInvoker.invoke(ActionInvoker.java:67)
	at org.nutz.mvc.ActionHandler.handle(ActionHandler.java:31)
	at org.nutz.mvc.NutFilter.doFilter(NutFilter.java:202)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at com.alibaba.druid.support.http.WebStatFilter.doFilter(WebStatFilter.java:123)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)
	at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)
	at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)
	at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)
	at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:387)
	at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)
	at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:478)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80)
	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:624)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:799)
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:861)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1455)
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Thread.java:748)
2017-11-01 14:23:59,912 com.chniccs.nutzdemo.mvc.LogTimeProcessor.process(LogTimeProcessor.java:27) DEBUG - [ GET]URI=/user/profile 243ms
2017-11-01 14:23:59,923 org.nutz.mvc.impl.UrlMappingImpl.get(UrlMappingImpl.java:101) DEBUG - Found mapping for [GET] path=/user/profile/avatar : UserProfileModule.readAvatar(UserProfileModule.java:145)
2017-11-01 14:23:59,924 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:151) DEBUG - Get 'userProfileModule'<class com.chniccs.nutzdemo.module.UserProfileModule>
2017-11-01 14:23:59,924 org.nutz.dao.impl.sql.run.NutDaoExecutor.printSQL(NutDaoExecutor.java:388) DEBUG - SELECT avatar FROM t_user_profile  WHERE uid=?
    | 1 |
    |---|
    | 1 |
  For example:> "SELECT avatar FROM t_user_profile  WHERE uid=1"
2017-11-01 14:23:59,928 org.nutz.plugins.cache.dao.impl.convert.JavaCacheSerializer.from(JavaCacheSerializer.java:31) INFO  - Object to bytes fail
java.io.NotSerializableException: com.chniccs.nutzdemo.bean.UserProfile
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1184)
	at java.io.ObjectOutputStream.writeUnshared(ObjectOutputStream.java:415)
	at org.nutz.plugins.cache.dao.impl.convert.JavaCacheSerializer.from(JavaCacheSerializer.java:27)
	at org.nutz.plugins.cache.dao.impl.provider.EhcacheDaoCacheProvider.put(EhcacheDaoCacheProvider.java:28)
	at org.nutz.plugins.cache.dao.CachedNutDaoExecutor.exec(CachedNutDaoExecutor.java:172)
	at org.nutz.plugins.cache.dao.DaoCacheInterceptor.filter(DaoCacheInterceptor.java:18)
	at org.nutz.dao.DaoInterceptorChain.doChain(DaoInterceptorChain.java:64)
	at org.nutz.dao.DaoInterceptorChain.invoke(DaoInterceptorChain.java:139)
	at org.nutz.dao.impl.sql.run.NutDaoRunner.runCallback(NutDaoRunner.java:158)
	at org.nutz.dao.impl.sql.run.NutDaoRunner._runWithoutTransaction(NutDaoRunner.java:125)
	at org.nutz.dao.impl.sql.run.NutDaoRunner._run(NutDaoRunner.java:92)
	at org.nutz.dao.impl.sql.run.NutDaoRunner.run(NutDaoRunner.java:81)
	at org.nutz.dao.impl.DaoSupport.run(DaoSupport.java:240)
	at org.nutz.dao.impl.DaoSupport._exec(DaoSupport.java:252)
	at org.nutz.dao.impl.NutDao.fetch(NutDao.java:556)
	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.nutz.dao.util.ExtDaoInvocationHandler$1.run(Daos.java:1051)
	at org.nutz.dao.FieldFilter.run(FieldFilter.java:286)
	at org.nutz.dao.FieldFilter.run(FieldFilter.java:297)
	at org.nutz.dao.util.ExtDaoInvocationHandler.invoke(Daos.java:1067)
	at com.sun.proxy.$Proxy38.fetch(Unknown Source)
	at com.chniccs.nutzdemo.module.UserProfileModule.readAvatar(UserProfileModule.java:145)
	at com.chniccs.nutzdemo.module.UserProfileModule$FM$readAvatar$54fa516e335f5bbf064b7d9a73e2a5c1.invoke(UserProfileModule.java)
	at org.nutz.mvc.impl.processor.MethodInvokeProcessor.process(MethodInvokeProcessor.java:31)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.AdaptorProcessor.process(AdaptorProcessor.java:33)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.ActionFiltersProcessor.process(ActionFiltersProcessor.java:58)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.integration.shiro.NutShiroProcessor.process(NutShiroProcessor.java:126)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.ModuleProcessor.process(ModuleProcessor.java:123)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.EncodingProcessor.process(EncodingProcessor.java:27)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.UpdateRequestAttributesProcessor.process(UpdateRequestAttributesProcessor.java:15)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at com.chniccs.nutzdemo.mvc.LogTimeProcessor.process(LogTimeProcessor.java:22)
	at org.nutz.mvc.impl.NutActionChain.doChain(NutActionChain.java:44)
	at org.nutz.mvc.impl.ActionInvoker.invoke(ActionInvoker.java:67)
	at org.nutz.mvc.ActionHandler.handle(ActionHandler.java:31)
	at org.nutz.mvc.NutFilter.doFilter(NutFilter.java:202)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at com.alibaba.druid.support.http.WebStatFilter.doFilter(WebStatFilter.java:123)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)
	at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)
	at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)
	at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)
	at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:387)
	at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)
	at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:478)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80)
	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:624)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:799)
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:861)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1455)
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Thread.java:748)
2017-11-01 14:23:59,934 com.chniccs.nutzdemo.mvc.LogTimeProcessor.process(LogTimeProcessor.java:27) DEBUG - [ GET]URI=/user/profile/avatar 11ms
2017-11-01 14:24:00,003 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:151) DEBUG - Get 'cleanNonActiveUserJob'<class com.chniccs.nutzdemo.quartz.job.CleanNonActiveUserJob>
2017-11-01 14:24:00,003 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:177) DEBUG - 	 >> Load definition name=cleanNonActiveUserJob
2017-11-01 14:24:00,003 org.nutz.ioc.loader.combo.ComboIocLoader.load(ComboIocLoader.java:161) DEBUG - Found IocObject(cleanNonActiveUserJob) in AnnotationIocLoader(packages=[com.chniccs.nutzdemo])
2017-11-01 14:24:00,003 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:209) DEBUG - 	 >> Make...'cleanNonActiveUserJob'<class com.chniccs.nutzdemo.quartz.job.CleanNonActiveUserJob>
2017-11-01 14:24:00,003 org.nutz.ioc.aop.impl.DefaultMirrorFactory.getMirror(DefaultMirrorFactory.java:70) DEBUG - Load class com.chniccs.nutzdemo.quartz.job.CleanNonActiveUserJob without AOP
2017-11-01 14:24:00,003 org.nutz.ioc.impl.ScopeContext.save(ScopeContext.java:64) DEBUG - Save object 'cleanNonActiveUserJob' to [app] 
2017-11-01 14:24:00,005 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:151) DEBUG - Get 'dao'<interface org.nutz.dao.Dao>
2017-11-01 14:24:00,006 org.quartz.core.QuartzSchedulerThread.run(QuartzSchedulerThread.java:291) DEBUG - batch acquisition of 0 triggers
2017-11-01 14:24:00,006 org.quartz.core.JobRunShell.run(JobRunShell.java:201) DEBUG - Calling execute on job DEFAULT.com.chniccs.nutzdemo.quartz.job.CleanNonActiveUserJob
2017-11-01 14:24:00,006 com.chniccs.nutzdemo.quartz.job.CleanNonActiveUserJob.execute(CleanNonActiveUserJob.java:35) DEBUG - clean Non-Active User , start
2017-11-01 14:24:00,011 org.nutz.dao.impl.sql.run.NutDaoExecutor.printSQL(NutDaoExecutor.java:388) DEBUG - DELETE FROM t_user_profile WHERE uid>? AND ct<? AND (email_checked=? OR email IS NULL )
    |  1 |                   2 |     3 |
    |----|---------------------|-------|
    | 10 | 2017-10-31 14:24:00 | false |
  For example:> "DELETE FROM t_user_profile WHERE uid>10 AND ct<'2017-10-31 14:24:00' AND (email_checked=false OR email IS NULL )"
2017-11-01 14:24:00,016 com.chniccs.nutzdemo.quartz.job.CleanNonActiveUserJob.execute(CleanNonActiveUserJob.java:39) DEBUG - delete 0 UserProfile
2017-11-01 14:24:00,053 org.nutz.dao.impl.sql.run.NutDaoExecutor.printSQL(NutDaoExecutor.java:388) DEBUG - delete from t_user where id > 10 and not exists (select 1 from t_user_profile where t_user.id = uid ) and ct < ?
    |                   1 |
    |---------------------|
    | 2017-10-31 14:24:00 |
  For example:> "delete from t_user where id > 10 and not exists (select 1 from t_user_profile where t_user.id = uid ) and ct < '2017-10-31 14:24:00'"
2017-11-01 14:24:00,054 com.chniccs.nutzdemo.quartz.job.CleanNonActiveUserJob.execute(CleanNonActiveUserJob.java:46) DEBUG - delete 0 User
2017-11-01 14:24:00,055 com.chniccs.nutzdemo.quartz.job.CleanNonActiveUserJob.execute(CleanNonActiveUserJob.java:48) DEBUG - clean Non-Active User , Done

1 回复

解决了,忘记实现Serializable接口了 0.0

添加回复
请先登陆
回到顶部