Jahia Dev Forum > How to extend Jahia...

0 (0 Good)
0 (0 Bad)

How to extend Jahia class

by  mabouchacra »  2011/06/07 20:44

 

Hello,

 

I'm trying to fix some bug that I've found on Jahia, however I'm facing some difficulties.

For example : I've tried to extend the class Search_Engine.java in my template, so I've just created the package org.jahia.engines.search and copy the Search_Engine class on my package. I didn't modify anything in the class, but when I try to use the search engine it doesn't work I've got this error in the log :

2010-09-07 14:52:26,765: ERROR [http-8080-4] EngineRenderer, org.jahia.engines.EngineRenderer: Root cause : Error while forwarding the Engine /templates/CnisTemplate/searchResults.jsp : javax.servlet.jsp.JspException: javax.servlet.ServletException: java.lang.NoSuchMethodError: org.jahia.engines.search.Search_Engine.search(Lorg/jahia/engines/search/SearchCriteria;Lorg/jahia/params/ProcessingContext;)Ljava/util/List; -> BAILING OUT

javax.servlet.ServletException: javax.servlet.jsp.JspException: javax.servlet.ServletException: java.lang.NoSuchMethodError: org.jahia.engines.search.Search_Engine.search(Lorg/jahia/engines/search/SearchCriteria;Lorg/jahia/params/ProcessingContext;)Ljava/util/List;

   at org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:848)

   at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:781)

   at org.apache.jsp.templates.CnisTemplate.squelette_jsp._jspService(squelette_jsp.java:140)

   at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)

   at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

   at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)

   at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)

   at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)

   at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

   at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:630)

   at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:535)

   at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:472)

   at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:968)

   at org.apache.jsp.templates.CnisTemplate.searchResults_jsp._jspService(searchResults_jsp.java:53)

   at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)

   at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

   at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)

   at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)

   at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)

   at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

   at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:630)

   at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)

   at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)

   at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)

   at org.jahia.engines.EngineRenderer.renderCore(EngineRenderer.java:162)

   at org.jahia.engines.EngineRenderer.render(EngineRenderer.java:79)

   at org.jahia.engines.core.Core_Engine.processCore(Core_Engine.java:160)

   at org.jahia.engines.core.Core_Engine.handleActions(Core_Engine.java:103)

   at org.jahia.operations.valves.EngineValve.processEngineRequest(EngineValve.java:198)

   at org.jahia.operations.valves.EngineValve.invoke(EngineValve.java:98)

   at org.jahia.pipelines.impl.GenericPipeline.invokeNext(GenericPipeline.java:163)

   at org.jahia.operations.valves.SkeletonAggregatorValve.invoke(SkeletonAggregatorValve.java:84)

   at org.jahia.pipelines.impl.GenericPipeline.invokeNext(GenericPipeline.java:163)

   at org.jahia.operations.valves.PlutoProcessActionValve.invoke(PlutoProcessActionValve.java:164)

   at org.jahia.pipelines.impl.GenericPipeline.invokeNext(GenericPipeline.java:163)

   at org.jahia.operations.valves.FormValve.invoke(FormValve.java:110)

   at org.jahia.pipelines.impl.GenericPipeline.invokeNext(GenericPipeline.java:163)

   at org.jahia.operations.valves.ThemeValve.invoke(ThemeValve.java:97)

   at org.jahia.pipelines.impl.GenericPipeline.invokeNext(GenericPipeline.java:163)

   at org.jahia.operations.valves.UserAgentViewSwitcherValve.invoke(UserAgentViewSwitcherValve.java:57)

   at org.jahia.pipelines.impl.GenericPipeline.invokeNext(GenericPipeline.java:163)

   at org.jahia.operations.valves.HistoryValve.invoke(HistoryValve.java:47)

   at org.jahia.pipelines.impl.GenericPipeline.invokeNext(GenericPipeline.java:163)

   at org.jahia.operations.valves.PageAccessCheckValve.invoke(PageAccessCheckValve.java:75)

   at org.jahia.pipelines.impl.GenericPipeline.invokeNext(GenericPipeline.java:163)

   at org.jahia.operations.valves.OperationModeCheckValve.invoke(OperationModeCheckValve.java:84)

   at org.jahia.pipelines.impl.GenericPipeline.invokeNext(GenericPipeline.java:163)

   at org.jahia.operations.valves.SiteCheckValve.invoke(SiteCheckValve.java:78)

   at org.jahia.pipelines.impl.GenericPipeline.invokeNext(GenericPipeline.java:163)

   at org.jahia.pipelines.impl.GenericPipeline.invoke(GenericPipeline.java:150)

   at org.jahia.operations.OperationManager.handleOperations(OperationManager.java:80)

   at org.jahia.bin.JahiaAction.execute(JahiaAction.java:74)

   at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)

   at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)

   at org.jahia.bin.JahiaRequestProcessor.process(JahiaRequestProcessor.java:82)

   at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)

   at org.jahia.bin.Jahia.process(Jahia.java:1543)

   at org.jahia.bin.Jahia.service(Jahia.java:835)

   at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

   at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:164)

   at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:141)

   at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:90)

   at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:417)

   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

   at org.jahia.bin.filters.jcr.JcrSessionFilter.doFilter(JcrSessionFilter.java:40)

   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

   at org.jahia.bin.filters.ResponseCacheControlFilter.doFilter(ResponseCacheControlFilter.java:93)

   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

   at org.jahia.bin.filters.ResponseCacheControlFilter.doFilter(ResponseCacheControlFilter.java:93)

   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)

   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

   at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)

   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)

   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

   at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:568)

   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)

   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)

   at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)

   at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)

   at java.lang.Thread.run(Thread.java:619)

