Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0019140Openbravo ERPA. Platformpublic2011-11-22 16:052011-11-30 12:30
roklenardic 
marvintm 
highmajoralways
closedfixed 
5
3.0MP5.1 
 
OBPS
Core
No
0019140: update.database does not work on a fresh sources folder
One should be able to do an update/upgrade in the following way:
# rename existing OpenbravoERP sources (let's say 3.0MP3) folder to OpenbravoERP-old
# clone MP5.1 sources into a new OpenbravoERP folder
# copy config files and custom modules from OpenbravoERP-old to OpenbravoERP folder
# run ant core.lib wad.lib trl.lib
# run ant update.database -Dforce=yes
# run compile.complete
However, it fails on step 4, the update database fails because it's looking for some HeartBeatData and AlertData classes that have not been compiled yet. It fails on apply.modules step:

[javac] Compiling 1 source file to /DEVELOP/openbravo/deployment3/build.apply/classes
    [javac] /DEVELOP/openbravo/deployment3/src/org/openbravo/erpCommon/ad_process/HeartbeatProcess.java:56: cannot find symbol
    [javac] symbol : class HeartbeatData
    [javac] location: package org.openbravo.erpCommon.businessUtility
    [javac] import org.openbravo.erpCommon.businessUtility.HeartbeatData;
    [javac] ^
    [javac] /DEVELOP/openbravo/deployment3/src/org/openbravo/erpCommon/ad_process/HeartbeatProcess.java:57: cannot find symbol
    [javac] symbol : class RegistrationData
    [javac] location: package org.openbravo.erpCommon.businessUtility
    [javac] import org.openbravo.erpCommon.businessUtility.RegistrationData;
    [javac] ^
    [javac] /DEVELOP/openbravo/deployment3/src/org/openbravo/erpCommon/ad_process/HeartbeatProcess.java:714: cannot find symbol
    [javac] symbol : class HeartbeatData
    [javac] location: class org.openbravo.erpCommon.ad_process.HeartbeatProcess
    [javac] final HeartbeatData[] hbData = HeartbeatData.selectSystemProperties(connectionProvider);
    [javac] ^
    [javac] /DEVELOP/openbravo/deployment3/src/org/openbravo/erpCommon/ad_process/HeartbeatProcess.java:714: cannot find symbol
    [javac] symbol : variable HeartbeatData
    [javac] location: class org.openbravo.erpCommon.ad_process.HeartbeatProcess
    [javac] final HeartbeatData[] hbData = HeartbeatData.selectSystemProperties(connectionProvider);
    [javac] ^
    [javac] /DEVELOP/openbravo/deployment3/src/org/openbravo/erpCommon/ad_process/HeartbeatProcess.java:739: cannot find symbol
    [javac] symbol : class RegistrationData
    [javac] location: class org.openbravo.erpCommon.ad_process.HeartbeatProcess
    [javac] final RegistrationData[] rData = RegistrationData.select(connectionProvider);
    [javac] ^
    [javac] /DEVELOP/openbravo/deployment3/src/org/openbravo/erpCommon/ad_process/HeartbeatProcess.java:739: cannot find symbol
    [javac] symbol : variable RegistrationData
    [javac] location: class org.openbravo.erpCommon.ad_process.HeartbeatProcess
    [javac] final RegistrationData[] rData = RegistrationData.select(connectionProvider);
    [javac] ^
    [javac] /DEVELOP/openbravo/deployment3/src/org/openbravo/erpCommon/utility/Alert.java:77: cannot find symbol
    [javac] symbol : class AlertData
    [javac] location: class org.openbravo.erpCommon.utility.Alert
    [javac] AlertData[] data = null;
    [javac] ^
    [javac] /DEVELOP/openbravo/deployment3/src/org/openbravo/erpCommon/utility/Alert.java:79: cannot find symbol
    [javac] symbol : variable AlertData
    [javac] location: class org.openbravo.erpCommon.utility.Alert
    [javac] data = AlertData.select(conn, String.valueOf(alertRuleId), recordId);
    [javac] ^
    [javac] /DEVELOP/openbravo/deployment3/src/org/openbravo/erpCommon/utility/Alert.java:81: cannot find symbol
    [javac] symbol : variable AlertData
    [javac] location: class org.openbravo.erpCommon.utility.Alert
    [javac] data = AlertData.selectByDescription(conn, String.valueOf(alertRuleId), description);
    [javac] ^
    [javac] /DEVELOP/openbravo/deployment3/src/org/openbravo/erpCommon/utility/Alert.java:84: cannot find symbol
    [javac] symbol : variable AlertData
    [javac] location: class org.openbravo.erpCommon.utility.Alert
    [javac] AlertData.insert(conn, description, String.valueOf(alertRuleId), recordId, referencekeyId);
    [javac] ^
    [javac] 10 errors
 
