Hibernate Books

All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: merge with composite primary keys fails (StackOverflowError)
PostPosted: Sun Jan 29, 2012 7:00 am 
Newbie

Joined: Mon Mar 12, 2007 2:45 pm
Posts: 4
Hi all,

I get a StackOverflowError when doing entityManager.merge(order). I believe it is connected to cascaded merge and the composite primary key in OrderItem.

Here's the (trimmed down) model/mapping:

Code:
@Entity
public class OrderItem implements Serializable {
    @Id
    @ManyToOne
    @JoinColumn(updatable = false)
    private Order order;

    @Id
    @ManyToOne
    @JoinColumn(updatable = false)
    private Product product;

    private Double quantity;

    protected OrderItem() { }

    public OrderItem(Order order, Product product, Double quantity) {
        this.order = order;
        this.product = product;
        this.quantity = quantity;
    }

    // getters, setters
}



Code:
@Entity
@Table(name = "ORDERS")
public class Order implements Ided, Serializable {
    @Id @Size(max = 40)
    private String id;

    private Date created = new Date();

    @Version
    private Date updated;

    @OneToMany(mappedBy = "order", cascade = CascadeType.ALL, orphanRemoval = true)
    @OrderBy("product")
    private List<OrderItem> items = new ArrayList<OrderItem>();

    public Order() { }

    public List<OrderItem> getItems() {
        return items;
    }

    public boolean addItem(OrderItem item) {
        item.setOrder(this);
        return items.add(item);
    }

    public void addItem(Product product, double quantity) {
        addItem(new OrderItem(this, product, quantity));
    }

    public void setItems(List<OrderItem> items) {
        this.items = items;
    }

    // other getters, setters
}


Code:
@Entity
public class Product implements Ided, Named, Serializable {
    @Id @Size(max = 40)
    private String id;

    @Size(max = 255) @NotNull
    private String name;

    // getters, setters
}


The code that fails is a SFSB method, the argument is serialized from a remote client:

Code:
    public Order updateOrder(Order order) {
        em.merge(order);
        return order;
    }


If I add:
Code:
@Id @GeneratedValue private Long id

to OrderItem and remove the existing @Id annotations, merge works fine.

Also, if I set the cascade setting to only cascade PERSIST and DELETE but not MERGE, the error doesn't occur (but the result is wrong as I need the OrderItems to be merged as well).

Below is the relevant part of the log and stack trace.

Thanks for any help!
Matija

