History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: CACHE-72
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Lars Torunski
Reporter: Cal Holman
Votes: 7
Watchers: 7
Operations

If you were logged in you would be able to see more operations.
OSCache

NullPointerException in AbstractConcurrentReadCache.clear

Created: 06/Jan/04 02:14 PM   Updated: 14/Apr/05 09:23 AM
Component/s: Base Classes
Affects Version/s: 2.0.1
Fix Version/s: 2.1

Environment: win2k, tomcat 5.0.16, jdk 1.4.02, using FIFO and session based cashing


 Description  « Hide
I am getting peridoic null pointer exceptions that do not seem to impact the application. Here is part of the log.

INFO 01-06 13:44:32 Constructed ServletCacheAdministrator() (ServletCacheAdministrator.java:139)
INFO 01-06 13:44:32 Created new instance of ServletCacheAdministrator (ServletCacheAdministrator.j
ava:174)
INFO 01-06 13:44:33 Created new application-scoped cache at key: __oscache_cache (ServletCacheAdmi
nistrator.java:243)
INFO 01-06 13:44:33 Created new cache in scope 4 (ServletCacheAdministrator.java:690)
INFO 01-06 13:44:33 Created new session-scoped cache in session 6D5956E91EF4CD67C697DB54C1B58DCC at
 key: __oscache_cache (ServletCacheAdministrator.java:268)
INFO 01-06 13:44:33 Created new cache in scope 3 (ServletCacheAdministrator.java:690)
INFO 01-06 13:44:33 <cache>: Cached content not used: New cache entry, cache stale or scope flushed
 : /portal (CacheTag.java:508)
INFO 01-06 13:44:38 <cache>: Updating cache entry with new content : /portal (CacheTag.java:354)
INFO 01-06 13:44:44 Popular Pictures Action <br> ** 68.217.82.230 ** Mozilla/4.0 (compatible; MSIE
6.0; Windows NT 5.0) (PopularPicturesAction.java:70)
INFO 01-06 13:44:50 Displaying picture: 4672 Title: Sweetpea and a Monkey Toy Name: peaMonkey.jpg <
br> ** 68.217.82.230 ** Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0) (ScrapbookDisplayPicture
Action.java:90)
INFO 01-06 13:44:54 Popular Pages Action <br> ** 68.217.82.230 ** Mozilla/4.0 (compatible; MSIE 6.0
; Windows NT 5.0) (PopularPagesAction.java:67)
INFO 01-06 13:47:49 [Cache] Unbound from session B36D6403F7CE6B9D155D19377ECFDF14 using name __osca
che_cache (ServletCache.java:95)
Jan 6, 2004 1:47:49 PM org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor processCh
ildren
SEVERE: Exception invoking periodic operation:
java.lang.NullPointerException
        at com.opensymphony.oscache.base.algorithm.AbstractConcurrentReadCache.clear(AbstractConcurr
entReadCache.java:460)
        at com.opensymphony.oscache.base.Cache.clear(Cache.java:665)
        at com.opensymphony.oscache.web.ServletCache.valueUnbound(ServletCache.java:97)
        at org.apache.catalina.session.StandardSession.removeAttribute(StandardSession.java:1187)
        at org.apache.catalina.session.StandardSession.expire(StandardSession.java:712)
        at org.apache.catalina.session.StandardSession.isValid(StandardSession.java:589)
        at org.apache.catalina.session.StandardManager.processExpires(StandardManager.java:815)
        at org.apache.catalina.core.StandardContext.backgroundProcess(StandardContext.java:4563)
        at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(Conta
inerBase.java:1659)
        at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(Conta
inerBase.java:1668)
        at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(Conta
inerBase.java:1668)
        at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.jav
a:1648)
        at java.lang.Thread.run(Thread.java:534)
INFO 01-06 13:48:23 Logon <br> ** 68.217.82.230 ** Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.
1; .NET CLR 1.0.3705; .NET CLR 1.1.4322) (HolmanSiteAction.java:136)
INFO 01-06 13:48:23 Home Page accessed <br> ** 68.217.82.230 ** Mozilla/4.0 (compatible; MSIE 6.0;
Windows NT 5.1; .NET CLR 1.0.3705; .NET CLR 1.1.4322) (WelcomeAction.java:65)
INFO 01-06 13:48:23 Created new session-scoped cache in session C3841BB35A4E9AEBAC0A82B5F151F526 at
 key: __oscache_cache (ServletCacheAdministrator.java:268)
INFO 01-06 13:48:23 Created new cache in scope 3 (ServletCacheAdministrator.java:690)
INFO 01-06 13:48:23 <cache>: Cached content not used: New cache entry, cache stale or scope flushed
 : /portal (CacheTag.java:508)
