[jboss-user] [JBoss Seam] - coerceToType / javaassist error

damianharvey do-not-reply at jboss.com
Tue Oct 9 09:09:47 EDT 2007


I'm getting the following error on a few pages (using Seam 2.0.0.CR1):

  | java.lang.IllegalArgumentException: Cannot convert com.locuslive.odyssey.entity.Groups at 3960f3 of type class com.locuslive.odyssey.entity.Groups to class com.locuslive.odyssey.entity.Groups_$$_javassist_219
  | 
My page fragment looks like this:

  | <fieldset class="inputFieldset">
  | 	<legend>#{messages['users.groups']}</legend>
  | 	<div style="">
  | 		<h:selectManyCheckbox layout="pageDirection" id="userGroups" value="#{adminMaintainUser.groups}">
  | 			<s:selectItems value="#{adminMaintainUser.allGroups}" var="groups" label="${groups.groupName}" />
  | 			<s:convertEntity/>
  | 		</h:selectManyCheckbox>
  | 	</div>
  | </fieldset>
  | 
My adminMaintainUser Bean includes the following methods:

  | public List<Groups> getAllGroups() {
  | 	//Get all possible groups for this company
  | 	return entityManager.createQuery("select g from Groups AS g where g.companyByCompanyId = :company")
  | 		.setParameter("company", userProfile.getUser().getCompany())
  | 		.getResultList();
  | 	
  | }
  | public List<Groups> getGroups() {
  | 	//Populate the groups from the user entity before passing back to the page.
  | 	return entityManager.createQuery("select ugl.groups from UserGroupList AS ugl WHERE ugl.user = :user")
  | 		.setParameter("user", userHome.getInstance())
  | 		.getResultList();
  | }
  | 
UserGroupList is an entity that contains both a User and a Group (ie. many-to-many join table).

I've seen references to similar problems as this in the forum but they had issues that were fixed in Seam 1.2.1.GA.

Can anyone point me in the right direction? Weirdly enough this used to work and I can't for the life of me see what has changed.

Much appreciated.

Thanks,

Damian.



View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4093009#4093009

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4093009



More information about the jboss-user mailing list