11:49:02,865 INFO [stdout] (management-handler-threads - 47) Hibernate: select order0_.id as id289_1_, order0_.assignee_username as assignee7_289_1_, order0_.comments as comments289_1_, order0_.created as created289_1_, order0_.creator_username as creator8_289_1_, order0_.eta as eta289_1_, order0_.port_id as port9_289_1_, order0_.status as status289_1_, order0_.updated as updated289_1_, order0_.vessel_id as vessel10_289_1_, items1_.order_id as order3_289_3_, items1_.product_id as product2_3_, items1_.order_id as order3_3_, items1_.product_id as product2_292_0_, items1_.order_id as order3_292_0_, items1_.quantity as quantity292_0_ from ORDERS order0_ left outer join OrderItem items1_ on order0_.id=items1_.order_id where order0_.id=? order by items1_.product_id asc
11:49:02,877 INFO [stdout] (management-handler-threads - 47) Hibernate: select product0_.id as id296_0_, product0_.category_id as category3_296_0_, product0_.name as name296_0_, product0_.unit_id as unit4_296_0_ from Product product0_ where product0_.id=?
11:49:02,882 INFO [stdout] (management-handler-threads - 47) Hibernate: select productcat0_.id as id295_0_, productcat0_.name as name295_0_ from ProductCategory productcat0_ where productcat0_.id=?
11:49:02,888 INFO [stdout] (management-handler-threads - 47) Hibernate: select unit0_.id as id293_0_, unit0_.name as name293_0_ from Unit unit0_ where unit0_.id=?
11:49:02,891 INFO [stdout] (management-handler-threads - 47) Hibernate: select order0_.id as id289_1_, order0_.assignee_username as assignee7_289_1_, order0_.comments as comments289_1_, order0_.created as created289_1_, order0_.creator_username as creator8_289_1_, order0_.eta as eta289_1_, order0_.port_id as port9_289_1_, order0_.status as status289_1_, order0_.updated as updated289_1_, order0_.vessel_id as vessel10_289_1_, items1_.order_id as order3_289_3_, items1_.product_id as product2_3_, items1_.order_id as order3_3_, items1_.product_id as product2_292_0_, items1_.order_id as order3_292_0_, items1_.quantity as quantity292_0_ from ORDERS order0_ left outer join OrderItem items1_ on order0_.id=items1_.order_id where order0_.id=? order by items1_.product_id asc
11:49:02,903 INFO [stdout] (management-handler-threads - 47) Hibernate: select order0_.id as id289_1_, order0_.assignee_username as assignee7_289_1_, order0_.comments as comments289_1_, order0_.created as created289_1_, order0_.creator_username as creator8_289_1_, order0_.eta as eta289_1_, order0_.port_id as port9_289_1_, order0_.status as status289_1_, order0_.updated as updated289_1_, order0_.vessel_id as vessel10_289_1_, items1_.order_id as order3_289_3_, items1_.product_id as product2_3_, items1_.order_id as order3_3_, items1_.product_id as product2_292_0_, items1_.order_id as order3_292_0_, items1_.quantity as quantity292_0_ from ORDERS order0_ left outer join OrderItem items1_ on order0_.id=items1_.order_id where order0_.id=? order by items1_.product_id asc
11:49:02,915 INFO [stdout] (management-handler-threads - 47) Hibernate: select order0_.id as id289_1_, order0_.assignee_username as assignee7_289_1_, order0_.comments as comments289_1_, order0_.created as created289_1_, order0_.creator_username as creator8_289_1_, order0_.eta as eta289_1_, order0_.port_id as port9_289_1_, order0_.status as status289_1_, order0_.updated as updated289_1_, order0_.vessel_id as vessel10_289_1_, items1_.order_id as order3_289_3_, items1_.product_id as product2_3_, items1_.order_id as order3_3_, items1_.product_id as product2_292_0_, items1_.order_id as order3_292_0_, items1_.quantity as quantity292_0_ from ORDERS order0_ left outer join OrderItem items1_ on order0_.id=items1_.order_id where order0_.id=? order by items1_.product_id asc
11:49:02,927 INFO [stdout] (management-handler-threads - 47) Hibernate: select order0_.id as id289_1_, order0_.assignee_username as assignee7_289_1_, order0_.comments as comments289_1_, order0_.created as created289_1_, order0_.creator_username as creator8_289_1_, order0_.eta as eta289_1_, order0_.port_id as port9_289_1_, order0_.status as status289_1_, order0_.updated as updated289_1_, order0_.vessel_id as vessel10_289_1_, items1_.order_id as order3_289_3_, items1_.product_id as product2_3_, items1_.order_id as order3_3_, items1_.product_id as product2_292_0_, items1_.order_id as order3_292_0_, items1_.quantity as quantity292_0_ from ORDERS order0_ left outer join OrderItem items1_ on order0_.id=items1_.order_id where order0_.id=? order by items1_.product_id asc
11:49:02,939 INFO [stdout] (management-handler-threads - 47) Hibernate: select order0_.id as id289_1_, order0_.assignee_username as assignee7_289_1_, order0_.comments as comments289_1_, order0_.created as created289_1_, order0_.creator_username as creator8_289_1_, order0_.eta as eta289_1_, order0_.port_id as port9_289_1_, order0_.status as status289_1_, order0_.updated as updated289_1_, order0_.vessel_id as vessel10_289_1_, items1_.order_id as order3_289_3_, items1_.product_id as product2_3_, items1_.order_id as order3_3_, items1_.product_id as product2_292_0_, items1_.order_id as order3_292_0_, items1_.quantity as quantity292_0_ from ORDERS order0_ left outer join OrderItem items1_ on order0_.id=items1_.order_id where order0_.id=? order by items1_.product_id asc
11:49:02,951 INFO [stdout] (management-handler-threads - 47) Hibernate: select order0_.id as id289_1_, order0_.assignee_username as assignee7_289_1_, order0_.comments as comments289_1_, order0_.created as created289_1_, order0_.creator_username as creator8_289_1_, order0_.eta as eta289_1_, order0_.port_id as port9_289_1_, order0_.status as status289_1_, order0_.updated as updated289_1_, order0_.vessel_id as vessel10_289_1_, items1_.order_id as order3_289_3_, items1_.product_id as product2_3_, items1_.order_id as order3_3_, items1_.product_id as product2_292_0_, items1_.order_id as order3_292_0_, items1_.quantity as quantity292_0_ from ORDERS order0_ left outer join OrderItem items1_ on order0_.id=items1_.order_id where order0_.id=? order by items1_.product_id asc
11:49:02,964 INFO [stdout] (management-handler-threads - 47) Hibernate: select order0_.id as id289_1_, order0_.assignee_username as assignee7_289_1_, order0_.comments as comments289_1_, order0_.created as created289_1_, order0_.creator_username as creator8_289_1_, order0_.eta as eta289_1_, order0_.port_id as port9_289_1_, order0_.status as status289_1_, order0_.updated as updated289_1_, order0_.vessel_id as vessel10_289_1_, items1_.order_id as order3_289_3_, items1_.product_id as product2_3_, items1_.order_id as order3_3_, items1_.product_id as product2_292_0_, items1_.order_id as order3_292_0_, items1_.quantity as quantity292_0_ from ORDERS order0_ left outer join OrderItem items1_ on order0_.id=items1_.order_id where order0_.id=? order by items1_.product_id asc
[repeated almost 200 times]

