Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0040897Openbravo ERPA. Platformpublic2019-05-17 11:012019-05-21 15:17
immediateminorhave not tried
Production - Confirmed Stable
3.0PR17Q3 [^]
0040897: unreachable system after tying to create a record through ws with unlimited access license
In 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.
In 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
    at org.openbravo.client.kernel.event.PersistenceEventOBInterceptor.sendNewEvent( ~[classes/:?]
    at org.openbravo.client.kernel.event.PersistenceEventOBInterceptor.onSave( ~[classes/:?]
    at org.openbravo.client.kernel.event.PersistenceEventOBInterceptor$Proxy$_$$_WeldClientProxy.onSave(Unknown Source) ~[classes/:?]
    at org.openbravo.dal.core.OBInterceptor.onSave( ~[classes/:?]
Caused by: org.openbravo.base.exception.OBSecurityException: Entity ADTable is not readable by the user C63AF5553AEB4BC498A680DA95C89B70
    at ~[classes/:?]
    at org.openbravo.dal.service.OBDal.checkReadAccess( ~[classes/:?]
    at org.openbravo.dal.service.OBDal.checkReadAccess( ~[classes/:?]
    at org.openbravo.dal.service.OBDal.createCriteria( ~[classes/:?]
    at org.openbravo.client.application.event.TreeTablesEventHandler.getTreeTables( ~[classes/:?]
    at org.openbravo.client.application.event.TreeTablesEventHandler.<clinit>( ~[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( ~[?:?]
    at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance( ~[?:?]
    at java.lang.reflect.Constructor.newInstance( ~[?:?]
    at org.jboss.weld.injection.ConstructorInjectionPoint.newInstance( ~[weld-core-impl-3.1.1.Final.jar:3.1.1.Final]
    at org.jboss.weld.injection.ConstructorInjectionPoint.invokeAroundConstructCallbacks( ~[weld-core-impl-3.1.1.Final.jar:3.1.1.Final]
    at org.jboss.weld.injection.ConstructorInjectionPoint.newInstance( ~[weld-core-impl-3.1.1.Final.jar:3.1.1.Final]
    at org.jboss.weld.injection.producer.AbstractInstantiator.newInstance( ~[weld-core-impl-3.1.1.Final.jar:3.1.1.Final]
    at org.jboss.weld.injection.producer.BasicInjectionTarget.produce( ~[weld-core-impl-3.1.1.Final.jar:3.1.1.Final]
    at org.jboss.weld.injection.producer.BeanInjectionTarget.produce( ~[weld-core-impl-3.1.1.Final.jar:3.1.1.Final]
No tags attached.
depends on backport 00408983.0PR19Q2.1 closed alostale unreachable system after tying to create a record through ws with unlimited access license 
depends on backport 00408993.0PR19Q1.2 closed alostale unreachable system after tying to create a record through ws with unlimited access license 
caused by design defect 0035994 closed caristu Web service calls should not create ad_session entries being in an instance with unlimited web service calls 
Issue History
2019-05-17 11:01alostaleNew Issue
2019-05-17 11:01alostaleAssigned To => platform
2019-05-17 11:01alostaleModules => Core
2019-05-17 11:01alostaleTriggers an Emergency Pack => No
2019-05-17 11:02alostaleRelationship addedcaused by 0035994
2019-05-17 11:05alostaleReview Assigned To => caristu
2019-05-17 11:05alostaleRegression level => Production - Confirmed Stable
2019-05-17 11:05alostaleRegression date => 2017-05-18
2019-05-17 11:05alostaleRegression introduced in release => 3.0PR17Q3
2019-05-17 11:05alostaleRegression introduced by commit => [^]
2019-05-17 11:05alostaleAssigned Toplatform => alostale
2019-05-17 11:05alostalePrioritynormal => immediate
2019-05-17 11:16alostaleStatusnew => scheduled
2019-05-17 11:17hgbotCheckin
2019-05-17 11:17hgbotNote Added: 0111769
2019-05-17 11:18hgbotStatusscheduled => resolved
2019-05-17 11:18hgbotResolutionopen => fixed
2019-05-17 11:18hgbotFixed in SCM revision => [^]
2019-05-17 13:59caristuNote Added: 0111773
2019-05-17 13:59caristuStatusresolved => closed
2019-05-17 13:59caristuFixed in Version => 3.0PR19Q3
2019-05-21 15:17hudsonbotCheckin
2019-05-21 15:17hudsonbotNote Added: 0112044

2019-05-17 11:17   
Repository: erp/devel/pi
Changeset: 1596542c21af70ae5e8d24640c8060a5fd4d9626
Author: Asier Lostalé <asier.lostale <at>>
Date: Fri May 17 11:14:19 2019 +0200
URL: [^]

fixed bug 40897: 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/
2019-05-17 13:59   
Reviewed + tested
2019-05-21 15:17   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: [^]
Maturity status: Test