BUILD FAILED
/DEVELOP/openbravo/deployment3/build.xml:715: The following error occurred while executing this line:
/DEVELOP/openbravo/deployment3/build.xml:785: The following error occurred while executing this line:
/DEVELOP/openbravo/deployment3/src/build.xml:175: Compile failed; see the compiler error output for details.
See above
the update.database task should compile any classes deemed necessary for its operation if they are not present yet.
Regression
zip update.database.log.zip (211,848) 2011-11-22 20:29
https://issues.openbravo.com/file_download.php?file_id=4773&type=bug
Issue History
2011-11-22 16:05roklenardicNew Issue
2011-11-22 16:05roklenardicAssigned To => marvintm
2011-11-22 16:05roklenardicModules => Core
2011-11-22 16:05roklenardicOBNetwork customer => Yes
2011-11-22 16:08roklenardicNote Added: 0043078
2011-11-22 17:12shuehnerNote Added: 0043082
2011-11-22 17:12shuehnerStatusnew => feedback
2011-11-22 20:29roklenardicFile Added: update.database.log.zip
2011-11-22 20:29roklenardicNote Added: 0043099
2011-11-24 09:35shuehnerNote Added: 0043137
2011-11-24 09:35shuehnerStatusfeedback => new
2011-11-24 14:23shuehnerNote Added: 0043164
2011-11-24 16:52shuehnerTag Attached: Regression
2011-11-24 16:52hgbotCheckin
2011-11-24 16:52hgbotNote Added: 0043187
2011-11-24 16:52hgbotStatusnew => resolved
2011-11-24 16:52hgbotResolutionopen => fixed
2011-11-24 16:52hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/df9e03f9dfeaf533b11b620b69d9c403c28aa020 [^]
2011-11-24 16:57shuehnerNote Added: 0043188
2011-11-24 18:00alostaleNote Added: 0043191
2011-11-24 18:00alostaleStatusresolved => closed
2011-11-30 12:30hudsonbotCheckin
2011-11-30 12:30hudsonbotNote Added: 0043440

Notes
(0043078)
roklenardic   
2011-11-22 16:08   
The current workaround is the following:
ant generate.entities
ant compile -Dtab=xxx
ant update.database -Dforce=yes
(0043082)
shuehner   
2011-11-22 17:12   
Hi Rok,

can you add a more complete output of the log? i.e. full output of the ant update.database?

as some important lines just before the ones you are posting are important.
As what is failing technically is the mini-compile step before apply.modules and not the update.database itself (but same for the user).
But that apply.module does have a mini-compile of the needed parts already, but it seems not be working correctly.
(0043099)
roklenardic   
2011-11-22 20:29   
Attached, with debugging turned on.
(0043137)
shuehner   
2011-11-24 09:35   
Problem clear now.
Reproducable with:
- rm -rf build
- ant apply.module
Because of some changes done elsewhere in the erp the manually maintained list of xsql files for the ant compile.apply.module target needs to be updated.
(0043164)
shuehner   
2011-11-24 14:23   
Issue present in MP5 + MP5.1. Issue not present in MP4.2
(0043187)
hgbot   
2011-11-24 16:52   
Repository: erp/devel/pi
Changeset: df9e03f9dfeaf533b11b620b69d9c403c28aa020
Author: Stefan Hühner <stefan.huehner <at> openbravo.com>
Date: Thu Nov 24 16:51:51 2011 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/df9e03f9dfeaf533b11b620b69d9c403c28aa020 [^]

Fixed 19140: fix apply.module without having sources compiled before
Add three more xsql files to manually maintained list of xsql files
being processed in compile.apply.module target as those are not indirect
compile time dependency of apply.module

---
M src/build.xml
---
(0043188)
shuehner   
2011-11-24 16:57   
Notes for review:

Change is in special compile.apply.module target only run as dependency of apply.module. Change is to process three more xsql files in this compile step. After that sql the javac step will automatically pick up the extra 3 java files generated by this change making the compilation work again.

How to test that bug as reported is fixed:
start with configured workspace (at least Openbravo.properties present + pointing to a database + create.database ran).
rm -rf build
ant core.lib
ant generate.entities
ant apply.module

This sequence of steps forces the compile.apply.module to recompile all needed parts and thus checks if it contains all needed files.

Side-effects: I don't expect this change to have any functional side-effects, as only 3 extra xsql files are compiled in apply.module (into the build/ folder). So later incremental compile (i.e. smartbuild) will just not reprocess them as they are uptodate.
Compile-time impact: None as total files process for compile.apply.module is too big compared to the 3 extra files.
(0043191)
alostale   
2011-11-24 18:00   
Reviewed and working fine on pi@df9e03f9dfea

Tested before the fix to check it failed and after it to confirm it works.

Code reviewed.
(0043440)
hudsonbot   
2011-11-30 12:30   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/01809c7b3135 [^]

Maturity status: Test