You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Howard M. Lewis Ship (JIRA)" <de...@tapestry.apache.org> on 2008/02/12 04:19:09 UTC
[jira] Closed: (TAPESTRY-2141) NullPointerExceptions under JDK 1.5
due to underlying ThreadLocal bug
[ https://issues.apache.org/jira/browse/TAPESTRY-2141?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Howard M. Lewis Ship closed TAPESTRY-2141.
------------------------------------------
Resolution: Fixed
Fix Version/s: 5.0.11
This looks pretty fixed; I think the specific case was when a per-thread service was using a TheadLocal to create the per-thread instance AND asking the ThreadCleanupHub to register a listener, as that would also create a per-thread instance inside a ThreadLocal to store the list. Now there's only one ThreadLocal in that scenario.
> NullPointerExceptions under JDK 1.5 due to underlying ThreadLocal bug
> ---------------------------------------------------------------------
>
> Key: TAPESTRY-2141
> URL: https://issues.apache.org/jira/browse/TAPESTRY-2141
> Project: Tapestry
> Issue Type: Bug
> Components: tapestry-ioc
> Affects Versions: 5.0.10
> Environment: jre 1.5
> Reporter: Davor Hrg
> Assignee: Howard M. Lewis Ship
> Fix For: 5.0.11
>
>
> 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
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org