11:49:05,431 INFO [org.jboss.as.ejb3] (management-handler-threads - 47) JBAS014101: Failed to find {[-87, -75, 33, -71, -16, -19, 70, -64, -77, 116, -75, 33, 63, 21, 87, -96]} in cache
11:49:05,435 ERROR [org.jboss.ejb3.invocation] (management-handler-threads - 47) JBAS014134: EJB Invocation failed on component OrderService for method public com.mindview.equinox.model.Order com.mindview.equinox.destinations.OrderService.updateOrder(com.mindview.equinox.model.Order): javax.ejb.EJBException: Unexpected Error
at org.jboss.as.ejb3.tx.CMTTxInterceptor.handleExceptionInOurTx(CMTTxInterceptor.java:163) [jboss-as-ejb3-7.1.0.CR1b.jar:7.1.0.CR1b]
at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:230) [jboss-as-ejb3-7.1.0.CR1b.jar:7.1.0.CR1b]
at org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:304) [jboss-as-ejb3-7.1.0.CR1b.jar:7.1.0.CR1b]
at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:190) [jboss-as-ejb3-7.1.0.CR1b.jar:7.1.0.CR1b]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41) [jboss-as-ejb3-7.1.0.CR1b.jar:7.1.0.CR1b]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50) [jboss-as-ee-7.1.0.CR1b.jar:7.1.0.CR1b]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45) [jboss-as-ee-7.1.0.CR1b.jar:7.1.0.CR1b]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:57) [jboss-as-ejb3-7.1.0.CR1b.jar:7.1.0.CR1b]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:165) [jboss-as-ee-7.1.0.CR1b.jar:7.1.0.CR1b]
at org.jboss.as.ee.component.ViewDescription$1.processInvocation(ViewDescription.java:173) [jboss-as-ee-7.1.0.CR1b.jar:7.1.0.CR1b]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.as.ejb3.component.stateful.StatefulComponentIdInterceptor.processInvocation(StatefulComponentIdInterceptor.java:52) [jboss-as-ejb3-7.1.0.CR1b.jar:7.1.0.CR1b]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.as.ee.component.ProxyInvocationHandler.invoke(ProxyInvocationHandler.java:72) [jboss-as-ee-7.1.0.CR1b.jar:7.1.0.CR1b]
at com.mindview.equinox.destinations.OrderService$$$view61.updateOrder(Unknown Source) [logic-1.0-SNAPSHOT.jar:]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_24]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_24]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_24]
at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_24]
at org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:264) [weld-core-1.1.4.Final.jar:2011-11-22 20:01]
at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:52) [weld-core-1.1.4.Final.jar:2011-11-22 20:01]
at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:137) [weld-core-1.1.4.Final.jar:2011-11-22 20:01]
at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:260) [weld-core-1.1.4.Final.jar:2011-11-22 20:01]
at org.jboss.weld.bean.proxy.EnterpriseBeanProxyMethodHandler.invoke(EnterpriseBeanProxyMethodHandler.java:111) [weld-core-1.1.4.Final.jar:2011-11-22 20:01]
at org.jboss.weld.bean.proxy.EnterpriseTargetBeanInstance.invoke(EnterpriseTargetBeanInstance.java:56) [weld-core-1.1.4.Final.jar:2011-11-22 20:01]
at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:105) [weld-core-1.1.4.Final.jar:2011-11-22 20:01]
at com.mindview.equinox.destinations.OrderService$Proxy$_$$_Weld$Proxy$.updateOrder(OrderService$Proxy$_$$_Weld$Proxy$.java) [logic-1.0-SNAPSHOT.jar:]
at com.mindview.equinox.destinations.OrderService$Proxy$_$$_WeldClientProxy.updateOrder(OrderService$Proxy$_$$_WeldClientProxy.java) [logic-1.0-SNAPSHOT.jar:]
at com.mindview.equinox.LogicTest.testUserOrders(LogicTest.java:152) [classes:]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_24]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_24]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_24]
at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_24]
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80) [arquillian-service:]
at org.testng.internal.MethodInvocationHelper$1.runTestMethod(MethodInvocationHelper.java:169) [arquillian-service:]
at org.jboss.arquillian.testng.Arquillian$2.invoke(Arquillian.java:167) [arquillian-service:]
at org.jboss.arquillian.container.test.impl.execution.LocalTestExecuter.execute(LocalTestExecuter.java:60) [arquillian-service:]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_24]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_24]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_24]
at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_24]
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90) [arquillian-service:]
at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99) [arquillian-service:]
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81) [arquillian-service:]
at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:134) [arquillian-service:]
at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:114) [arquillian-service:]
at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67) [arquillian-service:]
at org.jboss.arquillian.container.test.impl.execution.ContainerTestExecuter.execute(ContainerTestExecuter.java:38) [arquillian-service:]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_24]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_24]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_24]
at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_24]
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90) [arquillian-service:]
at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99) [arquillian-service:]
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81) [arquillian-service:]
at org.jboss.arquillian.test.impl.TestContextHandler.createTestContext(TestContextHandler.java:89) [arquillian-service:]
at sun.reflect.GeneratedMethodAccessor676.invoke(Unknown Source) [:1.6.0_24]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_24]
at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_24]
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90) [arquillian-service:]
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88) [arquillian-service:]
at org.jboss.arquillian.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:75) [arquillian-service:]
at sun.reflect.GeneratedMethodAccessor675.invoke(Unknown Source) [:1.6.0_24]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_24]
at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_24]
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90) [arquillian-service:]
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88) [arquillian-service:]
at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:60) [arquillian-service:]
at sun.reflect.GeneratedMethodAccessor673.invoke(Unknown Source) [:1.6.0_24]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_24]
at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_24]
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90) [arquillian-service:]
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88) [arquillian-service:]
at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:134) [arquillian-service:]
at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.test(EventTestRunnerAdaptor.java:111) [arquillian-service:]
at org.jboss.arquillian.testng.Arquillian.run(Arquillian.java:158) [arquillian-service:]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_24]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_24]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_24]
at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_24]
at org.testng.internal.MethodInvocationHelper.invokeHookable(MethodInvocationHelper.java:181) [arquillian-service:]
at org.testng.internal.Invoker.invokeMethod(Invoker.java:684) [arquillian-service:]
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:883) [arquillian-service:]
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1208) [arquillian-service:]
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127) [arquillian-service:]
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111) [arquillian-service:]
at org.testng.TestRunner.privateRun(TestRunner.java:753) [arquillian-service:]
at org.testng.TestRunner.run(TestRunner.java:613) [arquillian-service:]
at org.testng.SuiteRunner.runTest(SuiteRunner.java:334) [arquillian-service:]
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329) [arquillian-service:]
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291) [arquillian-service:]
at org.testng.SuiteRunner.run(SuiteRunner.java:240) [arquillian-service:]
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52) [arquillian-service:]
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86) [arquillian-service:]
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1137) [arquillian-service:]
at org.testng.TestNG.runSuitesLocally(TestNG.java:1062) [arquillian-service:]
at org.testng.TestNG.run(TestNG.java:974) [arquillian-service:]
at org.jboss.arquillian.testng.container.TestNGTestRunner.execute(TestNGTestRunner.java:53) [arquillian-service:]
at org.jboss.arquillian.protocol.jmx.JMXTestRunner.runTestMethodInternal(JMXTestRunner.java:128) [arquillian-service:]
at org.jboss.arquillian.protocol.jmx.JMXTestRunner.runTestMethod(JMXTestRunner.java:107) [arquillian-service:]
at org.jboss.as.arquillian.service.ArquillianService$ExtendedJMXTestRunner.runTestMethod(ArquillianService.java:226) [arquillian-service:]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_24]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_24]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_24]
at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_24]
at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:93) [:1.6.0_24]
at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:27) [:1.6.0_24]
at com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntrospector.java:208) [:1.6.0_24]
at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.java:120) [:1.6.0_24]
at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.java:262) [:1.6.0_24]
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836) [:1.6.0_24]
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761) [:1.6.0_24]
at org.jboss.as.jmx.PluggableMBeanServerImpl$TcclMBeanServer.invoke(PluggableMBeanServerImpl.java:489) [jboss-as-jmx-7.1.0.CR1b.jar:]
at org.jboss.as.jmx.PluggableMBeanServerImpl.invoke(PluggableMBeanServerImpl.java:243) [jboss-as-jmx-7.1.0.CR1b.jar:]
at org.jboss.as.jmx.InvokeMBeanRaw.executeRuntimeStep(InvokeMBeanRaw.java:96) [jboss-as-jmx-7.1.0.CR1b.jar:]
at org.jboss.as.controller.AbstractRuntimeOnlyHandler$1.execute(AbstractRuntimeOnlyHandler.java:90) [jboss-as-controller-7.1.0.CR1b.jar:]
at org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.java:359) [jboss-as-controller-7.1.0.CR1b.jar:]
at org.jboss.as.controller.AbstractOperationContext.doCompleteStep(AbstractOperationContext.java:254) [jboss-as-controller-7.1.0.CR1b.jar:]
at org.jboss.as.controller.AbstractOperationContext.completeStep(AbstractOperationContext.java:190) [jboss-as-controller-7.1.0.CR1b.jar:]
at org.jboss.as.controller.AbstractRuntimeOnlyHandler.execute(AbstractRuntimeOnlyHandler.java:94) [jboss-as-controller-7.1.0.CR1b.jar:]
at org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.java:359) [jboss-as-controller-7.1.0.CR1b.jar:]
at org.jboss.as.controller.AbstractOperationContext.doCompleteStep(AbstractOperationContext.java:254) [jboss-as-controller-7.1.0.CR1b.jar:]
at org.jboss.as.controller.AbstractOperationContext.completeStep(AbstractOperationContext.java:190) [jboss-as-controller-7.1.0.CR1b.jar:]
at org.jboss.as.controller.ModelControllerImpl$DefaultPrepareStepHandler.execute(ModelControllerImpl.java:432) [jboss-as-controller-7.1.0.CR1b.jar:]
at org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.java:359) [jboss-as-controller-7.1.0.CR1b.jar:]
at org.jboss.as.controller.AbstractOperationContext.doCompleteStep(AbstractOperationContext.java:254) [jboss-as-controller-7.1.0.CR1b.jar:]
at org.jboss.as.controller.AbstractOperationContext.completeStep(AbstractOperationContext.java:190) [jboss-as-controller-7.1.0.CR1b.jar:]
at org.jboss.as.controller.ModelControllerImpl.execute(ModelControllerImpl.java:119) [jboss-as-controller-7.1.0.CR1b.jar:]
at org.jboss.as.controller.remote.ModelControllerClientOperationHandler$ExecuteRequestHandler.doExecute(ModelControllerClientOperationHandler.java:121) [jboss-as-controller-7.1.0.CR1b.jar:]
at org.jboss.as.controller.remote.ModelControllerClientOperationHandler$ExecuteRequestHandler$1.execute(ModelControllerClientOperationHandler.java:98) [jboss-as-controller-7.1.0.CR1b.jar:]
at org.jboss.as.protocol.mgmt.AbstractMessageHandler$3$1.doExecute(AbstractMessageHandler.java:268) [jboss-as-protocol-7.1.0.CR1b.jar:]
at org.jboss.as.protocol.mgmt.AbstractMessageHandler$AsyncTaskRunner.run(AbstractMessageHandler.java:424) [jboss-as-protocol-7.1.0.CR1b.jar:]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_24]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_24]
at java.lang.Thread.run(Thread.java:662) [:1.6.0_24]
at org.jboss.threads.JBossThread.run(JBossThread.java:122) [jboss-threads-2.0.0.GA.jar:]
Caused by: java.lang.StackOverflowError
at org.jboss.jca.adapters.jdbc.BaseWrapperManagedConnection.broadcastConnectionError(BaseWrapperManagedConnection.java:569)
at org.jboss.jca.adapters.jdbc.BaseWrapperManagedConnection.connectionError(BaseWrapperManagedConnection.java:539)
at org.jboss.jca.adapters.jdbc.WrappedConnection.checkException(WrappedConnection.java:1622)
at org.jboss.jca.adapters.jdbc.WrappedConnection.prepareStatement(WrappedConnection.java:407)
at sun.reflect.GeneratedMethodAccessor51.invoke(Unknown Source) [:1.6.0_24]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_24]
at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_24]
at org.hibernate.engine.jdbc.internal.proxy.ConnectionProxyHandler.continueInvocation(ConnectionProxyHandler.java:138) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.engine.jdbc.internal.proxy.AbstractProxyHandler.invoke(AbstractProxyHandler.java:81) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at $Proxy128.prepareStatement(Unknown Source) at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$5.doPrepare(StatementPreparerImpl.java:147) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$StatementPreparationTemplate.prepareStatement(StatementPreparerImpl.java:166) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.engine.jdbc.internal.StatementPreparerImpl.prepareQueryStatement(StatementPreparerImpl.java:145) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1739) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.loader.Loader.doQuery(Loader.java:828) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:289) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.loader.Loader.loadEntity(Loader.java:2058) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:82) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:72) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:3697) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.event.internal.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:439) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.event.internal.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:420) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.event.internal.DefaultLoadEventListener.load(DefaultLoadEventListener.java:204) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.event.internal.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:251) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.event.internal.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:148) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.internal.SessionImpl.fireLoad(SessionImpl.java:954) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.internal.SessionImpl.internalLoad(SessionImpl.java:903) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.type.EntityType.resolveIdentifier(EntityType.java:610) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.type.EntityType.resolve(EntityType.java:438) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.type.ComponentType.resolve(ComponentType.java:658) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.loader.Loader.extractKeysFromResultSet(Loader.java:756) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:635) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.loader.Loader.doQuery(Loader.java:856) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:289) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.loader.Loader.loadEntity(Loader.java:2058) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:82) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:72) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:3697) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.event.internal.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:439) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.event.internal.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:420) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.event.internal.DefaultLoadEventListener.load(DefaultLoadEventListener.java:204) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.event.internal.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:251) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.event.internal.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:148) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.internal.SessionImpl.fireLoad(SessionImpl.java:954) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.internal.SessionImpl.internalLoad(SessionImpl.java:903) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.type.EntityType.resolveIdentifier(EntityType.java:610) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.type.EntityType.resolve(EntityType.java:438) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.type.ComponentType.resolve(ComponentType.java:658) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.loader.Loader.extractKeysFromResultSet(Loader.java:756) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:635) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.loader.Loader.doQuery(Loader.java:856) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:289) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.loader.Loader.loadEntity(Loader.java:2058) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:82) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:72) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:3697) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.event.internal.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:439) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.event.internal.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:420) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.event.internal.DefaultLoadEventListener.load(DefaultLoadEventListener.java:204) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.event.internal.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:251) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.event.internal.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:148) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.internal.SessionImpl.fireLoad(SessionImpl.java:954) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.internal.SessionImpl.internalLoad(SessionImpl.java:903) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.type.EntityType.resolveIdentifier(EntityType.java:610) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.type.EntityType.resolve(EntityType.java:438) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.type.ComponentType.resolve(ComponentType.java:658) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.loader.Loader.extractKeysFromResultSet(Loader.java:756) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:635) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.loader.Loader.doQuery(Loader.java:856) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:289) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.loader.Loader.loadEntity(Loader.java:2058) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:82) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:72) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:3697) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.event.internal.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:439) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.event.internal.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:420) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.event.internal.DefaultLoadEventListener.load(DefaultLoadEventListener.java:204) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.event.internal.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:251) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.event.internal.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:148) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.internal.SessionImpl.fireLoad(SessionImpl.java:954) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.internal.SessionImpl.internalLoad(SessionImpl.java:903) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.type.EntityType.resolveIdentifier(EntityType.java:610) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.type.EntityType.resolve(EntityType.java:438) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.type.ComponentType.resolve(ComponentType.java:658) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.loader.Loader.extractKeysFromResultSet(Loader.java:756) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:635) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.loader.Loader.doQuery(Loader.java:856) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:289) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.loader.Loader.loadEntity(Loader.java:2058) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:82) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:72) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]
[repeated many times]


