Discussion:
[Opensymphony-oscache] OSCache and Nutch (open source software)
Sean Dean
2006-12-27 07:11:37 UTC
Permalink
Hello,

I'm trying to get OSCache to work with a specific application, Nutch (lucene.apache.org/nutch/) and keep coming across the same problem, both in regular mode and CacheFilter.

When trying to display the page search.jsp (http://svn.apache.org/viewvc/lucene/nutch/trunk/src/web/jsp/search.jsp?view=markup) it keeps throwing out an error prior to the display of the page, which is the following:

2006-12-27 01:47:18,197 WARN [jsp] - Servlet.service() for servlet jsp threw exception
java.io.IOException: Illegal to flush within a custom tag
at javax.servlet.jsp.tagext.BodyContent.flush(BodyContent.java:79)
at org.apache.jsp.search_jsp._jspService(search_jsp.java:416)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
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.opensymphony.oscache.web.filter.CacheFilter.doFilter(CacheFilter.java:168)
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.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.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:199)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:282)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:767)
at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:697)
at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:889)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)

I have seen written somewhere else that this problem is usually due to "flushing?" but the explaination afterwards is rather slim.

In terms of other software on the server, I'm using OSCache 2.3.2 and Tomcat 5.5.20.

Any assistance or tips will be greatly appreciated.

Thanks,

Sean
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=55543&messageID=110508#110508
Lars Torunski
2006-12-27 08:06:08 UTC
Permalink
Do you use the CacheFilter for a fragment of page?
What do you mean with regular mode (runnung the web app without OSCache)?

Please post the web.xml and oscache.properties also.
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=55543&messageID=110515#110515
Sean Dean
2006-12-27 08:26:55 UTC
Permalink
CacheFilter would be set to do the complete page.

The "regular mode" was placing the <cache:cache> and </cache:cache> tags around only a fragment of the page (this was also tried with the complete page for trial and error purposes).

When using CacheFilter, this was my web.xml file:

<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app>

<!-- order is very important here -->

<servlet>
<servlet-name>Cached</servlet-name>
<servlet-class>org.apache.nutch.servlet.Cached</servlet-class>
</servlet>

<servlet>
<servlet-name>OpenSearch</servlet-name>
<servlet-class>org.apache.nutch.searcher.OpenSearchServlet</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>Cached</servlet-name>
<url-pattern>/servlet/cached</url-pattern>
</servlet-mapping>

<servlet-mapping>
<servlet-name>OpenSearch</servlet-name>
<url-pattern>/opensearch</url-pattern>
</servlet-mapping>

<welcome-file-list>
<welcome-file>search.html</welcome-file>
<welcome-file>index.html</welcome-file>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>

<taglib>
<taglib-uri>http://jakarta.apache.org/taglibs/i18n</taglib-uri>
<taglib-location>/WEB-INF/taglibs-i18n.tld</taglib-location>
</taglib>

<filter>
<filter-name>CacheFilter</filter-name>
<filter-class>com.opensymphony.oscache.web.filter.CacheFilter</filter-class>
<init-param>
<param-name>time</param-name>
<param-value>2592000</param-value>
</init-param>
</filter>

<filter-mapping>
<filter-name>CacheFilter</filter-name>
<url-pattern>*.jsp</url-pattern>
</filter-mapping>

</web-app>

In both cases, this was my oscache.properties file:

cache.persistence.class=com.opensymphony.oscache.plugins.diskpersistence.DiskPersistenceListener

cache.path=/tmp/oscache

cache.algorithm=com.opensymphony.oscache.base.algorithm.LRUCache

cache.capacity=1000

cache.unlimited.disk=true
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=55543&messageID=110518#110518
Lars Torunski
2006-12-28 06:52:31 UTC
Permalink
Please post a thread dump without the CacheFilter in regular mode.
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=55543&messageID=110751#110751
Sean Dean
2006-12-28 08:07:38 UTC
Permalink
This would be it:

Full thread dump Java HotSpot(TM) 64-Bit Server VM (diablo-1.5.0_07-b01 mixed mode):

"TP-Monitor" daemon prio=5 tid=0x0000000000989000 nid=0x989800 in Object.wait() [0x00007ffffe9ed000..0x00007ffffe9edc10]
at java.lang.Object.wait(Native Method)
- waiting on <0x000000080ec19fc8> (a org.apache.tomcat.util.threads.ThreadPool$MonitorRunnable)
at org.apache.tomcat.util.threads.ThreadPool$MonitorRunnable.run(ThreadPool.java:559)
- locked <0x000000080ec19fc8> (a org.apache.tomcat.util.threads.ThreadPool$MonitorRunnable)
at java.lang.Thread.run(Thread.java:595)

"TP-Processor4" daemon prio=5 tid=0x00000000008b9800 nid=0x8b9c00 runnable [0x00007ffffeaee000..0x00007ffffeaee990]
at java.net.PlainSocketImpl.socketAccept(Native Method)
at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:384)
- locked <0x000000080ec19478> (a java.net.SocksSocketImpl)
at java.net.ServerSocket.implAccept(ServerSocket.java:450)
at java.net.ServerSocket.accept(ServerSocket.java:421)
at org.apache.jk.common.ChannelSocket.accept(ChannelSocket.java:306)
at org.apache.jk.common.ChannelSocket.acceptConnections(ChannelSocket.java:660)
at org.apache.jk.common.ChannelSocket$SocketAcceptor.runIt(ChannelSocket.java:870)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)

