Author: tom.baeyens(a)jboss.com
Date: 2009-09-28 04:47:12 -0400 (Mon, 28 Sep 2009)
New Revision: 5670
Modified:
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/ConverterType.java
Log:
JBPM-2430 : added fix for classloading in ant: check the jbpm classloader after context
classloader fails
Modified:
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/ConverterType.java
===================================================================
---
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/ConverterType.java 2009-09-25
14:04:45 UTC (rev 5669)
+++
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/ConverterType.java 2009-09-28
08:47:12 UTC (rev 5670)
@@ -82,7 +82,15 @@
String converterClassName = (String) key;
try {
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
- Class<?> converterClass = Class.forName(converterClassName, true,
classLoader);
+ Class< ? > converterClass = null;
+ try {
+ converterClass = Class.forName(converterClassName, true, classLoader);
+ } catch (ClassNotFoundException e) {
+ // when running jBPM from ant, the context classloader is not set properly
+ // so the jBPM classloader is necessary as a fallback
+ classLoader = getClass().getClassLoader();
+ converterClass = Class.forName(converterClassName, true, classLoader);
+ }
String converterName = properties.getProperty(converterClassName);
converterNames.put(converterClass, converterName);
Show replies by date