agoncal/agoncal-application-petstore-ee6 — Issue #14: Bug in IT tests in CatalogServiceIT on Glassfish
Author: antoinesd
Created: 2012-02-06 13:26:37+00:00
State: open

When Launching integration tests on Glassfish. The following error occurs :

ATTENTION: EJB5184:A system exception occurred during an invocation on EJB CatalogService, method: public void org.agoncal.application.petstore.service.CatalogService.removeCategory(org.agoncal.application.petstore.domain.Category)
6 févr. 2012 14:15:36 com.sun.ejb.containers.BaseContainer postInvoke
ATTENTION: javax.ejb.TransactionRolledbackLocalException: Exception thrown from bean
at com.sun.ejb.containers.BaseContainer.checkExceptionClientTx(BaseContainer.java:5071)
at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:4906)
at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:2045)
at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1994)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:222)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:88)
at $Proxy158.removeCategory(Unknown Source)
at org.agoncal.application.petstore.service.__EJB31_Generated__CatalogService__Intf____Bean__.removeCategory(Unknown Source)
...
at org.agoncal.application.petstore.service.CatalogService$Proxy$_$$_Weld$Proxy$.removeCategory(CatalogService$Proxy$_$$_Weld$Proxy$.java)
at org.agoncal.application.petstore.service.DBPopulator.clearDB(DBPopulator.java:64)
Caused by: java.lang.IllegalArgumentException: Cannot merge an entity that has been removed: Category{id=1, name='Fish', description='Any of numerous cold-blooded aquatic vertebrates characteristically having fins, gills, and a streamlined body'}
at org.eclipse.persistence.internal.sessions.MergeManager.registerObjectForMergeCloneIntoWorkingCopy(MergeManager.java:912)
at org.eclipse.persistence.internal.sessions.MergeManager.mergeChangesOfCloneIntoWorkingCopy(MergeManager.java:494)
at org.eclipse.persistence.internal.sessions.MergeManager.mergeChanges(MergeManager.java:271)
...
... 133 more

Yet the tests are ok (green bar).