cache 报错

12-05-02 xbzgb
我在一个应用里面两个地方用到缓存,一个是分页里面,然后其中一项图片用到缓存,项目能运转,但是多次点击不同的页后有时候就会报错,然后有些页面就出不来了,后台报错如下:

[STDOUT] 15:11:10,756 ERROR [CacheInterceptor] [JdonFramework]CacheInterceptor Exception error:java.lang.NullPointerException

15:11:10,756 INFO [STDOUT] 15:11:10,756 ERROR [ModelListAction] setModellistByKey error java.lang.NullPointerException

15:11:25,413 INFO [STDOUT] 15:11:25,413 ERROR [CacheInterceptor] [JdonFramework]CacheInterceptor Exception error:java.lang.NullPointerException

15:11:25,428 INFO [STDOUT] 15:11:25,428 ERROR [ModelListAction] setModellistByKey error java.lang.NullPointerException

15:11:27,194 INFO [STDOUT] 15:11:27,194 ERROR [CacheInterceptor] [JdonFramework]CacheInterceptor Exception error:java.lang.NullPointerException

15:11:27,194 INFO [STDOUT] 15:11:27,194 ERROR [ModelListAction] setModellistByKey error java.lang.NullPointerException

15:11:27,694 INFO [STDOUT] 15:11:27,694 ERROR [CacheInterceptor] [JdonFramework]CacheInterceptor Exception error:java.lang.NullPointerException

15:11:27,694 INFO [STDOUT] 15:11:27,694 ERROR [ModelListAction] setModellistByKey error java.lang.NullPointerException

15:11:27,725 INFO [STDOUT] 15:11:27,725 ERROR [CacheInterceptor] [JdonFramework]CacheInterceptor Exception error:java.lang.NullPointerException

15:11:27,741 INFO [STDOUT] 15:11:27,741 ERROR [ModelListAction] setModellistByKey error java.lang.NullPointerException

15:11:27,756 INFO [STDOUT] 15:11:27,756 ERROR [CacheInterceptor] [JdonFramework]CacheInterceptor Exception error:java.lang.NullPointerException

15:11:27,756 INFO [STDOUT] 15:11:27,756 ERROR [ModelListAction] setModellistByKey error java.lang.NullPointerException

15:11:27,788 INFO [STDOUT] 15:11:27,788 ERROR [CacheInterceptor] [JdonFramework]CacheInterceptor Exception error:java.lang.NullPointerException

15:11:27,803 INFO [STDOUT] 15:11:27,803 ERROR [ModelListAction] setModellistByKey error java.lang.NullPointerException

15:11:27,835 INFO [STDOUT] 15:11:27,835 ERROR [CacheInterceptor] [JdonFramework]CacheInterceptor Exception error:java.lang.NullPointerException

15:11:27,850 INFO [STDOUT] 15:11:27,850 ERROR [CacheInterceptor] [JdonFramework]CacheInterceptor Exception error:java.lang.NullPointerException

15:11:27,850 INFO [STDOUT] 15:11:27,850 ERROR [ModelListAction] setModellistByKey error java.lang.NullPointerException

15:11:27,850 INFO [STDOUT] 15:11:27,850 ERROR [ModelListAction] setModellistByKey error java.lang.NullPointerException

15:11:27,897 INFO [STDOUT] 15:11:27,897 ERROR [CacheInterceptor] [JdonFramework]CacheInterceptor Exception error:java.lang.NullPointerException

15:11:27,897 INFO [STDOUT] 15:11:27,897 ERROR [ModelListAction] setModellistByKey error java.lang.NullPointerException

15:11:27,913 INFO [STDOUT] 15:11:27,913 ERROR [CacheInterceptor] [JdonFramework]CacheInterceptor Exception error:java.lang.NullPointerException

15:11:27,928 INFO [STDOUT] 15:11:27,928 ERROR [ModelListAction] setModellistByKey error java.lang.NullPointerException

15:11:27,975 INFO [STDOUT] 15:11:27,975 ERROR [CacheInterceptor] [JdonFramework]CacheInterceptor Exception error:java.lang.NullPointerException

15:11:27,975 INFO [STDOUT] 15:11:27,975 ERROR [CacheInterceptor] [JdonFramework]CacheInterceptor Exception error:java.lang.NullPointerException

15:11:28,006 INFO [STDOUT] 15:11:28,006 ERROR [ModelListAction] setModellistByKey error java.lang.NullPointerException

