Issue Details (XML | Word | Printable)

Key: CACHE-173
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Lars Torunski
Reporter: Sylvain Vieujot
Votes: 3
Watchers: 3
Operations

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

NullPointerException while flushing inexistant group

Created: 09/May/05 01:26 PM   Updated: 30/Sep/05 12:50 PM
Component/s: Tags
Affects Version/s: 2.1.1
Fix Version/s: 2.2 RC

Environment: Linux / Jdk 1.5.03
Issue Links:
Duplicate
 


 Description  « Hide
Flushing an group that doesn't exist (has never been used) generates a null pointer exception the second time it's called.

My tag is :
<cache:flush group="forum" scope="application"/>

I initially never used this group in the application, and then the second time the page is called, I get the following stack trace.
Just using the group once in my home page seems to resolve the problem ... but what if the home page isn't called first when the webapp reloads ?

Stack trace :

java.lang.NullPointerException
at java.util.HashSet.(HashSet.java:99)
at com.opensymphony.oscache.base.algorithm.AbstractConcurrentReadCache.getGroupForReading(AbstractConcurrentReadCache.java:954)
at com.opensymphony.oscache.base.algorithm.AbstractConcurrentReadCache.getGroup(AbstractConcurrentReadCache.java:372)
at com.opensymphony.oscache.base.Cache.flushGroup(Cache.java:447)
at com.opensymphony.oscache.base.Cache.flushGroup(Cache.java:434)
at com.opensymphony.oscache.web.tag.FlushTag.doStartTag(FlushTag.java:138)
at org.apache.jsp.forum.post_jsp._jspx_meth_cache_flush_0(post_jsp.java:364)
at org.apache.jsp.forum.post_jsp._jspService(post_jsp.java:340)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at com.seanergie.filter.authentication.LoginInterceptorFilter.doFilter(LoginInterceptorFilter.java:36)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at com.seanergie.filter.persistence.SessionsManagerFilter.doFilter(SessionsManagerFilter.java:41)
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:407)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:526)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
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:856)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
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(Thread.java:595)

Thanks for your help.

Sylvain.

 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Andres March made changes - 09/May/05 07:14 PM
Field Original Value New Value
Assignee Andres March [ dres1011 ]
Andres March made changes - 09/May/05 07:14 PM
Status Open [ 1 ] In Progress [ 3 ]
Tom Quellenberg added a comment - 20/Jun/05 11:17 AM
This is ab Bug in AbstractConcurrentReadCache.java:

    protected synchronized final Set getGroupForReading(String groupName) {
        Set group = (Set) getGroupsForReading().get(groupName);
        if (group == null) return null; // ======== this check is important
        return new HashSet(group);
    }


Lars Torunski made changes - 11/Sep/05 06:32 AM
Link This issue is duplicated by CACHE-191 [ CACHE-191 ]
Lars Torunski made changes - 11/Sep/05 06:43 AM
Description Flushing an group that doesn't exist (has never been used) generates a null pointer exception the second time it's called.

My tag is :
<cache:flush group="forum" scope="application"/>

I initially never used this group in the application, and then the second time the page is called, I get the following stack trace.
Just using the group once in my home page seems to resolve the problem ... but what if the home page isn't called first when the webapp reloads ?

Stack trace :

java.lang.NullPointerException
at java.util.HashSet.(HashSet.java:99)
at com.opensymphony.oscache.base.algorithm.AbstractConcurrentReadCache.getGroupForReading(AbstractConcurrentReadCache.java:954)
at com.opensymphony.oscache.base.algorithm.AbstractConcurrentReadCache.getGroup(AbstractConcurrentReadCache.java:372)
at com.opensymphony.oscache.base.Cache.flushGroup(Cache.java:447)
at com.opensymphony.oscache.base.Cache.flushGroup(Cache.java:434)
at com.opensymphony.oscache.web.tag.FlushTag.doStartTag(FlushTag.java:138)
at org.apache.jsp.forum.post_jsp._jspx_meth_cache_flush_0(post_jsp.java:364)
at org.apache.jsp.forum.post_jsp._jspService(post_jsp.java:340)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at com.seanergie.filter.authentication.LoginInterceptorFilter.doFilter(LoginInterceptorFilter.java:36)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at com.seanergie.filter.persistence.SessionsManagerFilter.doFilter(SessionsManagerFilter.java:41)
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:407)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:526)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
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:856)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
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(Thread.java:595)

Thanks for your help.

Sylvain.
Flushing an group that doesn't exist (has never been used) generates a null pointer exception the second time it's called.

My tag is :
<cache:flush group="forum" scope="application"/>

I initially never used this group in the application, and then the second time the page is called, I get the following stack trace.
Just using the group once in my home page seems to resolve the problem ... but what if the home page isn't called first when the webapp reloads ?

Stack trace :

java.lang.NullPointerException
at java.util.HashSet.(HashSet.java:99)
at com.opensymphony.oscache.base.algorithm.AbstractConcurrentReadCache.getGroupForReading(AbstractConcurrentReadCache.java:954)
at com.opensymphony.oscache.base.algorithm.AbstractConcurrentReadCache.getGroup(AbstractConcurrentReadCache.java:372)
at com.opensymphony.oscache.base.Cache.flushGroup(Cache.java:447)
at com.opensymphony.oscache.base.Cache.flushGroup(Cache.java:434)
at com.opensymphony.oscache.web.tag.FlushTag.doStartTag(FlushTag.java:138)
at org.apache.jsp.forum.post_jsp._jspx_meth_cache_flush_0(post_jsp.java:364)
at org.apache.jsp.forum.post_jsp._jspService(post_jsp.java:340)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at com.seanergie.filter.authentication.LoginInterceptorFilter.doFilter(LoginInterceptorFilter.java:36)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at com.seanergie.filter.persistence.SessionsManagerFilter.doFilter(SessionsManagerFilter.java:41)
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:407)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:526)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
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:856)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
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(Thread.java:595)

Thanks for your help.

Sylvain.
Assignee Andres March [ dres1011 ] Lars Torunski [ lars t ]
Fix Version/s 2.2 [ 21450 ]
Lars Torunski added a comment - 11/Sep/05 06:47 AM
fixed in CVS HEAD for 2.2 RC

Lars Torunski made changes - 11/Sep/05 06:47 AM
Resolution Fixed [ 1 ]
Status In Progress [ 3 ] Closed [ 6 ]
Sylvain Vieujot added a comment - 30/Sep/05 12:50 PM
Yes, works fine now.

Thanks.