Caused by: javax.servlet.ServletException: java.lang.NoSuchMethodError: org.jahia.engines.search.Search_Engine.search(Lorg/jahia/engines/search/SearchCriteria;Lorg/jahia/params/ProcessingContext;)Ljava/util/List;

   at org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:852)

   at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:781)

   at org.apache.jsp.templates.CnisTemplate.common.recherche.resultatRecherche_jsp._jspService(resultatRecherche_jsp.java:328)

   at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)

   at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

   at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)

   at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)

   at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)

   at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

   at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:630)

   at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:535)

   at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:472)

   at org.apache.taglibs.standard.tag.common.core.ImportSupport.acquireString(ImportSupport.java:296)

   at org.apache.taglibs.standard.tag.common.core.ImportSupport.doEndTag(ImportSupport.java:161)

   at org.apache.jsp.templates.CnisTemplate.squelette_jsp._jspx_meth_template_005finclude_005f1(squelette_jsp.java:1852)

   at org.apache.jsp.templates.CnisTemplate.squelette_jsp._jspx_meth_template_005ftemplateBody_005f0(squelette_jsp.java:578)

   at org.apache.jsp.templates.CnisTemplate.squelette_jsp._jspx_meth_template_005ftemplate_005f0(squelette_jsp.java:234)

   at org.apache.jsp.templates.CnisTemplate.squelette_jsp._jspService(squelette_jsp.java:133)

   ... 89 more

Caused by: java.lang.NoSuchMethodError: org.jahia.engines.search.Search_Engine.search(Lorg/jahia/engines/search/SearchCriteria;Lorg/jahia/params/ProcessingContext;)Ljava/util/List;

   at org.jahia.taglibs.search.ResultsTag.doStartTag(ResultsTag.java:89)

   at org.apache.jsp.templates.CnisTemplate.common.recherche.resultatRecherche_jsp._jspService(resultatRecherche_jsp.java:145)

   ... 106 more

So did I do something wrong? Or is it that it's just impossible to extend Jahia classes?

 

Cheers,

Marc.

 

  (mabouchacra)

Number of messages  44
Registration date
0 (0 Good)
0 (0 Bad)

Re: How to extend Jahia class

by  shyrkov »  2011/06/07 20:45

Hello Marc,

where have you put your compiled class? What target Java level have you used for the compilatioin (1.5, 1.6)?
You could also try to delete your compiled JSPs (in the Tomcat's work folder) and try again.

Kind regards
Sergiy
  • Re: How to extend Jahia class
    2011/06/07 20:45

    shyrkov Hello Marc,<br/><br/>where have you put your compiled class? What target Java level have you used for the compilatioin (1.5, 1.6)?<br/>You could also try to delete your compiled JSPs (in the Tomcat's work folder) and try again.<br/><br/>Kind regards<br/>Sergiy

  • Number of messages  407
    Registration date Jun 7, 2011
    0 (0 Good)
    0 (0 Bad)

    Re: How to extend Jahia class

    by  mabouchacra »  2011/06/07 20:45

    Hi Sergiy,

    I put my class in the template, so after the template deployement the compiled class was put in the ROOT/WEB-INF/classes folder.

    Also I've tried to remove the compiled JSP as you said but the result is the same.

    About my java environment I'm working and compiling whith java 1.6.

    Cheers,
    Marc.

      (mabouchacra)

    Number of messages  44
    Registration date
    Contact
    Share
    Feedback

    Get in touch

    Whether you are a current user or if you are just evaluating Jahia, we are here to help.

    Contact us

    Share this page