Gavin,
I'm having the same issues as Newlukai, and as this person stated it appears
somewhat random, but it related to the combination of @DataModelSelection, and
@DataModelSelectionIndex.
Below you will find three fragment; simplified code, modified component.java
from the seam project, and the logged output.
Please let me know if anything else would be helpful.
simplified ScheduleBean to show annotations
@Stateful
@Name("scheduleEditor")
@LoggedIn
@Interceptors(SeamInterceptor.class)
@PersistenceContext
private EntityManager em;
@In
private transient FacesContext facesContext;
@In
private transient Context sessionContext;
@In(required = true)
private Customer currentCustomer;
@DataModel
private List activityLogs;
@DataModelSelectionIndex
private int activityLogIndex;
@DataModelSelection
@Out(scope = ScopeType.CONVERSATION, required = false)
private ActivityLog activityLog;
@Create
public void initialize() {
}
@SuppressWarnings("unchecked")
@Factory("activityLogs")
public void find() {
}
@Destroy
@Remove
public void destroy() {
}
added log.info statements to component.java
for (Field field: selectionFields)
{
log.info("@DataModelSelection field: " + field.toString());
Annotation ann = dataModelSelectionFieldAnnotations.get(field);
log.info("@DataModelSelection ann: " + ann.toString());
String name = createUnwrapper(ann).getVariableName(ann);
log.info("@DataModelSelection name: " + name);
if ( name.length() == 0 )
{
if ( hasMultipleDataModels )
{
throw new IllegalStateException( "Missing value() for
@DataModelSelection with multiple @DataModels" );
}
name = defaultDataModelName;
}
Field existing = dataModelSelectionFields.put( name, field );
if (existing!=null)
{
throw new IllegalStateException("Multiple @DataModelSelection
fields for: " + name);
}
}
Logged results:
05:16:49,144 INFO [Component] Component: scheduleEditor, scope: CONVERSATION,
type: STATEFUL_SESSION_BEAN, class: com.aftertherun.bean.schedule.ScheduleBean,
JNDI: atrapp/ScheduleBean/local
05:16:49,144 INFO [Component] @DataModelSelection field: private int
com.aftertherun.bean.schedule.ScheduleBean.activityLogIndex
05:16:49,144 INFO [Component] @DataModelSelection ann:
@org.jboss.seam.annotations.datamodel.DataModelSelectionIndex(value=)
05:16:49,144 INFO [Component] @DataModelSelection name:
05:16:49,144 INFO [Component] @DataModelSelection field: private
com.rocksolid.beans.ActivityLog
com.aftertherun.bean.schedule.ScheduleBean.activityLog
05:16:49,144 INFO [Component] @DataModelSelection ann:
@org.jboss.seam.annotations.datamodel.DataModelSelection(value=)
05:16:49,144 INFO [Component] @DataModelSelection name:
05:16:49,144 ERROR [[/]] Exception sending context initialized event to
listener instance of class org.jboss.seam.servlet.SeamListener
java.lang.IllegalStateException: Multiple @DataModelSelection fields for:
activityLogs
at org.jboss.seam.Component.initMembers(Component.java:536)
at org.jboss.seam.Component.(Component.java:199)
at org.jboss.seam.Component.(Component.java:159)
at org.jboss.seam.Component.(Component.java:154)
at org.jboss.seam.Component.(Component.java:149)
at
org.jboss.seam.init.Initialization.addComponent(Initialization.java:381)
at
org.jboss.seam.init.Initialization.addComponents(Initialization.java:343)
at org.jboss.seam.init.Initialization.init(Initialization.java:195)
at
org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:32)
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3951887#3951887
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3951887
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user