|Title|search engine throws an exception
|Date|21-Dec-2004 17:48:18 EET
|Version|2.1.103 alpha
|Submitter|129.42.208.182
|Criticality|CriticalBug
|Browser version|any
|Status|ClosedBug
|[PageProvider] used|
|Servlet Container|search tools
|Operating System|linux
|URL|~ViewTemplate.jsp
|Java version|j2sdk 1.4.2.05 linux-i586
{{{
JSPWiki has detected an error
Error Message 
Tag failed, check logs: null 
Exception 
javax.servlet.jsp.JspException 
Place where detected 
com.ecyrd.jspwiki.tags.IncludeTag.doEndTag(), line 71 
}}}
If you have changed the templates, please do check them. This error message may show up because of that. If you have not changed them, and you are either installing JSPWiki for the first time or have changed configuration, then you might want to check your configuration files. If you are absolutely sure that JSPWiki was running quite okay or you can't figure out what is going on, then by all means, come over to jspwiki.org and tell us. There is more information in the log file (like the full stack trace, which you should add to any error report). 

And don't worry - it's just a computer program. Nothing really serious is probably going on: at worst you can lose a few nights sleep. It's not like it's the end of the world. 

I'm trying to use the Wiki search tool.
The original one that came with the template wiki works fine.
This one seems to work as well:

Code from ~ViewTemplate.jsp
{{{
<form action="Search.jsp" ACCEPT-CHARSET="ISO-8859-1,UTF-8">
<td class="label" align="right"><label for="header-search-field">Search Team Product Organization</label></td>
<td class="field"><input id="header-search-field" name="query" type="text" accesskey="4" size="15" /></td>
</form>
}}}

But this one causes the failure shown above:

{{{
<form action="Search.jsp" ACCEPT-CHARSET="ISO-8859-1,UTF-8">
<td class="label" align="right"><label for="header-search-field">Search New Hire Site</label></td>
<td class="field"><input id="header-search-field" name="query" type="text" accesskey="4" size="15" /></td>
</form>
}}}

Both Search.jsp files are identical...  I'm not sure how to debug this, I'm not a java programmer.  I'm doing something basically wrong, I just know it, I just don't know what it is.


{{{
2004-12-21 12:16:31 ApplicationDispatcher[/LabPlanning] Servlet.service() for servlet jsp threw exception
javax.servlet.jsp.JspException: Tag failed, check logs: null
        at com.ecyrd.jspwiki.tags.WikiTagBase.doStartTag(WikiTagBase.java:66)
        at org.apache.jsp.templates.w3v8.ViewTemplate_jsp._jspx_meth_wiki_DiffLink_0(ViewTemplate_jsp.java:788)
        at org.apache.jsp.templates.w3v8.ViewTemplate_jsp._jspx_meth_wiki_CheckVersion_0(ViewTemplate_jsp.java:760)
        at org.apache.jsp.templates.w3v8.ViewTemplate_jsp._jspService(ViewTemplate_jsp.java:304)
        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
        at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
        at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:704)
        at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:590)
        at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:510)
        at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:966)
        at org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:581)
        at com.ecyrd.jspwiki.tags.IncludeTag.doEndTag(IncludeTag.java:65)
        at org.apache.jsp.Search_jsp._jspService(Search_jsp.java:122)
        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
        at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
        at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
        at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
        at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)
        at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
        at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
        at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
        at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
        at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
        at java.lang.Thread.run(Thread.java:534)


With DEBUG logging set:

2004-12-21 14:56:29,964 [http-80-Processor25] DEBUG com.ecyrd.jspwiki.WikiEngine JSPWiki:FindPage - Servlet path is: /Search.jsp
2004-12-21 14:56:29,964 [http-80-Processor25] DEBUG com.ecyrd.jspwiki.WikiEngine JSPWiki:FindPage - Mapped to FindPage
2004-12-21 14:56:29,964 [http-80-Processor25] DEBUG com.ecyrd.jspwiki.auth.UserManager JSPWiki:FindPage - Stored username=null
2004-12-21 14:56:29,965 [http-80-Processor25] DEBUG JSPWiki JSPWiki:FindPage JSPWiki:FindPage - Error.jsp exception is: 
javax.servlet.jsp.JspException: Tag failed, check logs: null
        at com.ecyrd.jspwiki.tags.IncludeTag.doEndTag(IncludeTag.java:71)
        at org.apache.jsp.Search_jsp._jspService(Search_jsp.java:122)
        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
        at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
        at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
        at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
        at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)
        at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
        at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
        at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
        at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
        at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
        at java.lang.Thread.run(Thread.java:534)
2004-12-21 14:56:29,966 [http-80-Processor25] DEBUG JSPWiki JSPWiki:FindPage JSPWiki:FindPage - IS JSPEXCEPTION
2004-12-21 14:56:29,966 [http-80-Processor25] DEBUG JSPWiki JSPWiki:FindPage JSPWiki:FindPage - REALCAUSE=null

}}}

----

Okay, this is really difficult to debug.  Please check your compiled Search.jsp generated file, and drop the code that throws an exception here.

-- JanneJalkanen
----
The "compiled Search.jsp generated file" is __org.apache.jsp.Search__.  The doEndTag() that fails is at line 122 which reads,
{{{
121:      int _jspx_eval_wiki_Include_0 = _jspx_th_wiki_Include_0.doStartTag();
122:      if (_jspx_th_wiki_Include_0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE)
123:        return;
}}}

Here's the entire file.

-- DonRota

