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

Key: CACHE-260
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Blocker Blocker
Assignee: Lars Torunski
Reporter: James Rigg
Votes: 0
Watchers: 1
Operations

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

NullPointerException in AbstractConcurrentReadCache

Created: 03/Oct/06 02:04 AM   Updated: 24/Mar/07 06:18 AM
Component/s: Base Classes
Affects Version/s: 2.3.2
Fix Version/s: 2.4

Issue Links:
Duplicate
 
This issue is duplicated by:
CACHE-258 NullPointerException when using putCa... Major Closed

Flags: Important


 Description  « Hide
It looks to me as though there is a bug in AbstractConcurrentReadCache - the remove method (line 1699) will call addGroupMappings (line 1790) even if the oldEntry has no groups. Entry.getGroups() may return null if the Entry has no groups. The method addGroupMappings (line 1506) does not check whether its second parameter (a Set of group names) is null.

Either Entry.getGroups() should return an empty Set if there are no groups (instead of returning null), or the method AbstractConcurrentReadCache.addGroupMappings should check that the supplied Set is not null before attempting to iterate over its contents.


Stack trace:
2006-10-03 07:49:39,421 ERROR (StandardWrapperValve.java:260) - Servlet.service() for servlet ImageServlet threw exception
java.lang.NullPointerException
at com.opensymphony.oscache.base.algorithm.AbstractConcurrentReadCache.addGroupMappings(AbstractConcurrentReadCache.java:1508)
at com.opensymphony.oscache.base.algorithm.AbstractConcurrentReadCache.remove(AbstractConcurrentReadCache.java:1790)
at com.opensymphony.oscache.base.algorithm.AbstractConcurrentReadCache.put(AbstractConcurrentReadCache.java:1598)
at com.opensymphony.oscache.base.algorithm.AbstractConcurrentReadCache.put(AbstractConcurrentReadCache.java:863)
at com.opensymphony.oscache.base.Cache.putInCache(Cache.java:624)
at com.opensymphony.oscache.web.filter.CacheFilter.doFilter(CacheFilter.java:176)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at com.panoguide.filter.DomainFilter.doFilter(DomainFilter.java:51)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:541)
at org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:367)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:868)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:663)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Unknown Source)



 All   Comments   Change History      Sort Order:
James Rigg - [03/Oct/06 02:06 AM ]
I've just noticed that AbstractConcurrentReadCache.removeGroupMappings does check whether its second parameter (a Set of group names) is null or not. However addGroupMappings does not do this check - I guess it should?

Lars Torunski - [03/Oct/06 05:02 PM ]
Fixed in SVN trunk.
Committed revision 384.