Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0023833Openbravo ERPA. Platformpublic2013-05-16 12:452022-02-01 08:09
vmromanos 
Triage Platform Base 
urgentminoralways
acknowledgedopen 
20Debian 5.0
pi 
 
Core
No
0023833: Removing EntityPersistenceEventObserver
If a module contains any class that extends from EntityPersistenceEventObserver, and we delete that module in an instance, the compiled .class remains into the tomcat context.

This situation may cause important problems for the user, like for example the unavailability to save or update a record anymore. See steps to reproduce for an example.
1. Install the module: https://code.openbravo.com/erp/mods/org.openbravo.localization.us.bankformat/ [^]
2. Compile and restart tomcat as usual
3. Try to create a new financial account (just fill the mandatory fields).
4. Now remove that module and run ant smartbuild -Dlocal=no
5. Restart tomcat as usual
6. Repeat step 3. You will see that we can't save the record anymore. Looking at the log we see the error:

a3196480 2013-05-16 09:52:56,396 [ajp-8009-4] ERROR org.openbravo.service.json.DefaultJsonDataService -
javax.enterprise.event.ObserverException
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at java.lang.Class.newInstance0(Class.java:355)
        at java.lang.Class.newInstance(Class.java:308)
        at org.jboss.weld.util.reflection.SecureReflections$16.work(SecureReflections.java:395)
        at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:54)
        at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInstantiation(SecureReflectionAccess.java:216)
        at org.jboss.weld.util.reflection.SecureReflections.newInstance(SecureReflections.java:390)
        at org.jboss.weld.injection.Exceptions.rethrowException(Exceptions.java:40)
        at org.jboss.weld.injection.Exceptions.rethrowException(Exceptions.java:92)
        at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:214)
        at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:282)
        at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:265)
        at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:234)
        at org.jboss.weld.manager.BeanManagerImpl.notifyObservers(BeanManagerImpl.java:632)
        at org.jboss.weld.manager.BeanManagerImpl.fireEvent(BeanManagerImpl.java:625)
        at org.jboss.weld.event.EventImpl.fire(EventImpl.java:75)
        at org.openbravo.client.kernel.event.PersistenceEventOBInterceptor.sendNewEvent(PersistenceEventOBInterceptor.java:93)
        at org.openbravo.client.kernel.event.PersistenceEventOBInterceptor.onSave(PersistenceEventOBInterceptor.java:82)
        at org.openbravo.client.kernel.event.org$jboss$weld$bean-flat-ManagedBean-class_org$openbravo$client$kernel$event$PersistenceEventOBInterceptor_$$_WeldClientProxy.onSave(org$jboss$weld$bean-flat-ManagedBean-class_org$openbravo$client$kernel$event$PersistenceEventOBInterceptor_$$_WeldClientProxy.java)
        at org.openbravo.dal.core.OBInterceptor.onSave(OBInterceptor.java:238)
at org.hibernate.event.def.AbstractSaveEventListener.substituteValuesIfNecessary(AbstractSaveEventListener.java:413)
        at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:292)
        at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:203)
        at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:143)
        at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:210)
        at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:195)
        at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:117)
        at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:93)
        at org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl.java:685)
        at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:677)
        at org.openbravo.dal.core.SessionHandler.save(SessionHandler.java:126)
        at org.openbravo.dal.service.OBDal.save(OBDal.java:226)
        at org.openbravo.service.json.DefaultJsonDataService.update(DefaultJsonDataService.java:621)
        at org.openbravo.service.json.DefaultJsonDataService.add(DefaultJsonDataService.java:557)
        at org.openbravo.service.datasource.DefaultDataSourceService.add(DefaultDataSourceService.java:161)
        at org.openbravo.service.datasource.DataSourceServlet.doPost(DataSourceServlet.java:684)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
        at org.openbravo.base.HttpBaseServlet.serviceInitialized(HttpBaseServlet.java:225)
        at org.openbravo.base.secureApp.HttpSecureAppServlet.service(HttpSecureAppServlet.java:440)
        at org.openbravo.client.kernel.BaseKernelServlet.callServiceInSuper(BaseKernelServlet.java:87)
        at org.openbravo.client.kernel.BaseKernelServlet.service(BaseKernelServlet.java:63)
        at org.openbravo.service.datasource.DataSourceServlet.service(DataSourceServlet.java:138)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.openbravo.utils.SessionExpirationFilter.doFilter(SessionExpirationFilter.java:66)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.openbravo.utils.CharsetFilter.doFilter(CharsetFilter.java:35)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.openbravo.client.kernel.KernelFilter$1.doAction(KernelFilter.java:62)
        at org.openbravo.dal.core.ThreadHandler.run(ThreadHandler.java:46)
        at org.openbravo.client.kernel.KernelFilter.doFilter(KernelFilter.java:71)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.openbravo.dal.core.DalRequestFilter$1.doAction(DalRequestFilter.java:81)
        at org.openbravo.dal.core.ThreadHandler.run(ThreadHandler.java:46)
        at org.openbravo.dal.core.DalRequestFilter.doFilter(DalRequestFilter.java:103)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
        at org.apache.coyote.ajp.AjpAprProcessor.process(AjpAprProcessor.java:429)
        at org.apache.coyote.ajp.AjpAprProtocol$AjpConnectionHandler.process(AjpAprProtocol.java:384)
        at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1665)
        at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.NoSuchMethodError: org.openbravo.model.financialmgmt.payment.FIN_FinancialAccount.getUSBAFAccountNo()Ljava/lang/String;
        at org.openbravo.localization.us.bankformat.event.FinancialAccountUSBankAccountHandler.setDisplayedAccount(FinancialAccountUSBankAccountHandler.java:71)
        at org.openbravo.localization.us.bankformat.event.FinancialAccountUSBankAccountHandler.onSave(FinancialAccountUSBankAccountHandler.java:66)
        at sun.reflect.GeneratedMethodAccessor803.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:305)
        at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:54)
        at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:163)
        at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:299)
        at org.jboss.weld.introspector.jlr.WeldMethodImpl.invokeOnInstance(WeldMethodImpl.java:188)
        at org.jboss.weld.introspector.ForwardingWeldMethod.invokeOnInstance(ForwardingWeldMethod.java:59)
        at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:198)
        ... 61 more
Ensure the compiled class are removed from the tomcat's context when the module is removed from the ob's instance
No tags attached.
Issue History
2013-05-16 12:45vmromanosNew Issue
2013-05-16 12:45vmromanosAssigned To => AugustoMauch
2013-05-16 12:45vmromanosModules => Core
2013-05-16 12:45vmromanosTriggers an Emergency Pack => No
2015-03-17 14:37alostaleAssigned ToAugustoMauch => platform
2015-11-10 16:49alostaleNote Added: 0081666
2015-11-10 16:49alostaleSeveritymajor => minor
2015-11-10 16:49alostaleStatusnew => acknowledged
2015-11-10 16:49alostaleTypedefect => design defect
2022-02-01 08:09alostaleAssigned Toplatform => Triage Platform Base

Notes
(0081666)
alostale   
2015-11-10 16:49   
smartbuild is not handling correctly class removals: deinstalling a module should be performed with compile.complete