INFO 01-06 13:48:28 <cache>: Updating cache entry with new content : /portal (CacheTag.java:354)
INFO 01-06 13:48:30 Home Page accessed <br> ** 68.217.82.230 ** Mozilla/4.0 (compatible; MSIE 6.0;
Windows NT 5.1; .NET CLR 1.0.3705; .NET CLR 1.1.4322) (WelcomeAction.java:65)
INFO 01-06 13:48:34 Headed to about.pagedef Action <br> ** 68.217.82.230 ** Mozilla/4.0 (compatible
; MSIE 6.0; Windows NT 5.1; .NET CLR 1.0.3705; .NET CLR 1.1.4322) (AutoForwardAction.java:142)
INFO 01-06 13:48:37 Support Projects Action <br> ** 68.217.82.230 ** Mozilla/4.0 (compatible; MSIE
6.0; Windows NT 5.1; .NET CLR 1.0.3705; .NET CLR 1.1.4322) (SupportProjectsAction.java:59)
INFO 01-06 13:49:36 Logon <br> ** 66.196.72.94 ** Mozilla/5.0 (Slurp/cat; slurp@inktomi.com; http:/
/www.inktomi.com/slurp.html) (HolmanSiteAction.java:136)
INFO 01-06 13:49:36 Read Blog Action <br> ** 66.196.72.94 ** Mozilla/5.0 (Slurp/cat; slurp@inktomi.
com; http://www.inktomi.com/slurp.html) (ReadAction.java:74)
INFO 01-06 13:49:36 Created new session-scoped cache in session E33A16FCF73E2FB5F7DD20C2802AFC30 at
 key: __oscache_cache (ServletCacheAdministrator.java:268)
INFO 01-06 13:49:36 Created new cache in scope 3 (ServletCacheAdministrator.java:690)
INFO 01-06 13:49:36 <cache>: Cached content not used: New cache entry, cache stale or scope flushed
 : /portal (CacheTag.java:508)

 All   Comments   Change History      Sort Order:
Ronan Brady - [12/Jan/04 08:51 AM ]
I've come across a similar NPE in similar circumstances. It too is intermittent and seems to be session related. IMHO the priority should be higher than minor as this NPE causes the application to be unstable.

My guess is that it's a symptom of the same bug, if it turns out not to be i can log it as a separate issue.

java.lang.NullPointerException
        at com.opensymphony.oscache.base.algorithm.AbstractConcurrentReadCache.get(AbstractConcurrentReadCache.java:686)
        at com.opensymphony.oscache.base.Cache.getCacheEntry(Cache.java:596)
        at com.opensymphony.oscache.base.Cache.getFromCache(Cache.java:227)
        at com.opensymphony.oscache.base.Cache.getFromCache(Cache.java:202)
        at com.opensymphony.oscache.web.ServletCacheAdministrator.getFromCache(ServletCacheAdministrator.java:356)
        at com.mobileaware.cache.e.b(SourceFile:104)
        at com.mobileaware.cache.documentcache.a.d(SourceFile:168)
        at com.mobileaware.cache.documentcache.a.b(SourceFile:64)
        at com.mobileaware.mcp.h.E(SourceFile:486)
        at com.mobileaware.mcp.MobilityFilter.a(SourceFile:492)
        at com.mobileaware.mcp.MobilityFilter.a(SourceFile:1098)
        at com.mobileaware.mcp.MobilityFilter.a(SourceFile:932)
        at com.mobileaware.mcp.MobilityFilter.a(SourceFile:625)
        at com.mobileaware.mcp.MobilityFilter.doFilter(SourceFile:1253)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
        at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
        at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
        at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
        at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
        at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
        at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
        at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
        at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
        at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
        at java.lang.Thread.run(Thread.java:534)

Ronan Brady - [12/Jan/04 08:51 AM ]
I've come across a similar NPE in similar circumstances. It too is intermittent and seems to be session related. IMHO the priority should be higher than minor as this NPE causes the application to be unstable.

My guess is that it's a symptom of the same bug, if it turns out not to be i can log it as a separate issue.

java.lang.NullPointerException
        at com.opensymphony.oscache.base.algorithm.AbstractConcurrentReadCache.get(AbstractConcurrentReadCache.java:686)
        at com.opensymphony.oscache.base.Cache.getCacheEntry(Cache.java:596)
        at com.opensymphony.oscache.base.Cache.getFromCache(Cache.java:227)
        at com.opensymphony.oscache.base.Cache.getFromCache(Cache.java:202)
        at com.opensymphony.oscache.web.ServletCacheAdministrator.getFromCache(ServletCacheAdministrator.java:356)
        at com.mobileaware.cache.e.b(SourceFile:104)
        at com.mobileaware.cache.documentcache.a.d(SourceFile:168)
        at com.mobileaware.cache.documentcache.a.b(SourceFile:64)
        at com.mobileaware.mcp.h.E(SourceFile:486)
        at com.mobileaware.mcp.MobilityFilter.a(SourceFile:492)
        at com.mobileaware.mcp.MobilityFilter.a(SourceFile:1098)
        at com.mobileaware.mcp.MobilityFilter.a(SourceFile:932)
        at com.mobileaware.mcp.MobilityFilter.a(SourceFile:625)
        at com.mobileaware.mcp.MobilityFilter.doFilter(SourceFile:1253)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
        at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
        at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
        at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
        at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
        at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
        at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
        at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
        at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
        at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
        at java.lang.Thread.run(Thread.java:534)

James Rigg - [06/Apr/04 04:58 PM ]

I have a similar but in my case fairly fatal problem. I am using session based caching, and when I restart Tomcat (v 5.0.19) any browser session still open gets errors (which are of course also in the logs):-

2004-04-06 17:43:07 StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception
java.lang.NullPointerException
        at com.opensymphony.oscache.base.algorithm.AbstractConcurrentReadCache.get(AbstractConcurrentReadCache.java:686)
        at com.opensymphony.oscache.base.Cache.getCacheEntry(Cache.java:594)
        at com.opensymphony.oscache.base.Cache.getFromCache(Cache.java:227)
        at com.opensymphony.oscache.web.tag.CacheTag.doStartTag(CacheTag.java:482)


The only work around I can think of is to try to devise an error page to catch this situation and invalidate the session, or at least clear the session cache.

Edouard De Oliveira - [11/Aug/04 05:54 AM ]
When i debug my jsps using exploded webapps this NPE happens every time i copy a new version of the JSP into the directory. This is very frustrating because i'm loosing a fairly great amount of time restarting my j2EE server to zero the oscache state...
It is not acceptable to me to deploy oscache in the project assuming that this only happens when modifying JSP's on the fly so if this bug could be corrected it would save me the time of reimplementing a simple hashtable cache

Thx

ps : it seems that the table var is null but i don't see why it can happen (int index = hash & (tab.length - 1)) maybe it has been reloaded too ???

Here goes the NPE stack trace :

java.lang.NullPointerException
        at com.opensymphony.oscache.base.algorithm.AbstractConcurrentReadCache.g
et(AbstractConcurrentReadCache.java:686)
        at com.opensymphony.oscache.base.Cache.getCacheEntry(Cache.java:594)
        at com.opensymphony.oscache.base.Cache.getFromCache(Cache.java:227)
        at com.opensymphony.oscache.web.tag.CacheTag.doStartTag(CacheTag.java:47
9)
        at jsp_servlet._test.__application._jspService(__application.java:217)
        at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
        at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run
(ServletStubImpl.java:1058)
        at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:401)
        at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:306)
        at weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