{{{
package org.apache.jsp;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import org.apache.log4j.*;
import com.ecyrd.jspwiki.*;
import java.util.*;
import com.ecyrd.jspwiki.tags.WikiTagBase;

public final class Search_jsp extends org.apache.jasper.runtime.HttpJspBase
    implements org.apache.jasper.runtime.JspSourceDependent {


    public void jspInit()
    {
        wiki = WikiEngine.getInstance( getServletConfig() );
    }

    Category log = Category.getInstance("JSPWikiSearch");
    WikiEngine wiki;

  private static java.util.Vector _jspx_dependants;

  static {
    _jspx_dependants = new java.util.Vector(1);
    _jspx_dependants.add("/WEB-INF/jspwiki.tld");
  }

  private org.apache.jasper.runtime.TagHandlerPool _jspx_tagPool_wiki_Include_page_nobody;

  public java.util.List getDependants() {
    return _jspx_dependants;
  }

  public void _jspInit() {
    _jspx_tagPool_wiki_Include_page_nobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
  }

  public void _jspDestroy() {
    _jspx_tagPool_wiki_Include_page_nobody.release();
  }

  public void _jspService(HttpServletRequest request, HttpServletResponse response)
        throws java.io.IOException, ServletException {


    JspFactory _jspxFactory = null;
    PageContext pageContext = null;
    HttpSession session = null;
    ServletContext application = null;
    ServletConfig config = null;
    JspWriter out = null;
    Object page = this;
    JspWriter _jspx_out = null;
    PageContext _jspx_page_context = null;


    try {
      _jspxFactory = JspFactory.getDefaultFactory();
      response.setContentType("text/html");
      pageContext = _jspxFactory.getPageContext(this, request, response,
                        "/Error.jsp", true, 8192, true);
      _jspx_page_context = pageContext;
      application = pageContext.getServletContext();
      config = pageContext.getServletConfig();
      session = pageContext.getSession();
      out = pageContext.getOut();
      _jspx_out = out;

      out.write("\n");
      out.write("\n");
      out.write("\n");
      out.write("\n");
      out.write("\n");
      out.write("\n");
      out.write("\n");
      out.write('\n');
      out.write('\n');
      out.write('\n');

    WikiContext wikiContext = wiki.createContext( request, WikiContext.FIND );
    String pagereq = wikiContext.getPage().getName();

    NDC.push( wiki.getApplicationName()+":"+pagereq );

    String query = wiki.safeGetParameter( request, "query");
    Collection list = null;


    pageContext.setAttribute( WikiTagBase.ATTR_CONTEXT,
                              wikiContext,
                              PageContext.REQUEST_SCOPE );

    response.setContentType("text/html; charset="+wiki.getContentEncoding() );

    if( query != null )
    {
        log.info("Searching for string "+query);

        list = wiki.findPages( query );

        pageContext.setAttribute( "searchresults",
                                  list,
                                  PageContext.REQUEST_SCOPE );

        pageContext.setAttribute( "query",
                                  query,
                                  PageContext.REQUEST_SCOPE );

        log.info("Found "+list.size()+" pages");
    }

    String contentPage = "templates/"+wikiContext.getTemplate()+"/ViewTemplate.jsp";

      out.write('\n');
      out.write('\n');
      //  wiki:Include
      com.ecyrd.jspwiki.tags.IncludeTag _jspx_th_wiki_Include_0 = (com.ecyrd.jspwiki.tags.IncludeTag) _jspx_tagPool_wiki_Inc\
lude_page_nobody.get(com.ecyrd.jspwiki.tags.IncludeTag.class);
      _jspx_th_wiki_Include_0.setPageContext(_jspx_page_context);
      _jspx_th_wiki_Include_0.setParent(null);
      _jspx_th_wiki_Include_0.setPage(contentPage);
      int _jspx_eval_wiki_Include_0 = _jspx_th_wiki_Include_0.doStartTag();
      if (_jspx_th_wiki_Include_0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE)
        return;
      _jspx_tagPool_wiki_Include_page_nobody.reuse(_jspx_th_wiki_Include_0);
      out.write('\n');
      out.write('\n');

    NDC.pop();
    NDC.remove();

      out.write('\n');
    } catch (Throwable t) {
      if (!(t instanceof SkipPageException)){
        out = _jspx_out;
        if (out != null && out.getBufferSize() != 0)
          out.clearBuffer();
        if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
      }
    } finally {
      if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }
}
}}}

----

Looking quickly at it it seems to me that the code that is failing has nothing to do with the Search itself - it looks as if you actually have faulty pages within the repository or something (because it's the CheckVersionTag that is failing).  Could you please try and upgrade to the [latest CVS version|JSPWikiDownload] and see if the problem still persists?

-- JanneJalkanen

----

The strange thing about it, is that some wiki apps work (search) and others throw exceptions.
There really was not much difference between them.  Two of us spent almost all day on it yesterday and we thought we had it narrowed down to a jspwiki.tld and header.jsp, but it 
still eludes us...  I'll try downloading a later version and plugging that in.  Thanks for your
help.

--DonRota

Could it be that it depends on the actual query that you use?

--JanneJalkanen

Don, any news on this one?  Can I close it?

--JanneJalkanen


----

Hi,
I am releasing a search service for livejournal blogs that works on a similar architecture to this. If people are interested in discussing it and its similarites to wiki search you can contact me through the site. Thanks

Leon

<a href="http://www.ljfind.com"> Ljfind</a> Also <a href="http://www.wpfind.com"> Wpfind</a> on the same architecture
--Anonymous, 22-Jan-2006

----

Closed, no further information available.

-- JanneJalkanen, 24-Sep-2006