[jboss-cvs] JBoss Messaging SVN: r5685 - trunk/src/main/org/jboss/messaging/util.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Jan 22 05:49:12 EST 2009


Author: jmesnil
Date: 2009-01-22 05:49:12 -0500 (Thu, 22 Jan 2009)
New Revision: 5685

Modified:
   trunk/src/main/org/jboss/messaging/util/XMLUtil.java
Log:
XML Schema validation

use the context class loader to retrieve the schema (using ClassLoader.getSystemReource() won't work in AS)


Modified: trunk/src/main/org/jboss/messaging/util/XMLUtil.java
===================================================================
--- trunk/src/main/org/jboss/messaging/util/XMLUtil.java	2009-01-22 09:42:45 UTC (rev 5684)
+++ trunk/src/main/org/jboss/messaging/util/XMLUtil.java	2009-01-22 10:49:12 UTC (rev 5685)
@@ -471,7 +471,7 @@
    public static void validate(Node node, String schemaFile) throws Exception
    {
       SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
-      Schema schema = factory.newSchema(ClassLoader.getSystemResource(schemaFile));
+      Schema schema = factory.newSchema(Thread.currentThread().getContextClassLoader().getResource(schemaFile));
       Validator validator = schema.newValidator();
 
       // validate the DOM tree




More information about the jboss-cvs-commits mailing list