[JBoss Seam] - seam-ui example: s:selectItems example is broken
by stephen.friedrich
On a fresh Seam from CVS and pristine JBossAS 4.2.1:
- Deploy the seam-ui example
- Select the s:selectItems topic
- Select the "Edit the continent/country relationship"
- Add some countries to Antarctica
- Click on Apply
- Select the s:fragment topic
- Select the s:selectItems topic again (you'll get a new conversation)
=> Bug: Your previous edits are lost
Gosh - this cost me the best part of the night.
I copied the "h:selectManyListbox" part from continents.xhtml but my changes to the DB were always lost.
I did not notice that the changes weren't persisted in the example either, because I always stayed in the same conversation (and of course I expected the example to be correct).
What is the best way to solve this, specifically:
How to update country.continent when the selectManyListbox is used?
Here's what worked for me in my own code, but maybe there's a better way?
| public void setDepartments(List<Department> departments) {
| for (Department department : departments) {
| DepartmentGroup oldGroup = department.getGroup();
| if (oldGroup != null)
| oldGroup.getDepartments().remove(department);
| department.setGroup(this);
| }
| this.departments = departments;
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4069440#4069440
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4069440
17Â years, 4Â months
[EJB 3.0] - MDB inflow; does the context classloader get set during TX c
by genman
I posted this message in other forums, but I figure this problem is really centered around EJB3.
2007-07-25 11:14:41,313 ERROR [AbstractFlushingEventListener] Could not synchronize database state with session
| org.hibernate.type.SerializationException: could not deserialize
| at org.hibernate.util.SerializationHelper.deserialize(SerializationHelper.java:214)
| at org.hibernate.util.SerializationHelper.deserialize(SerializationHelper.java:240)
| at org.hibernate.type.SerializableType.fromBytes(SerializableType.java:82)
| at org.hibernate.type.SerializableType.deepCopyNotNull(SerializableType.java:74)
| at org.hibernate.type.MutableType.deepCopy(MutableType.java:25)
| at org.hibernate.type.SerializableToBlobType.deepCopy(SerializableToBlobType.java:102)
| at org.hibernate.type.TypeFactory.deepCopy(TypeFactory.java:353)
| at org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.java:114)
| at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:248)
| at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:232)
| at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:140)
| at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventList
| ener.java:298)
| at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
| at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
| at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
| at org.hibernate.ejb.AbstractEntityManagerImpl$1.beforeCompletion(AbstractEntityManagerImpl.java:515
| )
| at com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple.beforeCompletion(Synchroniz
| ationImple.java:114)
| at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.beforeCompletion(TwoPhaseCoordinator.java:2
| 49)
| at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.end(TwoPhaseCoordinator.java:88)
| at com.arjuna.ats.arjuna.AtomicAction.commit(AtomicAction.java:177)
| at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(Transac
| tionImple.java:1256)
| at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:13
| 5)
| at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.commit(BaseTransactionManagerDelegate.java
| :87)
| at org.jboss.resource.adapter.jms.inflow.JmsServerSession$XATransactionDemarcationStrategy.end(JmsSe
| rverSession.java:494)
| at org.jboss.resource.adapter.jms.inflow.JmsServerSession.run(JmsServerSession.java:248)
| at org.jboss.resource.work.WorkWrapper.execute(WorkWrapper.java:204)
| at org.jboss.util.threadpool.BasicTaskWrapper.run(BasicTaskWrapper.java:275)
| at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:743)
| at java.lang.Thread.run(Thread.java:595)
| Caused by: java.lang.ClassNotFoundException: No ClassLoaders found for: com.example.msg.Message
| at org.jboss.mx.loading.LoadMgr3.beginLoadTask(LoadMgr3.java:306)
| at org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryClassLoader.java:514)
| at org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassLoader.java:408)
| at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
| at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
| at java.lang.Class.forName0(Native Method)
| at java.lang.Class.forName(Class.java:242)
| at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:574)
| at org.hibernate.util.SerializationHelper$CustomObjectInputStream.resolveClass(SerializationHelper.j
| ava:268)
| at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1538)
| at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1460)
| at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1693)
| at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
| at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
| at org.hibernate.util.SerializationHelper.deserialize(SerializationHelper.java:210)
| ... 28 more
I modified a serializable object, part of an EJB3 Entity, during an MDB.onMessage() call. Hibernate attempts to update this serializable object during the transaction commit, but fails because it cannot load the class from the classloader.
The thread context classloader is assigned when processing the message. Is it cleared after message processing or after transaction completion? From my limited understanding of the code, it seems like the former.
Ordinarily, transaction commit does not require the context classloader of the .ear file, but in this case it does.
I'm certain this is a bug, I'd like to confirm it, however.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4069435#4069435
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4069435
17Â years, 4Â months