djencks     2004/04/17 16:35:20

  Modified:    modules/core/src/java/org/openejb/deployment
                        EJBConfigBuilder.java
  Log:

  Not only look for xml validation errors, but complain when they occur
  
  Revision  Changes    Path
  1.11      +10 -4     
openejb/modules/core/src/java/org/openejb/deployment/EJBConfigBuilder.java
  
  Index: EJBConfigBuilder.java
  ===================================================================
  RCS file: 
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/deployment/EJBConfigBuilder.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- EJBConfigBuilder.java     16 Apr 2004 02:34:06 -0000      1.10
  +++ EJBConfigBuilder.java     17 Apr 2004 20:35:20 -0000      1.11
  @@ -97,6 +97,7 @@
   import org.apache.xmlbeans.SchemaTypeLoader;
   import org.apache.xmlbeans.XmlBeans;
   import org.apache.xmlbeans.XmlObject;
  +import org.apache.xmlbeans.XmlException;
   
   import org.openejb.ContainerBuilder;
   import org.openejb.EJBModule;
  @@ -138,7 +139,7 @@
           return new SchemaTypeLoader[]{XmlBeans.getContextTypeLoader()};
       }
   
  -    public XmlObject getDeploymentPlan(URL module) {
  +    public XmlObject getDeploymentPlan(URL module)  throws XmlException {
           try {
               URL moduleBase;
               if (module.toString().endsWith("/")) {
  @@ -157,7 +158,7 @@
           }
       }
   
  -    private OpenejbOpenejbJarDocument createDefaultPlan(URL module) {
  +    private OpenejbOpenejbJarDocument createDefaultPlan(URL module) throws 
XmlException {
           EjbJarDocument ejbJarDoc = (EjbJarDocument) 
XmlBeansUtil.getXmlObject(module, EjbJarDocument.type);
           if (ejbJarDoc == null) {
               return null;
  @@ -232,7 +233,12 @@
           if (ejbJarXml == null) {
               throw new DeploymentException("Module does not contain the ejb-jar.xml 
deployment descriptor");
           }
  -        EjbJarDocument doc = (EjbJarDocument) XmlBeansUtil.getXmlObject(ejbJarXml, 
EjbJarDocument.type);
  +        EjbJarDocument doc = null;
  +        try {
  +            doc = (EjbJarDocument) XmlBeansUtil.getXmlObject(ejbJarXml, 
EjbJarDocument.type);
  +        } catch (XmlException e) {
  +            throw new DeploymentException(e);
  +        }
           if (doc == null) {
               throw new DeploymentException("The ejb-jar.xml deployment descriptor is 
not valid");
           }
  
  
  

Reply via email to