15:11:28,006 INFO [STDOUT] 15:11:28,006 ERROR [ModelListAction] setModellistByKey error java.lang.NullPointerException

15:11:28,022 INFO [STDOUT] 15:11:28,022 ERROR [CacheInterceptor] [JdonFramework]CacheInterceptor Exception error:java.lang.NullPointerException

15:11:28,022 INFO [STDOUT] 15:11:28,022 ERROR [ModelListAction] setModellistByKey error java.lang.NullPointerException

15:11:28,053 INFO [STDOUT] 15:11:28,053 ERROR [CacheInterceptor] [JdonFramework]CacheInterceptor Exception error:java.lang.NullPointerException

15:11:28,069 INFO [STDOUT] 15:11:28,069 ERROR [ModelListAction] setModellistByKey error java.lang.NullPointerException

15:11:28,085 INFO [STDOUT] 15:11:28,085 ERROR [CacheInterceptor] [JdonFramework]CacheInterceptor Exception error:java.lang.NullPointerException

15:11:28,085 INFO [STDOUT] 15:11:28,085 ERROR [ModelListAction] setModellistByKey error java.lang.NullPointerException

15:11:28,131 INFO [STDOUT] 15:11:28,131 ERROR [CacheInterceptor] [JdonFramework]CacheInterceptor Exception error:java.lang.NullPointerException

15:11:28,131 INFO [STDOUT] 15:11:28,131 ERROR [ModelListAction] setModellistByKey error java.lang.NullPointerException

15:11:28,147 INFO [STDOUT] 15:11:28,147 ERROR [CacheInterceptor] [JdonFramework]CacheInterceptor Exception error:java.lang.NullPointerException

15:11:28,147 INFO [STDOUT] 15:11:28,147 ERROR [ModelListAction] setModellistByKey error java.lang.NullPointerException

15:13:27,570 INFO [STDOUT] 15:13:27,570 ERROR [CacheInterceptor] [JdonFramework]CacheInterceptor Exception error:java.lang.NullPointerException

15:13:27,586 INFO [STDOUT] 15:13:27,586 ERROR [ModelListAction] setModellistByKey error java.lang.NullPointerException

15:13:28,742 INFO [STDOUT] 15:13:28,742 ERROR [CacheInterceptor] [JdonFramework]CacheInterceptor Exception error:java.lang.NullPointerException

15:13:28,742 INFO [STDOUT] 15:13:28,742 ERROR [ModelListAction] setModellistByKey error java.lang.NullPointerException

15:13:30,852 INFO [STDOUT] 15:13:30,852 ERROR [CacheInterceptor] [JdonFramework]CacheInterceptor Exception error:java.lang.NullPointerException

15:13:31,024 INFO [STDOUT] 15:13:31,024 ERROR [ModelListAction] setModellistByKey error java.lang.NullPointerException

15:45:17,343 INFO [STDOUT] 15:45:17,343 ERROR [ModelListAction] setModellistByKey error java.lang.NullPointerException

banq
2012-05-02 19:29
好像是设置缓存主键时出错,最好在测试环境自己做个modellistaction, 然后进行代码定位。

xbzgb
2012-05-03 15:42
关键问题,如果是程序层面的错得话应该每次都报错,现在不是,点击多次后才偶尔会出现,后来我把图片改成不从缓存读取,而是从硬盘读取就可以了,是不是缓存有大小限制,图片放在里面不合适?

banq
2012-05-03 15:48
2012-05-03 15:42 "@xbzgb"的内容
是不是缓存有大小限制,图片放在里面不合适 ...

有可能,调整ehcache.xml中配置,注意JVM中内存大小分配。

xbzgb
2012-05-03 16:53
cache的配置文件

<?xml version="1.0" encoding="UTF-8"?>

<config>

<cache>

<default>

<maxSize>1000</maxSize>

<expireTime>3600*1000</expireTime><!-- 1小时后过期 -->

<useSoftReference>true</useSoftReference>

</default>

</cache>

</config>

banq
2012-05-03 17:20
这是Utilcache 的配置文件,不是缺省的ehcache,建议你看jdon-ehcache,xml

xbzgb
2012-05-04 09:40
不是这个配置吗?<component name="cache" class="com.jdon.controller.cache.LRUCache" >

<constructor value="cache.xml"/>

</component>

猜你喜欢