Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0016146Openbravo ERPA. Platformpublic2011-02-07 10:482011-03-15 12:15
egoitz 
alostale 
highminoralways
closedfixed 
5
2.50MP25 
2.50MP28 
Core
No
0016146: Having a module include in a package two times, the package module task gives an error, but packages the module
Having a module include in a package two times, the package module task gives an error, but packages the module.
After the error the package modules should stop, and not package a module.
-Create a new module and check as indevelopment
-Creaate a new package and check as indevelopment
-Go to include tab of the package.
-Add the module created on the first step two time.
-Export the modules: ant export.database
-Package the module package.
You get the following error:

obx.export.config.script:
[extractModule] 1 [main] ERROR org.openbravo.erpCommon.modules.ExtractModule - Error packaging module
[extractModule] java.util.zip.ZipException: duplicate entry: com.openbravo.borrar-0.0.1.obx
[extractModule] at java.util.zip.ZipOutputStream.putNextEntry(ZipOutputStream.java:175)
[extractModule] at org.openbravo.erpCommon.modules.ExtractModule.extractPackage(ExtractModule.java:181)
[extractModule] at org.openbravo.erpCommon.modules.ExtractModule.extract(ExtractModule.java:94)
[extractModule] at org.openbravo.erpCommon.modules.ExtractModule.extractName(ExtractModule.java:150)
[extractModule] at org.openbravo.erpCommon.modules.ExtractModuleTask.doExecute(ExtractModuleTask.java:64)
[extractModule] at org.openbravo.erpCommon.modules.ExtractModuleTask.execute(ExtractModuleTask.java:44)
[extractModule] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
[extractModule] at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
[extractModule] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[extractModule] at java.lang.reflect.Method.invoke(Method.java:597)
[extractModule] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[extractModule] at org.apache.tools.ant.Task.perform(Task.java:348)
[extractModule] at org.apache.tools.ant.Target.execute(Target.java:357)
[extractModule] at org.apache.tools.ant.Target.performTasks(Target.java:385)
[extractModule] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
[extractModule] at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
[extractModule] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
[extractModule] at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
[extractModule] at org.apache.tools.ant.Main.runBuild(Main.java:758)
[extractModule] at org.apache.tools.ant.Main.startAnt(Main.java:217)
[extractModule] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
[extractModule] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)

BUILD SUCCESSFUL
Two options.

-Add a validation to avoid packaging module if the module is include twice

-Add a constraint to avoid including the module twice

In any case, after any error the process shoud not say
Build Successfull
No tags attached.
blocks defect 00158702.50MP28 closed alostale Having a module include in a package two times, the package module task gives an error, but packages the module 
Issue History
2011-03-07 09:36alostaleTypedefect => backport
2011-03-07 09:36alostalefix_in_branch => 2.50
2011-03-07 09:46hgbotCheckin
2011-03-07 09:46hgbotNote Added: 0034593
2011-03-07 09:46hgbotStatusscheduled => resolved
2011-03-07 09:46hgbotResolutionopen => fixed
2011-03-07 09:46hgbotFixed in SCM revision => http://code.openbravo.com/erp/stable/2.50/rev/10cbb435abf2c06cb7d5ab64370fb481de485ffe [^]
2011-03-15 12:15marvintmNote Added: 0034868
2011-03-15 12:15marvintmStatusresolved => closed

Notes
(0034593)
hgbot   
2011-03-07 09:46   
Repository: erp/stable/2.50
Changeset: 10cbb435abf2c06cb7d5ab64370fb481de485ffe
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Mon Mar 07 09:45:38 2011 +0100
URL: http://code.openbravo.com/erp/stable/2.50/rev/10cbb435abf2c06cb7d5ab64370fb481de485ffe [^]

fixed bug 16146: Do not include same module more than once

  When packaging module in obx file, it is checked the same module is not included
  more than once.

---
M build.xml
M src/org/openbravo/service/system/ModuleValidator.java
M src/org/openbravo/service/system/SystemValidationResult.java
M src/org/openbravo/service/system/SystemValidationTask.java
---
(0034868)
marvintm   
2011-03-15 12:15   
Tested that when a package includes (recursively) the same module more than once, package.module fails, and that it doesn't fail when this doesn't happen.