"TP-Processor3" daemon prio=5 tid=0x00000000008b9000 nid=0x8b9400 runnable [0x00007ffffebef000..0x00007ffffebef910]
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
at java.io.BufferedInputStream.read1(BufferedInputStream.java:256)
at java.io.BufferedInputStream.read(BufferedInputStream.java:313)
- locked <0x000000080ec1d8b8> (a java.io.BufferedInputStream)
at org.apache.jk.common.ChannelSocket.read(ChannelSocket.java:620)
at org.apache.jk.common.ChannelSocket.receive(ChannelSocket.java:558)
at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:685)
at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:889)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)

"TP-Processor2" daemon prio=5 tid=0x0000000000856800 nid=0x856c00 runnable [0x00007ffffecf0000..0x00007ffffecf0a90]
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
at java.io.BufferedInputStream.read1(BufferedInputStream.java:256)
at java.io.BufferedInputStream.read(BufferedInputStream.java:313)
- locked <0x000000083c6b8c78> (a java.io.BufferedInputStream)
at org.apache.jk.common.ChannelSocket.read(ChannelSocket.java:620)
at org.apache.jk.common.ChannelSocket.receive(ChannelSocket.java:558)
at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:685)
at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:889)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)

"TP-Processor1" daemon prio=5 tid=0x00000000009f3800 nid=0x856400 in Object.wait() [0x00007ffffedf1000..0x00007ffffedf1a10]
at java.lang.Object.wait(Native Method)
- waiting on <0x000000080ec1c1c8> (a org.apache.tomcat.util.threads.ThreadPool$ControlRunnable)
at java.lang.Object.wait(Object.java:474)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:656)
- locked <0x000000080ec1c1c8> (a org.apache.tomcat.util.threads.ThreadPool$ControlRunnable)
at java.lang.Thread.run(Thread.java:595)

"ContainerBackgroundProcessor[StandardEngine[Catalina]]" daemon prio=5 tid=0x00000000009a8800 nid=0x9a8c00 waiting on conditi
on [0x00007ffffeef2000..0x00007ffffeef2b90]
at java.lang.Thread.sleep(Native Method)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1547)
at java.lang.Thread.run(Thread.java:595)

"Low Memory Detector" daemon prio=5 tid=0x00000000006cec00 nid=0x6d3800 runnable [0x0000000000000000..0x0000000000000000]

"CompilerThread1" daemon prio=9 tid=0x00000000006c7c00 nid=0x6ce800 waiting on condition [0x0000000000000000..0x00007fffff1f4
590]

"CompilerThread0" daemon prio=9 tid=0x00000000006c2c00 nid=0x6c7800 waiting on condition [0x0000000000000000..0x00007fffff2f5
310]

"AdapterThread" daemon prio=9 tid=0x00000000006b8c00 nid=0x6c2800 waiting on condition [0x0000000000000000..0x000000000000000
0]

"Signal Dispatcher" daemon prio=9 tid=0x00000000006a6c00 nid=0x6b8800 waiting on condition [0x0000000000000000..0x00000000000
00000]

"Finalizer" daemon prio=8 tid=0x00000000006a6000 nid=0x6a6800 in Object.wait() [0x00007fffff5f9000..0x00007fffff5f9a10]
at java.lang.Object.wait(Native Method)
- waiting on <0x000000080efeeb58> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:116)
- locked <0x000000080efeeb58> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:132)
at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:159)

"Reference Handler" daemon prio=10 tid=0x000000000062a800 nid=0x62ac00 in Object.wait() [0x00007fffff6fa000..0x00007fffff6fab
90]
at java.lang.Object.wait(Native Method)
- waiting on <0x000000080e724530> (a java.lang.ref.Reference$Lock)
at java.lang.Object.wait(Object.java:474)
at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:116)
- locked <0x000000080e724530> (a java.lang.ref.Reference$Lock)

"main" prio=5 tid=0x0000000000516800 nid=0x516000 runnable [0x00007fffffffc000..0x00007fffffffd9d0]
at java.net.PlainSocketImpl.socketAccept(Native Method)
at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:384)
- locked <0x000000080f00dcc0> (a java.net.SocksSocketImpl)
at java.net.ServerSocket.implAccept(ServerSocket.java:450)
at java.net.ServerSocket.accept(ServerSocket.java:421)
at org.apache.catalina.core.StandardServer.await(StandardServer.java:388)
at org.apache.catalina.startup.Catalina.await(Catalina.java:615)
at org.apache.catalina.startup.Catalina.start(Catalina.java:575)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:294)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:432)

"VM Thread" prio=9 tid=0x000000000065f200 nid=0x62a400 runnable

"GC task thread#0 (ParallelGC)" prio=5 tid=0x0000000000525c00 nid=0x5ae400 runnable

"GC task thread#1 (ParallelGC)" prio=5 tid=0x00000000005b4200 nid=0x5bc000 runnable

"VM Periodic Task Thread" prio=9 tid=0x0000000000525800 nid=0x6da800 waiting on condition
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=55543&messageID=110757#110757
Sean Dean
2006-12-28 08:32:48 UTC
Permalink
I just did something interesting that might shed light on the problem. I ran the application without OSCache in it, it worked and created the regular .class and .java files in the tomcat "work" directory for the search.jsp page.

Now, if they are kept there without the need for tomcat to recompile them on any restart and OSCache is added to the application, OSCache WILL work using CacheFilter in non-regular mode (loaded via web.xml).

Problem is, when these files are either forced to be updated (tomcats decision) or I deploy changes to my application (forced to re-make based on changes in source) OSCache will once again not function and pass along the same error.

There seems to be a problem during the compilation of the JSP code.
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=55543&messageID=110759#110759
Loading...