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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0009640
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] 00. Application dictionaryminorhave not tried2009-06-25 16:072010-10-30 11:24
ReporterFrancescoFinamoreView Statuspublic 
Assigned Tomtaal 
PrioritynormalResolutionfixedFixed in Version
StatusclosedFix in branchpiFixed in SCM revisiond61bca59af84
ProjectionnoneETAnoneTarget Version
OSLinux 32 bitDatabasePostgreSQLJava version1.6.0_11
OS VersionrPath LinuxDatabase version8.3.5Ant version1.7.1
Product Version2.50MP1SCM revision 
Review Assigned To
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0009640: Table Validation on View

DescriptionI have create a reference with type Table Validation based on a view :
The view is :
CREATE OR REPLACE VIEW it_c_orderlinedetail_v AS
 SELECT ord.ad_client_id, ord.ad_org_id, ord.c_order_id, ord.documentno, ord.dateordered, ord.c_bpartner_id, ad_column_identifier_std('c_bpartner'::character varying, to_char(ord.c_bpartner_id)) AS bpartner_name, ordln.c_orderline_id, ordln.isactive, ordln.line, (((((ord.documentno::text || ' - '::text) || substr(to_char(ord.dateordered)::text, 1, 10)) || ' - '::text) || ordln.line) || ' - '::text) || ad_column_identifier_std('c_bpartner'::character varying, to_char(ord.c_bpartner_id))::text AS name
   FROM c_order ord
   LEFT JOIN c_orderline ordln ON ord.c_order_id::text = ordln.c_order_id::text
  ORDER BY (((((ord.documentno::text || ' - '::text) || substr(to_char(ord.dateordered)::text, 1, 10)) || ' - '::text) || ordln.line) || ' - '::text) || ad_column_identifier_std('c_bpartner'::character varying, to_char(ord.c_bpartner_id))::text;

when i put this reference on a column the compile goes ok, but when i start tomcat the application crashes and give the error :
java.lang.NullPointerException
25-giu-2009 15.50.53 org.apache.catalina.core.StandardContext listenerStart
GRAVE: Exception sending context initialized event to listener instance of class org.openbravo.dal.core.DalContextListener
org.openbravo.base.exception.OBException: java.lang.NullPointerException
    at org.openbravo.base.model.ModelProvider.refresh(ModelProvider.java:114)
    at org.openbravo.dal.core.DalLayerInitializer.initialize(DalLayerInitializer.java:65)
    at org.openbravo.dal.core.DalContextListener.contextInitialized(DalContextListener.java:80)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4342)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
    at org.apache.catalina.core.StandardService.start(StandardService.java:516)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: java.lang.NullPointerException
    at org.openbravo.base.model.Property.setReferencedProperty(Property.java:266)
    at org.openbravo.base.model.ModelProvider.setReferenceProperties(ModelProvider.java:377)
    at org.openbravo.base.model.ModelProvider.initialize(ModelProvider.java:209)
    at org.openbravo.base.model.ModelProvider.getModel(ModelProvider.java:127)
    at org.openbravo.base.model.ModelProvider.refresh(ModelProvider.java:111)
    ... 17 more
    at org.openbravo.base.model.Property.setReferencedProperty(Property.java:266)
    at org.openbravo.base.model.ModelProvider.setReferenceProperties(ModelProvider.java:377)
    at org.openbravo.base.model.ModelProvider.initialize(ModelProvider.java:209)
    at org.openbravo.base.model.ModelProvider.getModel(ModelProvider.java:127)
    at org.openbravo.base.model.ModelProvider.refresh(ModelProvider.java:111)
    at org.openbravo.dal.core.DalLayerInitializer.initialize(DalLayerInitializer.java:65)
    at org.openbravo.dal.core.DalContextListener.contextInitialized(DalContextListener.java:80)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4342)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
    at org.apache.catalina.core.StandardService.start(StandardService.java:516)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
25-giu-2009 15.50.54 org.apache.catalina.core.StandardContext start
GRAVE: Error listenerStart
25-giu-2009 15.50.54 org.apache.catalina.core.StandardContext start
GRAVE: Context [/openbravo] startup failed due to previous errors
25-giu-2009 15.50.54 org.apache.catalina.session.StandardManager stop
GRAVE: Exception unloading sessions to persistent storage
java.lang.NullPointerException
    at org.openbravo.base.secureApp.OrgTreeNode.writeObject(OrgTreeNode.java:68)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945)
    at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1461)
    at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
    at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
    at java.util.ArrayList.writeObject(ArrayList.java:570)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945)
    at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1461)
    at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
    at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
    at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
    at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
    at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
    at org.apache.catalina.session.StandardSession.writeObject(StandardSession.java:1517)
    at org.apache.catalina.session.StandardSession.writeObjectData(StandardSession.java:959)
    at org.apache.catalina.session.StandardManager.doUnload(StandardManager.java:517)
    at org.apache.catalina.session.StandardManager.unload(StandardManager.java:463)
    at org.apache.catalina.session.StandardManager.stop(StandardManager.java:667)
    at org.apache.catalina.core.StandardContext.stop(StandardContext.java:4519)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4387)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
    at org.apache.catalina.core.StandardService.start(StandardService.java:516)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
 
