[jboss-svn-commits] JBoss Common SVN: r4286 - jbossxb/trunk/src/main/java/org/jboss/xb/util.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Wed Apr 21 08:32:18 EDT 2010


Author: alex.loubyansky at jboss.com
Date: 2010-04-21 08:32:17 -0400 (Wed, 21 Apr 2010)
New Revision: 4286

Modified:
   jbossxb/trunk/src/main/java/org/jboss/xb/util/JBossXBHelper.java
Log:
JBXB-248

Modified: jbossxb/trunk/src/main/java/org/jboss/xb/util/JBossXBHelper.java
===================================================================
--- jbossxb/trunk/src/main/java/org/jboss/xb/util/JBossXBHelper.java	2010-04-21 09:51:16 UTC (rev 4285)
+++ jbossxb/trunk/src/main/java/org/jboss/xb/util/JBossXBHelper.java	2010-04-21 12:32:17 UTC (rev 4286)
@@ -222,15 +222,18 @@
       if (source == null)
          throw new IllegalArgumentException("Null source");
 
-      log.debug("Parsing file: " + source + " for type: " + expectedType);
+      boolean trace = log.isTraceEnabled();
+      if(trace)
+         log.trace("Parsing file: " + source + " for type: " + expectedType);
       Unmarshaller unmarshaller = factory.newUnmarshaller();
       unmarshaller.setSchemaValidation(isUseSchemaValidation());
       unmarshaller.setValidation(isUseValidation());
       Object parsed = unmarshaller.unmarshal(source, getResolver());
       if (parsed == null)
-         throw new Exception("The xml " + source + " is not well formed!");
+         throw new Exception("Failed to resolve Java binding for " + source + " (check the SchemaBinding resolver configuration)");
 
-      log.debug("Parsed file: " + source + " to: " + parsed);
+      if(trace)
+         log.trace("Parsed file: " + source + " to: " + parsed);
       return expectedType.cast(parsed);
    }
 
@@ -264,16 +267,19 @@
       if (source == null)
          throw new IllegalArgumentException("Null source");
 
-      log.debug("Parsing source: " + source + " for deploymentType: " + expectedType);
+      boolean trace = log.isTraceEnabled();
+      if(trace)
+         log.trace("Parsing source: " + source + " for deploymentType: " + expectedType);
 
       Unmarshaller unmarshaller = factory.newUnmarshaller();
       unmarshaller.setSchemaValidation(isUseSchemaValidation());
       unmarshaller.setValidation(isUseValidation());
       Object parsed = unmarshaller.unmarshal(source, omf, root);
       if (parsed == null)
-         throw new Exception("The xml " + source + " is not well formed!");
+         throw new Exception("Failed to resolve Java binding for " + source);
 
-      log.debug("Parsed file: " + source + " to: "+parsed);
+      if(trace)
+         log.trace("Parsed file: " + source + " to: "+parsed);
       return expectedType.cast(parsed);
    }
 }
\ No newline at end of file



More information about the jboss-svn-commits mailing list