jpacontainer manytomany throws ClassCastException


i have a problem with jpacontainer and manytomany relation.

I have 2 entities… first is an entity like tasks … second is users.

so a task could be done by more than one user. and a user can work on more than one task.

and i`ve created an editor for tasks… with fields like taskName,taskStartDate, taskEndDate, etc… and a table for the manytomany-relation with users. in my fieldfactory the manytomany-table looks like this:

	public Field createField(Item item, Object propertyId, Component uiContext) {
		Field field = DefaultFieldFactory.get().createField(item, propertyId,

		if ("user".equals(propertyId)) {
			field = createUserTable(propertyId);
		if ("taskStartDate".equals(propertyId)) {
			DateField field = (DateField) field;
		if (field instanceof TextField) {
			((TextField) field).setNullRepresentation("");
		return field;

	private Field createUserTable(Object propertyId) {
		userTable = new Table();

		userContainer = JPAContainerFactory.makeReadOnly(User.class,em);

		userContainer.sort(new String[] { "lastname" }, new boolean[]
 { true });

		userTable.setPropertyDataSource(new MultiSelectTranslator(userTable));

		userTable.setVisibleColumns(new Object[] { "lastname", "firstname",
				"phone" });
		userTable.setColumnHeader("lastname", "Nachname");
		userTable.setColumnHeader("firstname", "Vorname");
		userTable.setColumnHeader("phone", "Telefon");

		return userTable;

this works fine, if i update an existing task, which i have inserted via mysql workbench. i can save the task and if i select some users for this task, they are saved too.

but if i try to create a new task and select some users, this exception is thrown:$ConversionException: java.lang.ClassCastException: cannot be cast to com.vaadin.addon.jpacontainer.EntityItemProperty
at com.vaadin.addon.jpacontainer.fieldfactory.PropertyTranslator.setValue(
at com.vaadin.ui.AbstractField.commit(…

is this a problem because the existing task item is from table.getValue() and the new task is created in this way:
Task newTask = new Task();
BeanItem newTaskItem = new BeanItem(newTask);

my environment is jboss with eclipselink and mysql. let me know if you need further information…!

thank you!!