Tapestry
  1. Tapestry
  2. TAPESTRY-361

Using @Asset annotation causes NullPointerException

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.0
    • Fix Version/s: 4.0
    • Component/s: Annotations
    • Labels:
      None
    • Environment:
      Windows XP, Tomcat 5.5, JDk 1.5 Update 1

      Description

      Inside a custom Border compoinent, I want to reference an asset via annotations via

      @Asset("css/style.css")
      public abstract IAsset getStylesheet();

      Inside my BorderComponent I have:

      At runtime I get the following stack trace:

      java.lang.NullPointerException
      Stack Trace:

      • org.apache.tapestry.pageload.PageLoader.convertAsset(PageLoader.java:719)
      • org.apache.tapestry.pageload.PageLoader.addAssets(PageLoader.java:703)
      • org.apache.tapestry.pageload.PageLoader.constructComponent(PageLoader.java:468)
      • org.apache.tapestry.pageload.PageLoader.createImplicitComponent(PageLoader.java:529)
      • $IPageLoader_104c5a5a4bc.createImplicitComponent($IPageLoader_104c5a5a4bc.java)
      • $IPageLoader_104c5a5a4bd.createImplicitComponent($IPageLoader_104c5a5a4bd.java)
      • org.apache.tapestry.services.impl.ComponentTemplateLoaderLogic.createImplicitComponent(ComponentTemplateLoaderLogic.java:220)
      • org.apache.tapestry.services.impl.ComponentTemplateLoaderLogic.process(ComponentTemplateLoaderLogic.java:174)
      • org.apache.tapestry.services.impl.ComponentTemplateLoaderLogic.process(ComponentTemplateLoaderLogic.java:113)
      • org.apache.tapestry.services.impl.ComponentTemplateLoaderLogic.loadTemplate(ComponentTemplateLoaderLogic.java:90)
      • org.apache.tapestry.services.impl.ComponentTemplateLoaderImpl.loadTemplate(ComponentTemplateLoaderImpl.java:61)
      • $ComponentTemplateLoader_104c5a5a4c5.loadTemplate($ComponentTemplateLoader_104c5a5a4c5.java)
      • $ComponentTemplateLoader_104c5a5a4c4.loadTemplate($ComponentTemplateLoader_104c5a5a4c4.java)
      • org.apache.tapestry.pageload.PageLoader.loadTemplateForComponent(PageLoader.java:670)
      • org.apache.tapestry.BaseComponent.readTemplate(BaseComponent.java:77)
      • org.apache.tapestry.BaseComponent.finishLoad(BaseComponent.java:107)
      • $Home_0.finishLoad($Home_0.java)
      • org.apache.tapestry.pageload.PageLoader.constructComponent(PageLoader.java:478)
      • org.apache.tapestry.pageload.PageLoader.loadPage(PageLoader.java:641)
      • $IPageLoader_104c5a5a4bc.loadPage($IPageLoader_104c5a5a4bc.java)
      • $IPageLoader_104c5a5a4bd.loadPage($IPageLoader_104c5a5a4bd.java)
      • org.apache.tapestry.pageload.PageSource.getPage(PageSource.java:118)
      • $IPageSource_104c5a5a42d.getPage($IPageSource_104c5a5a42d.java)
      • $IPageSource_104c5a5a42c.getPage($IPageSource_104c5a5a42c.java)
      • org.apache.tapestry.engine.RequestCycle.loadPage(RequestCycle.java:252)
      • org.apache.tapestry.engine.RequestCycle.getPage(RequestCycle.java:235)
      • org.apache.tapestry.engine.RequestCycle.activate(RequestCycle.java:596)
      • org.apache.tapestry.engine.HomeService.service(HomeService.java:63)
      • $IEngineService_104c5a5a4a8.service($IEngineService_104c5a5a4a8.java)
      • org.apache.tapestry.services.impl.EngineServiceInnerProxy.service(EngineServiceInnerProxy.java:74)
      • org.apache.tapestry.services.impl.EngineServiceOuterProxy.service(EngineServiceOuterProxy.java:65)
      • org.apache.tapestry.engine.AbstractEngine.service(AbstractEngine.java:241)
      • org.apache.tapestry.services.impl.InvokeEngineTerminator.service(InvokeEngineTerminator.java:60)
      • $WebRequestServicer_104c5a5a48d.service($WebRequestServicer_104c5a5a48d.java)
      • $WebRequestServicer_104c5a5a48c.service($WebRequestServicer_104c5a5a48c.java)
      • $WebRequestServicer_104c5a5a489.service($WebRequestServicer_104c5a5a489.java)
      • $WebRequestServicer_104c5a5a488.service($WebRequestServicer_104c5a5a488.java)
      • org.apache.tapestry.services.impl.WebRequestServicerPipelineBridge.service(WebRequestServicerPipelineBridge.java:56)
      • $ServletRequestServicer_104c5a5a46d.service($ServletRequestServicer_104c5a5a46d.java)
      • $ServletRequestServicer_104c5a5a46c.service($ServletRequestServicer_104c5a5a46c.java)
      • org.apache.tapestry.request.DecodedRequestInjector.service(DecodedRequestInjector.java:55)
      • $ServletRequestServicerFilter_104c5a5a469.service($ServletRequestServicerFilter_104c5a5a469.java)
      • $ServletRequestServicerFilter_104c5a5a468.service($ServletRequestServicerFilter_104c5a5a468.java)
      • $ServletRequestServicer_104c5a5a46e.service($ServletRequestServicer_104c5a5a46e.java)
      • org.apache.tapestry.multipart.MultipartDecoderFilter.service(MultipartDecoderFilter.java:52)
      • $ServletRequestServicerFilter_104c5a5a467.service($ServletRequestServicerFilter_104c5a5a467.java)
      • $ServletRequestServicerFilter_104c5a5a466.service($ServletRequestServicerFilter_104c5a5a466.java)
      • $ServletRequestServicer_104c5a5a46e.service($ServletRequestServicer_104c5a5a46e.java)
      • org.apache.tapestry.services.impl.SetupRequestEncoding.service(SetupRequestEncoding.java:53)
      • $ServletRequestServicerFilter_104c5a5a46b.service($ServletRequestServicerFilter_104c5a5a46b.java)
      • $ServletRequestServicerFilter_104c5a5a46a.service($ServletRequestServicerFilter_104c5a5a46a.java)
      • $ServletRequestServicer_104c5a5a46e.service($ServletRequestServicer_104c5a5a46e.java)
      • $ServletRequestServicer_104c5a5a461.service($ServletRequestServicer_104c5a5a461.java)
      • $ServletRequestServicer_104c5a5a460.service($ServletRequestServicer_104c5a5a460.java)
      • org.apache.tapestry.ApplicationServlet.doService(ApplicationServlet.java:145)
      • org.apache.tapestry.ApplicationServlet.doGet(ApplicationServlet.java:101)
      • javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
      • javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
      • org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
      • org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      • org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:362)
      • org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      • org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      • org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
      • org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
      • org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
      • org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
      • org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
      • org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
      • org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:825)
      • org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:738)
      • org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:526)
      • org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
      • org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
      • java.lang.Thread.run(Thread.java:595)

        Activity

        Hide
        Howard M. Lewis Ship added a comment -

        Added uses of @Asset and @InjectAsset to the Workbench to validate that it all works.

        Show
        Howard M. Lewis Ship added a comment - Added uses of @Asset and @InjectAsset to the Workbench to validate that it all works.
        Hide
        Howard M. Lewis Ship added a comment -

        Re-open to set fix version.

        Show
        Howard M. Lewis Ship added a comment - Re-open to set fix version.
        Hide
        Scott Walter added a comment -

        Since this issue is being closed, does it mean I did something wrong? Or is a fix required?

        thanks, scott.

        Show
        Scott Walter added a comment - Since this issue is being closed, does it mean I did something wrong? Or is a fix required? thanks, scott.

          People

          • Assignee:
            Howard M. Lewis Ship
            Reporter:
            Scott Walter
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development