Page 1 of 2

Crashing in integrationdev state

Posted: Wed Oct 31, 2012 4:55 pm
by chico1198@yahoo.com
I've recently been working through your example web project and got it to a state where it is tantalizingly close to a state in which I can deploy it to a test account I have on Amazon. To date I have accomplished the following:
1) Changed database to MySQL
2) Changed application server from Jetty to Tomcat(7) and got https working
3) Cleaned and compiled the application to the 'integrationdev' state (so all tables get populated)

I can now run the application, enter users, change products, create new pages, etc. Basically, everything the site can and should do. And, since I am running it in the 'integrationdev' mode, all of the changes get persisted. Great!

But, when I run the application and/or admin console, both environments seem to suffer from random crashing. (not good...) On the Demo site, it sometimes crashes with this error:

HTTP Status 500 - Don't change the reference to a collection with cascade="all-delete-orphan": org.broadleafcommerce.profile.core.domain.CustomerImpl.customerAttributes; nested exception is org.hibernate.HibernateException: Don't change the reference to a collection with cascade="all-delete-orphan": org.broadleafcommerce.profile.core.domain.CustomerImpl.customerAttributes

type Exception report

message Don't change the reference to a collection with cascade="all-delete-orphan": org.broadleafcommerce.profile.core.domain.CustomerImpl.customerAttributes; nested exception is org.hibernate.HibernateException: Don't change the reference to a collection with cascade="all-delete-orphan": org.broadleafcommerce.profile.core.domain.CustomerImpl.customerAttributes

description The server encountered an internal error that prevented it from fulfilling this request.

exception

org.springframework.orm.hibernate3.HibernateSystemException: Don't change the reference to a collection with cascade="all-delete-orphan": org.broadleafcommerce.profile.core.domain.CustomerImpl.customerAttributes; nested exception is org.hibernate.HibernateException: Don't change the reference to a collection with cascade="all-delete-orphan": org.broadleafcommerce.profile.core.domain.CustomerImpl.customerAttributes
org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:690)
org.springframework.orm.jpa.vendor.HibernateJpaDialect.translateExceptionIfPossible(HibernateJpaDialect.java:104)
org.springframework.orm.jpa.JpaTransactionManager.doCommit(JpaTransactionManager.java:516)
org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:754)
org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:723)
org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:393)
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:120)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
$Proxy117.save(Unknown Source)
org.broadleafcommerce.core.order.service.MergeCartServiceImpl.mergeCart(MergeCartServiceImpl.java:102)
org.broadleafcommerce.core.order.service.MergeCartServiceImpl.mergeCart(MergeCartServiceImpl.java:61)
org.broadleafcommerce.core.web.order.security.MergeCartProcessorImpl.execute(MergeCartProcessorImpl.java:60)
org.broadleafcommerce.core.web.order.security.BroadleafAuthenticationSuccessHandler.onAuthenticationSuccess(BroadleafAuthenticationSuccessHandler.java:39)
org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.successfulAuthentication(AbstractAuthenticationProcessingFilter.java:323)
org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.successfulAuthentication(AbstractAuthenticationProcessingFilter.java:288)
org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:213)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
org.broadleafcommerce.common.security.handler.CsrfFilter.doFilter(CsrfFilter.java:83)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
org.springframework.security.web.access.channel.ChannelProcessingFilter.doFilter(ChannelProcessingFilter.java:144)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:173)
org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
org.broadleafcommerce.common.web.BroadleafRequestFilter.doFilterInternal(BroadleafRequestFilter.java:146)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter.doFilterInternal(OpenEntityManagerInViewFilter.java:147)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)

=====================================================================

In the admin console, it generally just goes back to the admin sign-in page.

Any ideas on what might be causing this?

Regards,

Chris

Re: Crashing in integrationdev state

Posted: Mon Nov 05, 2012 10:37 am
by aazzolini
Can you describe what you're doing that's triggering this error?

Re: Crashing in integrationdev state

Posted: Mon Nov 05, 2012 4:23 pm
by chico1198@yahoo.com
One way that I can always get this to occur is to register a dummy user and then, as that user, click on any of the hot-sauces to put them into my cart. The application seems to hang for a few seconds and then I get the error above on the console output.

FYI, I am running on localhost, using MySQL as the database, and Tomcat7 for the application server.

Re: Crashing in integrationdev state

Posted: Mon Nov 05, 2012 5:54 pm
by aazzolini
Is this with both applications started up side by side in one Tomcat install?

Have you made any changes to the DemoSite code we've provided (other than hooking up Tomcat and MySQL)?

Re: Crashing in integrationdev state

Posted: Mon Nov 05, 2012 9:30 pm
by chico1198@yahoo.com
This is with only one application running on Tomcat, although the same issue occurs with both applications.

And, no, I have not changed the sample applications other than utilizing mySQL and Tomcat. My plan was to try and get it working with these systems and then to deploy it to my Amazon AWS account to get a stable deployment methodology. At that point I was going to begin modification.

FYI, now that I have the debugger up and running, I can break at any point to test values/parameters, if that helps.

Re: Crashing in integrationdev state

Posted: Mon Nov 05, 2012 11:35 pm
by chico1198@yahoo.com
The following attachment shows the debugger when the error occurs. It's during the commit to the database during "MergeCart". Does this help?

Re: Crashing in integrationdev state

Posted: Tue Nov 06, 2012 2:03 pm
by aazzolini
Tomcat and MySQL is what I use for development, and I've never seen that error. "integrationdev" isn't a default environment that we use.

Can you remain on the "development" environment and make the changes necessary to support Tomcat/MySQL in there?

Re: Crashing in integrationdev state

Posted: Tue Nov 06, 2012 3:37 pm
by chico1198@yahoo.com
The only changes I can think of would be modification of the homepage via the Admin interface. Would any changes made within the Admin interface create an error? The only changes I made were removing overlapping ads to see how it changes a page.

Re: Crashing in integrationdev state

Posted: Tue Nov 06, 2012 4:04 pm
by chico1198@yahoo.com
Actually, that would not matter as I set the environment setting to "development", thus repopulating the application.

FYI, the behavior persists (no pun intended) in the development mode. I am also now seeing that the application will just 'hang' rather than send the previous error.

This seems to be something to do with the DB as I recreated the DB from scratch. Can you think of any DB issues that might cause such an issue?

Re: Crashing in integrationdev state

Posted: Wed Nov 07, 2012 3:56 pm
by chico1198@yahoo.com
I'm happy to report that I found the problem - JRebel. :shock:

While I had seen your warning about using versions above 4.x, I charged ahead and used the latest-and-greatest version because it was the only 'free' version. Turns out that (ironically) that was a time-consuming mistake. So, if anyone else is using JRebel, let this be a warning. Let the Broadleaf folks test vs. JRebel first.

FYI, I believe the issue with JRebel is that it tries to maintain references to Hibernate objects and does so by changing those references after Hibernate passes them back. It turns out that this is illegal for Hibernate.