Tapestry
  1. Tapestry
  2. TAPESTRY-2723

Compenents that should be found are not found during page loading

    Details

    • Type: Bug Bug
    • Status: In Progress
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 4.1.6
    • Fix Version/s: None
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      Windows XP Service pack 3 - 1.86 GHz, 3 GB of ram - JBoss - Tapestry 4.1.6

      Description

      When AbstractComponent.getComponents(String) is called the HashMap "_components" is unexpectedly null, causing an ApplicationRuntimeException which indicates that the given component (id passed as parameter to getComponents(String)), does not exist. We have confirmed that in every instance the given component does exist in the given page.
      This problem happens randomly on a variety of pages.
      This could be an indication of a thread safety problem in the PageLoader class. We can duplicate the problem, (unreliably), via our selenium test suite.

      1. StackTrace.txt
        10 kB
        michael wasserman

        Activity

        Hide
        michael wasserman added a comment -

        This is a sample stack trace

        Show
        michael wasserman added a comment - This is a sample stack trace
        Hide
        Andreas Andreou added a comment -

        As reported in the mailing list, this occures under:
        java version "1.5.0_10"
        Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_10-b03)
        Java HotSpot(TM) Client VM (build 1.5.0_10-b03, mixed mode, sharing)

        and JDK 1.5.0_17

        Also, another note:
        "We've tracked the problem further and it appears to be a thread safety problem in the PageLoader class.
        We have pop-ups in our app that are seperate Tapestry pages and we think that they may be clobbering each other when getting loaded."

        Show
        Andreas Andreou added a comment - As reported in the mailing list, this occures under: java version "1.5.0_10" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_10-b03) Java HotSpot(TM) Client VM (build 1.5.0_10-b03, mixed mode, sharing) and JDK 1.5.0_17 Also, another note: "We've tracked the problem further and it appears to be a thread safety problem in the PageLoader class. We have pop-ups in our app that are seperate Tapestry pages and we think that they may be clobbering each other when getting loaded."
        Hide
        Andreas Andreou added a comment -

        Are you sure on the tapestry version?

        The first line of your trace is AbstractComponent.getComponent(AbstractComponent.java:393)
        but in 4.1.6 that line is not in getComponent()

        Show
        Andreas Andreou added a comment - Are you sure on the tapestry version? The first line of your trace is AbstractComponent.getComponent(AbstractComponent.java:393) but in 4.1.6 that line is not in getComponent()
        Hide
        michael wasserman added a comment -

        The line numbers may be off due to debugging code that we've placed in the source.

        The exception is being thrown at the following lines in the getComponent() method:

        if (result == null)
        throw new ApplicationRuntimeException(Tapestry.format("no-such-component", this, id),
        this, null, null);

        The problem is that result is never set because the _components HashMap is null.

        We believe we may have found a solution to this problem.
        By placing the line "_pageSpecificationResolver.resolve(_cycle, pageKey.getPageName());"
        from PageSource.makeObject(Object key) in a synchronize block we have so far been unable to recreate the exception.
        We are intending to test more aggressively on Monday/Tuesday and will report our findings then.

        Show
        michael wasserman added a comment - The line numbers may be off due to debugging code that we've placed in the source. The exception is being thrown at the following lines in the getComponent() method: if (result == null) throw new ApplicationRuntimeException(Tapestry.format("no-such-component", this, id), this, null, null); The problem is that result is never set because the _components HashMap is null. We believe we may have found a solution to this problem. By placing the line "_pageSpecificationResolver.resolve(_cycle, pageKey.getPageName());" from PageSource.makeObject(Object key) in a synchronize block we have so far been unable to recreate the exception. We are intending to test more aggressively on Monday/Tuesday and will report our findings then.
        Hide
        Andreas Andreou added a comment -

        Didn't quite get time for this yet - a quick digging into jira however showed
        TAPESTRY-2530, TAPESTRY-2382 and TAPESTRY-2604... From the description the
        fix for the first might be causing this - and on the other hand, the proposed solution for this may
        trigger TAPESTRY-2530 again (would have been nice if there was a test case).

        Anyway, as i said, i havent looked at the code yet, but for the record i've managed to (sometimes)
        reproduce this in 1.6u11VMs as well. It seems to happen when hitting a 'not yet fully started' server with
        simultaneous requests for multiple pages

        Show
        Andreas Andreou added a comment - Didn't quite get time for this yet - a quick digging into jira however showed TAPESTRY-2530 , TAPESTRY-2382 and TAPESTRY-2604 ... From the description the fix for the first might be causing this - and on the other hand, the proposed solution for this may trigger TAPESTRY-2530 again (would have been nice if there was a test case). Anyway, as i said, i havent looked at the code yet, but for the record i've managed to (sometimes) reproduce this in 1.6u11VMs as well. It seems to happen when hitting a 'not yet fully started' server with simultaneous requests for multiple pages
        Hide
        Mark Reynolds added a comment -

        Michael, did your solution work? Any side effects? We are hitting this issue pretty badly with our latest product release, in which we moved to 4.1.6.

        Show
        Mark Reynolds added a comment - Michael, did your solution work? Any side effects? We are hitting this issue pretty badly with our latest product release, in which we moved to 4.1.6.

          People

          • Assignee:
            Unassigned
            Reporter:
            michael wasserman
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:

              Development