n.run(WebAppServletContext.java:5445)
        at weblogic.security.service.SecurityServiceManager.runAs(SecurityServic
eManager.java:780)
        at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
rvletContext.java:3105)
        at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
pl.java:2588)
        at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:213)
        at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:189)

Didier Alves - [13/Sep/04 09:16 AM ]
Hi,

I'm getting this error too. I'm using tomcat-5.0.25, jgroups-2.2.6 for clustering and session based caching.

The problem is that the cache table is cleared whenever the context of the webapp is reloaded in tomcat. Does anyone have a solution?

Thanks.

Andres March - [12/Mar/05 01:47 AM ]
COntext reloading is broken in tomcat. Can anybody provide a junit test case that demonstrates this bug? I am sure there is something going on but I am not convinced it is oscache.

Samir Jyoti - [11/Apr/05 07:25 AM ]
I am getting the same error using weblogic server here with seesion based caching. This should have been a higher priority issue, wonder why it is marked minor.

Does anyone have a solution.

thanks


Lars Torunski - [11/Apr/05 10:43 AM ]
Samir, please add your error log and the OSCache version you are using.

Samir Jyoti - [11/Apr/05 11:34 PM ]
OSCache Version 1.1

NullPointerException
at com.opensymphony.oscache.base.algorithm.AbstractConcurrentReadCache.get(AbstractConcurrentReadCache.java:686)
at com.opensymphony.oscache.base.Cache.getCacheEntry(Cache.java:594)
at com.opensymphony.oscache.base.Cache.flushEntry(Cache.java:418)
at com.opensymphony.oscache.base.Cache.flushEntry(Cache.java:405)
at com.test.presentation.cache.CacheAdministrator.flushQueryFromCache

Lars Torunski - [12/Apr/05 12:32 AM ]
Can you upgrade to 2.1, because there are some fixes around AbstractConcurrentReadCache in CACHE-71 and CACHE-73.

Samir Jyoti - [14/Apr/05 05:59 AM ]
Many thanks Lars, the problem has not reoccurred here since I updated the version to 2.1

It seems to be ok now!