[webbeans-commits] Webbeans SVN: r1800 - ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap.

webbeans-commits at lists.jboss.org webbeans-commits at lists.jboss.org
Fri Mar 6 11:18:43 EST 2009


Author: pete.muir at jboss.org
Date: 2009-03-06 11:18:43 -0500 (Fri, 06 Mar 2009)
New Revision: 1800

Modified:
   ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeansXmlParser.java
Log:
WBRI-154

Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeansXmlParser.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeansXmlParser.java	2009-03-06 16:16:41 UTC (rev 1799)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeansXmlParser.java	2009-03-06 16:18:43 UTC (rev 1800)
@@ -9,6 +9,7 @@
 import java.util.List;
 import java.util.Map;
 
+import javax.inject.DefinitionException;
 import javax.inject.DeploymentException;
 import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
@@ -174,7 +175,7 @@
          {
             if (child instanceof Element)
             {
-               String className = getAsClassName(child.getNodeName(), deployElement.getNamespaces());
+               String className = getAsClassName(child.getNodeName(), deployElement.getNamespaces(), deployElement.getFile());
                if (className != null)
                {
                   enabledDeploymentTypes.add(resourceLoader.classForName(className).asSubclass(Annotation.class));
@@ -184,7 +185,7 @@
       }
    }
    
-   private static String getAsClassName(String nodeName, Map<String, String> namespaces)
+   private static String getAsClassName(String nodeName, Map<String, String> namespaces, URL file)
    {
       String namespacePrefix;
       String simpleClassName;
@@ -199,6 +200,10 @@
          simpleClassName = nodeName;
       }
       String namespace = namespaces.get(namespacePrefix);
+      if (namespace == null)
+      {
+         throw new DefinitionException("Prefix " + namespacePrefix + " has no namespace mapped in " + file.getPath());
+      }
       String packageName;
       if (namespace.startsWith("urn:java:ee"))
       {




More information about the weld-commits mailing list