[jbossseam-issues] [JBoss JIRA] Commented: (JBSEAM-3999) Race condition in component initialization
Toshiya Kobayashi (JIRA)
jira-events at lists.jboss.org
Wed Jul 1 04:44:31 EDT 2009
[ https://jira.jboss.org/jira/browse/JBSEAM-3999?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12474401#action_12474401 ]
Toshiya Kobayashi commented on JBSEAM-3999:
-------------------------------------------
In case of org.jboss.seam.drools.RuleBase, Seam allows the 2nd thread to access the component which is not properly instantiated and results in "java.lang.IllegalArgumentException: Could not invoke method by reflection: RuleBasedIdentity.setSecurityRules(org.drools.RuleBase) with parameters: (org.jboss.seam.drools.RuleBase) on: org.jboss.seam.security.RuleBasedIdentity"
Since org.jboss.seam.drools.RuleBase is an application scoped component, you can add startup="true" to work around.
> Race condition in component initialization
> ------------------------------------------
>
> Key: JBSEAM-3999
> URL: https://jira.jboss.org/jira/browse/JBSEAM-3999
> Project: Seam
> Issue Type: Bug
> Components: Core
> Affects Versions: 2.1.1.GA
> Reporter: Stuart Douglas
> Assignee: Norman Richards
>
> When starting up application (or session) scoped component that do not have an @Startup annotation it is possible to get a race condition where two instances of the component are instantiated, as no locking is present in component initialization. I ran into this when my multi-threaded reporting process was the first component to hit the cache and jboss cache provider got instantiated twice:
> `16:54:48,717 INFO [JbossCacheProvider] Starting JBoss Treecache 1.x
> 16:54:48,717 INFO [JbossCacheProvider] Starting JBoss Treecache 1.x`
> In this case it is easy to work around, by simply adding startup="true" to the application scoped component. It is also possible to make calls on a component before the create method is called.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the seam-issues
mailing list