[jboss-jira] [JBoss JIRA] (AS7-3601) Component context not available on spawned threads
jaikiran pai (JIRA)
jira-events at lists.jboss.org
Mon Feb 6 02:08:48 EST 2012
[ https://issues.jboss.org/browse/AS7-3601?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12664343#comment-12664343 ]
jaikiran pai commented on AS7-3601:
-----------------------------------
Note that this _isn't_ a bug. The spec says that Threads should not be spawned by application code. See this thread for more details http://lists.jboss.org/pipermail/jboss-as7-dev/2011-June/002292.html
> Component context not available on spawned threads
> --------------------------------------------------
>
> Key: AS7-3601
> URL: https://issues.jboss.org/browse/AS7-3601
> Project: Application Server 7
> Issue Type: Bug
> Components: Naming
> Affects Versions: 7.1.0.CR1b
> Reporter: Johannes Odland
> Assignee: John Bailey
>
> When a request is processed, the JavaNamespaceSetup pushes an InjectedEENamespaceContextSelector onto a ThreadLocalStack, making the app and component contexts available for lookups through InitialContext().lookup().
> As a result, the application and component contexts are only available on the same thread as the request, and not on threads spawned by the application itself.
> Many applications, such as Solr, spawns its own threads for doing asynchronous processing. These are not able to access the JNDI component context (java:comp/env/).
> Perhaps one should use InheritableThreadLocal to store the selector instead?
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list