Top
 Profile  
 
 Post subject: Re: merge with composite primary keys fails (StackOverflowError)
PostPosted: Sun Jan 29, 2012 8:38 am 
Newbie

Joined: Mon Mar 12, 2007 2:45 pm
Posts: 4
Also, operations like persist and find, as well as queries, work just fine; it's just merge that has problems.

I tried adding an @IdClass, but that caused different problems already when saving an Order (hibernate tried to insert into product (no idea why) and failed because of duplicate product_id) -- an operation that works perfectly without the @IdClass.


Top
 Profile  
 
 Post subject: Re: merge with composite primary keys fails (StackOverflowError)
PostPosted: Sun Jan 29, 2012 8:40 am 
Newbie

Joined: Mon Mar 12, 2007 2:45 pm
Posts: 4
Oh, my environment is Hibernate 4.0.0.Final in JBoss AS 7.1.0.CR1b.


Top
 Profile  
 
 Post subject: Re: merge with composite primary keys fails (StackOverflowError)
PostPosted: Tue May 15, 2012 10:48 am 
Newbie

Joined: Tue May 15, 2012 10:14 am
Posts: 2
Hi Mazi,
We are migrating a Seam project from JBoss 4.3 to Jboss 7. The same hibernate entities and code were working fine. But now I have the StackOverFlowError that you described.

Have you resolved your issue? I've had this situation earlier this month and I did a dumb workaround because I didn't have time to do more (select entity from database and then copy all values).

But I have another situation now where I don't want to do this ugly workaround. Also, I fear I might see this again before the migration of project is done.

I'll have to dig deeper and I'll post here whatever I figure out. But it would be greatly appreciated if you had any extra information you can post.

Thanks,
Sylvain


Top
 Profile  
 
 Post subject: Re: merge with composite primary keys fails (StackOverflowError)
PostPosted: Wed May 16, 2012 10:45 am 
Newbie

Joined: Tue May 15, 2012 10:14 am
Posts: 2
I gave up and simply added an auto generated primary key on my entity.

Sylvain


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.