details: https://code.openbravo.com/erp/devel/pi/rev/b8e85d42ebbc
changeset: 32625:b8e85d42ebbc
user: Carlos Aristu <carlos.aristu <at> openbravo.com>
date: Wed Sep 06 17:09:53 2017 +0200
summary: fixes bug 35654: module validation fails for killable BG processes
using CDI
The DatabaseValidator class uses Class.forName(className) to retrieve the
class of the background processes and then determine if they implement the
KillableProcess interface.
When using that method, the class is also initialized. This initialization
failed in some cases with a java.lang.NoClassDefFoundError if the class was
making use of weld (CDI).
As we don't need to initialize the background process class to determine if it
implements the KillableProcess interface, we replace the usage of
Class.forName(className) with Class.forName(className, false, classLoader).
With the second argument the class initialization is prevented.
diffstat:
src/org/openbravo/service/system/DatabaseValidator.java | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diffs (22 lines):
diff -r 1ce8df93a3fb -r b8e85d42ebbc
src/org/openbravo/service/system/DatabaseValidator.java
--- a/src/org/openbravo/service/system/DatabaseValidator.java Wed Sep 06
11:07:49 2017 +0200
+++ b/src/org/openbravo/service/system/DatabaseValidator.java Wed Sep 06
17:09:53 2017 +0200
@@ -11,7 +11,7 @@
* under the License.
* The Original Code is Openbravo ERP.
* The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2009-2016 Openbravo SLU
+ * All portions are Copyright (C) 2009-2017 Openbravo SLU
* All Rights Reserved.
* Contributor(s): ______________________________________.
************************************************************************
@@ -895,7 +895,8 @@
List<org.openbravo.model.ad.ui.Process> processList = obc.list();
for (org.openbravo.model.ad.ui.Process process : processList) {
try {
- Class<?> processClass = Class.forName(process.getJavaClassName());
+ Class<?> processClass = Class.forName(process.getJavaClassName(),
false, this.getClass()
+ .getClassLoader());
if (!KillableProcess.class.isAssignableFrom(processClass)) {
result
.addWarning(
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits