Tapestry
  1. Tapestry
  2. TAPESTRY-2141

NullPointerExceptions under JDK 1.5 due to underlying ThreadLocal bug

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.0.10
    • Fix Version/s: 5.0.11
    • Component/s: tapestry-ioc
    • Labels:
      None
    • Environment:
      jre 1.5

      Description

      There is a ThreadLocal bug that might be a source of problems for following code:

      here is a non trivial example that is broken,
      I'll try to make a trivial one that fails

      a simple page with test link
      <t:eventlink event="test">test</t:eventlink>

      page:
      @Inject private HibernateSessionManager _sessionManager;
      @Inject private ThreadCleanupHub _cleanupHub;

      public void onTest(){
      new Thread(new Runnable(){
      public void run()

      { User user = (User) _sessionManager.getSession().load(User.class, Long.valueOf(1L)); user.setName(user.getName()+"1"); _cleanupHub.cleanup(); }

      }).start();
      }

      for java 1.5 this code fails to save data (threadCleanupHub looses listener list )
      and it works fo 1.6

      here's a link to articles about this bug
      http://crazybob.org/2006/07/hard-core-java-threadlocal.html

      and the bug
      http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5025230

      it also makes this snippet not working
      http://wiki.apache.org/tapestry/Tapestry5HowToRunTaskInThread

        Issue Links

          Activity

          Davor Hrg created issue -
          Howard M. Lewis Ship made changes -
          Field Original Value New Value
          Link This issue relates to TAPESTRY-2037 [ TAPESTRY-2037 ]
          Howard M. Lewis Ship made changes -
          Assignee Howard M. Lewis Ship [ hlship ]
          Howard M. Lewis Ship made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          Howard M. Lewis Ship made changes -
          Summary ThreadLocal bug that needs a workarround NullPointerExceptions under JDK 1.5 due to underlying ThreadLocal bug
          Howard M. Lewis Ship made changes -
          Status In Progress [ 3 ] Closed [ 6 ]
          Resolution Fixed [ 1 ]
          Fix Version/s 5.0.11 [ 12312968 ]
          Howard M. Lewis Ship made changes -
          Link This issue is related to TAP5-945 [ TAP5-945 ]
          Mark Thomas made changes -
          Workflow jira [ 12423078 ] Default workflow, editable Closed status [ 12567722 ]
          Mark Thomas made changes -
          Workflow Default workflow, editable Closed status [ 12567722 ] jira [ 12591973 ]

            People

            • Assignee:
              Howard M. Lewis Ship
              Reporter:
              Davor Hrg
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development