Tapestry
  1. Tapestry
  2. TAPESTRY-1415

A page with a form and a getOrg() method will crash on retrieval

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 4.1.1
    • Fix Version/s: 4.1.2
    • Component/s: Framework
    • Labels:
      None

      Description

      If Tapestry attempts to load a page which contains a form and has a method named getOrg(), it will crash. This appears to be due to the ClientIdPropertyWorker.createProperty()'s enhancement of the page. It contains a static method call to org.apache.tapestry.TapestryUtils.convertTapestryIdToNMToken(), but because the token "org" maps to a valid page property name, it instead attempts to find an apache property on the object returned by getOrg(), which causes the crash because the apache property does not exist.

      TapestryBugPage.html


      <html jwcid="@Shell" title="Tapestry Bug Test">
      <body jwcid="@Body">
      <form jwcid="@Form">
      If you see this, the bug is fixed.
      <input jwcid="@TextField" value="ognl:org" />
      </form>
      </body>
      </html>


      TapestryBugPage.page


      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE page-specification PUBLIC
      "-//Apache Software Foundation//Tapestry Specification 4.0//EN"
      "http://jakarta.apache.org/tapestry/dtd/Tapestry_4_0.dtd">

      <page-specification class="mshare.web.tapestry.page.TapestryBugPage">
      </page-specification>


      TapestryBugPage.java


      package test;

      import org.apache.tapestry.event.PageDetachListener;
      import org.apache.tapestry.event.PageEvent;
      import org.apache.tapestry.html.BasePage;

      public abstract class TapestryBugPage extends BasePage implements PageDetachListener {
      private String org;

      public String getOrg()

      { return org; }

      public void setOrg(String org)

      { this.org = org; }

      public void pageDetached(PageEvent event)

      { org = null; }

      }


      Resulting exception:


      org.apache.hivemind.ApplicationRuntimeException: Error at context:/WEB-INF/TapestryBugPage.page, line 6, column 70: Error adding property clientId to class test.TapestryBugPage: Unable to add method java.lang.String getClientId() to class $TapestryBugPage_0: [source error] no such field: apache [context:/WEB-INF/TapestryBugPage.page, line 6, column 70]
      at org.apache.hivemind.impl.StrictErrorHandler.error(StrictErrorHandler.java:39)
      at org.apache.hivemind.impl.ErrorLogImpl.error(ErrorLogImpl.java:40)
      at org.apache.tapestry.enhance.ClientIdPropertyWorker.performEnhancement(ClientIdPropertyWorker.java:54)
      at $EnhancementWorker_111fd364d67.performEnhancement($EnhancementWorker_111fd364d67.java)
      at $EnhancementWorker_111fd364d66.performEnhancement($EnhancementWorker_111fd364d66.java)
      at $EnhancementWorker_111fd364d7a.performEnhancement($EnhancementWorker_111fd364d7a.java)
      at $EnhancementWorker_111fd364d4f.performEnhancement($EnhancementWorker_111fd364d4f.java)
      at $EnhancementWorker_111fd364d4e.performEnhancement($EnhancementWorker_111fd364d4e.java)
      at org.apache.tapestry.services.impl.ComponentConstructorFactoryImpl.getComponentConstructor(ComponentConstructorFactoryImpl.java:103)
      at $ComponentConstructorFactory_111fd364d3c.getComponentConstructor($ComponentConstructorFactory_111fd364d3c.java)
      at $ComponentConstructorFactory_111fd364d3b.getComponentConstructor($ComponentConstructorFactory_111fd364d3b.java)
      at org.apache.tapestry.pageload.PageLoader.instantiatePage(PageLoader.java:564)
      at org.apache.tapestry.pageload.PageLoader.loadPage(PageLoader.java:591)
      at $IPageLoader_111fd364d35.loadPage($IPageLoader_111fd364d35.java)
      at $IPageLoader_111fd364d36.loadPage($IPageLoader_111fd364d36.java)
      at org.apache.tapestry.pageload.PageSource.getPage(PageSource.java:119)
      at $IPageSource_111fd364c96.getPage($IPageSource_111fd364c96.java)
      at $IPageSource_111fd364c95.getPage($IPageSource_111fd364c95.java)
      at org.apache.tapestry.engine.RequestCycle.loadPage(RequestCycle.java:248)
      at org.apache.tapestry.engine.RequestCycle.getPage(RequestCycle.java:235)
      at org.apache.tapestry.engine.RequestCycle.activate(RequestCycle.java:551)
      at org.apache.tapestry.engine.PageService.service(PageService.java:66)
      at $IEngineService_111fd364d1e.service($IEngineService_111fd364d1e.java)
      at org.apache.tapestry.services.impl.EngineServiceInnerProxy.service(EngineServiceInnerProxy.java:77)
      at org.apache.tapestry.services.impl.EngineServiceOuterProxy.service(EngineServiceOuterProxy.java:72)
      at org.apache.tapestry.engine.AbstractEngine.service(AbstractEngine.java:246)
      at org.apache.tapestry.services.impl.InvokeEngineTerminator.service(InvokeEngineTerminator.java:54)
      at $WebRequestServicer_111fd364cfc.service($WebRequestServicer_111fd364cfc.java)
      at $WebRequestServicer_111fd364cfb.service($WebRequestServicer_111fd364cfb.java)
      at org.apache.tapestry.services.impl.DisableCachingFilter.service(DisableCachingFilter.java:54)
      at $WebRequestServicerFilter_111fd364cfe.service($WebRequestServicerFilter_111fd364cfe.java)
      at $WebRequestServicerFilter_111fd364cfd.service($WebRequestServicerFilter_111fd364cfd.java)
      at $WebRequestServicer_111fd364cff.service($WebRequestServicer_111fd364cff.java)
      at $WebRequestServicer_111fd364cf8.service($WebRequestServicer_111fd364cf8.java)
      at $WebRequestServicer_111fd364cf7.service($WebRequestServicer_111fd364cf7.java)
      at org.apache.tapestry.services.impl.WebRequestServicerPipelineBridge.service(WebRequestServicerPipelineBridge.java:61)
      at $ServletRequestServicer_111fd364cde.service($ServletRequestServicer_111fd364cde.java)
      at $ServletRequestServicer_111fd364cdd.service($ServletRequestServicer_111fd364cdd.java)
      at org.apache.tapestry.request.DecodedRequestInjector.service(DecodedRequestInjector.java:55)
      at $ServletRequestServicerFilter_111fd364cda.service($ServletRequestServicerFilter_111fd364cda.java)
      at $ServletRequestServicerFilter_111fd364cd9.service($ServletRequestServicerFilter_111fd364cd9.java)
      at $ServletRequestServicer_111fd364cdf.service($ServletRequestServicer_111fd364cdf.java)
      at org.apache.tapestry.multipart.MultipartDecoderFilter.service(MultipartDecoderFilter.java:52)
      at $ServletRequestServicerFilter_111fd364cd8.service($ServletRequestServicerFilter_111fd364cd8.java)
      at $ServletRequestServicerFilter_111fd364cd7.service($ServletRequestServicerFilter_111fd364cd7.java)
      at $ServletRequestServicer_111fd364cdf.service($ServletRequestServicer_111fd364cdf.java)
      at org.apache.tapestry.services.impl.SetupRequestEncoding.service(SetupRequestEncoding.java:53)
      at $ServletRequestServicerFilter_111fd364cdc.service($ServletRequestServicerFilter_111fd364cdc.java)
      at $ServletRequestServicerFilter_111fd364cdb.service($ServletRequestServicerFilter_111fd364cdb.java)
      at $ServletRequestServicer_111fd364cdf.service($ServletRequestServicer_111fd364cdf.java)
      at $ServletRequestServicer_111fd364cd2.service($ServletRequestServicer_111fd364cd2.java)
      at $ServletRequestServicer_111fd364cd1.service($ServletRequestServicer_111fd364cd1.java)
      at org.apache.tapestry.ApplicationServlet.doService(ApplicationServlet.java:123)
      at org.apache.tapestry.ApplicationServlet.doGet(ApplicationServlet.java:104)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
      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 org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:183)
      at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:77)
      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.coyote.http11.Http11Processor.process(Http11Processor.java:869)
      at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
      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)
      Caused by: org.apache.hivemind.ApplicationRuntimeException: Unable to add method java.lang.String getClientId() to class $TapestryBugPage_0: [source error] no such field: apache
      at org.apache.hivemind.service.impl.ClassFabImpl.addMethod(ClassFabImpl.java:295)
      at org.apache.tapestry.enhance.EnhancementOperationImpl.addMethod(EnhancementOperationImpl.java:397)
      at org.apache.tapestry.enhance.ClientIdPropertyWorker.createProperty(ClientIdPropertyWorker.java:99)
      at org.apache.tapestry.enhance.ClientIdPropertyWorker.performEnhancement(ClientIdPropertyWorker.java:50)
      ... 71 more
      Caused by: javassist.CannotCompileException: [source error] no such field: apache
      at javassist.CtBehavior.setBody(CtBehavior.java:347)
      at javassist.CtBehavior.setBody(CtBehavior.java:316)
      at org.apache.hivemind.service.impl.ClassFabImpl.addMethod(ClassFabImpl.java:288)
      ... 74 more
      Caused by: compile error: no such field: apache
      at javassist.compiler.MemberResolver.lookupField(MemberResolver.java:302)
      at javassist.compiler.MemberResolver.lookupFieldByJvmName(MemberResolver.java:288)
      at javassist.compiler.TypeChecker.fieldAccess(TypeChecker.java:829)
      at javassist.compiler.TypeChecker.atFieldRead(TypeChecker.java:770)
      at javassist.compiler.TypeChecker.atExpr(TypeChecker.java:571)
      at javassist.compiler.ast.Expr.accept(Expr.java:67)
      at javassist.compiler.TypeChecker.fieldAccess(TypeChecker.java:827)
      at javassist.compiler.TypeChecker.atFieldRead(TypeChecker.java:770)
      at javassist.compiler.TypeChecker.atExpr(TypeChecker.java:571)
      at javassist.compiler.ast.Expr.accept(Expr.java:67)
      at javassist.compiler.TypeChecker.fieldAccess(TypeChecker.java:827)
      at javassist.compiler.TypeChecker.atFieldRead(TypeChecker.java:770)
      at javassist.compiler.TypeChecker.atExpr(TypeChecker.java:571)
      at javassist.compiler.ast.Expr.accept(Expr.java:67)
      at javassist.compiler.TypeChecker.atCallExpr(TypeChecker.java:653)
      at javassist.compiler.JvstTypeChecker.atCallExpr(JvstTypeChecker.java:156)
      at javassist.compiler.ast.CallExpr.accept(CallExpr.java:45)
      at javassist.compiler.JvstTypeChecker.atMethodArgs(JvstTypeChecker.java:220)
      at javassist.compiler.TypeChecker.atMethodCallCore(TypeChecker.java:702)
      at javassist.compiler.TypeChecker.atCallExpr(TypeChecker.java:681)
      at javassist.compiler.JvstTypeChecker.atCallExpr(JvstTypeChecker.java:156)
      at javassist.compiler.ast.CallExpr.accept(CallExpr.java:45)
      at javassist.compiler.CodeGen.doTypeCheck(CodeGen.java:235)
      at javassist.compiler.CodeGen.compileExpr(CodeGen.java:222)
      at javassist.compiler.CodeGen.atReturnStmnt2(CodeGen.java:591)
      at javassist.compiler.JvstCodeGen.atReturnStmnt(JvstCodeGen.java:424)
      at javassist.compiler.CodeGen.atStmnt(CodeGen.java:356)
      at javassist.compiler.ast.Stmnt.accept(Stmnt.java:49)
      at javassist.compiler.CodeGen.atStmnt(CodeGen.java:344)
      at javassist.compiler.ast.Stmnt.accept(Stmnt.java:49)
      at javassist.compiler.CodeGen.atIfStmnt(CodeGen.java:384)
      at javassist.compiler.CodeGen.atStmnt(CodeGen.java:348)
      at javassist.compiler.ast.Stmnt.accept(Stmnt.java:49)
      at javassist.compiler.CodeGen.atMethodBody(CodeGen.java:285)
      at javassist.compiler.Javac.compileBody(Javac.java:212)
      at javassist.CtBehavior.setBody(CtBehavior.java:341)
      ... 76 more


        Activity

          People

          • Assignee:
            Jesse Kuhnert
            Reporter:
            Robert J. Walker
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development