留言板

ehcache giving exception first time

thumbnail
Nikhil Nishchal,修改在7 年前。

ehcache giving exception first time

Regular Member 帖子: 176 加入日期: 12-6-22 最近的帖子
Hello,
While using ehcache I am getting following exception.
I used ehcache in my liferay (on local):
ehcache.multi.vm.config.location=/ehcache/my-ehcache-config.xml
but with this I am able to get cache result , but on fist time opening the page it gives following exception.
and this problem shows in random behavior.
Exception:
Sep 01, 2016 7:47:14 AM net.sf.ehcache.store.disk.DiskStorageFactory$DiskWriteTask call
SEVERE: Disk Write of com.liferay.portal.servlet.filters.cache.CacheUtil#4fbb#HTTP:///WEB/GUEST/HOME?#EN_US#47998721#TRUE failed:
java.lang.NullPointerException
at java.io.ObjectOutputStream.write(ObjectOutputStream.java:703)
at com.liferay.util.servlet.filters.CacheResponseData.writeObject(CacheResponseData.java:102)
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 java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:1028)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1496)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548)
at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:441)
at net.sf.ehcache.Element.writeObject(Element.java:867)
at sun.reflect.GeneratedMethodAccessor150.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:1028)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1496)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348)
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$PersistentDiskWriteTask.call(DiskStorageFactory.java:1055)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

Please let me know the solution or workaround to fix it.
thumbnail
Naresh Reddy Kallamadi,修改在7 年前。

RE: ehcache giving exception first time

Regular Member 帖子: 120 加入日期: 14-7-9 最近的帖子
Hi Nikhil,

I am also same issue as your, Can you tell me solution for it?

Thanks,
Naresh.
thumbnail
Naresh Reddy Kallamadi,修改在7 年前。

RE: ehcache giving exception first time

Regular Member 帖子: 120 加入日期: 14-7-9 最近的帖子
This is happens because of missing our custom eh cache configuration files missing liferay_home/web-inf/classes/
thumbnail
Nikhil Nishchal,修改在7 年前。

RE: ehcache giving exception first time

Regular Member 帖子: 176 加入日期: 12-6-22 最近的帖子
Hello Naresh,
is this issue get fixed to you while putting files in : liferay_home/web-inf/classes/ ?
thumbnail
Naresh Reddy Kallamadi,修改在7 年前。

RE: ehcache giving exception first time

Regular Member 帖子: 120 加入日期: 14-7-9 最近的帖子
Yes Nikhil, I could fix it by placing ehcache files in /web-inf/classes
thumbnail
Murat ÖZDEMİR,修改在6 年前。

RE: ehcache giving exception first time

New Member 帖子: 14 加入日期: 12-12-14 最近的帖子
Gentlemen,
i'm using Liferay 6.2-GA6

according to my ehcache config "ehcache.xsd" stays in "<LFR_HOME>/tomcat-7.0.62/webapps/ROOT/WEB-INF/classes/", "hibernate-clustered.xml" and "liferay-multi-vm-clustered.xml" files also stay "<LFR_HOME>/tomcat-7.0.62/webapps/ROOT/WEB-INF/classes/custom_cache" folder.

in my "portal-ext.properties" file these parameters are set regarding to replication:
cluster.link.enabled=true
cluster.link.autodetect.address=postgresql1:5432
net.sf.ehcache.configurationResourceName=/custom_cache/hibernate-clustered.xml
ehcache.multi.vm.config.location=/custom_cache/liferay-multi-vm-clustered.xml


But i'm still getting these exceptions. I could not find what to do. Please give a help to me.

21:44:39,243 ERROR [com%002eliferay%002eportal%002eservlet%002efilters%002ecache%002e%0043ache%0055til.data][DiskStorageFactory:120] Disk Write of com.liferay.portal.servlet.filters.cache.CacheUtil#27ab#HTTP:///GROUP/GUEST/DEMO?#EN_US#0#FALSE failed: 
java.lang.NullPointerException
	at java.io.ObjectOutputStream.write(ObjectOutputStream.java:702)
	at com.liferay.util.servlet.filters.CacheResponseData.writeObject(CacheResponseData.java:102)
	at sun.reflect.GeneratedMethodAccessor1252.invoke(Unknown Source)
	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:867)
	at sun.reflect.GeneratedMethodAccessor108.invoke(Unknown Source)
	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$PersistentDiskWriteTask.call(DiskStorageFactory.java:1055)
	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:745)