Steps To Reproduce1) Create the view :
CREATE OR REPLACE VIEW it_c_orderlinedetail_v AS
 SELECT ord.ad_client_id, ord.ad_org_id, ord.c_order_id, ord.documentno, ord.dateordered, ord.c_bpartner_id, ad_column_identifier_std('c_bpartner'::character varying, to_char(ord.c_bpartner_id)) AS bpartner_name, ordln.c_orderline_id, ordln.isactive, ordln.line, (((((ord.documentno::text || ' - '::text) || substr(to_char(ord.dateordered)::text, 1, 10)) || ' - '::text) || ordln.line) || ' - '::text) || ad_column_identifier_std('c_bpartner'::character varying, to_char(ord.c_bpartner_id))::text AS name
   FROM c_order ord
   LEFT JOIN c_orderline ordln ON ord.c_order_id::text = ordln.c_order_id::text
  ORDER BY (((((ord.documentno::text || ' - '::text) || substr(to_char(ord.dateordered)::text, 1, 10)) || ' - '::text) || ordln.line) || ' - '::text) || ad_column_identifier_std('c_bpartner'::character varying, to_char(ord.c_bpartner_id))::text;
2) Create on A.D. the table it_c_orderlinedetail_v (and columns) linked this view with Window = Sales Order
and Po Window=Purchase Order
3) Create a reference it_c_orderlinedetail_v with Type=Table and put on Table Reference tab the table create in the step 2 , the key = C_orderline_id and displayedcolumn = Name
4) Add on c_orderline a field it_rif_id with reference=Table and Reference Search Key = it_c_orderlinedetail_v (created in the step 3)
5) compile window and build the project
6) Start tomcat and it crashes ..
Tagsdev-platform-quick-wins
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
depends on defect 0014636pi closedmtaal Support database views defined in the AD in the Data Access Layer 

-  Notes
(0031357)
hgbot (developer)
2010-09-25 11:27

Repository: erp/devel/pi
Changeset: d61bca59af84c289ad12a3f124432ef0f8fe33df
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Sat Sep 25 11:26:10 2010 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/d61bca59af84c289ad12a3f124432ef0f8fe33df [^]

Fixes issue 14636: Support database views defined in the AD in the Data Access Layer, Fixes issue 9640: Table Validation on View

---
M src-test/org/openbravo/test/AllAntTaskTests.java
M src/org/openbravo/base/model/Column.java
M src/org/openbravo/base/model/ModelProvider.java
A src-test/org/openbravo/test/dal/ViewTest.java
---
(0031467)
hudsonbot (developer)
2010-09-29 11:57

A changeset related to this issue has been promoted to main after passing a series of tests and an OBX has been generated:

Changeset: http://code.openbravo.com/erp/devel/main/rev/d61bca59af84 [^]
Merge Changeset: http://code.openbravo.com/erp/devel/main/rev/51c2c2967221 [^]
Tests: http://builds.openbravo.com/view/int/ [^]
OBX: http://builds.openbravo.com/erp/core/obx/OpenbravoERP-2.50CI.18452.obx [^]
(0032056)
marvintm (developer)
2010-10-21 12:53

DAL now supports views, so this case will work from now on. However, it's necessary to remark that for views to work on DAL, they need to provide a single primary key column.

- Issue History
Date Modified Username Field Change
2009-06-25 16:07 FrancescoFinamore New Issue
2009-06-25 16:07 FrancescoFinamore Assigned To => rafaroda
2009-06-30 20:44 psarobe Status new => scheduled
2009-06-30 20:44 psarobe Assigned To rafaroda => mtaal
2009-06-30 20:44 psarobe fix_in_branch => pi
2010-09-21 16:29 mtaal Relationship added depends on 0014636
2010-09-25 11:27 hgbot Checkin
2010-09-25 11:27 hgbot Note Added: 0031357
2010-09-25 11:27 hgbot Status scheduled => resolved
2010-09-25 11:27 hgbot Resolution open => fixed
2010-09-25 11:27 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/d61bca59af84c289ad12a3f124432ef0f8fe33df [^]
2010-09-27 17:09 rafaroda Tag Attached: dev-platform-quick-wins
2010-09-29 11:57 hudsonbot Checkin
2010-09-29 11:57 hudsonbot Note Added: 0031467
2010-10-21 12:53 marvintm Note Added: 0032056
2010-10-21 12:53 marvintm Status resolved => closed
2010-10-30 11:24 anonymous sf_bug_id 0 => 3098723


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker