Package org.eclipse.wst.wsi.internal.core

Examples of org.eclipse.wst.wsi.internal.core.WSIException


      parseXMLDocumentURL(createURL(url, baseURI), schema);
    }

    catch (Exception e)
    {
      throw new WSIException(e.getMessage(), e);
    }

    return parseXMLDocumentURL(url, schema);
  }
View Full Code Here


      throw e;
    }

    catch (Throwable t)
    {
      throw new WSIException(t.getMessage());
    }
  }
View Full Code Here

      throw we;
    }

    catch (Exception e)
    {
      throw new WSIException(e.getMessage(), e);
    }

    return document;
  }
View Full Code Here

      reader.close();
    }

    catch (Exception e)
    {
      throw new WSIException(e.getMessage(), e);
    }

    return document;
  }
View Full Code Here

      if (doc instanceof org.apache.xerces.dom.DocumentImpl)
      {
      if (((org.apache.xerces.dom.DocumentImpl) doc).getXmlVersion().equals(
            "1.1"))
      {
        throw new WSIException("Fatal Error: XML version "1.1" "
            + "is not supported, only XML 1.0 is supported.");
      }
      }
    }
    catch (Exception e)
    {
      throw new WSIException("Could not parse XML document.", e);
    }
      finally
      {
        Thread.currentThread().setContextClassLoader(currentLoader);
      }   
View Full Code Here

      if (doc instanceof org.apache.xerces.dom.DocumentImpl)
      {
      if (((org.apache.xerces.dom.DocumentImpl) doc).getXmlVersion().equals(
            "1.1"))
      {
        throw new WSIException("Fatal Error: XML version "1.1" "
              + "is not supported, only XML 1.0 is supported.");
      }
        }
    }
    catch (Exception e)
    {
      throw new WSIException("Could not parse XML document.", e);
    }
      finally
      {
        Thread.currentThread().setContextClassLoader(currentLoader);
      }   
View Full Code Here

      {
      String errMessage = "Error: JAXP DocumentBuilderFactory attribute not recognized: "
          + JAXP_SCHEMA_LANGUAGE
          + "\n"
          + "Check to see if parser conforms to JAXP 1.2 spec.";
      throw new WSIException(errMessage, e);
      }
      factory.setAttribute(JAXP_SCHEMA_SOURCE, new InputSource(schema));

      // Parse the document
      DocumentBuilder builder = factory.newDocumentBuilder();
      builder.setErrorHandler(new ErrHandler());
      doc = builder.parse(inputSource);

      // workaround for compatibility Xerces 2.2.1 with Xerces 2.6.2,
      // Xerces 2.6.2 supported XML 1.1 but WSI-tool and Xerces 2.2.1
      // supported only XML 1.0
      if (doc instanceof org.apache.xerces.dom.DocumentImpl)
      {
      if (((org.apache.xerces.dom.DocumentImpl) doc).getXmlVersion().equals("1.1"))
      {
         throw new WSIException("Fatal Error: XML version "1.1" "
              + "is not supported, only XML 1.0 is supported.");
      }
      }
      }
    catch (Exception e)
    {
      throw new WSIException("Could not parse XML document.", e);
    }
      finally
      {
        Thread.currentThread().setContextClassLoader(currentLoader);
      }   
View Full Code Here

      {
      String errMessage = "Error: JAXP DocumentBuilderFactory attribute not recognized: "
          + JAXP_SCHEMA_LANGUAGE
          + "\n"
          + "Check to see if parser conforms to JAXP 1.2 spec.";
      throw new WSIException(errMessage, e);
      }
      factory.setAttribute(JAXP_SCHEMA_SOURCE, new InputSource(schema));

          // Parse the document
      DocumentBuilder builder = factory.newDocumentBuilder();
      builder.setErrorHandler(new ErrHandler());
      doc = builder.parse(source);

      // workaround for compatibility Xerces 2.2.1 with Xerces 2.6.2,
      // Xerces 2.6.2 supported XML 1.1 but WSI-tool and Xerces 2.2.1
      // supported only XML 1.0
      if (doc instanceof org.apache.xerces.dom.DocumentImpl)
      {
      if (((org.apache.xerces.dom.DocumentImpl) doc).getXmlVersion().equals(
            "1.1"))
      {
        throw new WSIException("Fatal Error: XML version "1.1" "
            + "is not supported, only XML 1.0 is supported.");
      }
      }
    }
    catch (Exception e)
    {
      throw new WSIException("Could not parse XML document.", e);
    }
      finally
      {
        Thread.currentThread().setContextClassLoader(currentLoader);
      }   
View Full Code Here

      {
      String errMessage = "Error: JAXP DocumentBuilderFactory attribute not recognized: "
          + JAXP_SCHEMA_LANGUAGE
          + "\n"
          + "Check to see if parser conforms to JAXP 1.2 spec.";
      throw new WSIException(errMessage, e);
      }
      factory.setAttribute(JAXP_SCHEMA_SOURCE, new InputSource(schemaString));

      // Parse the document
      DocumentBuilder builder = factory.newDocumentBuilder();
      builder.setErrorHandler(new ErrHandler());
      doc = builder.parse(inputSource);
    }
    catch (Exception e)
    {
      throw new WSIException("Could not parse XML document.", e);
    }
      finally
      {
        Thread.currentThread().setContextClassLoader(currentLoader);
      }   
View Full Code Here

      {
        String errMessage = "Error: JAXP DocumentBuilderFactory attribute not recognized: "
          + JAXP_SCHEMA_LANGUAGE
          + "\n"
          + "Check to see if parser conforms to JAXP 1.2 spec.";
      throw new WSIException(errMessage, e);
      }
      // convert schema strings to array of InputSources
      Iterator i = schemaStrings.iterator();
      Vector readers = new Vector();
      while (i.hasNext())
      {
      String nextSchema = (String) i.next();
      readers.add(new InputSource(new StringReader(nextSchema)));
      }
      InputSource[] inputSources = (InputSource[]) readers
        .toArray(new InputSource[]{});
      // pass an array of schema strings (each of which contains a schema)
      factory.setAttribute(JAXP_SCHEMA_SOURCE, inputSources);

      // Parse the document
      DocumentBuilder builder = factory.newDocumentBuilder();
      builder.setErrorHandler(new ErrHandler());
      doc = builder.parse(inputSource);
    }
    catch (Exception e)
    {
      throw new WSIException("Could not parse XML document.", e);
    }
      finally
      {
        Thread.currentThread().setContextClassLoader(currentLoader);
      }   
View Full Code Here

TOP

Related Classes of org.eclipse.wst.wsi.internal.core.WSIException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.