Tapestry
  1. Tapestry
  2. TAPESTRY-1338

ApplicationStateObjects not properly instantiated when using PageTester

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.0.3
    • Fix Version/s: 5.0.4
    • Component/s: tapestry-core
    • Labels:
      None
    • Environment:
      OSX, java 1.5, tapestry 5.0.3

      Description

      When using PageTester with pages which contain injected application state objects, the application state objects aren't instantiated. The problem seems to lie at the level of trying to store the ASO into the session (NPE thrown when trying access the session). For test cases, see the attached jar in tapestry-1337.

      Stack Trace:

      org.apache.tapestry.ioc.internal.util.TapestryException [at classpath:org/tapestrycomponents/tassel/pages/ASOTestPage.html, line 3, column 31]
      at org.apache.tapestry.internal.bindings.PropBinding.get(PropBinding.java:58)
      at org.apache.tapestry.internal.structure.ExpansionPageElement.render(ExpansionPageElement.java:47)
      at org.apache.tapestry.internal.services.RenderQueueImpl.run(RenderQueueImpl.java:57)
      at org.apache.tapestry.internal.services.PageMarkupRendererImpl.renderPageMarkup(PageMarkupRendererImpl.java:40)
      at $PageMarkupRenderer_11137ebe6dd.renderPageMarkup($PageMarkupRenderer_11137ebe6dd.java)
      at org.apache.tapestry.test.pagelevel.PageLinkInvoker$1.renderPage(PageLinkInvoker.java:65)
      at org.apache.tapestry.internal.services.PageLinkHandlerImpl.handle(PageLinkHandlerImpl.java:89)
      at $PageLinkHandler_11137ebe6dc.handle($PageLinkHandler_11137ebe6dc.java)
      at org.apache.tapestry.test.pagelevel.PageLinkInvoker.invoke(PageLinkInvoker.java:60)
      at org.apache.tapestry.test.pagelevel.PageTester.invoke(PageTester.java:219)
      at org.apache.tapestry.test.pagelevel.PageTester.renderPage(PageTester.java:184)
      at org.tapestrycomponents.tassel.pages.TestPageTester.testRenderPageWithASO(TestPageTester.java:23)
      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 junit.framework.TestCase.runTest(TestCase.java:154)
      at junit.framework.TestCase.runBare(TestCase.java:127)
      at junit.framework.TestResult$1.protect(TestResult.java:106)
      at junit.framework.TestResult.runProtected(TestResult.java:124)
      at junit.framework.TestResult.run(TestResult.java:109)
      at junit.framework.TestCase.run(TestCase.java:118)
      at junit.framework.TestSuite.runTest(TestSuite.java:208)
      at junit.framework.TestSuite.run(TestSuite.java:203)
      at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128)
      at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
      Caused by: java.lang.NullPointerException
      at $Request_11137ebe6f5.getSession($Request_11137ebe6f5.java)
      at $Request_11137ebe6c1.getSession($Request_11137ebe6c1.java)
      at org.apache.tapestry.internal.services.SessionApplicationStatePersistenceStrategy.getSession(SessionApplicationStatePersistenceStrategy.java:41)
      at org.apache.tapestry.internal.services.SessionApplicationStatePersistenceStrategy.get(SessionApplicationStatePersistenceStrategy.java:47)
      at org.apache.tapestry.internal.services.ApplicationStateManagerImpl$ApplicationStateAdapter.getOrCreate(ApplicationStateManagerImpl.java:49)
      at org.apache.tapestry.internal.services.ApplicationStateManagerImpl.get(ApplicationStateManagerImpl.java:131)
      at $ApplicationStateManager_11137ebe6ac.get($ApplicationStateManager_11137ebe6ac.java)
      at org.tapestrycomponents.tassel.pages.ASOTestPage._$read_aso(ASOTestPage.java)
      at org.tapestrycomponents.tassel.pages.ASOTestPage.getFooString(ASOTestPage.java:16)
      at $PropertyConduit_11137ebe6ee.get($PropertyConduit_11137ebe6ee.java)
      at org.apache.tapestry.internal.bindings.PropBinding.get(PropBinding.java:54)
      ... 29 more

        Activity

          People

          • Assignee:
            Kent Tong
            Reporter:
            Robert Zeigler
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development