I've encountered a problem in my application that I was eventually able to
reproduce with a simple change to the messages example. If you add a value
attribute to the @DataModelSelection annotation, e.g.
@DataModelSelection("message")
Seam will fail to inject the selected object (message) when select() is called,
causing a null pointer exception at the first reference. The potential
ambiguity with the 'message' context variable introduced by Message.java is not
the cause. You will get the same behaviour if you rename MessageListBean.java's
'message ' attribute to 'message2' and use @DataModelSelection("message2")
instead.
You may wonder why I am using the undocumented value() attribute on
@DataModelSelection. This all started because I was attempting to use two
@DataModels in my statefull session component (two different @DataModel
attribute names, two different @DataModelSelection attribute names, no use of
the value attribute). The component fails to deploy with the following error:
10:24:28,341 ERROR [[/seam-messages]] Exception sending context initialized
event to listener instance of class org.jboss.seam.servlet.SeamListener
| java.lang.IllegalStateException: Missing value() for @DataModelSelection
with multiple @DataModels
The documentation doesn't list a value() attribute for the @DataModelSelection
annotation. Adding the value attribute to the two @DataModelSelection
annotations (same name as the attribute) fixes the deployment problem, but
causes the injection failure/null pointer problem.
Is this a bug? Is there a way to employ two @DataModels without using the
value() attribute on @DataModelSelection?
Thanks
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3932686#3932686
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3932686
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user