Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0040899
TypeCategorySeverityReproducibilityDate SubmittedLast Update
backport[Openbravo ERP] A. Platformminorhave not tried2019-05-17 11:012019-05-17 13:59
ReporteralostaleView Statuspublic 
Assigned Toalostale 
PriorityimmediateResolutionfixedFixed in Version
StatusclosedFix in branchFixed in SCM revision763f7fe84755
ProjectionnoneETAnoneTarget Version3.0PR19Q1.2
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Tocaristu
Web browser
ModulesCore
Regression levelProduction - Confirmed Stable
Regression date2017-05-18
Regression introduced in release3.0PR17Q3
Regression introduced by commithttp://code.openbravo.com/erp/devel/pi/rev/383058dac5699aa263e209cbfcd10000b8153d3f [^]
Triggers an Emergency PackNo
Summary

0040899: unreachable system after tying to create a record through ws with unlimited access license

DescriptionIn professional instances with unlimited WS calls if the very first action after Tomcat restart is invoking a WS that performs DB modifications with a limited role, the system becomes unreachable.

Under these circumstances, TreeTablesEventHandler cannot be initialized with ExceptionInInitializerError because it is not executed in admin mode. This class is not tried to be initialized afterward so any subsequent DAL flush with dirty entities will fail with NoClassDefFoundError.

The only way to overcome this situation is to restart Tomcat and perform a regular login as the first action.
Steps To ReproduceIn a professional instance with unlimited WS access:
1. Create a ws role with access to only Alert window and assign as default role for a new user
2. Restart Tomcat
3. Create through WS a new AlertRule
  -> ERROR: cannot perform action
java.lang.ExceptionInInitializerError
    ...
    at org.openbravo.client.kernel.event.PersistenceEventOBInterceptor.sendNewEvent(PersistenceEventOBInterceptor.java:94) ~[classes/:?]
    at org.openbravo.client.kernel.event.PersistenceEventOBInterceptor.onSave(PersistenceEventOBInterceptor.java:83) ~[classes/:?]
    at org.openbravo.client.kernel.event.PersistenceEventOBInterceptor$Proxy$_$$_WeldClientProxy.onSave(Unknown Source) ~[classes/:?]
    at org.openbravo.dal.core.OBInterceptor.onSave(OBInterceptor.java:244) ~[classes/:?]
    ...
Caused by: org.openbravo.base.exception.OBSecurityException: Entity ADTable is not readable by the user C63AF5553AEB4BC498A680DA95C89B70
    at org.openbravo.dal.security.EntityAccessChecker.checkReadable(EntityAccessChecker.java:548) ~[classes/:?]
    at org.openbravo.dal.service.OBDal.checkReadAccess(OBDal.java:741) ~[classes/:?]
    at org.openbravo.dal.service.OBDal.checkReadAccess(OBDal.java:728) ~[classes/:?]
    at org.openbravo.dal.service.OBDal.createCriteria(OBDal.java:564) ~[classes/:?]
    at org.openbravo.client.application.event.TreeTablesEventHandler.getTreeTables(TreeTablesEventHandler.java:167) ~[classes/:?]
    at org.openbravo.client.application.event.TreeTablesEventHandler.<clinit>(TreeTablesEventHandler.java:58) ~[classes/:?]
    ...
4. Try to login with Openbravo user
  -> ERROR: cannot login
       ...
Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.openbravo.client.application.event.TreeTablesEventHandler
    at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:?]
    at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:?]
    at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:?]
    at java.lang.reflect.Constructor.newInstance(Constructor.java:490) ~[?:?]
    at org.jboss.weld.injection.ConstructorInjectionPoint.newInstance(ConstructorInjectionPoint.java:119) ~[weld-core-impl-3.1.1.Final.jar:3.1.1.Final]
    at org.jboss.weld.injection.ConstructorInjectionPoint.invokeAroundConstructCallbacks(ConstructorInjectionPoint.java:92) ~[weld-core-impl-3.1.1.Final.jar:3.1.1.Final]
    at org.jboss.weld.injection.ConstructorInjectionPoint.newInstance(ConstructorInjectionPoint.java:78) ~[weld-core-impl-3.1.1.Final.jar:3.1.1.Final]
    at org.jboss.weld.injection.producer.AbstractInstantiator.newInstance(AbstractInstantiator.java:28) ~[weld-core-impl-3.1.1.Final.jar:3.1.1.Final]
    at org.jboss.weld.injection.producer.BasicInjectionTarget.produce(BasicInjectionTarget.java:112) ~[weld-core-impl-3.1.1.Final.jar:3.1.1.Final]
    at org.jboss.weld.injection.producer.BeanInjectionTarget.produce(BeanInjectionTarget.java:186) ~[weld-core-impl-3.1.1.Final.jar:3.1.1.Final]
 ...
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
blocks defect 0040897 closedalostale unreachable system after tying to create a record through ws with unlimited access license 

-  Notes
(0111771)
hgbot (developer)
2019-05-17 11:42

Repository: erp/backports/3.0PR19Q1.2
Changeset: 763f7fe847559b6ce608c5c118dd9e1c7f9866dd
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Fri May 17 11:14:19 2019 +0200
URL: http://code.openbravo.com/erp/backports/3.0PR19Q1.2/rev/763f7fe847559b6ce608c5c118dd9e1c7f9866dd [^]

fixed bug 40899: broken system if tying to create a ws row with unlimited WS

  System became unreacheable after trtying to create/update a record through WS
  as first action after Tomcat restart having unlimited WS access license.

  This occurred because TreeTablesEventHandler initialization assumed to be in
  admin mode. As unlimited access license does not do any DB modification on login,
  which is what occurs in standard login and with limited acess licenses, first
  flush with dirty entities causes TreeTablesEventHandler init to fail in a
  unrecoverable manner.

  Now TreeTablesEventHandler is initialized in admin mode to prevent this case.

---
M modules/org.openbravo.client.application/src/org/openbravo/client/application/event/TreeTablesEventHandler.java
---
(0111772)
caristu (developer)
2019-05-17 13:59

Reviewed + tested

- Issue History
Date Modified Username Field Change
2019-05-17 11:17 alostale Type defect => backport
2019-05-17 11:17 alostale Target Version => 3.0PR19Q1.2
2019-05-17 11:42 hgbot Checkin
2019-05-17 11:42 hgbot Note Added: 0111771
2019-05-17 11:42 hgbot Status scheduled => resolved
2019-05-17 11:42 hgbot Resolution open => fixed
2019-05-17 11:42 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/backports/3.0PR19Q1.2/rev/763f7fe847559b6ce608c5c118dd9e1c7f9866dd [^]
2019-05-17 13:59 caristu Note Added: 0111772
2019-05-17 13:59 caristu Status resolved => closed


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker