This content has been marked as final.
Show 4 replies
-
1. Re: Strange Groovy Seam component
bgoetzmann Feb 11, 2009 10:46 AM (in response to bgoetzmann)I would like to correct a point in my previous message and add an extra information.
First, I just forgot the @ of the Name annotation; so the Seam Groovy is:
@Name("inSession")
@Scope(ScopeType.SESSION)
class InSession {
String prop = 'Salut !'
public InSession() {
println "InSession called at ${new Date()} !"
}
}
The first time the view is displayed, two instances of the InSession class are createed (its constructor is called twice!).
The second point is that, as this component is hot deployed, if you change it and/or explode your Seam application, and navigate to the view, you get an exception from Seam:
java.lang.IllegalStateException: Two components with the same name and precedence - component name: inSession, component classes: com.lsy.clink.visualizations.InSession, com.lsy.clink.visualizations.InSession
Any idea about this? Is a Seam bug?
Thank you,
Bertrand. -
2. Re: Strange Groovy Seam component
willpiasecki Oct 8, 2010 2:42 PM (in response to bgoetzmann)Hello.
I'm having the same problem: the component keeps getting recreated and can't save it's state (a println in the constructor is called all the time some action in page happens)
Is this a bug? Does anyone know something about it?
Thanks :)
-
3. Re: Strange Groovy Seam component
yahawari Oct 8, 2010 8:00 PM (in response to bgoetzmann)seam proxies your object to make it a seam component. it may create you object number of time especially in clusters. don't put ur initialization code in the constructor. leave the constructor empty and create another function that is annotated with @Create. this function will act as an initialization function and will be called once only.
-
4. Re: Strange Groovy Seam component
willpiasecki Oct 11, 2010 11:00 AM (in response to bgoetzmann)Solved the problem, it was a dumb mistake of mine: didn't made the conversation start through 'filename.pages.xml' or through the @Begin/@End annotations.