Tapestry
  1. Tapestry
  2. TAPESTRY-1337

PageTester can't handle pages with context assets

    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, java1.5

      Description

      Pages which inject a context asset will cause a NullPointerException.

      Stack trace:

      java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
      at org.apache.tapestry.internal.services.ReflectiveInstantiator.newInstance(ReflectiveInstantiator.java:88)
      at org.apache.tapestry.internal.structure.InternalComponentResourcesImpl.<init>(InternalComponentResourcesImpl.java:74)
      at org.apache.tapestry.internal.structure.ComponentPageElementImpl.<init>(ComponentPageElementImpl.java:539)
      at org.apache.tapestry.internal.structure.ComponentPageElementImpl.<init>(ComponentPageElementImpl.java:581)
      at org.apache.tapestry.internal.services.PageElementFactoryImpl.newRootComponentElement(PageElementFactoryImpl.java:190)
      at $PageElementFactory_11137ebe69c.newRootComponentElement($PageElementFactory_11137ebe69c.java)
      at org.apache.tapestry.internal.services.PageLoaderProcessor.loadRootComponent(PageLoaderProcessor.java:345)
      at org.apache.tapestry.internal.services.PageLoaderProcessor.loadPage(PageLoaderProcessor.java:330)
      at org.apache.tapestry.internal.services.PageLoaderImpl.loadPage(PageLoaderImpl.java:62)
      at $PageLoader_11137ebe69b.loadPage($PageLoader_11137ebe69b.java)
      at org.apache.tapestry.internal.services.PagePoolImpl.checkout(PagePoolImpl.java:63)
      at $PagePool_11137ebe69a.checkout($PagePool_11137ebe69a.java)
      at org.apache.tapestry.internal.services.RequestPageCacheImpl.getByClassName(RequestPageCacheImpl.java:58)
      at org.apache.tapestry.internal.services.RequestPageCacheImpl.get(RequestPageCacheImpl.java:49)
      at $RequestPageCache_11137ebe699.get($RequestPageCache_11137ebe699.java)
      at $RequestPageCache_11137ebe688.get($RequestPageCache_11137ebe688.java)
      at org.apache.tapestry.internal.services.PageLinkHandlerImpl.handle(PageLinkHandlerImpl.java:57)
      at $PageLinkHandler_11137ebe693.handle($PageLinkHandler_11137ebe693.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.testRenderPageWithContextAsset(TestPageTester.java:17)
      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.reflect.InvocationTargetException
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
      at org.apache.tapestry.internal.services.ReflectiveInstantiator.newInstance(ReflectiveInstantiator.java:84)
      ... 39 more
      Caused by: java.lang.NullPointerException
      at $Request_11137ebe6a5.getContextPath($Request_11137ebe6a5.java)
      at $Request_11137ebe678.getContextPath($Request_11137ebe678.java)
      at org.apache.tapestry.internal.services.ContextAssetFactory.createAsset(ContextAssetFactory.java:42)
      at $AssetFactory_11137ebe6a2.createAsset($AssetFactory_11137ebe6a2.java)
      at org.apache.tapestry.internal.services.AssetSourceImpl.createAssetFromResource(AssetSourceImpl.java:124)
      at org.apache.tapestry.internal.services.AssetSourceImpl.getAssetForResource(AssetSourceImpl.java:107)
      at org.apache.tapestry.internal.services.AssetSourceImpl.findRelativeAsset(AssetSourceImpl.java:98)
      at org.apache.tapestry.internal.services.AssetSourceImpl.findAsset(AssetSourceImpl.java:87)
      at $AssetSource_11137ebe665.findAsset($AssetSource_11137ebe665.java)
      at org.tapestrycomponents.tassel.pages.ContextAssetTestPage.<init>(ContextAssetTestPage.java)
      ... 44 more

        Activity

        Hide
        Robert Zeigler added a comment -

        test cases for @Inject("context:asset") issues. Also contains test cases for @ApplicationState problems.

        Show
        Robert Zeigler added a comment - test cases for @Inject("context:asset") issues. Also contains test cases for @ApplicationState problems.
        Hide
        Kent Tong added a comment -

        Fixed. Please verify.

        Show
        Kent Tong added a comment - Fixed. Please verify.
        Hide
        Robert Zeigler added a comment -

        Verified.

        Show
        Robert Zeigler added a comment - Verified.

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development