Hi,
the class SchemaPropertyLoader is using the class loader from
Object.class to load its property file. In other words, it is using the
boot class loader.
I do not understand the rationale. Assuming, that the property file is
in axis2-0.94-SNAPSHOT.jar, it isn't necessarily locatable through the
boot class loader. For example, I stumbled over the problem when
invoking the WSDL2Code class from within an Ant task with a custom class
loader.
I propose using SchemaCompiler.class instead, because this is quite
likely to contain the property file. Besides, if we actually want the
boot class loader, then it is taken anyways, if the parent class loader
is preferred, as is typically the case. In other words, the change would
be upwards compatible.
Jochen
Index:
/home/jwi/workspace/Axis2/modules/codegen/src/org/apache/axis2/schema/util/SchemaPropertyLoader.java
===================================================================
---
/home/jwi/workspace/Axis2/modules/codegen/src/org/apache/axis2/schema/util/SchemaPropertyLoader.java
(revision 358079)
+++
/home/jwi/workspace/Axis2/modules/codegen/src/org/apache/axis2/schema/util/SchemaPropertyLoader.java
(working copy)
@@ -1,5 +1,6 @@
package org.apache.axis2.schema.util;
+import org.apache.axis2.schema.SchemaCompiler;
import org.apache.axis2.schema.typemap.TypeMap;
import org.apache.axis2.schema.writer.BeanWriter;
@@ -37,7 +38,7 @@
try {
//load the properties
Properties props = new Properties();
-
props.load(Object.class.getResourceAsStream(SCHEMA_COMPILER_PROPERTIES));
+
props.load(SchemaCompiler.class.getResourceAsStream(SCHEMA_COMPILER_PROPERTIES));
String beanWriterClassName =
props.getProperty(BEAN_WRITER_KEY);
if (beanWriterClassName!=null){