[jbossseam-issues] [JBoss JIRA] Commented: (JBSEAM-3983) @Observer methods may be called multiple times

Norman Richards (JIRA) jira-events at lists.jboss.org
Tue Mar 3 11:35:22 EST 2009

    [ https://jira.jboss.org/jira/browse/JBSEAM-3983?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12455204#action_12455204 ] 

Norman Richards commented on JBSEAM-3983:

Subclassing a class does cause annotations on parent classes to be ignored.  We can continue the discussion in the forums.

I'll leave the issue open until you can confirm that missing observer is caused by an error condition.  One suggestion would be to comment out the implementation on the other observers (so that no error would be generated) and see if the third method is being called.

> @Observer methods may be called multiple times
> ----------------------------------------------
>                 Key: JBSEAM-3983
>                 URL: https://jira.jboss.org/jira/browse/JBSEAM-3983
>             Project: Seam
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.1.1.GA
>            Reporter: Vanessa Williams
>            Assignee: Norman Richards
> Some @Observer methods may be called multiple times, while others may not be called at all. This bug is reproducible; occurs in both 2.1.0 and 2.1.1 and requires specific circumstances (described below.)
> I do not have the time (unfortunately) to create a sample project to demonstrate the problem, but it is easy enough to describe.
> Create an EntityHome<E> subclass, let's call it FooHome.java. Override the persist() method and at the end of it, raise an event, say "fooSaved". Now, in the same class create a method postFooSaved() and annotate it with @Observer("fooSaved"). In any other component you like, create another @Observer method, with a different name, say watchFoo(), observing the same event. In this case, everything works as expected. After FooHome.persist() is called, postFooSaved() and watchFoo() will each be executed once.
> Now to replicate the bug: create a subclass of FooHome.java, say BarHome.java. It doesn't matter what it contains. Now postFooSaved() will be executed twice and watchFoo() will not be executed at all.
> As an extended demonstration, create an action component called FooAction.java and move the original postFooSaved() @Observer to that class. Again, all will work as expected, with postFooSaved() and watchFoo() each executing once. Now create a subclass of FooAction: BarAction.java. The bug will re-appear, with postFooSaved() executing twice and watchFoo() not executing at all.
> Hope that helps.

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